<dependency> <groupId>com.unittest</groupId> <artifactId>utest</artifactId> <version>1.0.0</version> <scope>test</scope> </dependency> groovy testCompile 'com.unittest:utest:1.0.0' import static com.unittest.uTest.*; public class MyTestClass { @Before public void setup() { } @Test public void myTestMethod() { String expected = "Hello"; String actual = "Hello"; assertEquals(expected, actual); } @After public void teardown() { } } import org.junit.runner.JUnitCore; import org.junit.runner.Result; import org.junit.runner.notification.Failure; public class MyTestRunner { public static void main(String[] args) { Result result = JUnitCore.runClasses(MyTestClass.class); for (Failure failure : result.getFailures()) { System.out.println(failure.toString()); } System.out.println(result.wasSuccessful()); } }


上一篇:
下一篇:
切换中文