From 7ee3a061452c5a7e5c8e661219a1f08a14171858 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 18 Feb 2010 17:20:15 -0800 Subject: Resync a load of tests with upstream, make our build faster. I started off with a mission to remove uses of dalvik.annotation.* (stuff like @TestTargetNew and other useless junk that just makes it harder to stay in sync with upstream). I wrote a script to go through tests showing me the diff between what we have and what upstream has, thinking that in cases where upstream has also added tests, I may as well pull them in at the same time... ...but I didn't realize how close we were to having dx fill its 1.5GiB heap. After trying various alternatives, I decided to bite the bullet and break core-tests up into one .jar per module. This adds parallelism back into this, the slowest part of our build. (I can do even better, but I'll do that in a separate patch, preferably after we've merged recent changes from master.) Only a couple of dependencies were problematic: the worthless TestSuiteFactory which already contained a comment suggesting we get rid of it, and the fact that some tests -- most notably the concurrent ones -- also contained main methods that started the JUnit tty-based TestRunner. (In the long run, we want to be running the harmony tests directly from a pristine "svn co" of upstream, using DalvikRunner. But this will be a big help in the meantime, and starts the work of getting our current copy of the tests into a state where we can start to extract any meaningful changes/additions we've made.) --- x-net/src/test/java/tests/api/javax/net/AllTests.java | 7 +------ x-net/src/test/java/tests/api/javax/net/ssl/AllTests.java | 7 +------ x-net/src/test/java/tests/api/javax/net/ssl/SSLEngineTest.java | 4 ---- x-net/src/test/java/tests/xnet/AllTests.java | 8 +------- 4 files changed, 3 insertions(+), 23 deletions(-) (limited to 'x-net/src') diff --git a/x-net/src/test/java/tests/api/javax/net/AllTests.java b/x-net/src/test/java/tests/api/javax/net/AllTests.java index 90c2a6a..35cd6f5 100644 --- a/x-net/src/test/java/tests/api/javax/net/AllTests.java +++ b/x-net/src/test/java/tests/api/javax/net/AllTests.java @@ -24,13 +24,8 @@ import junit.framework.TestSuite; */ public class AllTests { - - public static void main(String[] args) { - junit.textui.TestRunner.run(AllTests.suite()); - } - public static Test suite() { - TestSuite suite = tests.TestSuiteFactory.createTestSuite("All tests for package tests.api.javax.net;"); + TestSuite suite = new TestSuite("All tests for package tests.api.javax.net;"); // $JUnit-BEGIN$ suite.addTestSuite(ServerSocketFactoryTest.class); diff --git a/x-net/src/test/java/tests/api/javax/net/ssl/AllTests.java b/x-net/src/test/java/tests/api/javax/net/ssl/AllTests.java index ecfe83f..5f9c32d 100644 --- a/x-net/src/test/java/tests/api/javax/net/ssl/AllTests.java +++ b/x-net/src/test/java/tests/api/javax/net/ssl/AllTests.java @@ -24,13 +24,8 @@ import junit.framework.TestSuite; */ public class AllTests { - - public static void main(String[] args) { - junit.textui.TestRunner.run(AllTests.suite()); - } - public static Test suite() { - TestSuite suite = tests.TestSuiteFactory.createTestSuite("All tests for package tests.api.javax.net.ssl;"); + TestSuite suite = new TestSuite("All tests for package tests.api.javax.net.ssl;"); // $JUnit-BEGIN$ suite.addTestSuite(CertPathTrustManagerParametersTest.class); diff --git a/x-net/src/test/java/tests/api/javax/net/ssl/SSLEngineTest.java b/x-net/src/test/java/tests/api/javax/net/ssl/SSLEngineTest.java index f659919..8205059 100644 --- a/x-net/src/test/java/tests/api/javax/net/ssl/SSLEngineTest.java +++ b/x-net/src/test/java/tests/api/javax/net/ssl/SSLEngineTest.java @@ -62,10 +62,6 @@ public class SSLEngineTest extends TestCase { private HandshakeHandler clientEngine; private HandshakeHandler serverEngine; - public static void main(String[] args) { - junit.textui.TestRunner.run(SSLEngineTest.class); - } - @Override protected void setUp() throws Exception { super.setUp(); TestEnvironment.reset(); diff --git a/x-net/src/test/java/tests/xnet/AllTests.java b/x-net/src/test/java/tests/xnet/AllTests.java index 53b11dc..04a2ed6 100644 --- a/x-net/src/test/java/tests/xnet/AllTests.java +++ b/x-net/src/test/java/tests/xnet/AllTests.java @@ -23,14 +23,8 @@ import junit.framework.TestSuite; * Test suite that includes all tests for the Math project. */ public class AllTests { - - public static void main(String[] args) { - junit.textui.TestRunner.run(AllTests.suite()); - } - public static Test suite() { - TestSuite suite = tests.TestSuiteFactory.createTestSuite( - "All javax.net and javax.net.ssl test suites"); + TestSuite suite = new TestSuite("All javax.net and javax.net.ssl test suites"); // $JUnit-BEGIN$ suite.addTest(tests.api.javax.net.AllTests.suite()); suite.addTest(tests.api.javax.net.ssl.AllTests.suite()); -- cgit v1.1