Revision: 1557
Author: sberlin
Date: Fri Jun 24 22:05:23 2011
Log: refactor removeSuppressedTests out of AllTests, to remove the
circular dependency between it & StrictContainerTestSuite.
http://code.google.com/p/google-guice/source/detail?r=1557
Added:
/trunk/core/test/com/google/inject/SuiteUtils.java
Modified:
/trunk/core/test/com/google/inject/AllTests.java
/trunk/core/test/com/googlecode/guice/StrictContainerTestSuite.java
=======================================
--- /dev/null
+++ /trunk/core/test/com/google/inject/SuiteUtils.java Fri Jun 24 22:05:23
2011
@@ -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;
+ }
+
+}
=======================================
--- /trunk/core/test/com/google/inject/AllTests.java Sun Jun 5 11:32:05
2011
+++ /trunk/core/test/com/google/inject/AllTests.java Fri Jun 24 22:05:23
2011
@@ -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);
}
}
=======================================
--- /trunk/core/test/com/googlecode/guice/StrictContainerTestSuite.java Sat
Jul 3 08:51:31 2010
+++ /trunk/core/test/com/googlecode/guice/StrictContainerTestSuite.java Fri
Jun 24 22:05:23 2011
@@ -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);
}
}
--
You received this message because you are subscribed to the Google Groups
"google-guice-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice-dev?hl=en.