fixing test execution on german / windows machines

This commit is contained in:
Oliver Milke
2017-05-10 13:56:13 +02:00
parent 5cae7ab35a
commit 80fe417206
2 changed files with 18 additions and 1 deletions

View File

@@ -58,6 +58,17 @@ public class I18nMessagesTest
@Test
public void testI18n()
{
/*
lookup-order for this test:
- TM_en (es specified, but not ava)
- TM_<execution-locale>
- TM
This means that, if there is no default locale specified, this test accidentally passes on non-german machines, an fails on german machines, since the execution locale is de_DE, which is checked even before the fallback locale is considered.
*/
Locale.setDefault(Locale.ENGLISH);
TestMessages msg = I18nMessages.get(TestMessages.class);
assertEquals("Normal Key", msg.normalKey);

View File

@@ -55,7 +55,9 @@ import static org.junit.Assert.*;
import java.io.File;
import java.io.IOException;
import java.util.UUID;
import java.util.logging.Logger;
/**
*
@@ -155,7 +157,11 @@ public class AbstractTestBase
}
finally
{
IOUtil.delete(tempDirectory);
try {
IOUtil.delete(tempDirectory);
} catch (IOException e) {
Logger.getGlobal().warning(String.format("deleting temp <%s> failed: %s", tempDirectory.getAbsolutePath(), e.getMessage()));
}
}
}