refactor removeSuppressedTests out of AllTests, to remove the circular dependency between it & StrictContainerTestSuite.
git-svn-id: https://google-guice.googlecode.com/svn/trunk@1557 d779f126-a31b-0410-b53b-1d3aecad763e
diff --git a/core/test/com/google/inject/AllTests.java b/core/test/com/google/inject/AllTests.java
index 21d11de..ba7a072 100644
--- a/core/test/com/google/inject/AllTests.java
+++ b/core/test/com/google/inject/AllTests.java
@@ -41,7 +41,6 @@
import com.google.inject.util.TypesTest;
import com.googlecode.guice.Jsr330Test;
import com.googlecode.guice.GuiceTck;
-import java.util.Enumeration;
import java.util.Set;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -149,26 +148,6 @@
suite.addTestSuite(com.googlecode.guice.OSGiContainerTest.class);
suite.addTestSuite(Jsr330Test.class);
- return removeSuppressedTests(suite, SUPPRESSED_TEST_NAMES);
- }
-
- public static TestSuite removeSuppressedTests(TestSuite suite, Set<String> suppressedTestNames) {
- TestSuite result = new TestSuite(suite.getName());
-
- for(Enumeration e = suite.tests(); e.hasMoreElements(); ) {
- Test test = (Test) e.nextElement();
-
- if (suppressedTestNames.contains(test.toString())) {
- continue;
- }
-
- if (test instanceof TestSuite) {
- result.addTest(removeSuppressedTests((TestSuite) test, suppressedTestNames));
- } else {
- result.addTest(test);
- }
- }
-
- return result;
+ return SuiteUtils.removeSuppressedTests(suite, SUPPRESSED_TEST_NAMES);
}
}
diff --git a/core/test/com/google/inject/SuiteUtils.java b/core/test/com/google/inject/SuiteUtils.java
new file mode 100644
index 0000000..c3db60b
--- /dev/null
+++ b/core/test/com/google/inject/SuiteUtils.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright (C) 2011 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.inject;
+
+import java.util.Enumeration;
+import java.util.Set;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class SuiteUtils {
+
+ public static TestSuite removeSuppressedTests(TestSuite suite, Set<String> suppressedTestNames) {
+ TestSuite result = new TestSuite(suite.getName());
+
+ for(Enumeration e = suite.tests(); e.hasMoreElements(); ) {
+ Test test = (Test) e.nextElement();
+
+ if (suppressedTestNames.contains(test.toString())) {
+ continue;
+ }
+
+ if (test instanceof TestSuite) {
+ result.addTest(removeSuppressedTests((TestSuite) test, suppressedTestNames));
+ } else {
+ result.addTest(test);
+ }
+ }
+
+ return result;
+ }
+
+}
diff --git a/core/test/com/googlecode/guice/StrictContainerTestSuite.java b/core/test/com/googlecode/guice/StrictContainerTestSuite.java
index 906609c..647bbd7 100644
--- a/core/test/com/googlecode/guice/StrictContainerTestSuite.java
+++ b/core/test/com/googlecode/guice/StrictContainerTestSuite.java
@@ -16,7 +16,7 @@
package com.googlecode.guice;
-import com.google.inject.AllTests;
+import com.google.inject.SuiteUtils;
import com.google.inject.internal.util.ImmutableSet;
import com.google.inject.internal.util.MapMakerTestSuite;
import com.google.inject.internal.util.MapMakerTestSuite.ReferenceMapTest;
@@ -84,6 +84,6 @@
/*end[AOP]*/
builder.addSuite(MapMakerTestSuite.class.getName());
- return AllTests.removeSuppressedTests(builder.build(), SUPPRESSED_TEST_NAMES);
+ return SuiteUtils.removeSuppressedTests(builder.build(), SUPPRESSED_TEST_NAMES);
}
}