• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.unicode.cldr.unittest;
2 
3 import static org.junit.jupiter.api.Assertions.assertArrayEquals;
4 import static org.junit.jupiter.api.Assertions.assertEquals;
5 
6 import org.junit.jupiter.api.Test;
7 import org.unicode.cldr.util.TestShimUtils;
8 
9 // NOTE: When not under Maven, you'll see compile errs in eclipse.
10 // Ignore them.
11 
12 /** a JUnit test that calls TestAll. */
13 class TestShim {
14     @Test
TestAll()15     public void TestAll() {
16         String args[] = TestShimUtils.getArgs(TestShim.class, "-n -q");
17         // regular main() will System.exit() which is not too friendly.
18         // call this instead.
19         int errCount = TestAll.runTests(args);
20         assertEquals(0, errCount, "Test had errors");
21     }
22 
23     @Test
TestTestShimUtilTest()24     public void TestTestShimUtilTest() {
25         // Note: checks the system property corresponding to java.lang
26         // We expect the system property "java.lang.testArgs" will not be set,
27         // and so the default "-a -b -c" will be used.
28         String args[] = TestShimUtils.getArgs(java.lang.String.class, "-a -b -c");
29         String expectArgs[] = {"-a", "-b", "-c"};
30         assertArrayEquals(args, expectArgs, "Expected arg parse");
31     }
32 }
33