1 /* 2 * Copyright (C) 2006 Google Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.google.inject; 18 19 import com.google.common.collect.ImmutableSet; 20 import com.google.inject.internal.MoreTypesTest; 21 import com.google.inject.internal.UniqueAnnotationsTest; 22 import com.google.inject.internal.WeakKeySetTest; 23 import com.google.inject.internal.util.LineNumbersTest; 24 import com.google.inject.matcher.MatcherTest; 25 import com.google.inject.name.NamedEquivalanceTest; 26 import com.google.inject.name.NamesTest; 27 import com.google.inject.spi.BindingTargetVisitorTest; 28 import com.google.inject.spi.ElementApplyToTest; 29 import com.google.inject.spi.ElementSourceTest; 30 import com.google.inject.spi.ElementsTest; 31 import com.google.inject.spi.HasDependenciesTest; 32 import com.google.inject.spi.InjectionPointTest; 33 import com.google.inject.spi.InjectorSpiTest; 34 import com.google.inject.spi.MessageTest; 35 import com.google.inject.spi.ModuleAnnotatedMethodScannerTest; 36 import com.google.inject.spi.ModuleRewriterTest; 37 import com.google.inject.spi.ModuleSourceTest; 38 import com.google.inject.spi.ProviderMethodsTest; 39 import com.google.inject.spi.SpiBindingsTest; 40 import com.google.inject.spi.ToolStageInjectorTest; 41 import com.google.inject.util.NoopOverrideTest; 42 import com.google.inject.util.OverrideModuleTest; 43 import com.google.inject.util.ProvidersTest; 44 import com.google.inject.util.TypesTest; 45 import com.googlecode.guice.GuiceTck; 46 import com.googlecode.guice.Jsr330Test; 47 import junit.framework.Test; 48 import junit.framework.TestSuite; 49 50 /** @author crazybob@google.com (Bob Lee) */ 51 public class AllTests { 52 53 private static final ImmutableSet<String> SUPPRESSED_TEST_NAMES = 54 ImmutableSet.of( 55 "testUnscopedProviderWorksOutsideOfRequestedScope(" + ScopesTest.class.getName() + ")", 56 "testCannotConvertUnannotatedBindings(" + TypeConversionTest.class.getName() + ")"); 57 suite()58 public static Test suite() { 59 TestSuite suite = new TestSuite(); 60 61 suite.addTest(GuiceTck.suite()); 62 suite.addTestSuite(BinderTest.class); 63 suite.addTest(BinderTestSuite.suite()); 64 suite.addTestSuite(BindingAnnotationTest.class); 65 suite.addTestSuite(BindingOrderTest.class); 66 suite.addTestSuite(BindingTest.class); 67 suite.addTestSuite(BoundInstanceInjectionTest.class); 68 suite.addTestSuite(BoundProviderTest.class); 69 suite.addTestSuite(CircularDependencyTest.class); 70 suite.addTestSuite(DuplicateBindingsTest.class); 71 // ErrorHandlingTest.class is not a testcase 72 suite.addTestSuite(EagerSingletonTest.class); 73 suite.addTestSuite(GenericInjectionTest.class); 74 suite.addTestSuite(ImplicitBindingTest.class); 75 suite.addTestSuite(TypeListenerTest.class); 76 suite.addTestSuite(InjectorTest.class); 77 suite.addTestSuite(JitBindingsTest.class); 78 // IntegrationTest is AOP-only 79 suite.addTestSuite(KeyTest.class); 80 suite.addTestSuite(LoggerInjectionTest.class); 81 // MethodInterceptionTest is AOP-only 82 suite.addTestSuite(MembersInjectorTest.class); 83 suite.addTestSuite(ModulesTest.class); 84 suite.addTestSuite(ModuleTest.class); 85 suite.addTestSuite(ModuleAnnotatedMethodScannerTest.class); 86 suite.addTestSuite(NullableInjectionPointTest.class); 87 suite.addTestSuite(OptionalBindingTest.class); 88 suite.addTestSuite(OverrideModuleTest.class); 89 suite.addTestSuite(ParentInjectorTest.class); 90 suite.addTestSuite(PrivateModuleTest.class); 91 suite.addTestSuite(ProviderInjectionTest.class); 92 suite.addTestSuite(ProvisionExceptionTest.class); 93 suite.addTestSuite(ProvisionListenerTest.class); 94 // ProxyFactoryTest is AOP-only 95 suite.addTestSuite(ReflectionTest.class); 96 suite.addTestSuite(RequestInjectionTest.class); 97 suite.addTestSuite(RequireAtInjectOnConstructorsTest.class); 98 suite.addTestSuite(ScopesTest.class); 99 suite.addTestSuite(SerializationTest.class); 100 suite.addTestSuite(SuperclassTest.class); 101 suite.addTestSuite(TypeConversionTest.class); 102 suite.addTestSuite(TypeLiteralInjectionTest.class); 103 suite.addTestSuite(TypeLiteralTest.class); 104 suite.addTestSuite(TypeLiteralTypeResolutionTest.class); 105 suite.addTestSuite(WeakKeySetTest.class); 106 107 // internal 108 suite.addTestSuite(LineNumbersTest.class); 109 suite.addTestSuite(MoreTypesTest.class); 110 suite.addTestSuite(UniqueAnnotationsTest.class); 111 112 // matcher 113 suite.addTestSuite(MatcherTest.class); 114 115 // names 116 suite.addTestSuite(NamesTest.class); 117 suite.addTestSuite(NamedEquivalanceTest.class); 118 119 // spi 120 suite.addTestSuite(BindingTargetVisitorTest.class); 121 suite.addTestSuite(ElementsTest.class); 122 suite.addTestSuite(ElementApplyToTest.class); 123 suite.addTestSuite(HasDependenciesTest.class); 124 suite.addTestSuite(InjectionPointTest.class); 125 suite.addTestSuite(InjectorSpiTest.class); 126 suite.addTestSuite(ModuleRewriterTest.class); 127 suite.addTestSuite(ProviderMethodsTest.class); 128 suite.addTestSuite(SpiBindingsTest.class); 129 suite.addTestSuite(ToolStageInjectorTest.class); 130 suite.addTestSuite(ModuleSourceTest.class); 131 suite.addTestSuite(ElementSourceTest.class); 132 suite.addTestSuite(MessageTest.class); 133 134 // tools 135 // suite.addTestSuite(JmxTest.class); not a testcase 136 137 // util 138 suite.addTestSuite(NoopOverrideTest.class); 139 suite.addTestSuite(ProvidersTest.class); 140 suite.addTestSuite(TypesTest.class); 141 142 /*if[AOP]*/ 143 suite.addTestSuite(com.google.inject.internal.ProxyFactoryTest.class); 144 suite.addTestSuite(IntegrationTest.class); 145 suite.addTestSuite(MethodInterceptionTest.class); 146 suite.addTestSuite(com.googlecode.guice.BytecodeGenTest.class); 147 /*end[AOP]*/ 148 149 // googlecode.guice 150 suite.addTestSuite(com.googlecode.guice.OSGiContainerTest.class); 151 suite.addTestSuite(Jsr330Test.class); 152 153 // multibindings tests 154 suite.addTestSuite(com.google.inject.internal.MapBinderTest.class); 155 suite.addTestSuite(com.google.inject.internal.MultibinderTest.class); 156 suite.addTestSuite(com.google.inject.internal.OptionalBinderTest.class); 157 suite.addTestSuite(com.google.inject.internal.RealElementTest.class); 158 suite.addTestSuite(com.google.inject.multibindings.ProvidesIntoTest.class); 159 160 return SuiteUtils.removeSuppressedTests(suite, SUPPRESSED_TEST_NAMES); 161 } 162 } 163