Methods Summary |
---|
public static void | main(java.lang.String[] args)
if (args.length == 0){
junit.textui.TestRunner.run(CLIManFileFinderTest.class);
} else {
junit.textui.TestRunner.run(makeSuite(args));
}
|
private static junit.framework.TestSuite | makeSuite(java.lang.String[] args)
final TestSuite ts = new TestSuite();
for (int i = 0; i < args.length; i++){
ts.addTest(new CLIManFileFinderTest(args[i]));
}
return ts;
|
private void | nyi()
fail("Not Yet Implemented");
|
protected void | setUp()
|
protected void | tearDown()
|
public void | testEmptyVariant()
CLIManFileFinder c = new CLIManFileFinder();
Locale l = new Locale("en", "uk", "");
assertEquals(3,c.getLocaleLocations(l).length);
assertEquals("/en/UK", c.getLocaleLocations(l)[0]);
assertEquals("/en", c.getLocaleLocations(l)[1]);
assertEquals("", c.getLocaleLocations(l)[2]);
|
public void | testEndOfFirstSearch()
CLIManFileFinder c = new CLIManFileFinder();
Locale l = new Locale("en", "UK", "v1");
Iterator it = c.getPossibleLocations("command", l);
for (int i = 0; i < 17; i++){
it.next();
}
assertEquals("help/en/UK/v1/command.9m", (String) it.next());
assertEquals("help/en/UK/command.1", (String) it.next());
|
public void | testEndOfIterator()
CLIManFileFinder c = new CLIManFileFinder();
Locale l = new Locale("en", "UK", "v1");
Iterator it = c.getPossibleLocations("command", l);
for (int i = 0; i < 71; i++){
it.next();
}
assertEquals("help/command.9m", (String) it.next());
assertTrue(!it.hasNext());
try {
it.next();
fail("Expected NoSuchElementException indicating we'd read beyond the end of the interator");
}
catch (NoSuchElementException nse){
}
|
public void | testEndOfSecondSearch()
CLIManFileFinder c = new CLIManFileFinder();
Locale l = new Locale("en", "UK", "v1");
Iterator it = c.getPossibleLocations("command", l);
for (int i = 0; i < 35; i++){
it.next();
}
assertEquals("help/en/UK/command.9m", (String) it.next());
assertEquals("help/en/command.1", (String) it.next());
|
public void | testEndOfThirdSearch()
CLIManFileFinder c = new CLIManFileFinder();
Locale l = new Locale("en", "UK", "v1");
Iterator it = c.getPossibleLocations("command", l);
for (int i = 0; i < 53; i++){
it.next();
}
assertEquals("help/en/command.9m", (String) it.next());
assertEquals("help/command.1", (String) it.next());
|
public void | testLocations()
CLIManFileFinder c = new CLIManFileFinder();
Locale l = new Locale("en", "UK", "v1");
Iterator it = c.getPossibleLocations("command", l);
assertEquals("help/en/UK/v1/command.1", (String) it.next());
assertEquals("help/en/UK/v1/command.1m",(String) it.next());
assertEquals("help/en/UK/v1/command.2", (String) it.next());
for (int i = 0; i < 5; i++){
it.next();
}
assertEquals("help/en/UK/v1/command.5", (String) it.next());
|
public void | testNoCountry()
CLIManFileFinder c = new CLIManFileFinder();
Locale l = new Locale("en", "", "v1");
assertEquals(2,c.getLocaleLocations(l).length);
assertEquals("/en", c.getLocaleLocations(l)[0]);
assertEquals("", c.getLocaleLocations(l)[1]);
|
public void | testNoLanguage()
CLIManFileFinder c = new CLIManFileFinder();
Locale l = new Locale("", "UK", "v1");
assertEquals(1,c.getLocaleLocations(l).length);
assertEquals("", c.getLocaleLocations(l)[0]);
|
public void | testNoVariant()
CLIManFileFinder c = new CLIManFileFinder();
Locale l = new Locale("en", "uk");
assertEquals(3,c.getLocaleLocations(l).length);
assertEquals("/en/UK", c.getLocaleLocations(l)[0]);
assertEquals("/en", c.getLocaleLocations(l)[1]);
assertEquals("", c.getLocaleLocations(l)[2]);
|
public void | testSimpleLocation()
CLIManFileFinder c = new CLIManFileFinder();
Locale l = new Locale("en", "uk", "v1");
assertEquals(4,c.getLocaleLocations(l).length);
assertEquals("/en/UK/v1", c.getLocaleLocations(l)[0]);
assertEquals("/en/UK", c.getLocaleLocations(l)[1]);
assertEquals("/en", c.getLocaleLocations(l)[2]);
assertEquals("", c.getLocaleLocations(l)[3]);
|