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 /** 13 * a JUnit test that calls TestAll. 14 */ 15 class TestShim { 16 @Test TestAll()17 public void TestAll() { 18 String args[] = TestShimUtils.getArgs(TestShim.class, "-n -q"); 19 // regular main() will System.exit() which is not too friendly. 20 // call this instead. 21 int errCount = TestAll.runTests(args); 22 assertEquals(0, errCount, "Test had errors"); 23 } 24 25 @Test TestTestShimUtilTest()26 public void TestTestShimUtilTest() { 27 // Note: checks the system property corresponding to java.lang 28 // We expect the system property "java.lang.testArgs" will not be set, 29 // and so the default "-a -b -c" will be used. 30 String args[] = TestShimUtils.getArgs(java.lang.String.class, "-a -b -c"); 31 String expectArgs[] = { "-a", "-b", "-c" }; 32 assertArrayEquals(args, expectArgs, "Expected arg parse"); 33 } 34 }