Skip to content

Commit

Permalink
Fix import order for compile-testing code and remove some stray white…
Browse files Browse the repository at this point in the history
…space

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129104075
  • Loading branch information
ronshapiro committed Aug 3, 2016
1 parent 9fd8df1 commit e9066f6
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public void testEmptyBuilder() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand Down Expand Up @@ -303,7 +302,6 @@ public void testMoreThanOneBuilderFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand Down Expand Up @@ -332,7 +330,6 @@ public void testBuilderGenericsFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand Down Expand Up @@ -371,7 +368,6 @@ public void testBuilderMissingBuildMethodFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand All @@ -392,7 +388,6 @@ public void testPrivateBuilderFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand All @@ -413,7 +408,6 @@ public void testNonStaticBuilderFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand All @@ -434,7 +428,6 @@ public void testNonAbstractBuilderFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand All @@ -454,7 +447,6 @@ public void testBuilderOneCxtorWithArgsFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand All @@ -477,7 +469,6 @@ public void testBuilderMoreThanOneCxtorFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand All @@ -501,7 +492,6 @@ public void testBuilderEnumFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand All @@ -522,7 +512,6 @@ public void testBuilderBuildReturnsWrongTypeFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand All @@ -536,7 +525,7 @@ public void testBuilderBuildReturnsWrongTypeFails() {
.processedWith(new ComponentProcessor())
.failsToCompile()
.withErrorContaining(MSGS.buildMustReturnComponentType())
.in(componentFile).onLine(11);
.in(componentFile).onLine(10);
}

@Test
Expand All @@ -545,7 +534,6 @@ public void testInheritedBuilderBuildReturnsWrongTypeFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand All @@ -562,7 +550,7 @@ public void testInheritedBuilderBuildReturnsWrongTypeFails() {
.failsToCompile()
.withErrorContaining(
String.format(MSGS.inheritedBuildMustReturnComponentType(), "build"))
.in(componentFile).onLine(14);
.in(componentFile).onLine(13);
}

@Test
Expand All @@ -571,7 +559,6 @@ public void testTwoBuildMethodsFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand All @@ -586,7 +573,7 @@ public void testTwoBuildMethodsFails() {
.processedWith(new ComponentProcessor())
.failsToCompile()
.withErrorContaining(String.format(MSGS.twoBuildMethods(), "build()"))
.in(componentFile).onLine(12);
.in(componentFile).onLine(11);
}

@Test
Expand All @@ -595,7 +582,6 @@ public void testInheritedTwoBuildMethodsFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand All @@ -613,7 +599,7 @@ public void testInheritedTwoBuildMethodsFails() {
.failsToCompile()
.withErrorContaining(
String.format(MSGS.inheritedTwoBuildMethods(), "create()", "build()"))
.in(componentFile).onLine(15);
.in(componentFile).onLine(14);
}

@Test
Expand All @@ -622,7 +608,6 @@ public void testMoreThanOneArgFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand All @@ -638,9 +623,9 @@ public void testMoreThanOneArgFails() {
.processedWith(new ComponentProcessor())
.failsToCompile()
.withErrorContaining(MSGS.methodsMustTakeOneArg())
.in(componentFile).onLine(12)
.in(componentFile).onLine(11)
.and().withErrorContaining(MSGS.methodsMustTakeOneArg())
.in(componentFile).onLine(13);
.in(componentFile).onLine(12);
}

@Test
Expand All @@ -649,7 +634,6 @@ public void testInheritedMoreThanOneArgFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand All @@ -668,7 +652,7 @@ public void testInheritedMoreThanOneArgFails() {
.withErrorContaining(
String.format(MSGS.inheritedMethodsMustTakeOneArg(),
"set1(java.lang.String,java.lang.Integer)"))
.in(componentFile).onLine(15);
.in(componentFile).onLine(14);
}

@Test
Expand All @@ -677,7 +661,6 @@ public void testSetterReturningNonVoidOrBuilderFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand All @@ -692,7 +675,7 @@ public void testSetterReturningNonVoidOrBuilderFails() {
.processedWith(new ComponentProcessor())
.failsToCompile()
.withErrorContaining(MSGS.methodsMustReturnVoidOrBuilder())
.in(componentFile).onLine(12);
.in(componentFile).onLine(11);
}

@Test
Expand All @@ -701,7 +684,6 @@ public void testInheritedSetterReturningNonVoidOrBuilderFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand All @@ -720,7 +702,7 @@ public void testInheritedSetterReturningNonVoidOrBuilderFails() {
.withErrorContaining(
String.format(MSGS.inheritedMethodsMustReturnVoidOrBuilder(),
"set(java.lang.Integer)"))
.in(componentFile).onLine(15);
.in(componentFile).onLine(14);
}

@Test
Expand All @@ -729,7 +711,6 @@ public void testGenericsOnSetterMethodFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand All @@ -744,7 +725,7 @@ public void testGenericsOnSetterMethodFails() {
.processedWith(new ComponentProcessor())
.failsToCompile()
.withErrorContaining(MSGS.methodsMayNotHaveTypeParameters())
.in(componentFile).onLine(12);
.in(componentFile).onLine(11);
}

@Test
Expand All @@ -753,7 +734,6 @@ public void testGenericsOnInheritedSetterMethodFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand All @@ -771,7 +751,7 @@ public void testGenericsOnInheritedSetterMethodFails() {
.failsToCompile()
.withErrorContaining(
String.format(MSGS.inheritedMethodsMayNotHaveTypeParameters(), "<T>set(T)"))
.in(componentFile).onLine(15);
.in(componentFile).onLine(14);
}

@Test
Expand All @@ -780,7 +760,6 @@ public void testMultipleSettersPerTypeFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand All @@ -798,7 +777,7 @@ public void testMultipleSettersPerTypeFails() {
.withErrorContaining(
String.format(MSGS.manyMethodsForType(),
"java.lang.String", "[set1(java.lang.String), set2(java.lang.String)]"))
.in(componentFile).onLine(10);
.in(componentFile).onLine(9);
}

@Test
Expand All @@ -807,7 +786,6 @@ public void testMultipleSettersPerTypeIncludingResolvedGenericsFails() {
"package test;",
"",
"import dagger.Component;",
"",
"import javax.inject.Provider;",
"",
"@Component",
Expand All @@ -828,7 +806,7 @@ public void testMultipleSettersPerTypeIncludingResolvedGenericsFails() {
.withErrorContaining(
String.format(MSGS.manyMethodsForType(),
"java.lang.String", "[set1(T), set2(java.lang.String)]"))
.in(componentFile).onLine(14);
.in(componentFile).onLine(13);
}

@Test
Expand Down
Loading

0 comments on commit e9066f6

Please sign in to comment.