public class SysinfoLocaleTest extends BaseTestCase
sysinfo
correctly localizes its
messages according to the default locale and derby.ui.locale
.Modifier and Type | Field and Description |
---|---|
private java.util.Locale |
defaultLocale
Default locale to run this test under.
|
private static java.lang.String |
ENCODING
The encoding sysinfo should use for its output.
|
private static java.lang.String[] |
GERMAN_STRINGS
Some German strings that are expected to be in sysinfo's output when
localized to German.
|
private static java.lang.String[] |
ITALIAN_STRINGS
Some Italian strings that are expected to be in sysinfo's output when
localized to Italian.
|
private boolean |
localizedToGerman
Tells whether or not this test expects sysinfo's output to be localized
to German.
|
private java.lang.String |
name
Name of the test.
|
private java.util.Locale |
savedLocale
The default locale before this test started.
|
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Modifier | Constructor and Description |
---|---|
private |
SysinfoLocaleTest(java.util.Locale defaultLocale,
boolean german,
java.lang.String info)
Create a test.
|
Modifier and Type | Method and Description |
---|---|
private void |
assertContains(java.lang.String[] expectedSubstrings,
java.lang.String output)
Checks that all the expected substrings are part of the output from
sysinfo.
|
private static junit.framework.Test |
createTest(java.util.Locale loc,
java.lang.String ui,
boolean german)
Create a single test case.
|
java.lang.String |
getName()
Returns the name of the test, which includes the default locale and
derby.ui.locale to aid debugging.
|
private static java.lang.String |
getSysinfoOutput()
Run sysinfo and return its output as a string.
|
private static void |
runSysinfo()
Run a sysinfo class that is loaded in a separate class loader.
|
protected void |
setUp()
Set up the test environment.
|
static junit.framework.Test |
suite()
Create a suite of tests.
|
protected void |
tearDown()
Tear down the test environment.
|
void |
testSysinfoLocale()
Test method which checks that the output from sysinfo is correctly
localized.
|
alarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSameNullness, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, newAssertionFailedError, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runBare, runsWithEmma, runsWithJaCoCo, setSystemErr, setSystemOut, setSystemProperty, sleep, sleepAtLeastOneTick, traceit, vmAtLeast
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, run, run, runTest, setName, toString
private static final java.lang.String ENCODING
private final java.util.Locale defaultLocale
private final boolean localizedToGerman
private final java.lang.String name
private java.util.Locale savedLocale
private static final java.lang.String[] GERMAN_STRINGS
private static final java.lang.String[] ITALIAN_STRINGS
private SysinfoLocaleTest(java.util.Locale defaultLocale, boolean german, java.lang.String info)
defaultLocale
- the default locale for this testgerman
- true if output is expected to be localized to Germaninfo
- extra information to append to the test name (for debugging)public java.lang.String getName()
getName
in class junit.framework.TestCase
protected void setUp()
setUp
in class junit.framework.TestCase
protected void tearDown() throws java.lang.Exception
tearDown
in class junit.framework.TestCase
java.lang.Exception
public static junit.framework.Test suite()
derby.ui.locale
and default localeprivate static junit.framework.Test createTest(java.util.Locale loc, java.lang.String ui, boolean german)
loc
- default locale for the test caseui
- derby.ui.locale
for the test casegerman
- whether output is expected to be Germanprivate static void runSysinfo() throws java.lang.Exception
derby.ui.locale
(happens when the class is loaded).java.lang.Exception
private static java.lang.String getSysinfoOutput() throws java.lang.Exception
java.lang.Exception
private void assertContains(java.lang.String[] expectedSubstrings, java.lang.String output)
expectedSubstrings
- substrings in the expected localeoutput
- the output from sysinfopublic void testSysinfoLocale() throws java.lang.Exception
java.lang.Exception
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.