Files
JIMRI/java/test/jmri/util/I18NTest.java
T
2026-06-17 14:00:51 +02:00

65 lines
2.0 KiB
Java

package jmri.util;
import java.io.IOException;
import org.junit.jupiter.api.*;
/**
*
* @author Randall Wood
*/
public class I18NTest {
@Test
@Disabled("Test requires further development")
public void testI18N() throws IOException {
// disable the test until I can figure out why its failing on Jenkins
/*
File suiteDir = new File(System.getProperty("user.dir")); // root of SVN checkout
suiteDir = suiteDir.getCanonicalFile();
String topDirs = "."; // use "." since null or "" cause tests to fail
Boolean allProperties = true; // test all .properties files, not just <package>/Bundle.properties
String logger = "log";
List<String> loggerMethods = Arrays.asList(new String[] {"info", "warn", "error", "debug"});
String result = I18nChecker.runAsTest(suiteDir, topDirs, this.getUnfinishedI18NModules(), allProperties, logger, loggerMethods);
if (!result.isEmpty()) {
fail(result);
}
*/
}
/* Referenced in disabled test above
private Map<String, Integer> getUnfinishedI18NModules() throws IOException {
Properties props = new Properties();
InputStream is = new FileInputStream(new File("java/test/jmri/util/i18n_known_errors.properties"));
try {
props.load(is);
} catch (Exception e) {
log.error("Exception handling properties", e);
} finally {
is.close();
}
Map<String, Integer> result = new HashMap<String, Integer>();
for (String key : props.stringPropertyNames()) {
int val = Integer.parseInt(props.getProperty(key, "0"));
log.info("I18NTest expected results from file: " + key + "=" + props.getProperty(key));
log.info("I18NTest expected results as used: " + key + "=" + val);
result.put(key, val);
}
return result;
}
*/
@BeforeEach
public void setUp() {
JUnitUtil.setUp();
}
@AfterEach
public void tearDown() {
JUnitUtil.tearDown();
}
}