/*
 * Copyright 2016 ZJNU ACM.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.ckfinder.connector.errors;

import java.io.OutputStream;
import java.lang.reflect.Field;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import java.util.ResourceBundle;
import org.junit.Test;

/**
 *
 * @author zhanhb
 */
public class ErrorUtilsTest {

    /**
     * Test of getErrorMsgByLangAndCode method, of class ErrorUtils.
     * @throws java.lang.Exception
     */
    @Test
    public void testGetErrorMsgByLangAndCode() throws Exception {
        System.out.println("getErrorMsgByLangAndCode");
        URL location = ErrorUtils.class.getProtectionDomain().getCodeSource().getLocation();
        Path base = Paths.get(location.toURI()).resolve(ErrorUtils.class.getPackage().getName().replace('.', '/'));
        System.out.println(base);
        ErrorUtils instance = ErrorUtils.getInstance();
        Field field = ErrorUtils.class.getDeclaredField("langMap");
        field.setAccessible(true);
        Object obj = field.get(instance);
        for (Map.Entry<String, Map<Integer, String>> en : ((Map<String, Map<Integer, String>>) obj).entrySet()) {
            String key = en.getKey();
            Map<Integer, String> value = en.getValue();
            Locale locale = new Locale(key);
            Properties p = new Properties();
            for (Map.Entry<Integer, String> entry : value.entrySet()) {
                Integer key1 = entry.getKey();
                String value1 = entry.getValue();
                p.setProperty("" + key1, value1);
            }
            Path path = base.resolve("LocalStrings_" + locale + ".properties");
            try (OutputStream out = Files.newOutputStream(path)) {
                p.store(out, null);
            }
            System.out.println(path);
            ResourceBundle.getBundle("com/ckfinder/connector/errors/LocalStrings", locale);
        }

    }

}

@@ -904,31 +904,8 @@
 dle;
-%0Aimport org.junit.Test;
 %0A%0A/*
@@ -970,255 +970,100 @@
     
-/**%0A     * Test of getErrorMsgByLangAndCode method, of class ErrorUtils.%0A     * @throws java.lang.Exception%0A     */%0A    @Test%0A    public void testGetErrorMsgByLangAndCode() throws Exception %7B%0A        System.out.println(%22getErrorMsgByLangAndCode%22);
+@SuppressWarnings(%22unchecked%22)%0A    public static void main(String%5B%5D args) throws Exception %7B
 %0A   
@@ -1272,42 +1272,8 @@
 ));%0A
-        System.out.println(base);%0A
     
@@ -2201,46 +2201,8 @@
   %7D%0A
-            System.out.println(path);%0A
     

Change ErrorUtilsTest to main class