Skip to content

Commit

Permalink
Clean all at the end of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanenicolas committed Apr 15, 2016
1 parent d3c4b3b commit 307b178
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
@@ -1,6 +1,7 @@
package com.example.smoothie;

import com.example.smoothie.deps.ContextNamer;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
Expand All @@ -21,6 +22,11 @@
@Config(manifest = "src/main/AndroidManifest.xml")
public class SimpleActivityTest {

@After
public void tearDown() throws Exception {
ToothPick.reset();
}

@Test
public void verifyInjectionAtOnCreate() {
//GIVEN
Expand Down
@@ -1,5 +1,6 @@
package toothpick;

import org.junit.After;
import org.junit.BeforeClass;
import toothpick.registries.factory.FactoryRegistryLocator;
import toothpick.registries.memberinjector.MemberInjectorRegistryLocator;
Expand All @@ -13,4 +14,9 @@ public static void setUp() throws Exception {
MemberInjectorRegistryLocator.setRootRegistry(new toothpick.test.MemberInjectorRegistry());
FactoryRegistryLocator.setRootRegistry(new toothpick.test.FactoryRegistry());
}

@After
public void tearDown() throws Exception {
ToothPick.reset();
}
}
Expand Up @@ -2,6 +2,7 @@

import org.easymock.EasyMockRule;
import org.easymock.TestSubject;
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
Expand All @@ -23,6 +24,11 @@ public static void setUp() throws Exception {
FactoryRegistryLocator.setRootRegistry(new toothpick.sample.FactoryRegistry());
}

@After
public void tearDown() throws Exception {
ToothPick.reset();
}

@Test
public void testMultiply() throws Exception {
//GIVEN
Expand Down
Expand Up @@ -3,6 +3,7 @@
import org.easymock.EasyMockRule;
import org.easymock.Mock;
import org.easymock.TestSubject;
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -31,6 +32,11 @@ public static void setUp() throws Exception {
FactoryRegistryLocator.setRootRegistry(new toothpick.sample.FactoryRegistry());
}

@After
public void tearDown() throws Exception {
ToothPick.reset();
}

@Test
public void testMultiply() throws Exception {
//GIVEN
Expand Down
Expand Up @@ -40,7 +40,11 @@ public void setScopeName(Object scopeName) {

@Override
public Statement apply(Statement base, Description description) {
return base;
try {
return base;
} finally {
ToothPick.reset();
}
}

public ToothPickTestModule getTestModule() {
Expand Down

0 comments on commit 307b178

Please sign in to comment.