Skip to content

Commit

Permalink
[#74] rework integration tests pt.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored and bmarwell committed Oct 26, 2023
1 parent 34f9cd8 commit ee7d0b4
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 19 deletions.
19 changes: 17 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
<mojo.java.target>8</mojo.java.target>
<wagon.api.version>3.0.0</wagon.api.version>

<takari-plugin-testing.version>2.9.0</takari-plugin-testing.version>
<takari-lifecycle-plugin.version>1.12.2</takari-lifecycle-plugin.version>
<takari-plugin-testing.version>2.9.2</takari-plugin-testing.version>
<takari-lifecycle-plugin.version>2.0.0</takari-lifecycle-plugin.version>

<ftpserver.version>1.1.1</ftpserver.version>
<project.build.outputTimestamp>2022-01-18T09:14:02Z</project.build.outputTimestamp>
Expand Down Expand Up @@ -297,6 +297,21 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>integration-test</id>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>

</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

@RunWith( MavenJUnitTestRunner.class )
@MavenVersions( { "3.6.3" } )
public class Wagon334MojoHttpTest
public class Wagon334MojoHttpIT
{
@Rule
public final TestResources resources = new TestResources();

public final MavenRuntime maven;

public Wagon334MojoHttpTest(MavenRuntimeBuilder builder )
public Wagon334MojoHttpIT(MavenRuntimeBuilder builder )
throws Exception
{
this.maven = builder.withCliOptions( "-B" ).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@

@RunWith( MavenJUnitTestRunner.class )
@MavenVersions( { "3.2.5" } )
public class WagonMojoFtpBasicTest
public class WagonMojoFtpBasicIT
{
@Rule
public final TestResources resources = new TestResources();

public final MavenRuntime maven;
public final FtpServer ftpServer;

public WagonMojoFtpBasicTest( MavenRuntimeBuilder builder )
public WagonMojoFtpBasicIT( MavenRuntimeBuilder builder )
throws Exception
{
this.ftpServer = createFtp();
Expand All @@ -60,9 +60,9 @@ public void testFtpBasic()
MavenExecution mavenExec = maven.forProject( projDir );
MavenExecutionResult result = mavenExec.execute( "clean", "verify" );
result.assertErrorFreeLog();
Assert.assertTrue( new File( result.getBasedir(), "target/it/WagonMojoFtpBasicTest.class" ).exists() );
Assert.assertTrue( new File( result.getBasedir(), "target/it/single-dir/WagonMojoFtpBasicTest.class" ).exists() );
Assert.assertTrue( new File( result.getBasedir(), "target/it/single-dir/WagonMojoHttpTest.class" ).exists() );
Assert.assertTrue( new File( result.getBasedir(), "target/it/" + this.getClass().getSimpleName() + ".class" ).exists() );
Assert.assertTrue( new File( result.getBasedir(), "target/it/single-dir/"+ this.getClass().getSimpleName() + ".class" ).exists() );
Assert.assertTrue( new File( result.getBasedir(), "target/it/single-dir/" + this.getClass().getSimpleName() + ".class" ).exists() );

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

@RunWith( MavenJUnitTestRunner.class )
@MavenVersions( { "3.2.5" } )
public class WagonMojoHttpTest
public class WagonMojoHttpIT
{
@Rule
public final TestResources resources = new TestResources();

public final MavenRuntime maven;

public WagonMojoHttpTest( MavenRuntimeBuilder builder )
public WagonMojoHttpIT( MavenRuntimeBuilder builder )
throws Exception
{
this.maven = builder.withCliOptions( "-B" ).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

@RunWith( MavenJUnitTestRunner.class )
@MavenVersions( { "3.2.5" } )
public class WagonMojoHttpSettingsTest
public class WagonMojoHttpSettingsIT
{
@Rule
public final TestResources resources = new TestResources();

public final MavenRuntime maven;

public WagonMojoHttpSettingsTest( MavenRuntimeBuilder builder )
public WagonMojoHttpSettingsIT( MavenRuntimeBuilder builder )
throws Exception
{
this.maven = builder.withCliOptions( "-B", "-e", "-s", "settings.xml" ).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

@RunWith( MavenJUnitTestRunner.class )
@MavenVersions( { "3.2.5" } )
public class WagonMojoSshTest
public class WagonMojoSshIT
{
@Rule
public final TestResources resources = new TestResources();

public final MavenRuntime maven;

public WagonMojoSshTest( MavenRuntimeBuilder builder )
public WagonMojoSshIT( MavenRuntimeBuilder builder )
throws Exception
{
this.maven = builder.withCliOptions( "-B", "-e", "-s", "settings.xml" ).build();
Expand Down
6 changes: 3 additions & 3 deletions src/test/projects/ftp-basic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<goal>download-single</goal>
</goals>
<configuration>
<fromFile>WagonMojoFtpBasicTest.class</fromFile>
<fromFile>WagonMojoFtpBasicIT.class</fromFile>
<toDir>${downloadDirectory.base}</toDir>
</configuration>
</execution>
Expand All @@ -53,7 +53,7 @@
</goals>
<configuration>
<toDir>${downloadDirectory.base}/single-dir</toDir>
<includes>WagonMojoFtpBasicTest.class,WagonMojoHttpTest.class</includes>
<includes>WagonMojoFtpBasicIT.class,WagonMojoHttpTest.class</includes>
</configuration>
</execution>
<execution>
Expand All @@ -73,4 +73,4 @@



</project>
</project>
2 changes: 1 addition & 1 deletion src/test/projects/http-download/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
</goals>
<configuration>
<url>https://repo1.maven.org/maven2/commons-dbutils/commons-dbutils</url>
<includes>1*/**</includes>
<includes>1.1/**</includes>
<excludes>1.0/**, 1.2/**, 1.3/**, 1.4/**, 1.5/**, 1.6/**</excludes>
<toDir>${downloadDirectory.base}</toDir>
</configuration>
Expand Down

0 comments on commit ee7d0b4

Please sign in to comment.