-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ec5921
commit 98ad2c7
Showing
14 changed files
with
89 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 6 additions & 5 deletions
11
src/it/filter-main-annotation/src/main/java-templates/pkg/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
package pkg; | ||
import org.junit.Ignore; | ||
|
||
@Ignore("${someprop}") | ||
import org.junit.jupiter.api.Disabled; | ||
|
||
@Disabled("${someprop}") | ||
public class A { | ||
public static final String FILTER_A="${someprop}"; | ||
public static final String FILTER_B="@someprop@"; | ||
} | ||
public static final String FILTER_A="${someprop}"; | ||
public static final String FILTER_B="@someprop@"; | ||
} |
6 changes: 3 additions & 3 deletions
6
src/it/filter-main-annotation/src/main/java-templates/pkg/B.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
package pkg; | ||
import org.junit.Ignore; | ||
import org.junit.jupiter.api.Disabled; | ||
|
||
@Ignore( "@someprop@") | ||
@Disabled( "@someprop@") | ||
public class B { | ||
public static final String FILTER_A="${someprop}"; | ||
public static final String FILTER_A="${someprop}"; | ||
public static final String FILTER_B="@someprop@"; | ||
} |
7 changes: 4 additions & 3 deletions
7
src/it/filter-main-annotation/src/main/java-templates/pkg/C.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
package pkg; | ||
import org.junit.Ignore; | ||
|
||
@Ignore( | ||
import org.junit.jupiter.api.Disabled; | ||
|
||
@Disabled( | ||
"${someprop}" + | ||
"@someprop@" + | ||
"${someprop}@someprop@ @someprop@${someprop}" | ||
) | ||
|
||
public class C { | ||
} | ||
} |
7 changes: 4 additions & 3 deletions
7
src/it/filter-main-annotation/src/main/java-templates/pkg/SomeClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
src/it/filter-main/src/test/java/net/batmat/maven/AppTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
package net.batmat.maven; | ||
|
||
import org.junit.Assert; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class AppTest | ||
public class AppTest | ||
{ | ||
@org.junit.Test | ||
@Test | ||
public void testApp() | ||
{ | ||
Assert.assertEquals( "<1.0-specialversion>", pkg.SomeClass.VERSION); | ||
assertEquals( "<1.0-specialversion>", pkg.SomeClass.VERSION); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
package some.testpkg; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.junit.jupiter.api.Test; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
@SuppressWarnings( net.batmat.maven.SomeTestClass.VERSION ) | ||
public class TheClass | ||
{ | ||
@Test | ||
public void testFoo() | ||
{ | ||
Assert.assertEquals( "%1.0-specialtestversion%", net.batmat.maven.SomeTestClass.VERSION ); | ||
assertEquals( "%1.0-specialtestversion%", net.batmat.maven.SomeTestClass.VERSION ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,6 @@ | |
import static org.mockito.Mockito.verify; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
import org.apache.commons.io.FileUtils; | ||
import org.apache.maven.execution.MavenSession; | ||
|
@@ -35,22 +34,22 @@ | |
import org.apache.maven.shared.filtering.MavenFilteringException; | ||
import org.apache.maven.shared.filtering.MavenResourcesExecution; | ||
import org.apache.maven.shared.filtering.MavenResourcesFiltering; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.mockito.InjectMocks; | ||
import org.mockito.Mock; | ||
import org.mockito.Spy; | ||
import org.mockito.invocation.InvocationOnMock; | ||
import org.mockito.junit.MockitoJUnitRunner; | ||
import org.mockito.junit.jupiter.MockitoExtension; | ||
import org.mockito.stubbing.Answer; | ||
|
||
/** | ||
* @author Krzysztof Suszyński <[email protected]> | ||
* @since 2015-11-17 | ||
*/ | ||
@RunWith( MockitoJUnitRunner.class ) | ||
public class AbstractFilterSourcesMojoTest | ||
@ExtendWith(MockitoExtension.class) | ||
class AbstractFilterSourcesMojoTest | ||
{ | ||
@Spy | ||
private MavenProject project = MavenProjectStub.createProjectForITExample( "sample-simple" ); | ||
|
@@ -70,16 +69,14 @@ public class AbstractFilterSourcesMojoTest | |
@InjectMocks | ||
private AbstractFilterSourcesMojo mojo = new FilterSourcesMojo(); | ||
|
||
@Before | ||
public void before() | ||
throws IOException | ||
{ | ||
@BeforeEach | ||
void before() { | ||
File target = resolve( project.getBasedir(), outputDirectory.getPath() ); | ||
FileUtils.deleteQuietly( target ); | ||
} | ||
|
||
@Test | ||
public void testGetOutputDirectory() | ||
void testGetOutputDirectory() | ||
{ | ||
// when | ||
File file = mojo.getOutputDirectory(); | ||
|
@@ -90,7 +87,7 @@ public void testGetOutputDirectory() | |
} | ||
|
||
@Test | ||
public void testGetSourceDirectory() | ||
void testGetSourceDirectory() | ||
{ | ||
// when | ||
File file = mojo.getSourceDirectory(); | ||
|
@@ -104,8 +101,7 @@ public void testGetSourceDirectory() | |
} | ||
|
||
@Test | ||
public void testExecute() | ||
throws MojoExecutionException, MavenFilteringException | ||
void testExecute() throws MojoExecutionException, MavenFilteringException | ||
{ | ||
// given | ||
doAnswer( new MockCopyAnswer() ).when( mavenResourcesFiltering ).filterResources( any( MavenResourcesExecution.class ) ); | ||
|
@@ -148,4 +144,4 @@ private static File resolve( File file, String... paths ) | |
} | ||
return new File( sb.toString() ); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters