8000 Add RunWith annotations by cgruber · Pull Request #1 · google/dagger · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add RunWith annotations #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 21, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@
import java.util.Collections;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;

import static dagger.androidmanifest.ModuleGenerator.cleanActivityName;
import static org.fest.assertions.Assertions.assertThat;
import static org.junit.Assert.fail;

@RunWith(JUnit4.class)
public final class ModuleGeneratorTest {
private final ModuleGenerator generator = new ModuleGenerator();
private final StringWriter stringWriter = new StringWriter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
import java.io.IOException;
import java.io.StringWriter;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import static org.fest.assertions.Assertions.assertThat;

@RunWith(JUnit4.class)
public final class DotWriterTest {
private final StringWriter stringWriter = new StringWriter();
private final DotWriter dotWriter = new DotWriter(stringWriter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@
import java.util.Set;
import javax.inject.Named;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import static org.fest.assertions.Assertions.assertThat;

@RunWith(JUnit4.class)
public final class GraphVisualizerTest {
private final GraphVisualizer graphVisualizer = new GraphVisualizer();

Expand Down
3 changes: 3 additions & 0 deletions core/src/test/java/dagger/ExtensionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@
import javax.inject.Inject;
import javax.inject.Singleton;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import static org.fest.assertions.Assertions.assertThat;
import static org.junit.Assert.assertNotNull;

@RunWith(JUnit4.class)
public final class ExtensionTest {
@Singleton
static class A {
Expand Down
3 changes: 3 additions & 0 deletions core/src/test/java/dagger/InjectStaticsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
import javax.inject.Inject;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import static org.fest.assertions.Assertions.assertThat;

@RunWith(JUnit4.class)
public final class InjectStaticsTest {
@Before public void setUp() {
InjectsOneField.staticField = null;
Expand Down
3 changes: 3 additions & 0 deletions core/src/test/java/dagger/InjectionOfLazyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@
import javax.inject.Inject;
import javax.inject.Provider;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

/**
* Tests of injection of Lazy<T> bindings.
*/
@RunWith(JUnit4.class)
public final class InjectionOfLazyTest {
@Test public void lazyValueCreation() {
final AtomicInteger counter = new AtomicInteger();
Expand Down
8 changes: 6 additions & 2 deletions core/src/test/java/dagger/InjectionTest.java
AE88
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@
import javax.inject.Provider;
import javax.inject.Singleton;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import static org.fest.assertions.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

@RunWith(JUnit4.class)
public final class InjectionTest {
@Test public void basicInjection() {
class TestEntryPoint {
Expand Down Expand Up @@ -497,11 +500,12 @@ class TestModule {
}
}

@Test public void noConstructorInjectionsForClassesWithTypeParameters() {
class Parameterized<T> {
static class Parameterized<T> {
@Inject String string;
}

@Test public void noConstructorInjectionsForClassesWithTypeParameters() {

class TestEntryPoint {
@Inject Parameterized<Long> parameterized;
}
Expand Down
3 changes: 3 additions & 0 deletions core/src/test/java/dagger/LazyInjectionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@

import javax.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import static org.fest.assertions.Assertions.assertThat;

@RunWith(JUnit4.class)
public final class LazyInjectionTest {
@Test public void getLazyDoesNotCauseEntryPointsToBeLoaded() {
@Module(entryPoints = LazyEntryPoint.class)
Expand Down
3 changes: 3 additions & 0 deletions core/src/test/java/dagger/MembersInjectorTest.java
< F438 /tr>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import javax.inject.Provider;
import javax.inject.Singleton;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import static org.fest.assertions.Assertions.assertThat;
import static org.junit.Assert.fail;
Expand All @@ -27,6 +29,7 @@
* Tests MembersInjector injection, and how object graph features interact with
* types unconstructable types (types that support members injection only).
*/
@RunWith(JUnit4.class)
public final class MembersInjectorTest {
@Test public void injectMembers() {
class TestEntryPoint {
Expand Down
12 changes: 3 additions & 9 deletions core/src/test/java/dagger/ModuleIncludesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@

import javax.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import static org.fest.assertions.Assertions.assertThat;
import static org.junit.Assert.fail;

@RunWith(JUnit4.class)
public final class ModuleIncludesTest {
static class TestEntryPoint {
@Inject String s;
Expand Down Expand Up @@ -73,9 +76,6 @@ static class ModuleWithBinding {
}

@Test public void childModuleWithBinding() {
class TestEntryPoint {
@Inject String s;
}

@Module(
entryPoints = TestEntryPoint.class,
Expand All @@ -95,9 +95,6 @@ static class ModuleWithChildModule {
}

@Test public void childModuleWithChildModule() {
class TestEntryPoint {
@Inject String s;
}

@Module(
entryPoints = TestEntryPoint.class,
Expand Down Expand Up @@ -138,9 +135,6 @@ class TestModule {
}

@Test public void childModuleWithManualConstruction() {
class TestEntryPoint {
@Inject String s;
}

@Module(
entryPoints = TestEntryPoint.class,
Expand Down
3 changes: 3 additions & 0 deletions core/src/test/java/dagger/ProblemDetectorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@

import javax.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import static org.junit.Assert.fail;

@RunWith(JUnit4.class)
public final class ProblemDetectorTest {
@Test public void atInjectCircularDependenciesDetected() {
class TestEntryPoint {
Expand Down
3 changes: 3 additions & 0 deletions core/src/test/java/dagger/SetBindingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@
import javax.inject.Named;
import javax.inject.Singleton;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import static dagger.Provides.Type.SET;
import static org.fest.assertions.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

@RunWith(JUnit4.class)
public final class SetBindingTest {
@Test public void multiValueBindings_SingleModule() {
class TestEntryPoint {
Expand Down
3 changes: 3 additions & 0 deletions core/src/test/java/dagger/internal/KeysTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@
import javax.inject.Named;
import javax.inject.Provider;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import static dagger.Provides.Type.SET;
import static org.fest.assertions.Assertions.assertThat;

@RunWith(JUnit4.class)
public final class KeysTest {
int primitive;
@Test public void lonePrimitiveGetsBoxed() throws NoSuchFieldException {
Expand Down
0