@Before public void setUp() throws Exception { Toothpick.setConfiguration(Configuration.forProduction().disableReflection()); Toothpick.openScope(ROOT_SCOPE); scopeNames.clear(); }
@AfterClass public static void staticTearDown() throws Exception { Toothpick.setConfiguration(Configuration.forProduction().disableReflection()); }
@Before public void setUp() throws Exception { Toothpick.setConfiguration(Configuration.forProduction().disableReflection()); }
@BeforeClass public static void setUp() throws Exception { ToothpickBaseTest.setUp(); Toothpick.setConfiguration(Configuration.forDevelopment().disableReflection()); }
@Test public void testGetMemberInjector_shouldReturnNull_whenThereAreNoRegistries() throws Exception { //GIVEN Toothpick.setConfiguration(Configuration.forProduction().disableReflection()); MemberInjectorRegistryLocator.setRootRegistry(null); //WHEN MemberInjector<Foo> memberInjector = MemberInjectorRegistryLocator.getMemberInjector(Foo.class); //THEN assertThat(memberInjector, nullValue()); }
@BeforeClass public static void setUp() throws Exception { MemberInjectorRegistryLocator.setRootRegistry(new toothpick.test.MemberInjectorRegistry()); FactoryRegistryLocator.setRootRegistry(new toothpick.test.FactoryRegistry()); Toothpick.setConfiguration(Configuration.forProduction().disableReflection()); }
@Override public void onCreate() { super.onCreate(); // com.example.smoothie.MemberInjectorRegistry and com.example.smoothie.FactoryRegistry are classes generated by this project // Your project will have these classes in your package (or the one you specify). // Please note that the fully qualified name should be used instead of an import. // (see https://github.com/stephanenicolas/toothpick/wiki/Factory-and-Member-Injector-registries) // If you're not using the reflection free configuration, the next 3 lines can be omitted Toothpick.setConfiguration(Configuration.forProduction().disableReflection()); MemberInjectorRegistryLocator.setRootRegistry(new com.example.smoothie.MemberInjectorRegistry()); FactoryRegistryLocator.setRootRegistry(new com.example.smoothie.FactoryRegistry()); Scope appScope = Toothpick.openScope(this); initToothpick(appScope); }