This commit is contained in:
Guillaume Nodet 2023-06-02 11:57:19 +02:00
parent aedbb150f5
commit 386efc3d6c
902 changed files with 23349 additions and 31763 deletions

View File

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
Licensed to the Apache Software Foundation (ASF) under one Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file or more contributor license agreements. See the NOTICE file
@ -18,9 +17,7 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. under the License.
--> -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
@ -77,8 +74,8 @@ under the License.
<proxy.host>localhost</proxy.host> <proxy.host>localhost</proxy.host>
<proxy.port>80</proxy.port> <proxy.port>80</proxy.port>
<proxy.type>none</proxy.type> <proxy.type>none</proxy.type>
<proxy.user></proxy.user> <proxy.user />
<proxy.pass></proxy.pass> <proxy.pass />
<proxy.nonProxyHosts>localhost</proxy.nonProxyHosts> <proxy.nonProxyHosts>localhost</proxy.nonProxyHosts>
<slf4jVersion>1.6.1</slf4jVersion> <slf4jVersion>1.6.1</slf4jVersion>
<jetty9Version>9.4.50.v20221201</jetty9Version> <jetty9Version>9.4.50.v20221201</jetty9Version>
@ -486,8 +483,8 @@ under the License.
<directory>src/test/resources</directory> <directory>src/test/resources</directory>
</testResource> </testResource>
<testResource> <testResource>
<directory>src/test/resources-filtered</directory>
<filtering>true</filtering> <filtering>true</filtering>
<directory>src/test/resources-filtered</directory>
</testResource> </testResource>
</testResources> </testResources>
<plugins> <plugins>
@ -542,17 +539,6 @@ under the License.
</profile> </profile>
<profile> <profile>
<id>run-its</id> <id>run-its</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
<dependencies> <dependencies>
<!-- not really used but will force download in the local repo used --> <!-- not really used but will force download in the local repo used -->
<dependency> <dependency>
@ -574,6 +560,17 @@ under the License.
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile> </profile>
<profile> <profile>
<id>maven-repo-local</id> <id>maven-repo-local</id>
@ -625,7 +622,7 @@ under the License.
<jdk>(,1.8)</jdk> <jdk>(,1.8)</jdk>
</activation> </activation>
<properties> <properties>
<surefireMemory>-Xmx384m -XX:MaxPermSize=192m</surefireMemory> <surefireMemory>-Xmx384m -XX:MaxPermSize=192m</surefireMemory>
</properties> </properties>
</profile> </profile>
<profile> <profile>
@ -676,10 +673,10 @@ under the License.
<executions> <executions>
<execution> <execution>
<id>download-maven-distro</id> <id>download-maven-distro</id>
<phase>process-test-resources</phase>
<goals> <goals>
<goal>copy</goal> <goal>copy</goal>
</goals> </goals>
<phase>process-test-resources</phase>
<configuration> <configuration>
<artifactItems> <artifactItems>
<artifactItem> <artifactItem>
@ -702,20 +699,17 @@ under the License.
<executions> <executions>
<execution> <execution>
<id>unpack-maven-distro</id> <id>unpack-maven-distro</id>
<phase>process-test-resources</phase>
<goals> <goals>
<goal>run</goal> <goal>run</goal>
</goals> </goals>
<phase>process-test-resources</phase>
<configuration> <configuration>
<target> <target>
<delete dir="${mavenHome}" /> <delete dir="${mavenHome}" />
<unzip src="${project.build.directory}/maven-bin.zip" <unzip dest="${mavenHome}" src="${project.build.directory}/maven-bin.zip">
dest="${mavenHome}"> <globmapper from="apache-maven-${mavenVersion}/*" handledirsep="true" to="*" />
<globmapper from="apache-maven-${mavenVersion}/*"
to="*" handledirsep="true" />
</unzip> </unzip>
<chmod dir="${mavenHome}/bin" perm="ugo+rx" <chmod dir="${mavenHome}/bin" includes="mvn,mvnDebug" perm="ugo+rx" />
includes="mvn,mvnDebug" />
</target> </target>
</configuration> </configuration>
</execution> </execution>
@ -748,19 +742,17 @@ under the License.
<executions> <executions>
<execution> <execution>
<id>unpack-maven-distro</id> <id>unpack-maven-distro</id>
<phase>process-test-resources</phase>
<goals> <goals>
<goal>run</goal> <goal>run</goal>
</goals> </goals>
<phase>process-test-resources</phase>
<configuration> <configuration>
<target> <target>
<delete dir="${mavenHome}" /> <delete dir="${mavenHome}" />
<unzip src="${mavenDistro}" dest="${mavenHome}"> <unzip dest="${mavenHome}" src="${mavenDistro}">
<regexpmapper from="^([^/]+)/(.*)$" <regexpmapper from="^([^/]+)/(.*)$" handledirsep="true" to="\2" />
to="\2" handledirsep="true" />
</unzip> </unzip>
<chmod dir="${mavenHome}/bin" perm="ugo+rx" <chmod dir="${mavenHome}/bin" includes="mvn,mvnDebug" perm="ugo+rx" />
includes="mvn,mvnDebug" />
</target> </target>
</configuration> </configuration>
</execution> </execution>
@ -789,18 +781,17 @@ under the License.
<executions> <executions>
<execution> <execution>
<id>copy-maven-distro</id> <id>copy-maven-distro</id>
<phase>process-test-classes</phase>
<goals> <goals>
<goal>run</goal> <goal>run</goal>
</goals> </goals>
<phase>process-test-classes</phase>
<configuration> <configuration>
<target> <target>
<delete dir="${preparedMavenHome}" /> <delete dir="${preparedMavenHome}" />
<copy todir="${preparedMavenHome}" overwrite="true"> <copy overwrite="true" todir="${preparedMavenHome}">
<fileset dir="${mavenHome}" /> <fileset dir="${mavenHome}" />
</copy> </copy>
<chmod dir="${preparedMavenHome}/bin" perm="ugo+rx" <chmod dir="${preparedMavenHome}/bin" includes="mvn,mvnDebug" perm="ugo+rx" />
includes="mvn,mvnDebug" />
</target> </target>
</configuration> </configuration>
</execution> </execution>
@ -812,10 +803,10 @@ under the License.
<executions> <executions>
<execution> <execution>
<id>inject-emma-into-core-realm</id> <id>inject-emma-into-core-realm</id>
<phase>process-test-classes</phase>
<goals> <goals>
<goal>copy</goal> <goal>copy</goal>
</goals> </goals>
<phase>process-test-classes</phase>
<configuration> <configuration>
<artifactItems> <artifactItems>
<artifactItem> <artifactItem>
@ -853,17 +844,17 @@ under the License.
<executions> <executions>
<execution> <execution>
<id>instrument</id> <id>instrument</id>
<phase>process-test-classes</phase>
<goals> <goals>
<goal>instrument</goal> <goal>instrument</goal>
</goals> </goals>
<phase>process-test-classes</phase>
</execution> </execution>
<execution> <execution>
<id>report</id> <id>report</id>
<phase>test</phase>
<goals> <goals>
<goal>report</goal> <goal>report</goal>
</goals> </goals>
<phase>test</phase>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>

View File

@ -1,5 +1,35 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.it; package org.apache.maven.it;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.util.Collections;
import com.google.common.io.ByteStreams; import com.google.common.io.ByteStreams;
import org.eclipse.jetty.security.ConstraintMapping; import org.eclipse.jetty.security.ConstraintMapping;
import org.eclipse.jetty.security.ConstraintSecurityHandler; import org.eclipse.jetty.security.ConstraintSecurityHandler;
@ -20,17 +50,6 @@ import org.eclipse.jetty.util.security.Password;
import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler; import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.util.Collections;
/** /**
* An HTTP server that handles all requests on a given port from a specified source, optionally secured using BASIC auth * An HTTP server that handles all requests on a given port from a specified source, optionally secured using BASIC auth
* by providing a username and password. The source can either be a URL or a directory. When a request is made the * by providing a username and password. The source can either be a URL or a directory. When a request is made the
@ -38,14 +57,12 @@ import java.util.Collections;
* *
* @author Jason van Zyl * @author Jason van Zyl
*/ */
public class HttpServer public class HttpServer {
{
static { static {
Log.initialized(); Log.initialized();
Logger rootLogger = Log.getRootLogger(); Logger rootLogger = Log.getRootLogger();
if ( rootLogger instanceof StdErrLog ) if (rootLogger instanceof StdErrLog) {
{ ((StdErrLog) rootLogger).setLevel(StdErrLog.LEVEL_WARN);
( (StdErrLog) rootLogger ).setLevel( StdErrLog.LEVEL_WARN );
} }
} }
@ -57,96 +74,81 @@ public class HttpServer
private final String password; private final String password;
public HttpServer( int port, String username, String password, StreamSource source ) public HttpServer(int port, String username, String password, StreamSource source) {
{
this.username = username; this.username = username;
this.password = password; this.password = password;
this.source = source; this.source = source;
this.server = server( port ); this.server = server(port);
} }
public void start() public void start() throws Exception {
throws Exception
{
server.start(); server.start();
// server.join(); // server.join();
} }
public boolean isFailed() public boolean isFailed() {
{
return server.isFailed(); return server.isFailed();
} }
public void stop() public void stop() throws Exception {
throws Exception
{
server.stop(); server.stop();
} }
public void join() public void join() throws Exception {
throws Exception
{
server.join(); server.join();
} }
public int port() public int port() {
{ return ((NetworkConnector) server.getConnectors()[0]).getLocalPort();
return ( (NetworkConnector) server.getConnectors()[0] ).getLocalPort();
} }
private Server server( int port ) private Server server(int port) {
{
QueuedThreadPool threadPool = new QueuedThreadPool(); QueuedThreadPool threadPool = new QueuedThreadPool();
threadPool.setMaxThreads( 500 ); threadPool.setMaxThreads(500);
Server server = new Server( threadPool ); Server server = new Server(threadPool);
server.setConnectors( new Connector[]{ new ServerConnector( server ) } ); server.setConnectors(new Connector[] {new ServerConnector(server)});
server.addBean( new ScheduledExecutorScheduler() ); server.addBean(new ScheduledExecutorScheduler());
ServerConnector connector = (ServerConnector) server.getConnectors()[0]; ServerConnector connector = (ServerConnector) server.getConnectors()[0];
connector.setIdleTimeout( 30_000L ); connector.setIdleTimeout(30_000L);
connector.setPort( port ); connector.setPort(port);
StreamSourceHandler handler = new StreamSourceHandler( source ); StreamSourceHandler handler = new StreamSourceHandler(source);
if ( username != null && password != null ) if (username != null && password != null) {
{ HashLoginService loginService = new HashLoginService("Test Server");
HashLoginService loginService = new HashLoginService( "Test Server" );
UserStore userStore = new UserStore(); UserStore userStore = new UserStore();
userStore.addUser( username, new Password( password ), new String[] { "user" } ); userStore.addUser(username, new Password(password), new String[] {"user"});
loginService.setUserStore( userStore ); loginService.setUserStore(userStore);
server.addBean( loginService ); server.addBean(loginService);
ConstraintSecurityHandler security = new ConstraintSecurityHandler(); ConstraintSecurityHandler security = new ConstraintSecurityHandler();
server.setHandler( security ); server.setHandler(security);
Constraint constraint = new Constraint(); Constraint constraint = new Constraint();
constraint.setName( "auth" ); constraint.setName("auth");
constraint.setAuthenticate( true ); constraint.setAuthenticate(true);
constraint.setRoles( new String[]{ "user", "admin" } ); constraint.setRoles(new String[] {"user", "admin"});
ConstraintMapping mapping = new ConstraintMapping(); ConstraintMapping mapping = new ConstraintMapping();
mapping.setPathSpec( "/*" ); mapping.setPathSpec("/*");
mapping.setConstraint( constraint ); mapping.setConstraint(constraint);
security.setConstraintMappings( Collections.singletonList( mapping ) ); security.setConstraintMappings(Collections.singletonList(mapping));
security.setAuthenticator( new BasicAuthenticator() ); security.setAuthenticator(new BasicAuthenticator());
security.setLoginService( loginService ); security.setLoginService(loginService);
security.setHandler( handler ); security.setHandler(handler);
} } else {
else server.setHandler(handler);
{
server.setHandler( handler );
} }
return server; return server;
} }
public static HttpServerBuilder builder() public static HttpServerBuilder builder() {
{
return new HttpServerBuilder(); return new HttpServerBuilder();
} }
public static class HttpServerBuilder public static class HttpServerBuilder {
{
private int port; private int port;
@ -156,100 +158,78 @@ public class HttpServer
private StreamSource source; private StreamSource source;
public HttpServerBuilder port( int port ) public HttpServerBuilder port(int port) {
{
this.port = port; this.port = port;
return this; return this;
} }
public HttpServerBuilder username( String username ) public HttpServerBuilder username(String username) {
{
this.username = username; this.username = username;
return this; return this;
} }
public HttpServerBuilder password( String password ) public HttpServerBuilder password(String password) {
{
this.password = password; this.password = password;
return this; return this;
} }
public HttpServerBuilder source( final String source ) public HttpServerBuilder source(final String source) {
{ this.source = new StreamSource() {
this.source = new StreamSource()
{
@Override @Override
public InputStream stream( String path ) public InputStream stream(String path) throws IOException {
throws IOException return new URL(String.format("%s/%s", source, path)).openStream();
{
return new URL( String.format( "%s/%s", source, path ) ).openStream();
} }
}; };
return this; return this;
} }
public HttpServerBuilder source( final File source ) public HttpServerBuilder source(final File source) {
{ this.source = new StreamSource() {
this.source = new StreamSource()
{
@Override @Override
public InputStream stream( String path ) public InputStream stream(String path) throws IOException {
throws IOException return new FileInputStream(new File(source, path));
{
return new FileInputStream( new File( source, path ) );
} }
}; };
return this; return this;
} }
public HttpServer build() public HttpServer build() {
{ return new HttpServer(port, username, password, source);
return new HttpServer( port, username, password, source );
} }
} }
public interface StreamSource public interface StreamSource {
{ InputStream stream(String path) throws IOException;
InputStream stream( String path )
throws IOException;
} }
public static class StreamSourceHandler public static class StreamSourceHandler extends AbstractHandler {
extends AbstractHandler
{
private final StreamSource source; private final StreamSource source;
public StreamSourceHandler( StreamSource source ) public StreamSourceHandler(StreamSource source) {
{
this.source = source; this.source = source;
} }
@Override @Override
public void handle( String target, Request baseRequest, HttpServletRequest request, public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
HttpServletResponse response ) throws IOException, ServletException {
throws IOException, ServletException response.setContentType("application/octet-stream");
{ response.setStatus(HttpServletResponse.SC_OK);
response.setContentType( "application/octet-stream" ); try (InputStream in = source.stream(target.substring(1));
response.setStatus( HttpServletResponse.SC_OK ); OutputStream out = response.getOutputStream()) {
try ( InputStream in = source.stream( ByteStreams.copy(in, out);
target.substring( 1 ) ); OutputStream out = response.getOutputStream() )
{
ByteStreams.copy( in, out );
} }
baseRequest.setHandled( true ); baseRequest.setHandled(true);
} }
} }
public static void main( String[] args ) public static void main(String[] args) throws Exception {
throws Exception
{
HttpServer server = HttpServer.builder() // HttpServer server = HttpServer.builder() //
.port( 0 ) // .port(0) //
.username( "maven" ) // .username("maven") //
.password( "secret" ) // .password("secret") //
.source( new File( "/tmp/repo" ) ) // .source(new File("/tmp/repo")) //
.build(); .build();
server.start(); server.start();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,6 +16,7 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
@ -27,42 +26,34 @@ import java.security.MessageDigest;
/** /**
* @author Benjamin Bentmann * @author Benjamin Bentmann
*/ */
class ItUtils class ItUtils {
{
public static String calcHash( File file, String algo ) public static String calcHash(File file, String algo) throws Exception {
throws Exception MessageDigest digester = MessageDigest.getInstance(algo);
{
MessageDigest digester = MessageDigest.getInstance( algo );
DigestInputStream dis; DigestInputStream dis;
try ( FileInputStream is = new FileInputStream( file ) ) try (FileInputStream is = new FileInputStream(file)) {
{ dis = new DigestInputStream(is, digester);
dis = new DigestInputStream( is, digester );
for ( byte[] buffer = new byte[1024 * 4]; dis.read( buffer ) >= 0; ) for (byte[] buffer = new byte[1024 * 4]; dis.read(buffer) >= 0; ) {
{
// just read it // just read it
} }
} }
byte[] digest = digester.digest(); byte[] digest = digester.digest();
StringBuilder hash = new StringBuilder( digest.length * 2 ); StringBuilder hash = new StringBuilder(digest.length * 2);
for ( byte aDigest : digest ) for (byte aDigest : digest) {
{
int b = aDigest & 0xFF; int b = aDigest & 0xFF;
if ( b < 0x10 ) if (b < 0x10) {
{ hash.append('0');
hash.append( '0' );
} }
hash.append( Integer.toHexString( b ) ); hash.append(Integer.toHexString(b));
} }
return hash.toString(); return hash.toString();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,21 +16,18 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0008SimplePluginTest public class MavenIT0008SimplePluginTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenIT0008SimplePluginTest() public MavenIT0008SimplePluginTest() {
{ super(ALL_MAVEN_VERSIONS);
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -44,19 +39,16 @@ public class MavenIT0008SimplePluginTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0008() public void testit0008() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0008");
{ Verifier verifier = newVerifier(testDir.getAbsolutePath());
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0008" ); verifier.setAutoclean(false);
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.deleteArtifact("org.apache.maven.its.plugins", "maven-it-plugin-touch", "1.0", "maven-plugin");
verifier.deleteDirectory( "target" ); verifier.addCliArgument("process-sources");
verifier.deleteArtifact( "org.apache.maven.its.plugins", "maven-it-plugin-touch", "1.0", "maven-plugin" );
verifier.addCliArgument( "process-sources" );
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/touch.txt" ); verifier.verifyFilePresent("target/touch.txt");
verifier.verifyFilePresent( "target/test-basedir-alignment/touch.txt" ); verifier.verifyFilePresent("target/test-basedir-alignment/touch.txt");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,21 +16,18 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0009GoalConfigurationTest public class MavenIT0009GoalConfigurationTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenIT0009GoalConfigurationTest() public MavenIT0009GoalConfigurationTest() {
{ super(ALL_MAVEN_VERSIONS);
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -42,22 +37,19 @@ public class MavenIT0009GoalConfigurationTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0009() public void testit0009() throws Exception {
throws Exception
{
boolean supportSpaceInXml = matchesVersionRange( "[3.1.0,)"); boolean supportSpaceInXml = matchesVersionRange("[3.1.0,)");
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0009" ); File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0009");
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( supportSpaceInXml ? "target/ pluginItem " : "target/pluginItem"); verifier.verifyFilePresent(supportSpaceInXml ? "target/ pluginItem " : "target/pluginItem");
verifier.verifyFilePresent( "target/goalItem" ); verifier.verifyFilePresent("target/goalItem");
verifier.verifyFileNotPresent( "target/bad-item" ); verifier.verifyFileNotPresent("target/bad-item");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,21 +16,18 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0010DependencyClosureResolutionTest public class MavenIT0010DependencyClosureResolutionTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0010DependencyClosureResolutionTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0010DependencyClosureResolutionTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -43,29 +38,26 @@ public class MavenIT0010DependencyClosureResolutionTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0010() public void testit0010() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0010");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0010" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteArtifacts( "org.apache.maven.its.it0010" ); verifier.deleteArtifacts("org.apache.maven.its.it0010");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyArtifactPresent( "org.apache.maven.its.it0010", "a", "0.1", "jar" ); verifier.verifyArtifactPresent("org.apache.maven.its.it0010", "a", "0.1", "jar");
verifier.verifyArtifactPresent( "org.apache.maven.its.it0010", "b", "0.2", "jar" ); verifier.verifyArtifactPresent("org.apache.maven.its.it0010", "b", "0.2", "jar");
verifier.verifyArtifactPresent( "org.apache.maven.its.it0010", "parent", "1.0", "pom" ); verifier.verifyArtifactPresent("org.apache.maven.its.it0010", "parent", "1.0", "pom");
List<String> artifacts = verifier.loadLines( "target/compile.txt", "UTF-8" ); List<String> artifacts = verifier.loadLines("target/compile.txt", "UTF-8");
assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.it0010:a:jar:0.1" ) ); assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.it0010:a:jar:0.1"));
assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.it0010:b:jar:0.2" ) ); assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.it0010:b:jar:0.2"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,21 +16,18 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0011DefaultVersionByDependencyManagementTest public class MavenIT0011DefaultVersionByDependencyManagementTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0011DefaultVersionByDependencyManagementTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0011DefaultVersionByDependencyManagementTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -41,24 +36,21 @@ public class MavenIT0011DefaultVersionByDependencyManagementTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0011() public void testit0011() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0011");
{ Verifier verifier = newVerifier(testDir.getAbsolutePath());
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0011" ); verifier.setAutoclean(false);
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.deleteArtifacts("org.apache.maven.its.it0011");
verifier.deleteDirectory( "target" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.deleteArtifacts( "org.apache.maven.its.it0011" ); verifier.addCliArgument("--settings");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("validate");
verifier.addCliArgument( "settings.xml" );
verifier.addCliArgument( "validate" );
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
List<String> artifacts = verifier.loadLines( "target/compile.txt", "UTF-8" ); List<String> artifacts = verifier.loadLines("target/compile.txt", "UTF-8");
assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.it0011:a:jar:0.1" ) ); assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.it0011:a:jar:0.1"));
assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.it0011:b:jar:0.2" ) ); assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.it0011:b:jar:0.2"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,20 +16,17 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0012PomInterpolationTest public class MavenIT0012PomInterpolationTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0012PomInterpolationTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0012PomInterpolationTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -40,19 +35,16 @@ public class MavenIT0012PomInterpolationTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0012() public void testit0012() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0012");
{ Verifier verifier = newVerifier(testDir.getAbsolutePath());
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0012" ); verifier.setAutoclean(false);
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.deleteDirectory("child-project/target");
verifier.deleteDirectory( "target" ); verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch");
verifier.deleteDirectory( "child-project/target" );
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-touch:touch" );
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/touch-3.8.1.txt" ); verifier.verifyFilePresent("target/touch-3.8.1.txt");
verifier.verifyFilePresent( "child-project/target/child-touch-3.0.3.txt" ); verifier.verifyFilePresent("child-project/target/child-touch-3.0.3.txt");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,20 +16,17 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0018DependencyManagementTest public class MavenIT0018DependencyManagementTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0018DependencyManagementTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0018DependencyManagementTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -42,20 +37,18 @@ public class MavenIT0018DependencyManagementTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0018() public void testit0018() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0018");
{ Verifier verifier = newVerifier(testDir.getAbsolutePath());
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0018" ); verifier.setAutoclean(false);
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); verifier.deleteArtifacts("org.apache.maven.its.it0018");
verifier.setAutoclean( false ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.deleteArtifacts( "org.apache.maven.its.it0018" ); verifier.addCliArgument("--settings");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument(
verifier.addCliArgument( "settings.xml" ); "org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile" );
verifier.execute(); verifier.execute();
verifier.verifyArtifactPresent( "org.apache.maven.its.it0018", "managed-dep", "1.0.3", "jar" ); verifier.verifyArtifactPresent("org.apache.maven.its.it0018", "managed-dep", "1.0.3", "jar");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,20 +16,17 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0019PluginVersionMgmtBySuperPomTest public class MavenIT0019PluginVersionMgmtBySuperPomTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0019PluginVersionMgmtBySuperPomTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0019PluginVersionMgmtBySuperPomTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -40,17 +35,14 @@ public class MavenIT0019PluginVersionMgmtBySuperPomTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0019() public void testit0019() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0019");
{ Verifier verifier = newVerifier(testDir.getAbsolutePath());
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0019" ); verifier.setAutoclean(false);
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.addCliArgument("process-resources");
verifier.deleteDirectory( "target" );
verifier.addCliArgument( "process-resources" );
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/classes/test.txt" ); verifier.verifyFilePresent("target/classes/test.txt");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,20 +16,17 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0021PomProfileTest public class MavenIT0021PomProfileTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0021PomProfileTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0021PomProfileTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -41,25 +36,22 @@ public class MavenIT0021PomProfileTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0021() public void testit0021() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0021");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0021" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteArtifacts( "org.apache.maven.its.it0021" ); verifier.deleteArtifacts("org.apache.maven.its.it0021");
verifier.getSystemProperties().setProperty( "includeProfile", "true" ); verifier.getSystemProperties().setProperty("includeProfile", "true");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "-Pprofile-2" ); verifier.addCliArgument("-Pprofile-2");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyArtifactPresent( "org.apache.maven.its.it0021", "a", "0.1", "jar" ); verifier.verifyArtifactPresent("org.apache.maven.its.it0021", "a", "0.1", "jar");
verifier.verifyArtifactPresent( "org.apache.maven.its.it0021", "b", "0.1", "jar" ); verifier.verifyArtifactPresent("org.apache.maven.its.it0021", "b", "0.1", "jar");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,20 +16,17 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0023SettingsProfileTest public class MavenIT0023SettingsProfileTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0023SettingsProfileTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0023SettingsProfileTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -41,21 +36,18 @@ public class MavenIT0023SettingsProfileTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0023() public void testit0023() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0023");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0023" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-touch:touch" ); verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/test.txt" ); verifier.verifyFilePresent("target/test.txt");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenIT0024MultipleGoalExecutionsTest public class MavenIT0024MultipleGoalExecutionsTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0024MultipleGoalExecutionsTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0024MultipleGoalExecutionsTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -47,19 +42,16 @@ public class MavenIT0024MultipleGoalExecutionsTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0024() public void testit0024() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0024");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0024" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "initialize" ); verifier.addCliArgument("initialize");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/plugin-exec-configuration.txt" ); verifier.verifyFilePresent("target/plugin-exec-configuration.txt");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenIT0025MultipleExecutionLevelConfigsTest public class MavenIT0025MultipleExecutionLevelConfigsTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0025MultipleExecutionLevelConfigsTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0025MultipleExecutionLevelConfigsTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -46,20 +41,17 @@ public class MavenIT0025MultipleExecutionLevelConfigsTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0025() public void testit0025() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0025");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0025" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/test.txt" ); verifier.verifyFilePresent("target/test.txt");
verifier.verifyFilePresent( "target/test2.txt" ); verifier.verifyFilePresent("target/test2.txt");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,20 +16,17 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0030DepPomDepMgmtInheritanceTest public class MavenIT0030DepPomDepMgmtInheritanceTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0030DepPomDepMgmtInheritanceTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0030DepPomDepMgmtInheritanceTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -41,20 +36,16 @@ public class MavenIT0030DepPomDepMgmtInheritanceTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0030() public void testit0030() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0030");
{ Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote");
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0030" ); verifier.deleteArtifact("org.apache.maven.it", "maven-it-it0030", "1.0-SNAPSHOT", "jar");
Verifier verifier = newVerifier( testDir.getAbsolutePath(), "remote" ); verifier.deleteArtifact("org.apache.maven.it", "maven-it-it0030-child-hierarchy", "1.0-SNAPSHOT", "jar");
verifier.deleteArtifact( "org.apache.maven.it", "maven-it-it0030", "1.0-SNAPSHOT", "jar" ); verifier.deleteArtifact("org.apache.maven.it", "maven-it-it0030-child-project1", "1.0-SNAPSHOT", "jar");
verifier.deleteArtifact( "org.apache.maven.it", "maven-it-it0030-child-hierarchy", "1.0-SNAPSHOT", "jar" ); verifier.deleteArtifact("org.apache.maven.it", "maven-it-it0030-child-project2", "1.0-SNAPSHOT", "jar");
verifier.deleteArtifact( "org.apache.maven.it", "maven-it-it0030-child-project1", "1.0-SNAPSHOT", "jar" ); verifier.addCliArgument("install");
verifier.deleteArtifact( "org.apache.maven.it", "maven-it-it0030-child-project2", "1.0-SNAPSHOT", "jar" );
verifier.addCliArgument( "install" );
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "child-hierarchy/project2/target/classes/org/apache/maven/it0001/Person.class" ); verifier.verifyFilePresent("child-hierarchy/project2/target/classes/org/apache/maven/it0001/Person.class");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,20 +16,17 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0032MavenPrerequisiteTest public class MavenIT0032MavenPrerequisiteTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0032MavenPrerequisiteTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0032MavenPrerequisiteTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -40,16 +35,13 @@ public class MavenIT0032MavenPrerequisiteTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0032() public void testit0032() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0032");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0032" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.addCliArgument( "initialize" ); verifier.addCliArgument("initialize");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenIT0037AlternatePomFileSameDirTest public class MavenIT0037AlternatePomFileSameDirTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0037AlternatePomFileSameDirTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0037AlternatePomFileSameDirTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -46,22 +41,19 @@ public class MavenIT0037AlternatePomFileSameDirTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0037() public void testit0037() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0037");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0037" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "-f" ); verifier.addCliArgument("-f");
verifier.addCliArgument( "pom2.xml" ); verifier.addCliArgument("pom2.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/passed.log" ); verifier.verifyFilePresent("target/passed.log");
verifier.verifyFileNotPresent( "target/failed.log" ); verifier.verifyFileNotPresent("target/failed.log");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenIT0038AlternatePomFileDifferentDirTest public class MavenIT0038AlternatePomFileDifferentDirTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0038AlternatePomFileDifferentDirTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0038AlternatePomFileDifferentDirTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -46,22 +41,19 @@ public class MavenIT0038AlternatePomFileDifferentDirTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0038() public void testit0038() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0038");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0038" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "project/target" ); verifier.deleteDirectory("project/target");
verifier.addCliArgument( "-f" ); verifier.addCliArgument("-f");
verifier.addCliArgument( "project/pom2.xml" ); verifier.addCliArgument("project/pom2.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "project/target/passed.log" ); verifier.verifyFilePresent("project/target/passed.log");
verifier.verifyFileNotPresent( "target/failed.log" ); verifier.verifyFileNotPresent("target/failed.log");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,13 +30,10 @@ import org.junit.jupiter.api.Test;
* @author Brett Porter * @author Brett Porter
* *
*/ */
public class MavenIT0040PackagingFromPluginExtensionTest public class MavenIT0040PackagingFromPluginExtensionTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenIT0040PackagingFromPluginExtensionTest() public MavenIT0040PackagingFromPluginExtensionTest() {
{ super(ALL_MAVEN_VERSIONS);
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -47,19 +42,16 @@ public class MavenIT0040PackagingFromPluginExtensionTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0040() public void testit0040() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0040");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0040" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "package" ); verifier.addCliArgument("package");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/maven-it-it0040-1.0-it.jar" ); verifier.verifyFilePresent("target/maven-it-it0040-1.0-it.jar");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author Brett Porter * @author Brett Porter
* *
*/ */
public class MavenIT0041ArtifactTypeFromPluginExtensionTest public class MavenIT0041ArtifactTypeFromPluginExtensionTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0041ArtifactTypeFromPluginExtensionTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0041ArtifactTypeFromPluginExtensionTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -46,22 +41,19 @@ public class MavenIT0041ArtifactTypeFromPluginExtensionTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0041() public void testit0041() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0041");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0041" );
Verifier verifier = newVerifier( testDir.getAbsolutePath(), "remote" ); Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote");
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteArtifacts( "org.apache.maven", "maven-core-it-support", "1.2" ); verifier.deleteArtifacts("org.apache.maven", "maven-core-it-support", "1.2");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyArtifactPresent( "org.apache.maven", "maven-core-it-support", "1.2", "coreit-artifact" ); verifier.verifyArtifactPresent("org.apache.maven", "maven-core-it-support", "1.2", "coreit-artifact");
verifier.verifyArtifactPresent( "org.apache.maven", "maven-core-it-support", "1.2", "pom" ); verifier.verifyArtifactPresent("org.apache.maven", "maven-core-it-support", "1.2", "pom");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,21 +16,18 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0051ReleaseProfileTest public class MavenIT0051ReleaseProfileTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenIT0051ReleaseProfileTest() public MavenIT0051ReleaseProfileTest() {
{ super("(2.0.2,4.0.0-alpha-1)");
super( "(2.0.2,4.0.0-alpha-1)" );
} }
/** /**
@ -41,21 +36,18 @@ public class MavenIT0051ReleaseProfileTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0051() public void testit0051() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0051");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0051" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "-DperformRelease=true" ); verifier.addCliArgument("-DperformRelease=true");
verifier.addCliArgument( "package" ); verifier.addCliArgument("package");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/source-jar.txt" ); verifier.verifyFilePresent("target/source-jar.txt");
verifier.verifyFilePresent( "target/javadoc-jar.txt" ); verifier.verifyFilePresent("target/javadoc-jar.txt");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,20 +16,17 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0052ReleaseProfileTest public class MavenIT0052ReleaseProfileTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0052ReleaseProfileTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0052ReleaseProfileTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -41,21 +36,18 @@ public class MavenIT0052ReleaseProfileTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0052() public void testit0052() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0052");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0052" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "package" ); verifier.addCliArgument("package");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/jar-jar.txt" ); verifier.verifyFilePresent("target/jar-jar.txt");
verifier.verifyFileNotPresent( "target/source-jar.txt" ); verifier.verifyFileNotPresent("target/source-jar.txt");
verifier.verifyFileNotPresent( "target/javadoc-jar.txt" ); verifier.verifyFileNotPresent("target/javadoc-jar.txt");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,20 +16,17 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0056MultipleGoalExecutionsTest public class MavenIT0056MultipleGoalExecutionsTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0056MultipleGoalExecutionsTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0056MultipleGoalExecutionsTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -41,20 +36,17 @@ public class MavenIT0056MultipleGoalExecutionsTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0056() public void testit0056() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0056");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0056" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "initialize" ); verifier.addCliArgument("initialize");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/first-exec.txt" ); verifier.verifyFilePresent("target/first-exec.txt");
verifier.verifyFilePresent( "target/second-exec.txt" ); verifier.verifyFilePresent("target/second-exec.txt");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,21 +16,18 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0063SystemScopeDependencyTest public class MavenIT0063SystemScopeDependencyTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0063SystemScopeDependencyTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0063SystemScopeDependencyTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -41,23 +36,22 @@ public class MavenIT0063SystemScopeDependencyTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0063() public void testit0063() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0063");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0063" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.getSystemProperties().setProperty( "jre.home", new File( testDir, "jdk/jre" ).getPath() ); verifier.getSystemProperties().setProperty("jre.home", new File(testDir, "jdk/jre").getPath());
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile" ); verifier.addCliArgument(
"org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
List<String> lines = verifier.loadLines( "target/compile.txt", "UTF-8" ); List<String> lines = verifier.loadLines("target/compile.txt", "UTF-8");
assertEquals( 2, lines.size() ); assertEquals(2, lines.size());
assertEquals( new File( testDir, "jdk/lib/tools.jar").getCanonicalFile(), assertEquals(
new File( (String) lines.get(1) ).getCanonicalFile() ); new File(testDir, "jdk/lib/tools.jar").getCanonicalFile(),
new File((String) lines.get(1)).getCanonicalFile());
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,20 +16,17 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0064MojoConfigViaSettersTest public class MavenIT0064MojoConfigViaSettersTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0064MojoConfigViaSettersTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0064MojoConfigViaSettersTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -41,19 +36,17 @@ public class MavenIT0064MojoConfigViaSettersTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0064() public void testit0064() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0064");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0064" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-setter:setter-touch" ); verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-setter:setter-touch");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/fooValue" ); verifier.verifyFilePresent("target/fooValue");
verifier.verifyFilePresent( "target/barValue.baz" ); verifier.verifyFilePresent("target/barValue.baz");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenIT0071PluginConfigWithDottedPropertyTest public class MavenIT0071PluginConfigWithDottedPropertyTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0071PluginConfigWithDottedPropertyTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0071PluginConfigWithDottedPropertyTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -47,19 +42,16 @@ public class MavenIT0071PluginConfigWithDottedPropertyTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0071() public void testit0071() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0071");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0071" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-touch:touch" ); verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/foo2" ); verifier.verifyFilePresent("target/foo2");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Properties; import java.util.Properties;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -33,12 +31,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenIT0072InterpolationWithDottedPropertyTest public class MavenIT0072InterpolationWithDottedPropertyTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0072InterpolationWithDottedPropertyTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0072InterpolationWithDottedPropertyTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -48,20 +43,17 @@ public class MavenIT0072InterpolationWithDottedPropertyTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0072() public void testit0072() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0072");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0072" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Properties props = verifier.loadProperties( "target/pom.properties" ); Properties props = verifier.loadProperties("target/pom.properties");
assertEquals( "1.0-SNAPSHOT", props.getProperty( "project.version" ) ); assertEquals("1.0-SNAPSHOT", props.getProperty("project.version"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,21 +16,18 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Collection; import java.util.Collection;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0085TransitiveSystemScopeTest public class MavenIT0085TransitiveSystemScopeTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0085TransitiveSystemScopeTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0085TransitiveSystemScopeTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -44,25 +39,22 @@ public class MavenIT0085TransitiveSystemScopeTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0085() public void testit0085() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0085");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0085" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteArtifacts( "org.apache.maven.its.it0085" ); verifier.deleteArtifacts("org.apache.maven.its.it0085");
verifier.getSystemProperties().setProperty( "test.home", testDir.getAbsolutePath() ); verifier.getSystemProperties().setProperty("test.home", testDir.getAbsolutePath());
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Collection<String> lines = verifier.loadLines( "target/test.txt", "UTF-8" ); Collection<String> lines = verifier.loadLines("target/test.txt", "UTF-8");
assertTrue( lines.toString(), lines.contains( "system.jar" ) ); assertTrue(lines.toString(), lines.contains("system.jar"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Properties; import java.util.Properties;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -33,13 +31,10 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenIT0086PluginRealmTest public class MavenIT0086PluginRealmTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenIT0086PluginRealmTest() public MavenIT0086PluginRealmTest() {
{ super("(2.0.2,)");
super( "(2.0.2,)" );
} }
/** /**
@ -49,30 +44,27 @@ public class MavenIT0086PluginRealmTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0086() public void testit0086() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0086");
{ Verifier verifier = newVerifier(testDir.getAbsolutePath());
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0086" ); verifier.setAutoclean(false);
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.addCliArgument("validate");
verifier.deleteDirectory( "target" );
verifier.addCliArgument( "validate" );
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Properties pclProps = verifier.loadProperties( "target/pcl.properties" ); Properties pclProps = verifier.loadProperties("target/pcl.properties");
assertNotNull( pclProps.getProperty( "org.apache.maven.plugin.coreit.ClassA" ) ); assertNotNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassA"));
assertNotNull( pclProps.getProperty( "org.apache.maven.plugin.coreit.ClassB" ) ); assertNotNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassB"));
assertNotNull( pclProps.getProperty( "org.apache.maven.plugin.coreit.SomeClass" ) ); assertNotNull(pclProps.getProperty("org.apache.maven.plugin.coreit.SomeClass"));
assertNotNull( pclProps.getProperty( "org/apache/maven/plugin/coreit/a.properties" ) ); assertNotNull(pclProps.getProperty("org/apache/maven/plugin/coreit/a.properties"));
assertEquals( "1", pclProps.getProperty( "org/apache/maven/plugin/coreit/a.properties.count" ) ); assertEquals("1", pclProps.getProperty("org/apache/maven/plugin/coreit/a.properties.count"));
assertNotNull( pclProps.getProperty( "org/apache/maven/plugin/coreit/b.properties" ) ); assertNotNull(pclProps.getProperty("org/apache/maven/plugin/coreit/b.properties"));
assertEquals( "1", pclProps.getProperty( "org/apache/maven/plugin/coreit/b.properties.count" ) ); assertEquals("1", pclProps.getProperty("org/apache/maven/plugin/coreit/b.properties.count"));
assertNotNull( pclProps.getProperty( "org/apache/maven/plugin/coreit/it.properties" ) ); assertNotNull(pclProps.getProperty("org/apache/maven/plugin/coreit/it.properties"));
assertEquals( "2", pclProps.getProperty( "org/apache/maven/plugin/coreit/it.properties.count" ) ); assertEquals("2", pclProps.getProperty("org/apache/maven/plugin/coreit/it.properties.count"));
Properties tcclProps = verifier.loadProperties( "target/tccl.properties" ); Properties tcclProps = verifier.loadProperties("target/tccl.properties");
assertEquals( pclProps, tcclProps ); assertEquals(pclProps, tcclProps);
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Properties; import java.util.Properties;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -33,13 +31,10 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenIT0087PluginRealmWithProjectLevelDepsTest public class MavenIT0087PluginRealmWithProjectLevelDepsTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenIT0087PluginRealmWithProjectLevelDepsTest() public MavenIT0087PluginRealmWithProjectLevelDepsTest() {
{ super("(2.0.2,)");
super( "(2.0.2,)" );
} }
/** /**
@ -49,30 +44,27 @@ public class MavenIT0087PluginRealmWithProjectLevelDepsTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0087() public void testit0087() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0087");
{ Verifier verifier = newVerifier(testDir.getAbsolutePath());
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0087" ); verifier.setAutoclean(false);
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.deleteArtifacts("org.apache.maven.its.it0087");
verifier.deleteDirectory( "target" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.deleteArtifacts( "org.apache.maven.its.it0087" ); verifier.addCliArgument("--settings");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("validate");
verifier.addCliArgument( "settings.xml" );
verifier.addCliArgument( "validate" );
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Properties pclProps = verifier.loadProperties( "target/pcl.properties" ); Properties pclProps = verifier.loadProperties("target/pcl.properties");
assertNotNull( pclProps.getProperty( "org.apache.maven.plugin.coreit.ClassA" ) ); assertNotNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassA"));
assertNotNull( pclProps.getProperty( "org.apache.maven.plugin.coreit.ClassB" ) ); assertNotNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassB"));
assertNotNull( pclProps.getProperty( "org.apache.maven.its.it0087.IT0087" ) ); assertNotNull(pclProps.getProperty("org.apache.maven.its.it0087.IT0087"));
assertNotNull( pclProps.getProperty( "src/main/java/org/apache/maven/its/it0087/IT0087.java" ) ); assertNotNull(pclProps.getProperty("src/main/java/org/apache/maven/its/it0087/IT0087.java"));
assertEquals( "1", pclProps.getProperty( "src/main/java/org/apache/maven/its/it0087/IT0087.java.count" ) ); assertEquals("1", pclProps.getProperty("src/main/java/org/apache/maven/its/it0087/IT0087.java.count"));
Properties tcclProps = verifier.loadProperties( "target/tccl.properties" ); Properties tcclProps = verifier.loadProperties("target/tccl.properties");
assertEquals( pclProps, tcclProps ); assertEquals(pclProps, tcclProps);
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,21 +16,18 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Properties; import java.util.Properties;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0090EnvVarInterpolationTest public class MavenIT0090EnvVarInterpolationTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0090EnvVarInterpolationTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0090EnvVarInterpolationTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -42,21 +37,18 @@ public class MavenIT0090EnvVarInterpolationTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0090() public void testit0090() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0090");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0090" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.setEnvironmentVariable( "MAVEN_TEST_ENVAR", "MAVEN_TEST_ENVAR_VALUE" ); verifier.setEnvironmentVariable("MAVEN_TEST_ENVAR", "MAVEN_TEST_ENVAR_VALUE");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Properties props = verifier.loadProperties( "target/env.properties" ); Properties props = verifier.loadProperties("target/env.properties");
assertEquals( "MAVEN_TEST_ENVAR_VALUE", props.getProperty( "stringParam" ) ); assertEquals("MAVEN_TEST_ENVAR_VALUE", props.getProperty("stringParam"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,10 +16,7 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.VerificationException;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@ -31,6 +26,9 @@ import java.util.Date;
import java.util.Locale; import java.util.Locale;
import org.apache.maven.shared.utils.io.FileUtils; import org.apache.maven.shared.utils.io.FileUtils;
import org.apache.maven.shared.verifier.VerificationException;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -39,13 +37,10 @@ import org.junit.jupiter.api.Test;
* Downloads a snapshot dependency that was deployed with uniqueVersion = false, and checks it can be * Downloads a snapshot dependency that was deployed with uniqueVersion = false, and checks it can be
* updated. See <a href="https://issues.apache.org/jira/browse/MNG-1908">MNG-1908</a>. * updated. See <a href="https://issues.apache.org/jira/browse/MNG-1908">MNG-1908</a>.
*/ */
@Disabled( "flaky test, see MNG-3137" ) @Disabled("flaky test, see MNG-3137")
public class MavenIT0108SnapshotUpdateTest public class MavenIT0108SnapshotUpdateTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0108SnapshotUpdateTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0108SnapshotUpdateTest()
{
super( ALL_MAVEN_VERSIONS );
} }
private Verifier verifier; private Verifier verifier;
@ -59,216 +54,195 @@ public class MavenIT0108SnapshotUpdateTest
private static final int TIME_OFFSET = 50000; private static final int TIME_OFFSET = 50000;
@BeforeEach @BeforeEach
protected void setUp() protected void setUp() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0108");
{ verifier = newVerifier(testDir.getAbsolutePath());
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0108" ); localRepoFile = getLocalRepoFile(verifier);
verifier = newVerifier( testDir.getAbsolutePath() ); deleteLocalArtifact(verifier, localRepoFile);
localRepoFile = getLocalRepoFile( verifier );
deleteLocalArtifact( verifier, localRepoFile );
repository = new File( testDir, "repository" ); repository = new File(testDir, "repository");
recreateRemoteRepository( repository ); recreateRemoteRepository(repository);
// create artifact in repository (TODO: into verifier) // create artifact in repository (TODO: into verifier)
artifact = new File( repository, artifact = new File(
"org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-core-it-support-1.0-SNAPSHOT.jar" ); repository,
"org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-core-it-support-1.0-SNAPSHOT.jar");
artifact.getParentFile().mkdirs(); artifact.getParentFile().mkdirs();
FileUtils.fileWrite( artifact.getAbsolutePath(), "originalArtifact" ); FileUtils.fileWrite(artifact.getAbsolutePath(), "originalArtifact");
verifier.verifyArtifactNotPresent( "org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar" ); verifier.verifyArtifactNotPresent("org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar");
} }
@Test @Test
public void testSnapshotUpdated() public void testSnapshotUpdated() throws Exception {
throws Exception verifier.addCliArgument("package");
{
verifier.addCliArgument( "package" );
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifyArtifactContent( "originalArtifact" ); verifyArtifactContent("originalArtifact");
// set in the past to ensure it is downloaded // set in the past to ensure it is downloaded
localRepoFile.setLastModified( System.currentTimeMillis() - TIME_OFFSET ); localRepoFile.setLastModified(System.currentTimeMillis() - TIME_OFFSET);
FileUtils.fileWrite( artifact.getAbsolutePath(), "updatedArtifact" ); FileUtils.fileWrite(artifact.getAbsolutePath(), "updatedArtifact");
verifier.addCliArgument( "package" ); verifier.addCliArgument("package");
verifier.execute(); verifier.execute();
verifyArtifactContent( "updatedArtifact" ); verifyArtifactContent("updatedArtifact");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
@Test @Test
public void testSnapshotUpdatedWithMetadata() public void testSnapshotUpdatedWithMetadata() throws Exception {
throws Exception File metadata = new File(repository, "org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml");
{ FileUtils.fileWrite(
File metadata = metadata.getAbsolutePath(), constructMetadata("1", System.currentTimeMillis() - TIME_OFFSET, true));
new File( repository, "org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml" );
FileUtils.fileWrite( metadata.getAbsolutePath(),
constructMetadata( "1", System.currentTimeMillis() - TIME_OFFSET, true ) );
verifier.addCliArgument( "package" ); verifier.addCliArgument("package");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifyArtifactContent( "originalArtifact" ); verifyArtifactContent("originalArtifact");
FileUtils.fileWrite( artifact.getAbsolutePath(), "updatedArtifact" ); FileUtils.fileWrite(artifact.getAbsolutePath(), "updatedArtifact");
metadata = new File( repository, "org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml" ); metadata = new File(repository, "org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml");
FileUtils.fileWrite( metadata.getAbsolutePath(), constructMetadata( "2", System.currentTimeMillis(), true ) ); FileUtils.fileWrite(metadata.getAbsolutePath(), constructMetadata("2", System.currentTimeMillis(), true));
verifier.addCliArgument( "package" ); verifier.addCliArgument("package");
verifier.execute(); verifier.execute();
verifyArtifactContent( "updatedArtifact" ); verifyArtifactContent("updatedArtifact");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
@Test @Test
public void testSnapshotUpdatedWithLocalMetadata() public void testSnapshotUpdatedWithLocalMetadata() throws Exception {
throws Exception File localMetadata = getMetadataFile("org/apache/maven", "maven-core-it-support", "1.0-SNAPSHOT");
{
File localMetadata = getMetadataFile( "org/apache/maven", "maven-core-it-support", "1.0-SNAPSHOT" );
FileUtils.deleteDirectory( localMetadata.getParentFile() ); FileUtils.deleteDirectory(localMetadata.getParentFile());
assertFalse( localMetadata.getParentFile().exists() ); assertFalse(localMetadata.getParentFile().exists());
localMetadata.getParentFile().mkdirs(); localMetadata.getParentFile().mkdirs();
File metadata = File metadata = new File(repository, "org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml");
new File( repository, "org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml" ); FileUtils.fileWrite(
FileUtils.fileWrite( metadata.getAbsolutePath(), metadata.getAbsolutePath(), constructMetadata("1", System.currentTimeMillis() - TIME_OFFSET, true));
constructMetadata( "1", System.currentTimeMillis() - TIME_OFFSET, true ) );
verifier.addCliArgument( "package" ); verifier.addCliArgument("package");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifyArtifactContent( "originalArtifact" ); verifyArtifactContent("originalArtifact");
assertFalse( localMetadata.exists() ); assertFalse(localMetadata.exists());
FileUtils.fileWrite( localRepoFile.getAbsolutePath(), "localArtifact" ); FileUtils.fileWrite(localRepoFile.getAbsolutePath(), "localArtifact");
FileUtils.fileWrite( localMetadata.getAbsolutePath(), constructLocalMetadata( "org.apache.maven", FileUtils.fileWrite(
"maven-core-it-support", localMetadata.getAbsolutePath(),
System.currentTimeMillis(), constructLocalMetadata("org.apache.maven", "maven-core-it-support", System.currentTimeMillis(), true));
true ) );
// update the remote file, but we shouldn't be looking // update the remote file, but we shouldn't be looking
artifact.setLastModified( System.currentTimeMillis() ); artifact.setLastModified(System.currentTimeMillis());
verifier.addCliArgument( "package" ); verifier.addCliArgument("package");
verifier.execute(); verifier.execute();
verifyArtifactContent( "localArtifact" ); verifyArtifactContent("localArtifact");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.add( Calendar.YEAR, -1 ); cal.add(Calendar.YEAR, -1);
FileUtils.fileWrite( localMetadata.getAbsolutePath(), constructLocalMetadata( "org.apache.maven", FileUtils.fileWrite(
"maven-core-it-support", localMetadata.getAbsolutePath(),
cal.getTimeInMillis(), true ) ); constructLocalMetadata("org.apache.maven", "maven-core-it-support", cal.getTimeInMillis(), true));
FileUtils.fileWrite( metadata.getAbsolutePath(), FileUtils.fileWrite(
constructMetadata( "2", System.currentTimeMillis() - 2000, true ) ); metadata.getAbsolutePath(), constructMetadata("2", System.currentTimeMillis() - 2000, true));
artifact.setLastModified( System.currentTimeMillis() ); artifact.setLastModified(System.currentTimeMillis());
verifier.addCliArgument( "package" ); verifier.addCliArgument("package");
verifier.execute(); verifier.execute();
verifyArtifactContent( "originalArtifact" ); verifyArtifactContent("originalArtifact");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
@Test @Test
public void testSnapshotUpdatedWithMetadataUsingFileTimestamp() public void testSnapshotUpdatedWithMetadataUsingFileTimestamp() throws Exception {
throws Exception File metadata = new File(repository, "org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml");
{ FileUtils.fileWrite(
File metadata = metadata.getAbsolutePath(), constructMetadata("1", System.currentTimeMillis() - TIME_OFFSET, false));
new File( repository, "org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml" ); metadata.setLastModified(System.currentTimeMillis() - TIME_OFFSET);
FileUtils.fileWrite( metadata.getAbsolutePath(),
constructMetadata( "1", System.currentTimeMillis() - TIME_OFFSET, false ) );
metadata.setLastModified( System.currentTimeMillis() - TIME_OFFSET );
verifier.addCliArgument( "package" ); verifier.addCliArgument("package");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifyArtifactContent( "originalArtifact" ); verifyArtifactContent("originalArtifact");
FileUtils.fileWrite( artifact.getAbsolutePath(), "updatedArtifact" ); FileUtils.fileWrite(artifact.getAbsolutePath(), "updatedArtifact");
metadata = new File( repository, "org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml" ); metadata = new File(repository, "org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml");
FileUtils.fileWrite( metadata.getAbsolutePath(), constructMetadata( "2", System.currentTimeMillis(), false ) ); FileUtils.fileWrite(metadata.getAbsolutePath(), constructMetadata("2", System.currentTimeMillis(), false));
verifier.addCliArgument( "package" ); verifier.addCliArgument("package");
verifier.execute(); verifier.execute();
verifyArtifactContent( "updatedArtifact" ); verifyArtifactContent("updatedArtifact");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
private File getMetadataFile( String groupId, String artifactId, String version ) private File getMetadataFile(String groupId, String artifactId, String version) {
{ return new File(verifier.getArtifactMetadataPath(groupId, artifactId, version, "maven-metadata-local.xml"));
return new File( verifier.getArtifactMetadataPath( groupId, artifactId, version, "maven-metadata-local.xml" ) );
} }
private void verifyArtifactContent( String s ) private void verifyArtifactContent(String s) throws IOException, VerificationException {
throws IOException, VerificationException verifier.verifyArtifactPresent("org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar");
{ verifier.verifyArtifactContent("org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar", s);
verifier.verifyArtifactPresent( "org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar" );
verifier.verifyArtifactContent( "org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar", s );
} }
private static File deleteLocalArtifact( Verifier verifier, File localRepoFile ) private static File deleteLocalArtifact(Verifier verifier, File localRepoFile) throws IOException {
throws IOException verifier.deleteArtifact("org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar");
{
verifier.deleteArtifact( "org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar" );
// this is to delete metadata - TODO: incorporate into deleteArtifact in verifier // this is to delete metadata - TODO: incorporate into deleteArtifact in verifier
FileUtils.deleteDirectory( localRepoFile.getParentFile() ); FileUtils.deleteDirectory(localRepoFile.getParentFile());
return localRepoFile; return localRepoFile;
} }
private static File getLocalRepoFile( Verifier verifier ) private static File getLocalRepoFile(Verifier verifier) {
{ return new File(verifier.getArtifactPath("org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar"));
return new File(
verifier.getArtifactPath( "org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar" ) );
} }
private static void recreateRemoteRepository( File repository ) private static void recreateRemoteRepository(File repository) throws IOException {
throws IOException
{
// create a repository (TODO: into verifier) // create a repository (TODO: into verifier)
FileUtils.deleteDirectory( repository ); FileUtils.deleteDirectory(repository);
assertFalse( repository.exists() ); assertFalse(repository.exists());
repository.mkdirs(); repository.mkdirs();
} }
private String constructMetadata( String buildNumber, long timestamp, boolean writeLastUpdated ) private String constructMetadata(String buildNumber, long timestamp, boolean writeLastUpdated) {
{ String ts = new SimpleDateFormat("yyyyMMddHHmmss", Locale.US).format(new Date(timestamp));
String ts = new SimpleDateFormat( "yyyyMMddHHmmss", Locale.US ).format( new Date( timestamp ) );
return "<?xml version=\"1.0\" encoding=\"UTF-8\"?><metadata>\n" + "<groupId>org.apache.maven</groupId>\n" + return "<?xml version=\"1.0\" encoding=\"UTF-8\"?><metadata>\n" + "<groupId>org.apache.maven</groupId>\n"
"<artifactId>maven-core-it-support</artifactId>\n" + "<version>1.0-SNAPSHOT</version>\n" + + "<artifactId>maven-core-it-support</artifactId>\n"
"<versioning>\n" + "<snapshot>\n" + "<buildNumber>" + buildNumber + "</buildNumber>\n" + "</snapshot>\n" + + "<version>1.0-SNAPSHOT</version>\n" + "<versioning>\n"
( writeLastUpdated ? "<lastUpdated>" + ts + "</lastUpdated>\n" : "" ) + "</versioning>\n" + "</metadata>"; + "<snapshot>\n" + "<buildNumber>" + buildNumber + "</buildNumber>\n" + "</snapshot>\n"
+ (writeLastUpdated ? "<lastUpdated>" + ts + "</lastUpdated>\n" : "")
+ "</versioning>\n" + "</metadata>";
} }
private String constructLocalMetadata( String groupId, String artifactId, long timestamp, boolean writeLastUpdated ) private String constructLocalMetadata(String groupId, String artifactId, long timestamp, boolean writeLastUpdated) {
{ String ts = new SimpleDateFormat("yyyyMMddHHmmss", Locale.US).format(new Date(timestamp));
String ts = new SimpleDateFormat( "yyyyMMddHHmmss", Locale.US ).format( new Date( timestamp ) );
return "<?xml version=\"1.0\" encoding=\"UTF-8\"?><metadata>\n" + " <groupId>" + groupId + "</groupId>\n" + return "<?xml version=\"1.0\" encoding=\"UTF-8\"?><metadata>\n" + " <groupId>" + groupId + "</groupId>\n"
" <artifactId>" + artifactId + "</artifactId>\n" + " <version>1.0-SNAPSHOT</version>\n" + + " <artifactId>"
" <versioning>\n" + " <snapshot>\n" + " <localCopy>true</localCopy>\n" + " </snapshot>\n" + + artifactId + "</artifactId>\n" + " <version>1.0-SNAPSHOT</version>\n" + " <versioning>\n"
( writeLastUpdated ? " <lastUpdated>" + ts + "</lastUpdated>\n" : "" ) + " </versioning>\n" + + " <snapshot>\n" + " <localCopy>true</localCopy>\n" + " </snapshot>\n"
"</metadata>"; + (writeLastUpdated ? " <lastUpdated>" + ts + "</lastUpdated>\n" : "")
+ " </versioning>\n" + "</metadata>";
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,21 +16,18 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Properties; import java.util.Properties;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0113ServerAuthzAvailableToWagonMgrInPluginTest public class MavenIT0113ServerAuthzAvailableToWagonMgrInPluginTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0113ServerAuthzAvailableToWagonMgrInPluginTest() {
{ super("[2.0,3.0-alpha-1),[3.0-alpha-7,)");
public MavenIT0113ServerAuthzAvailableToWagonMgrInPluginTest()
{
super( "[2.0,3.0-alpha-1),[3.0-alpha-7,)" );
} }
/** /**
@ -42,23 +37,20 @@ public class MavenIT0113ServerAuthzAvailableToWagonMgrInPluginTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0113() public void testit0113() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0113");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0113" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Properties props = verifier.loadProperties( "target/auth.properties" ); Properties props = verifier.loadProperties("target/auth.properties");
assertEquals( "testuser", props.getProperty( "test.username" ) ); assertEquals("testuser", props.getProperty("test.username"));
assertEquals( "testtest", props.getProperty( "test.password" ) ); assertEquals("testtest", props.getProperty("test.password"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -31,13 +29,10 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenIT0130CleanLifecycleTest public class MavenIT0130CleanLifecycleTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenIT0130CleanLifecycleTest() public MavenIT0130CleanLifecycleTest() {
{ super("[2.0.0,)");
super( "[2.0.0,)" );
} }
/** /**
@ -46,18 +41,15 @@ public class MavenIT0130CleanLifecycleTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0130() public void testit0130() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0130");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0130" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.addCliArgument( "clean" ); verifier.addCliArgument("clean");
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/clean-clean.txt" ); verifier.verifyFilePresent("target/clean-clean.txt");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -31,13 +29,10 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenIT0131SiteLifecycleTest public class MavenIT0131SiteLifecycleTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenIT0131SiteLifecycleTest() public MavenIT0131SiteLifecycleTest() {
{ super("[2.0.0,)");
super( "[2.0.0,)" );
} }
/** /**
@ -46,19 +41,16 @@ public class MavenIT0131SiteLifecycleTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0131() public void testit0131() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0131");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0131" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.addCliArgument( "site-deploy" ); verifier.addCliArgument("site-deploy");
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/site-site.txt" ); verifier.verifyFilePresent("target/site-site.txt");
verifier.verifyFilePresent( "target/site-deploy.txt" ); verifier.verifyFilePresent("target/site-deploy.txt");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -31,13 +29,10 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenIT0132PomLifecycleTest public class MavenIT0132PomLifecycleTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenIT0132PomLifecycleTest() public MavenIT0132PomLifecycleTest() {
{ super("[2.0.0,)");
super( "[2.0.0,)" );
} }
/** /**
@ -46,23 +41,19 @@ public class MavenIT0132PomLifecycleTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0132() public void testit0132() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0132");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0132" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.addCliArgument( "deploy" ); verifier.addCliArgument("deploy");
verifier.execute(); verifier.execute();
if ( matchesVersionRange( "(2.0.1,3.0-alpha-1)" ) ) if (matchesVersionRange("(2.0.1,3.0-alpha-1)")) {
{ verifier.verifyFilePresent("target/site-attach-descriptor.txt");
verifier.verifyFilePresent( "target/site-attach-descriptor.txt" );
} }
verifier.verifyFilePresent( "target/install-install.txt" ); verifier.verifyFilePresent("target/install-install.txt");
verifier.verifyFilePresent( "target/deploy-deploy.txt" ); verifier.verifyFilePresent("target/deploy-deploy.txt");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -31,13 +29,10 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenIT0133JarLifecycleTest public class MavenIT0133JarLifecycleTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenIT0133JarLifecycleTest() public MavenIT0133JarLifecycleTest() {
{ super("[2.0.0,)");
super( "[2.0.0,)" );
} }
/** /**
@ -46,25 +41,22 @@ public class MavenIT0133JarLifecycleTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0133() public void testit0133() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0133");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0133" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.addCliArgument( "deploy" ); verifier.addCliArgument("deploy");
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/resources-resources.txt" ); verifier.verifyFilePresent("target/resources-resources.txt");
verifier.verifyFilePresent( "target/compiler-compile.txt" ); verifier.verifyFilePresent("target/compiler-compile.txt");
verifier.verifyFilePresent( "target/resources-test-resources.txt" ); verifier.verifyFilePresent("target/resources-test-resources.txt");
verifier.verifyFilePresent( "target/compiler-test-compile.txt" ); verifier.verifyFilePresent("target/compiler-test-compile.txt");
verifier.verifyFilePresent( "target/surefire-test.txt" ); verifier.verifyFilePresent("target/surefire-test.txt");
verifier.verifyFilePresent( "target/jar-jar.txt" ); verifier.verifyFilePresent("target/jar-jar.txt");
verifier.verifyFilePresent( "target/install-install.txt" ); verifier.verifyFilePresent("target/install-install.txt");
verifier.verifyFilePresent( "target/deploy-deploy.txt" ); verifier.verifyFilePresent("target/deploy-deploy.txt");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -31,13 +29,10 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenIT0134WarLifecycleTest public class MavenIT0134WarLifecycleTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenIT0134WarLifecycleTest() public MavenIT0134WarLifecycleTest() {
{ super("[2.0.0,)");
super( "[2.0.0,)" );
} }
/** /**
@ -46,25 +41,22 @@ public class MavenIT0134WarLifecycleTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0134() public void testit0134() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0134");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0134" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.addCliArgument( "deploy" ); verifier.addCliArgument("deploy");
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/resources-resources.txt" ); verifier.verifyFilePresent("target/resources-resources.txt");
verifier.verifyFilePresent( "target/compiler-compile.txt" ); verifier.verifyFilePresent("target/compiler-compile.txt");
verifier.verifyFilePresent( "target/resources-test-resources.txt" ); verifier.verifyFilePresent("target/resources-test-resources.txt");
verifier.verifyFilePresent( "target/compiler-test-compile.txt" ); verifier.verifyFilePresent("target/compiler-test-compile.txt");
verifier.verifyFilePresent( "target/surefire-test.txt" ); verifier.verifyFilePresent("target/surefire-test.txt");
verifier.verifyFilePresent( "target/war-war.txt" ); verifier.verifyFilePresent("target/war-war.txt");
verifier.verifyFilePresent( "target/install-install.txt" ); verifier.verifyFilePresent("target/install-install.txt");
verifier.verifyFilePresent( "target/deploy-deploy.txt" ); verifier.verifyFilePresent("target/deploy-deploy.txt");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -31,13 +29,10 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenIT0135EjbLifecycleTest public class MavenIT0135EjbLifecycleTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenIT0135EjbLifecycleTest() public MavenIT0135EjbLifecycleTest() {
{ super("[2.0.0,)");
super( "[2.0.0,)" );
} }
/** /**
@ -46,25 +41,22 @@ public class MavenIT0135EjbLifecycleTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0135() public void testit0135() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0135");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0135" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.addCliArgument( "deploy" ); verifier.addCliArgument("deploy");
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/resources-resources.txt" ); verifier.verifyFilePresent("target/resources-resources.txt");
verifier.verifyFilePresent( "target/compiler-compile.txt" ); verifier.verifyFilePresent("target/compiler-compile.txt");
verifier.verifyFilePresent( "target/resources-test-resources.txt" ); verifier.verifyFilePresent("target/resources-test-resources.txt");
verifier.verifyFilePresent( "target/compiler-test-compile.txt" ); verifier.verifyFilePresent("target/compiler-test-compile.txt");
verifier.verifyFilePresent( "target/surefire-test.txt" ); verifier.verifyFilePresent("target/surefire-test.txt");
verifier.verifyFilePresent( "target/ejb-ejb.txt" ); verifier.verifyFilePresent("target/ejb-ejb.txt");
verifier.verifyFilePresent( "target/install-install.txt" ); verifier.verifyFilePresent("target/install-install.txt");
verifier.verifyFilePresent( "target/deploy-deploy.txt" ); verifier.verifyFilePresent("target/deploy-deploy.txt");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -31,13 +29,10 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenIT0136RarLifecycleTest public class MavenIT0136RarLifecycleTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenIT0136RarLifecycleTest() public MavenIT0136RarLifecycleTest() {
{ super("[2.0.0,)");
super( "[2.0.0,)" );
} }
/** /**
@ -46,25 +41,22 @@ public class MavenIT0136RarLifecycleTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0136() public void testit0136() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0136");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0136" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.addCliArgument( "deploy" ); verifier.addCliArgument("deploy");
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/resources-resources.txt" ); verifier.verifyFilePresent("target/resources-resources.txt");
verifier.verifyFilePresent( "target/compiler-compile.txt" ); verifier.verifyFilePresent("target/compiler-compile.txt");
verifier.verifyFilePresent( "target/resources-test-resources.txt" ); verifier.verifyFilePresent("target/resources-test-resources.txt");
verifier.verifyFilePresent( "target/compiler-test-compile.txt" ); verifier.verifyFilePresent("target/compiler-test-compile.txt");
verifier.verifyFilePresent( "target/surefire-test.txt" ); verifier.verifyFilePresent("target/surefire-test.txt");
verifier.verifyFilePresent( "target/rar-rar.txt" ); verifier.verifyFilePresent("target/rar-rar.txt");
verifier.verifyFilePresent( "target/install-install.txt" ); verifier.verifyFilePresent("target/install-install.txt");
verifier.verifyFilePresent( "target/deploy-deploy.txt" ); verifier.verifyFilePresent("target/deploy-deploy.txt");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -31,13 +29,10 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenIT0137EarLifecycleTest public class MavenIT0137EarLifecycleTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenIT0137EarLifecycleTest() public MavenIT0137EarLifecycleTest() {
{ super("[2.0.0,)");
super( "[2.0.0,)" );
} }
/** /**
@ -46,22 +41,19 @@ public class MavenIT0137EarLifecycleTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0137() public void testit0137() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0137");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0137" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.addCliArgument( "deploy" ); verifier.addCliArgument("deploy");
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/ear-generate-application-xml.txt" ); verifier.verifyFilePresent("target/ear-generate-application-xml.txt");
verifier.verifyFilePresent( "target/resources-resources.txt" ); verifier.verifyFilePresent("target/resources-resources.txt");
verifier.verifyFilePresent( "target/ear-ear.txt" ); verifier.verifyFilePresent("target/ear-ear.txt");
verifier.verifyFilePresent( "target/install-install.txt" ); verifier.verifyFilePresent("target/install-install.txt");
verifier.verifyFilePresent( "target/deploy-deploy.txt" ); verifier.verifyFilePresent("target/deploy-deploy.txt");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -31,13 +29,10 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenIT0138PluginLifecycleTest public class MavenIT0138PluginLifecycleTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenIT0138PluginLifecycleTest() public MavenIT0138PluginLifecycleTest() {
{ super("[2.0.0,)");
super( "[2.0.0,)" );
} }
/** /**
@ -46,31 +41,27 @@ public class MavenIT0138PluginLifecycleTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0138() public void testit0138() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0138");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0138" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.addCliArgument( "deploy" ); verifier.addCliArgument("deploy");
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/plugin-descriptor.txt" ); verifier.verifyFilePresent("target/plugin-descriptor.txt");
verifier.verifyFilePresent( "target/resources-resources.txt" ); verifier.verifyFilePresent("target/resources-resources.txt");
verifier.verifyFilePresent( "target/compiler-compile.txt" ); verifier.verifyFilePresent("target/compiler-compile.txt");
verifier.verifyFilePresent( "target/resources-test-resources.txt" ); verifier.verifyFilePresent("target/resources-test-resources.txt");
verifier.verifyFilePresent( "target/compiler-test-compile.txt" ); verifier.verifyFilePresent("target/compiler-test-compile.txt");
verifier.verifyFilePresent( "target/surefire-test.txt" ); verifier.verifyFilePresent("target/surefire-test.txt");
verifier.verifyFilePresent( "target/jar-jar.txt" ); verifier.verifyFilePresent("target/jar-jar.txt");
verifier.verifyFilePresent( "target/plugin-add-plugin-artifact-metadata.txt" ); verifier.verifyFilePresent("target/plugin-add-plugin-artifact-metadata.txt");
verifier.verifyFilePresent( "target/install-install.txt" ); verifier.verifyFilePresent("target/install-install.txt");
if ( matchesVersionRange( "(,2.2.0)" ) ) if (matchesVersionRange("(,2.2.0)")) {
{ verifier.verifyFilePresent("target/plugin-update-registry.txt");
verifier.verifyFilePresent( "target/plugin-update-registry.txt" );
} }
verifier.verifyFilePresent( "target/deploy-deploy.txt" ); verifier.verifyFilePresent("target/deploy-deploy.txt");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Properties; import java.util.Properties;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenIT0139InterpolationWithProjectPrefixTest public class MavenIT0139InterpolationWithProjectPrefixTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0139InterpolationWithProjectPrefixTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenIT0139InterpolationWithProjectPrefixTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -46,54 +41,50 @@ public class MavenIT0139InterpolationWithProjectPrefixTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0139() public void testit0139() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0139");
{ File child = new File(testDir, "child");
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0139" );
File child = new File( testDir, "child" );
Verifier verifier = newVerifier( child.getAbsolutePath() ); Verifier verifier = newVerifier(child.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "initialize" ); verifier.addCliArgument("initialize");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Properties props = verifier.loadProperties( "target/interpolated.properties" ); Properties props = verifier.loadProperties("target/interpolated.properties");
String prefix = "project.properties."; String prefix = "project.properties.";
assertEquals( child.getCanonicalFile(), new File( props.getProperty( prefix + "projectDir" ) ).getCanonicalFile() ); assertEquals(child.getCanonicalFile(), new File(props.getProperty(prefix + "projectDir")).getCanonicalFile());
assertEquals( "org.apache.maven.its.it0139.child", props.getProperty( prefix + "projectGroupId" ) ); assertEquals("org.apache.maven.its.it0139.child", props.getProperty(prefix + "projectGroupId"));
assertEquals( "child", props.getProperty( prefix + "projectArtifactId" ) ); assertEquals("child", props.getProperty(prefix + "projectArtifactId"));
assertEquals( "2.0-alpha-1", props.getProperty( prefix + "projectVersion" ) ); assertEquals("2.0-alpha-1", props.getProperty(prefix + "projectVersion"));
assertEquals( "jar", props.getProperty( prefix + "projectPackaging" ) ); assertEquals("jar", props.getProperty(prefix + "projectPackaging"));
assertEquals( "child-name", props.getProperty( prefix + "projectName" ) ); assertEquals("child-name", props.getProperty(prefix + "projectName"));
assertEquals( "child-desc", props.getProperty( prefix + "projectDesc" ) ); assertEquals("child-desc", props.getProperty(prefix + "projectDesc"));
assertEquals( "http://child.org/", props.getProperty( prefix + "projectUrl" ) ); assertEquals("http://child.org/", props.getProperty(prefix + "projectUrl"));
assertEquals( "2008", props.getProperty( prefix + "projectYear" ) ); assertEquals("2008", props.getProperty(prefix + "projectYear"));
assertEquals( "child-org-name", props.getProperty( prefix + "projectOrgName" ) ); assertEquals("child-org-name", props.getProperty(prefix + "projectOrgName"));
assertEquals( "2.0.0", props.getProperty( prefix + "projectPrereqMvn" ) ); assertEquals("2.0.0", props.getProperty(prefix + "projectPrereqMvn"));
assertEquals( "http://scm.org/", props.getProperty( prefix + "projectScmUrl" ) ); assertEquals("http://scm.org/", props.getProperty(prefix + "projectScmUrl"));
assertEquals( "http://issue.org/", props.getProperty( prefix + "projectIssueUrl" ) ); assertEquals("http://issue.org/", props.getProperty(prefix + "projectIssueUrl"));
assertEquals( "http://ci.org/", props.getProperty( prefix + "projectCiUrl" ) ); assertEquals("http://ci.org/", props.getProperty(prefix + "projectCiUrl"));
assertEquals( "child-dist-repo", props.getProperty( prefix + "projectDistRepoName" ) ); assertEquals("child-dist-repo", props.getProperty(prefix + "projectDistRepoName"));
assertEquals( "org.apache.maven.its.it0139", props.getProperty( prefix + "parentGroupId" ) ); assertEquals("org.apache.maven.its.it0139", props.getProperty(prefix + "parentGroupId"));
assertEquals( "parent", props.getProperty( prefix + "parentArtifactId" ) ); assertEquals("parent", props.getProperty(prefix + "parentArtifactId"));
assertEquals( "1.0", props.getProperty( prefix + "parentVersion" ) ); assertEquals("1.0", props.getProperty(prefix + "parentVersion"));
/* /*
* NOTE: We intentionally do not check whether the build paths have been basedir aligned, that's another * NOTE: We intentionally do not check whether the build paths have been basedir aligned, that's another
* story... * story...
*/ */
if ( matchesVersionRange( "(2.0.8,)" ) ) if (matchesVersionRange("(2.0.8,)")) {
{ assertTrue(props.getProperty(prefix + "projectBuildOut").endsWith("bin"));
assertTrue( props.getProperty( prefix + "projectBuildOut" ).endsWith( "bin" ) );
} }
assertTrue( props.getProperty( prefix + "projectSiteOut" ).endsWith( "doc" ) ); assertTrue(props.getProperty(prefix + "projectSiteOut").endsWith("doc"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Properties; import java.util.Properties;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -34,12 +32,9 @@ import org.junit.jupiter.api.Test;
* *
* @author Benjamin Bentmann * @author Benjamin Bentmann
*/ */
public class MavenIT0140InterpolationWithPomPrefixTest public class MavenIT0140InterpolationWithPomPrefixTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenIT0140InterpolationWithPomPrefixTest() {
{ super("[2.0,4.0.0-alpha-1)");
public MavenIT0140InterpolationWithPomPrefixTest()
{
super( "[2.0,4.0.0-alpha-1)" );
} }
/** /**
@ -48,54 +43,50 @@ public class MavenIT0140InterpolationWithPomPrefixTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0140() public void testit0140() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0140");
{ File child = new File(testDir, "child");
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0140" );
File child = new File( testDir, "child" );
Verifier verifier = newVerifier( child.getAbsolutePath() ); Verifier verifier = newVerifier(child.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "initialize" ); verifier.addCliArgument("initialize");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Properties props = verifier.loadProperties( "target/interpolated.properties" ); Properties props = verifier.loadProperties("target/interpolated.properties");
String prefix = "project.properties."; String prefix = "project.properties.";
assertEquals( child.getCanonicalFile(), new File( props.getProperty( prefix + "projectDir" ) ).getCanonicalFile() ); assertEquals(child.getCanonicalFile(), new File(props.getProperty(prefix + "projectDir")).getCanonicalFile());
assertEquals( "org.apache.maven.its.it0140.child", props.getProperty( prefix + "projectGroupId" ) ); assertEquals("org.apache.maven.its.it0140.child", props.getProperty(prefix + "projectGroupId"));
assertEquals( "child", props.getProperty( prefix + "projectArtifactId" ) ); assertEquals("child", props.getProperty(prefix + "projectArtifactId"));
assertEquals( "2.0-alpha-1", props.getProperty( prefix + "projectVersion" ) ); assertEquals("2.0-alpha-1", props.getProperty(prefix + "projectVersion"));
assertEquals( "jar", props.getProperty( prefix + "projectPackaging" ) ); assertEquals("jar", props.getProperty(prefix + "projectPackaging"));
assertEquals( "child-name", props.getProperty( prefix + "projectName" ) ); assertEquals("child-name", props.getProperty(prefix + "projectName"));
assertEquals( "child-desc", props.getProperty( prefix + "projectDesc" ) ); assertEquals("child-desc", props.getProperty(prefix + "projectDesc"));
assertEquals( "http://child.org/", props.getProperty( prefix + "projectUrl" ) ); assertEquals("http://child.org/", props.getProperty(prefix + "projectUrl"));
assertEquals( "2008", props.getProperty( prefix + "projectYear" ) ); assertEquals("2008", props.getProperty(prefix + "projectYear"));
assertEquals( "child-org-name", props.getProperty( prefix + "projectOrgName" ) ); assertEquals("child-org-name", props.getProperty(prefix + "projectOrgName"));
assertEquals( "2.0.0", props.getProperty( prefix + "projectPrereqMvn" ) ); assertEquals("2.0.0", props.getProperty(prefix + "projectPrereqMvn"));
assertEquals( "http://scm.org/", props.getProperty( prefix + "projectScmUrl" ) ); assertEquals("http://scm.org/", props.getProperty(prefix + "projectScmUrl"));
assertEquals( "http://issue.org/", props.getProperty( prefix + "projectIssueUrl" ) ); assertEquals("http://issue.org/", props.getProperty(prefix + "projectIssueUrl"));
assertEquals( "http://ci.org/", props.getProperty( prefix + "projectCiUrl" ) ); assertEquals("http://ci.org/", props.getProperty(prefix + "projectCiUrl"));
assertEquals( "child-dist-repo", props.getProperty( prefix + "projectDistRepoName" ) ); assertEquals("child-dist-repo", props.getProperty(prefix + "projectDistRepoName"));
assertEquals( "org.apache.maven.its.it0140", props.getProperty( prefix + "parentGroupId" ) ); assertEquals("org.apache.maven.its.it0140", props.getProperty(prefix + "parentGroupId"));
assertEquals( "parent", props.getProperty( prefix + "parentArtifactId" ) ); assertEquals("parent", props.getProperty(prefix + "parentArtifactId"));
assertEquals( "1.0", props.getProperty( prefix + "parentVersion" ) ); assertEquals("1.0", props.getProperty(prefix + "parentVersion"));
/* /*
* NOTE: We intentionally do not check whether the build paths have been basedir aligned, that's another * NOTE: We intentionally do not check whether the build paths have been basedir aligned, that's another
* story... * story...
*/ */
if ( matchesVersionRange( "(2.0.8,)" ) ) if (matchesVersionRange("(2.0.8,)")) {
{ assertTrue(props.getProperty(prefix + "projectBuildOut").endsWith("bin"));
assertTrue( props.getProperty( prefix + "projectBuildOut" ).endsWith( "bin" ) );
} }
assertTrue( props.getProperty( prefix + "projectSiteOut" ).endsWith( "doc" ) ); assertTrue(props.getProperty(prefix + "projectSiteOut").endsWith("doc"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,17 +30,14 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenIT0142DirectDependencyScopesTest public class MavenIT0142DirectDependencyScopesTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
/* /*
* NOTE: Class path ordering is another issue (MNG-1412), so we merely check set containment here. * NOTE: Class path ordering is another issue (MNG-1412), so we merely check set containment here.
*/ */
public MavenIT0142DirectDependencyScopesTest() public MavenIT0142DirectDependencyScopesTest() {
{ super(ALL_MAVEN_VERSIONS);
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -51,68 +46,73 @@ public class MavenIT0142DirectDependencyScopesTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0142() public void testit0142() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0142");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0142" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteArtifacts( "org.apache.maven.its.it0142" ); verifier.deleteArtifacts("org.apache.maven.its.it0142");
verifier.filterFile( "pom-template.xml", "pom.xml", "UTF-8" ); verifier.filterFile("pom-template.xml", "pom.xml", "UTF-8");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
List<String> compileArtifacts = verifier.loadLines( "target/compile-artifacts.txt", "UTF-8" ); List<String> compileArtifacts = verifier.loadLines("target/compile-artifacts.txt", "UTF-8");
assertTrue( compileArtifacts.toString(), compileArtifacts.contains( "org.apache.maven.its.it0142:system:jar:0.1" ) ); assertTrue(
assertTrue( compileArtifacts.toString(), compileArtifacts.contains( "org.apache.maven.its.it0142:provided:jar:0.1" ) ); compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.it0142:system:jar:0.1"));
assertTrue( compileArtifacts.toString(), compileArtifacts.contains( "org.apache.maven.its.it0142:compile:jar:0.1" ) ); assertTrue(
assertEquals( 3, compileArtifacts.size() ); compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.it0142:provided:jar:0.1"));
assertTrue(
compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.it0142:compile:jar:0.1"));
assertEquals(3, compileArtifacts.size());
List<String> compileClassPath = verifier.loadLines( "target/compile-cp.txt", "UTF-8" ); List<String> compileClassPath = verifier.loadLines("target/compile-cp.txt", "UTF-8");
assertTrue( compileClassPath.toString(), compileClassPath.contains( "classes" ) ); assertTrue(compileClassPath.toString(), compileClassPath.contains("classes"));
assertTrue( compileClassPath.toString(), compileClassPath.contains( "system-0.1.jar" ) ); assertTrue(compileClassPath.toString(), compileClassPath.contains("system-0.1.jar"));
assertTrue( compileClassPath.toString(), compileClassPath.contains( "provided-0.1.jar" ) ); assertTrue(compileClassPath.toString(), compileClassPath.contains("provided-0.1.jar"));
assertTrue( compileClassPath.toString(), compileClassPath.contains( "compile-0.1.jar" ) ); assertTrue(compileClassPath.toString(), compileClassPath.contains("compile-0.1.jar"));
assertEquals( 4, compileClassPath.size() ); assertEquals(4, compileClassPath.size());
List<String> runtimeArtifacts = verifier.loadLines( "target/runtime-artifacts.txt", "UTF-8" ); List<String> runtimeArtifacts = verifier.loadLines("target/runtime-artifacts.txt", "UTF-8");
assertTrue( runtimeArtifacts.toString(), runtimeArtifacts.contains( "org.apache.maven.its.it0142:compile:jar:0.1" ) ); assertTrue(
assertTrue( runtimeArtifacts.toString(), runtimeArtifacts.contains( "org.apache.maven.its.it0142:runtime:jar:0.1" ) ); runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.it0142:compile:jar:0.1"));
assertTrue( runtimeArtifacts.toString(), runtimeArtifacts.contains( "org.apache.maven.its.it0142:runtime:jar:retro:0.1" ) ); assertTrue(
assertEquals( 3, runtimeArtifacts.size() ); runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.it0142:runtime:jar:0.1"));
assertTrue(
runtimeArtifacts.toString(),
runtimeArtifacts.contains("org.apache.maven.its.it0142:runtime:jar:retro:0.1"));
assertEquals(3, runtimeArtifacts.size());
List<String> runtimeClassPath = verifier.loadLines( "target/runtime-cp.txt", "UTF-8" ); List<String> runtimeClassPath = verifier.loadLines("target/runtime-cp.txt", "UTF-8");
assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "classes" ) ); assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("classes"));
assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "compile-0.1.jar" ) ); assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("compile-0.1.jar"));
assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "runtime-0.1.jar" ) ); assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("runtime-0.1.jar"));
assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "runtime-0.1-retro.jar" ) ); assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("runtime-0.1-retro.jar"));
assertEquals( 4, runtimeClassPath.size() ); assertEquals(4, runtimeClassPath.size());
List<String> testArtifacts = verifier.loadLines( "target/test-artifacts.txt", "UTF-8" ); List<String> testArtifacts = verifier.loadLines("target/test-artifacts.txt", "UTF-8");
assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0142:system:jar:0.1" ) ); assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0142:system:jar:0.1"));
assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0142:provided:jar:0.1" ) ); assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0142:provided:jar:0.1"));
assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0142:compile:jar:0.1" ) ); assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0142:compile:jar:0.1"));
assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0142:runtime:jar:0.1" ) ); assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0142:runtime:jar:0.1"));
assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0142:runtime:jar:retro:0.1" ) ); assertTrue(
assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0142:test:jar:0.1" ) ); testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0142:runtime:jar:retro:0.1"));
assertEquals( 6, testArtifacts.size() ); assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0142:test:jar:0.1"));
assertEquals(6, testArtifacts.size());
List<String> testClassPath = verifier.loadLines( "target/test-cp.txt", "UTF-8" ); List<String> testClassPath = verifier.loadLines("target/test-cp.txt", "UTF-8");
assertTrue( testClassPath.toString(), testClassPath.contains( "classes" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("classes"));
assertTrue( testClassPath.toString(), testClassPath.contains( "test-classes" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("test-classes"));
assertTrue( testClassPath.toString(), testClassPath.contains( "system-0.1.jar" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("system-0.1.jar"));
assertTrue( testClassPath.toString(), testClassPath.contains( "provided-0.1.jar" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("provided-0.1.jar"));
assertTrue( testClassPath.toString(), testClassPath.contains( "compile-0.1.jar" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("compile-0.1.jar"));
assertTrue( testClassPath.toString(), testClassPath.contains( "runtime-0.1.jar" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("runtime-0.1.jar"));
assertTrue( testClassPath.toString(), testClassPath.contains( "runtime-0.1-retro.jar" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("runtime-0.1-retro.jar"));
assertTrue( testClassPath.toString(), testClassPath.contains( "test-0.1.jar" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("test-0.1.jar"));
assertEquals( 8, testClassPath.size() ); assertEquals(8, testClassPath.size());
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,14 +16,14 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -33,17 +31,14 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenIT0143TransitiveDependencyScopesTest public class MavenIT0143TransitiveDependencyScopesTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
/* /*
* NOTE: Class path ordering is another issue (MNG-1412), so we merely check set containment here. * NOTE: Class path ordering is another issue (MNG-1412), so we merely check set containment here.
*/ */
public MavenIT0143TransitiveDependencyScopesTest() public MavenIT0143TransitiveDependencyScopesTest() {
{ super(ALL_MAVEN_VERSIONS);
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -53,10 +48,8 @@ public class MavenIT0143TransitiveDependencyScopesTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitCompileScope() public void testitCompileScope() throws Exception {
throws Exception Verifier verifier = run("compile");
{
Verifier verifier = run( "compile" );
String targetDir = "target-compile"; String targetDir = "target-compile";
/* /*
@ -64,43 +57,48 @@ public class MavenIT0143TransitiveDependencyScopesTest
* dependency that extends a class from the transitive dependency, i.e. * dependency that extends a class from the transitive dependency, i.e.
* project imports A from direct dependency and A extends B from transitive dependency. * project imports A from direct dependency and A extends B from transitive dependency.
*/ */
List<String> compileArtifacts = verifier.loadLines( targetDir + "/compile-artifacts.txt", "UTF-8" ); List<String> compileArtifacts = verifier.loadLines(targetDir + "/compile-artifacts.txt", "UTF-8");
assertTrue( compileArtifacts.toString(), compileArtifacts.contains( "org.apache.maven.its.it0143:direct:jar:0.1" ) ); assertTrue(
assertTrue( compileArtifacts.toString(), compileArtifacts.contains( "org.apache.maven.its.it0143:compile:jar:0.1" ) ); compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.it0143:direct:jar:0.1"));
assertEquals( 2, compileArtifacts.size() ); assertTrue(
compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.it0143:compile:jar:0.1"));
assertEquals(2, compileArtifacts.size());
List<String> compileClassPath = verifier.loadLines( targetDir + "/compile-cp.txt", "UTF-8" ); List<String> compileClassPath = verifier.loadLines(targetDir + "/compile-cp.txt", "UTF-8");
assertTrue( compileClassPath.toString(), compileClassPath.contains( "classes" ) ); assertTrue(compileClassPath.toString(), compileClassPath.contains("classes"));
assertTrue( compileClassPath.toString(), compileClassPath.contains( "direct-0.1.jar" ) ); assertTrue(compileClassPath.toString(), compileClassPath.contains("direct-0.1.jar"));
assertTrue( compileClassPath.toString(), compileClassPath.contains( "compile-0.1.jar" ) ); assertTrue(compileClassPath.toString(), compileClassPath.contains("compile-0.1.jar"));
assertEquals( 3, compileClassPath.size() ); assertEquals(3, compileClassPath.size());
List<String> runtimeArtifacts = verifier.loadLines( targetDir + "/runtime-artifacts.txt", "UTF-8" ); List<String> runtimeArtifacts = verifier.loadLines(targetDir + "/runtime-artifacts.txt", "UTF-8");
assertTrue( runtimeArtifacts.toString(), runtimeArtifacts.contains( "org.apache.maven.its.it0143:direct:jar:0.1" ) ); assertTrue(
assertTrue( runtimeArtifacts.toString(), runtimeArtifacts.contains( "org.apache.maven.its.it0143:compile:jar:0.1" ) ); runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.it0143:direct:jar:0.1"));
assertTrue( runtimeArtifacts.toString(), runtimeArtifacts.contains( "org.apache.maven.its.it0143:runtime:jar:0.1" ) ); assertTrue(
assertEquals( 3, runtimeArtifacts.size() ); runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.it0143:compile:jar:0.1"));
assertTrue(
runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.it0143:runtime:jar:0.1"));
assertEquals(3, runtimeArtifacts.size());
List<String> runtimeClassPath = verifier.loadLines( targetDir + "/runtime-cp.txt", "UTF-8" ); List<String> runtimeClassPath = verifier.loadLines(targetDir + "/runtime-cp.txt", "UTF-8");
assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "classes" ) ); assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("classes"));
assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "direct-0.1.jar" ) ); assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("direct-0.1.jar"));
assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "compile-0.1.jar" ) ); assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("compile-0.1.jar"));
assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "runtime-0.1.jar" ) ); assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("runtime-0.1.jar"));
assertEquals( 4, runtimeClassPath.size() ); assertEquals(4, runtimeClassPath.size());
List<String> testArtifacts = verifier.loadLines( targetDir + "/test-artifacts.txt", "UTF-8" ); List<String> testArtifacts = verifier.loadLines(targetDir + "/test-artifacts.txt", "UTF-8");
assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:direct:jar:0.1" ) ); assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:direct:jar:0.1"));
assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:compile:jar:0.1" ) ); assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:compile:jar:0.1"));
assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:runtime:jar:0.1" ) ); assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:runtime:jar:0.1"));
assertEquals( 3, testArtifacts.size() ); assertEquals(3, testArtifacts.size());
List<String> testClassPath = verifier.loadLines( targetDir + "/test-cp.txt", "UTF-8" ); List<String> testClassPath = verifier.loadLines(targetDir + "/test-cp.txt", "UTF-8");
assertTrue( testClassPath.toString(), testClassPath.contains( "classes" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("classes"));
assertTrue( testClassPath.toString(), testClassPath.contains( "test-classes" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("test-classes"));
assertTrue( testClassPath.toString(), testClassPath.contains( "direct-0.1.jar" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("direct-0.1.jar"));
assertTrue( testClassPath.toString(), testClassPath.contains( "compile-0.1.jar" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("compile-0.1.jar"));
assertTrue( testClassPath.toString(), testClassPath.contains( "runtime-0.1.jar" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("runtime-0.1.jar"));
assertEquals( 5, testClassPath.size() ); assertEquals(5, testClassPath.size());
} }
/** /**
@ -110,45 +108,46 @@ public class MavenIT0143TransitiveDependencyScopesTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitProvidedScope() public void testitProvidedScope() throws Exception {
throws Exception Verifier verifier = run("provided");
{
Verifier verifier = run( "provided" );
String targetDir = "target-provided"; String targetDir = "target-provided";
List<String> compileArtifacts = verifier.loadLines( targetDir + "/compile-artifacts.txt", "UTF-8" ); List<String> compileArtifacts = verifier.loadLines(targetDir + "/compile-artifacts.txt", "UTF-8");
assertTrue( compileArtifacts.toString(), compileArtifacts.contains( "org.apache.maven.its.it0143:direct:jar:0.1" ) ); assertTrue(
assertTrue( compileArtifacts.toString(), compileArtifacts.contains( "org.apache.maven.its.it0143:compile:jar:0.1" ) ); compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.it0143:direct:jar:0.1"));
assertTrue( compileArtifacts.toString(), compileArtifacts.contains( "org.apache.maven.its.it0143:runtime:jar:0.1" ) ); assertTrue(
assertEquals( 3, compileArtifacts.size() ); compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.it0143:compile:jar:0.1"));
assertTrue(
compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.it0143:runtime:jar:0.1"));
assertEquals(3, compileArtifacts.size());
List<String> compileClassPath = verifier.loadLines( targetDir + "/compile-cp.txt", "UTF-8" ); List<String> compileClassPath = verifier.loadLines(targetDir + "/compile-cp.txt", "UTF-8");
assertTrue( compileClassPath.toString(), compileClassPath.contains( "classes" ) ); assertTrue(compileClassPath.toString(), compileClassPath.contains("classes"));
assertTrue( compileClassPath.toString(), compileClassPath.contains( "direct-0.1.jar" ) ); assertTrue(compileClassPath.toString(), compileClassPath.contains("direct-0.1.jar"));
assertTrue( compileClassPath.toString(), compileClassPath.contains( "compile-0.1.jar" ) ); assertTrue(compileClassPath.toString(), compileClassPath.contains("compile-0.1.jar"));
assertTrue( compileClassPath.toString(), compileClassPath.contains( "runtime-0.1.jar" ) ); assertTrue(compileClassPath.toString(), compileClassPath.contains("runtime-0.1.jar"));
assertEquals( 4, compileClassPath.size() ); assertEquals(4, compileClassPath.size());
List<String> runtimeArtifacts = verifier.loadLines( targetDir + "/runtime-artifacts.txt", "UTF-8" ); List<String> runtimeArtifacts = verifier.loadLines(targetDir + "/runtime-artifacts.txt", "UTF-8");
assertEquals( 0, runtimeArtifacts.size() ); assertEquals(0, runtimeArtifacts.size());
List<String> runtimeClassPath = verifier.loadLines( targetDir + "/runtime-cp.txt", "UTF-8" ); List<String> runtimeClassPath = verifier.loadLines(targetDir + "/runtime-cp.txt", "UTF-8");
assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "classes" ) ); assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("classes"));
assertEquals( 1, runtimeClassPath.size() ); assertEquals(1, runtimeClassPath.size());
List<String> testArtifacts = verifier.loadLines( targetDir + "/test-artifacts.txt", "UTF-8" ); List<String> testArtifacts = verifier.loadLines(targetDir + "/test-artifacts.txt", "UTF-8");
assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:direct:jar:0.1" ) ); assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:direct:jar:0.1"));
assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:compile:jar:0.1" ) ); assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:compile:jar:0.1"));
assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:runtime:jar:0.1" ) ); assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:runtime:jar:0.1"));
assertEquals( 3, testArtifacts.size() ); assertEquals(3, testArtifacts.size());
List<String> testClassPath = verifier.loadLines( targetDir + "/test-cp.txt", "UTF-8" ); List<String> testClassPath = verifier.loadLines(targetDir + "/test-cp.txt", "UTF-8");
assertTrue( testClassPath.toString(), testClassPath.contains( "classes" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("classes"));
assertTrue( testClassPath.toString(), testClassPath.contains( "test-classes" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("test-classes"));
assertTrue( testClassPath.toString(), testClassPath.contains( "direct-0.1.jar" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("direct-0.1.jar"));
assertTrue( testClassPath.toString(), testClassPath.contains( "compile-0.1.jar" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("compile-0.1.jar"));
assertTrue( testClassPath.toString(), testClassPath.contains( "runtime-0.1.jar" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("runtime-0.1.jar"));
assertEquals( 5, testClassPath.size() ); assertEquals(5, testClassPath.size());
} }
/** /**
@ -158,45 +157,46 @@ public class MavenIT0143TransitiveDependencyScopesTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitRuntimeScope() public void testitRuntimeScope() throws Exception {
throws Exception Verifier verifier = run("runtime");
{
Verifier verifier = run( "runtime" );
String targetDir = "target-runtime"; String targetDir = "target-runtime";
List<String> compileArtifacts = verifier.loadLines( targetDir + "/compile-artifacts.txt", "UTF-8" ); List<String> compileArtifacts = verifier.loadLines(targetDir + "/compile-artifacts.txt", "UTF-8");
assertEquals( 0, compileArtifacts.size() ); assertEquals(0, compileArtifacts.size());
List<String> compileClassPath = verifier.loadLines( targetDir + "/compile-cp.txt", "UTF-8" ); List<String> compileClassPath = verifier.loadLines(targetDir + "/compile-cp.txt", "UTF-8");
assertTrue( compileClassPath.toString(), compileClassPath.contains( "classes" ) ); assertTrue(compileClassPath.toString(), compileClassPath.contains("classes"));
assertEquals( 1, compileClassPath.size() ); assertEquals(1, compileClassPath.size());
List<String> runtimeArtifacts = verifier.loadLines( targetDir + "/runtime-artifacts.txt", "UTF-8" ); List<String> runtimeArtifacts = verifier.loadLines(targetDir + "/runtime-artifacts.txt", "UTF-8");
assertTrue( runtimeArtifacts.toString(), runtimeArtifacts.contains( "org.apache.maven.its.it0143:direct:jar:0.1" ) ); assertTrue(
assertTrue( runtimeArtifacts.toString(), runtimeArtifacts.contains( "org.apache.maven.its.it0143:compile:jar:0.1" ) ); runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.it0143:direct:jar:0.1"));
assertTrue( runtimeArtifacts.toString(), runtimeArtifacts.contains( "org.apache.maven.its.it0143:runtime:jar:0.1" ) ); assertTrue(
assertEquals( 3, runtimeArtifacts.size() ); runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.it0143:compile:jar:0.1"));
assertTrue(
runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.it0143:runtime:jar:0.1"));
assertEquals(3, runtimeArtifacts.size());
List<String> runtimeClassPath = verifier.loadLines( targetDir + "/runtime-cp.txt", "UTF-8" ); List<String> runtimeClassPath = verifier.loadLines(targetDir + "/runtime-cp.txt", "UTF-8");
assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "classes" ) ); assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("classes"));
assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "direct-0.1.jar" ) ); assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("direct-0.1.jar"));
assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "compile-0.1.jar" ) ); assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("compile-0.1.jar"));
assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "runtime-0.1.jar" ) ); assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("runtime-0.1.jar"));
assertEquals( 4, runtimeClassPath.size() ); assertEquals(4, runtimeClassPath.size());
List<String> testArtifacts = verifier.loadLines( targetDir + "/test-artifacts.txt", "UTF-8" ); List<String> testArtifacts = verifier.loadLines(targetDir + "/test-artifacts.txt", "UTF-8");
assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:direct:jar:0.1" ) ); assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:direct:jar:0.1"));
assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:compile:jar:0.1" ) ); assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:compile:jar:0.1"));
assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:runtime:jar:0.1" ) ); assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:runtime:jar:0.1"));
assertEquals( 3, testArtifacts.size() ); assertEquals(3, testArtifacts.size());
List<String> testClassPath = verifier.loadLines( targetDir + "/test-cp.txt", "UTF-8" ); List<String> testClassPath = verifier.loadLines(targetDir + "/test-cp.txt", "UTF-8");
assertTrue( testClassPath.toString(), testClassPath.contains( "classes" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("classes"));
assertTrue( testClassPath.toString(), testClassPath.contains( "test-classes" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("test-classes"));
assertTrue( testClassPath.toString(), testClassPath.contains( "direct-0.1.jar" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("direct-0.1.jar"));
assertTrue( testClassPath.toString(), testClassPath.contains( "compile-0.1.jar" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("compile-0.1.jar"));
assertTrue( testClassPath.toString(), testClassPath.contains( "runtime-0.1.jar" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("runtime-0.1.jar"));
assertEquals( 5, testClassPath.size() ); assertEquals(5, testClassPath.size());
} }
/** /**
@ -206,62 +206,57 @@ public class MavenIT0143TransitiveDependencyScopesTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitTestScope() public void testitTestScope() throws Exception {
throws Exception Verifier verifier = run("test");
{
Verifier verifier = run( "test" );
String targetDir = "target-test"; String targetDir = "target-test";
List<String> compileArtifacts = verifier.loadLines( targetDir + "/compile-artifacts.txt", "UTF-8" ); List<String> compileArtifacts = verifier.loadLines(targetDir + "/compile-artifacts.txt", "UTF-8");
assertEquals( 0, compileArtifacts.size() ); assertEquals(0, compileArtifacts.size());
List<String> compileClassPath = verifier.loadLines( targetDir + "/compile-cp.txt", "UTF-8" ); List<String> compileClassPath = verifier.loadLines(targetDir + "/compile-cp.txt", "UTF-8");
assertTrue( compileClassPath.toString(), compileClassPath.contains( "classes" ) ); assertTrue(compileClassPath.toString(), compileClassPath.contains("classes"));
assertEquals( 1, compileClassPath.size() ); assertEquals(1, compileClassPath.size());
List<String> runtimeArtifacts = verifier.loadLines( targetDir + "/runtime-artifacts.txt", "UTF-8" ); List<String> runtimeArtifacts = verifier.loadLines(targetDir + "/runtime-artifacts.txt", "UTF-8");
assertEquals( 0, runtimeArtifacts.size() ); assertEquals(0, runtimeArtifacts.size());
List<String> runtimeClassPath = verifier.loadLines( targetDir + "/runtime-cp.txt", "UTF-8" ); List<String> runtimeClassPath = verifier.loadLines(targetDir + "/runtime-cp.txt", "UTF-8");
assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "classes" ) ); assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("classes"));
assertEquals( 1, runtimeClassPath.size() ); assertEquals(1, runtimeClassPath.size());
List<String> testArtifacts = verifier.loadLines( targetDir + "/test-artifacts.txt", "UTF-8" ); List<String> testArtifacts = verifier.loadLines(targetDir + "/test-artifacts.txt", "UTF-8");
assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:direct:jar:0.1" ) ); assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:direct:jar:0.1"));
assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:compile:jar:0.1" ) ); assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:compile:jar:0.1"));
assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:runtime:jar:0.1" ) ); assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:runtime:jar:0.1"));
assertEquals( 3, testArtifacts.size() ); assertEquals(3, testArtifacts.size());
List<String> testClassPath = verifier.loadLines( targetDir + "/test-cp.txt", "UTF-8" ); List<String> testClassPath = verifier.loadLines(targetDir + "/test-cp.txt", "UTF-8");
assertTrue( testClassPath.toString(), testClassPath.contains( "classes" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("classes"));
assertTrue( testClassPath.toString(), testClassPath.contains( "test-classes" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("test-classes"));
assertTrue( testClassPath.toString(), testClassPath.contains( "direct-0.1.jar" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("direct-0.1.jar"));
assertTrue( testClassPath.toString(), testClassPath.contains( "compile-0.1.jar" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("compile-0.1.jar"));
assertTrue( testClassPath.toString(), testClassPath.contains( "runtime-0.1.jar" ) ); assertTrue(testClassPath.toString(), testClassPath.contains("runtime-0.1.jar"));
assertEquals( 5, testClassPath.size() ); assertEquals(5, testClassPath.size());
} }
private Verifier run( String scope ) private Verifier run(String scope) throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0143");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0143" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target-" + scope ); verifier.deleteDirectory("target-" + scope);
verifier.deleteArtifacts( "org.apache.maven.its.it0143" ); verifier.deleteArtifacts("org.apache.maven.its.it0143");
Map<String, String> filterProps = verifier.newDefaultFilterMap(); Map<String, String> filterProps = verifier.newDefaultFilterMap();
filterProps.put( "@scope@", scope ); filterProps.put("@scope@", scope);
verifier.filterFile( "pom-template.xml", "pom.xml", "UTF-8", filterProps ); verifier.filterFile("pom-template.xml", "pom.xml", "UTF-8", filterProps);
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps);
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.setLogFileName( "log-" + scope + ".txt" ); verifier.setLogFileName("log-" + scope + ".txt");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
return verifier; return verifier;
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,28 +16,24 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenIT0144LifecycleExecutionOrderTest public class MavenIT0144LifecycleExecutionOrderTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenIT0144LifecycleExecutionOrderTest() public MavenIT0144LifecycleExecutionOrderTest() {
{ super(ALL_MAVEN_VERSIONS);
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -48,69 +42,62 @@ public class MavenIT0144LifecycleExecutionOrderTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit0144() public void testit0144() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0144");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0144" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.addCliArguments( "post-clean", "deploy", "site-deploy" ); verifier.addCliArguments("post-clean", "deploy", "site-deploy");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
List<String> expected = new ArrayList<>(); List<String> expected = new ArrayList<>();
expected.add( "pre-clean" ); expected.add("pre-clean");
expected.add( "clean" ); expected.add("clean");
expected.add( "post-clean" ); expected.add("post-clean");
expected.add( "validate" ); expected.add("validate");
expected.add( "initialize" ); expected.add("initialize");
expected.add( "generate-sources" ); expected.add("generate-sources");
expected.add( "process-sources" ); expected.add("process-sources");
expected.add( "generate-resources" ); expected.add("generate-resources");
expected.add( "process-resources" ); expected.add("process-resources");
expected.add( "compile" ); expected.add("compile");
expected.add( "process-classes" ); expected.add("process-classes");
expected.add( "generate-test-sources" ); expected.add("generate-test-sources");
expected.add( "process-test-sources" ); expected.add("process-test-sources");
expected.add( "generate-test-resources" ); expected.add("generate-test-resources");
expected.add( "process-test-resources" ); expected.add("process-test-resources");
expected.add( "test-compile" ); expected.add("test-compile");
if ( matchesVersionRange( "(2.0.4,)" ) ) if (matchesVersionRange("(2.0.4,)")) {
{
// MNG-1508 // MNG-1508
expected.add( "process-test-classes" ); expected.add("process-test-classes");
} }
expected.add( "test" ); expected.add("test");
if ( matchesVersionRange( "(2.1.0-M1,)" ) ) if (matchesVersionRange("(2.1.0-M1,)")) {
{
// MNG-2097 // MNG-2097
expected.add( "prepare-package" ); expected.add("prepare-package");
} }
expected.add( "package" ); expected.add("package");
if ( matchesVersionRange( "(2.0.1,)" ) ) if (matchesVersionRange("(2.0.1,)")) {
{ expected.add("pre-integration-test");
expected.add( "pre-integration-test" );
} }
expected.add( "integration-test" ); expected.add("integration-test");
if ( matchesVersionRange( "(2.0.1,)" ) ) if (matchesVersionRange("(2.0.1,)")) {
{ expected.add("post-integration-test");
expected.add( "post-integration-test" );
} }
expected.add( "verify" ); expected.add("verify");
expected.add( "install" ); expected.add("install");
expected.add( "deploy" ); expected.add("deploy");
expected.add( "pre-site" ); expected.add("pre-site");
expected.add( "site" ); expected.add("site");
expected.add( "post-site" ); expected.add("post-site");
expected.add( "site-deploy" ); expected.add("site-deploy");
List<String> phases = verifier.loadLines( "target/phases.log", "UTF-8" ); List<String> phases = verifier.loadLines("target/phases.log", "UTF-8");
assertEquals( expected, phases ); assertEquals(expected, phases);
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,15 +16,15 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.net.InetAddress; import java.net.InetAddress;
import java.util.Map; import java.util.Map;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.NetworkConnector; import org.eclipse.jetty.server.NetworkConnector;
import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.Server;
@ -37,119 +35,102 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0146InstallerSnapshotNaming public class MavenIT0146InstallerSnapshotNaming extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
private Server server; private Server server;
private int port; private int port;
private final File testDir; private final File testDir;
public MavenIT0146InstallerSnapshotNaming() public MavenIT0146InstallerSnapshotNaming() throws IOException {
throws IOException super("(2.0.2,)");
{ testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0146");
super( "(2.0.2,)" );
testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0146" );
} }
@BeforeEach @BeforeEach
protected void setUp() protected void setUp() throws Exception {
throws Exception
{
ResourceHandler resourceHandler = new ResourceHandler(); ResourceHandler resourceHandler = new ResourceHandler();
resourceHandler.setResourceBase( new File( testDir, "repo" ).getAbsolutePath() ); resourceHandler.setResourceBase(new File(testDir, "repo").getAbsolutePath());
HandlerList handlers = new HandlerList(); HandlerList handlers = new HandlerList();
handlers.setHandlers( new Handler[]{ resourceHandler, new DefaultHandler() } ); handlers.setHandlers(new Handler[] {resourceHandler, new DefaultHandler()});
server = new Server( 0 ); server = new Server(0);
server.setHandler( handlers ); server.setHandler(handlers);
server.start(); server.start();
if ( server.isFailed() ) if (server.isFailed()) {
{ fail("Couldn't bind the server socket to a free port!");
fail( "Couldn't bind the server socket to a free port!" );
} }
port = ( (NetworkConnector) server.getConnectors()[0] ).getLocalPort(); port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort();
System.out.println( "Bound server socket to the port " + port ); System.out.println("Bound server socket to the port " + port);
} }
@AfterEach @AfterEach
protected void tearDown() protected void tearDown() throws Exception {
throws Exception if (server != null) {
{
if ( server != null )
{
server.stop(); server.stop();
server.join(); server.join();
} }
} }
@Test @Test
public void testitRemoteDownloadTimestampedName() public void testitRemoteDownloadTimestampedName() throws Exception {
throws Exception Verifier verifier = newVerifier(testDir.getAbsolutePath());
{
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
Map<String, String> properties = verifier.newDefaultFilterMap(); Map<String, String> properties = verifier.newDefaultFilterMap();
properties.put( "@host@", InetAddress.getLoopbackAddress().getCanonicalHostName() ); properties.put("@host@", InetAddress.getLoopbackAddress().getCanonicalHostName());
properties.put( "@port@", Integer.toString( port ) ); properties.put("@port@", Integer.toString(port));
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", properties);
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.deleteArtifacts( "org.apache.maven.its.it0146" ); verifier.deleteArtifacts("org.apache.maven.its.it0146");
verifier.addCliArgument( "-X" ); verifier.addCliArgument("-X");
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/appassembler/repo/dep-0.1-20110726.105319-1.jar" ); verifier.verifyFilePresent("target/appassembler/repo/dep-0.1-20110726.105319-1.jar");
} }
@Test @Test
public void testitNonTimestampedNameWithInstalledSNAPSHOT() public void testitNonTimestampedNameWithInstalledSNAPSHOT() throws Exception {
throws Exception Verifier verifier = newVerifier(testDir.getAbsolutePath());
{ verifier.deleteArtifacts("org.apache.maven.its.it0146");
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); verifier.addCliArgument("-f");
verifier.deleteArtifacts( "org.apache.maven.its.it0146" ); verifier.addCliArgument("project/pom.xml");
verifier.addCliArgument( "-f" ); verifier.deleteDirectory("project/target");
verifier.addCliArgument( "project/pom.xml" ); verifier.setLogFileName("log2.txt");
verifier.deleteDirectory( "project/target" );
verifier.setLogFileName( "log2.txt" );
verifier.addCliArgument( "install" ); verifier.addCliArgument("install");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier = newVerifier( testDir.getAbsolutePath() ); verifier = newVerifier(testDir.getAbsolutePath());
Map<String, String> properties = verifier.newDefaultFilterMap(); Map<String, String> properties = verifier.newDefaultFilterMap();
properties.put( "@host@", InetAddress.getLoopbackAddress().getCanonicalHostName() ); properties.put("@host@", InetAddress.getLoopbackAddress().getCanonicalHostName());
properties.put( "@port@", Integer.toString( port ) ); properties.put("@port@", Integer.toString(port));
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", properties);
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.setLogFileName( "log3.txt" ); verifier.setLogFileName("log3.txt");
verifier.addCliArgument("-X");
verifier.addCliArgument( "-X" ); verifier.deleteDirectory("target");
verifier.deleteDirectory( "target" ); verifier.addCliArgument("validate");
verifier.addCliArgument( "validate" );
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/appassembler/repo/dep-0.1-SNAPSHOT.jar" ); verifier.verifyFilePresent("target/appassembler/repo/dep-0.1-SNAPSHOT.jar");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class MavenIT0199CyclicImportScopeTest extends AbstractMavenIntegrationTestCase { public class MavenIT0199CyclicImportScopeTest extends AbstractMavenIntegrationTestCase {
@ -36,7 +34,8 @@ public class MavenIT0199CyclicImportScopeTest extends AbstractMavenIntegrationTe
public void testit0199() throws Exception { public void testit0199() throws Exception {
// v1: parent not using BOM; explicit dep from componentB componentA // v1: parent not using BOM; explicit dep from componentB componentA
// v2: BOM introduced; componentB componentA picks up implicit version 1 from main@v1 // v2: BOM introduced; componentB componentA picks up implicit version 1 from main@v1
// v3: components now inheriting indirectly from an older version of the BOM that includes them; componentB componentA version overridden // v3: components now inheriting indirectly from an older version of the BOM that includes them; componentB
// componentA version overridden
for (int i = 1; i <= 3; i++) { for (int i = 1; i <= 3; i++) {
build("v" + i + "/parent", null); build("v" + i + "/parent", null);
build("v" + i + "/componentA", "target/componentA-" + i + ".jar"); build("v" + i + "/componentA", "target/componentA-" + i + ".jar");
@ -57,5 +56,4 @@ public class MavenIT0199CyclicImportScopeTest extends AbstractMavenIntegrationTe
} }
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -33,12 +31,9 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenITBootstrapTest public class MavenITBootstrapTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITBootstrapTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITBootstrapTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -47,22 +42,20 @@ public class MavenITBootstrapTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testBootstrap() public void testBootstrap() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/bootstrap");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/bootstrap" );
Verifier verifier = newVerifier( testDir.getAbsolutePath(), "remote" ); Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote");
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "-Dbootstrap=" + getClass().getResource( "/bootstrap.txt" ).toURI().getPath() ); verifier.addCliArgument("-Dbootstrap="
+ getClass().getResource("/bootstrap.txt").toURI().getPath());
// bootstrap plugin is bound to this phase, do not go further // bootstrap plugin is bound to this phase, do not go further
// important: maven-plugin packaging will fail at package phase, as there is no Mojo present! // important: maven-plugin packaging will fail at package phase, as there is no Mojo present!
verifier.addCliArgument( "process-resources" ); verifier.addCliArgument("process-resources");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.VerificationException;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.VerificationException;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -33,12 +31,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenITmng0095ReactorFailureBehaviorTest public class MavenITmng0095ReactorFailureBehaviorTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0095ReactorFailureBehaviorTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0095ReactorFailureBehaviorTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -48,34 +43,29 @@ public class MavenITmng0095ReactorFailureBehaviorTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitFailFast() public void testitFailFast() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0095");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0095" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteDirectory( "subproject1/target" ); verifier.deleteDirectory("subproject1/target");
verifier.deleteDirectory( "subproject2/target" ); verifier.deleteDirectory("subproject2/target");
verifier.deleteDirectory( "subproject3/target" ); verifier.deleteDirectory("subproject3/target");
verifier.addCliArgument( "--fail-fast" ); verifier.addCliArgument("--fail-fast");
verifier.setLogFileName( "log-ff.txt" ); verifier.setLogFileName("log-ff.txt");
try try {
{ verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-touch:touch" );
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} } catch (VerificationException e) {
catch ( VerificationException e )
{
// expected // expected
} }
verifier.verifyFilePresent( "target/touch.txt" ); verifier.verifyFilePresent("target/touch.txt");
verifier.verifyFileNotPresent( "subproject1/target/touch.txt" ); verifier.verifyFileNotPresent("subproject1/target/touch.txt");
verifier.verifyFileNotPresent( "subproject2/target/touch.txt" ); verifier.verifyFileNotPresent("subproject2/target/touch.txt");
verifier.verifyFileNotPresent( "subproject3/target/touch.txt" ); verifier.verifyFileNotPresent("subproject3/target/touch.txt");
} }
/** /**
@ -85,26 +75,24 @@ public class MavenITmng0095ReactorFailureBehaviorTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitFailNever() public void testitFailNever() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0095");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0095" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteDirectory( "subproject1/target" ); verifier.deleteDirectory("subproject1/target");
verifier.deleteDirectory( "subproject2/target" ); verifier.deleteDirectory("subproject2/target");
verifier.deleteDirectory( "subproject3/target" ); verifier.deleteDirectory("subproject3/target");
verifier.addCliArgument( "--fail-never" ); verifier.addCliArgument("--fail-never");
verifier.setLogFileName( "log-fn.txt" ); verifier.setLogFileName("log-fn.txt");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-touch:touch" ); verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch");
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/touch.txt" ); verifier.verifyFilePresent("target/touch.txt");
verifier.verifyFileNotPresent( "subproject1/target/touch.txt" ); verifier.verifyFileNotPresent("subproject1/target/touch.txt");
verifier.verifyFilePresent( "subproject2/target/touch.txt" ); verifier.verifyFilePresent("subproject2/target/touch.txt");
verifier.verifyFilePresent( "subproject3/target/touch.txt" ); verifier.verifyFilePresent("subproject3/target/touch.txt");
} }
/** /**
@ -115,34 +103,28 @@ public class MavenITmng0095ReactorFailureBehaviorTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitFailAtEnd() public void testitFailAtEnd() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0095");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0095" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteDirectory( "subproject1/target" ); verifier.deleteDirectory("subproject1/target");
verifier.deleteDirectory( "subproject2/target" ); verifier.deleteDirectory("subproject2/target");
verifier.deleteDirectory( "subproject3/target" ); verifier.deleteDirectory("subproject3/target");
verifier.addCliArgument( "--fail-at-end" ); verifier.addCliArgument("--fail-at-end");
verifier.setLogFileName( "log-fae.txt" ); verifier.setLogFileName("log-fae.txt");
try try {
{ verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-touch:touch" );
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} } catch (VerificationException e) {
catch ( VerificationException e )
{
// expected // expected
} }
verifier.verifyFilePresent( "target/touch.txt" ); verifier.verifyFilePresent("target/touch.txt");
verifier.verifyFileNotPresent( "subproject1/target/touch.txt" ); verifier.verifyFileNotPresent("subproject1/target/touch.txt");
verifier.verifyFilePresent( "subproject2/target/touch.txt" ); verifier.verifyFilePresent("subproject2/target/touch.txt");
verifier.verifyFileNotPresent( "subproject3/target/touch.txt" ); verifier.verifyFileNotPresent("subproject3/target/touch.txt");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,9 +16,7 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
@ -29,6 +25,8 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -36,13 +34,10 @@ import org.junit.jupiter.api.Test;
* *
* @author Benjamin Bentmann * @author Benjamin Bentmann
*/ */
public class MavenITmng0187CollectedProjectsTest public class MavenITmng0187CollectedProjectsTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng0187CollectedProjectsTest() public MavenITmng0187CollectedProjectsTest() {
{ super(ALL_MAVEN_VERSIONS);
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -52,51 +47,45 @@ public class MavenITmng0187CollectedProjectsTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit() public void testit() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0187");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0187" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteDirectory( "sub-1/target" ); verifier.deleteDirectory("sub-1/target");
verifier.deleteDirectory( "sub-1/sub-2/target" ); verifier.deleteDirectory("sub-1/sub-2/target");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Properties props; Properties props;
props = verifier.loadProperties( "target/project.properties" ); props = verifier.loadProperties("target/project.properties");
assertEquals( "2", props.getProperty( "project.collectedProjects.size" ) ); assertEquals("2", props.getProperty("project.collectedProjects.size"));
assertEquals( Arrays.asList( new String[]{ "sub-1", "sub-2" } ), getProjects( props ) ); assertEquals(Arrays.asList(new String[] {"sub-1", "sub-2"}), getProjects(props));
props = verifier.loadProperties( "sub-1/target/project.properties" ); props = verifier.loadProperties("sub-1/target/project.properties");
assertEquals( "1", props.getProperty( "project.collectedProjects.size" ) ); assertEquals("1", props.getProperty("project.collectedProjects.size"));
assertEquals( Arrays.asList( new String[]{ "sub-2" } ), getProjects( props ) ); assertEquals(Arrays.asList(new String[] {"sub-2"}), getProjects(props));
props = verifier.loadProperties( "sub-1/sub-2/target/project.properties" ); props = verifier.loadProperties("sub-1/sub-2/target/project.properties");
assertEquals( "0", props.getProperty( "project.collectedProjects.size" ) ); assertEquals("0", props.getProperty("project.collectedProjects.size"));
assertEquals( Arrays.asList( new String[]{} ), getProjects( props ) ); assertEquals(Arrays.asList(new String[] {}), getProjects(props));
} }
private List<String> getProjects( Properties props ) private List<String> getProjects(Properties props) {
{
List<String> projects = new ArrayList<>(); List<String> projects = new ArrayList<>();
for ( Object o : props.keySet() ) for (Object o : props.keySet()) {
{
String key = o.toString(); String key = o.toString();
if ( key.startsWith( "project.collectedProjects." ) && !key.endsWith( ".size" ) ) if (key.startsWith("project.collectedProjects.") && !key.endsWith(".size")) {
{ projects.add(props.getProperty(key));
projects.add( props.getProperty( key ) );
} }
} }
Collections.sort( projects ); Collections.sort(projects);
return projects; return projects;
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -33,12 +31,9 @@ import org.junit.jupiter.api.Test;
* @author Brett Porter * @author Brett Porter
* *
*/ */
public class MavenITmng0249ResolveDepsFromReactorTest public class MavenITmng0249ResolveDepsFromReactorTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0249ResolveDepsFromReactorTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0249ResolveDepsFromReactorTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -47,31 +42,28 @@ public class MavenITmng0249ResolveDepsFromReactorTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG0249() public void testitMNG0249() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0249");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0249" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
List<String> ccp = verifier.loadLines( "test-component-c/target/compile.txt", "UTF-8" ); List<String> ccp = verifier.loadLines("test-component-c/target/compile.txt", "UTF-8");
assertTrue( ccp.toString(), ccp.contains( "test-component-c/classes" ) ); assertTrue(ccp.toString(), ccp.contains("test-component-c/classes"));
assertTrue( ccp.toString(), ccp.contains( "test-component-b/classes" ) ); assertTrue(ccp.toString(), ccp.contains("test-component-b/classes"));
assertTrue( ccp.toString(), ccp.contains( "test-component-a/classes" ) ); assertTrue(ccp.toString(), ccp.contains("test-component-a/classes"));
List<String> rcp = verifier.loadLines( "test-component-c/target/runtime.txt", "UTF-8" ); List<String> rcp = verifier.loadLines("test-component-c/target/runtime.txt", "UTF-8");
assertTrue( rcp.toString(), rcp.contains( "test-component-c/classes" ) ); assertTrue(rcp.toString(), rcp.contains("test-component-c/classes"));
assertTrue( rcp.toString(), rcp.contains( "test-component-b/classes" ) ); assertTrue(rcp.toString(), rcp.contains("test-component-b/classes"));
assertTrue( rcp.toString(), rcp.contains( "test-component-a/classes" ) ); assertTrue(rcp.toString(), rcp.contains("test-component-a/classes"));
List<String> tcp = verifier.loadLines( "test-component-c/target/test.txt", "UTF-8" ); List<String> tcp = verifier.loadLines("test-component-c/target/test.txt", "UTF-8");
assertTrue( tcp.toString(), tcp.contains( "test-component-c/classes" ) ); assertTrue(tcp.toString(), tcp.contains("test-component-c/classes"));
assertTrue( tcp.toString(), tcp.contains( "test-component-b/classes" ) ); assertTrue(tcp.toString(), tcp.contains("test-component-b/classes"));
assertTrue( tcp.toString(), tcp.contains( "test-component-a/classes" ) ); assertTrue(tcp.toString(), tcp.contains("test-component-a/classes"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenITmng0282NonReactorExecWhenProjectIndependentTest public class MavenITmng0282NonReactorExecWhenProjectIndependentTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0282NonReactorExecWhenProjectIndependentTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0282NonReactorExecWhenProjectIndependentTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -46,20 +41,17 @@ public class MavenITmng0282NonReactorExecWhenProjectIndependentTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG282() public void testitMNG282() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0282");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0282" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteDirectory( "subproject/target" ); verifier.deleteDirectory("subproject/target");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-no-project:light-touch" ); verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-no-project:light-touch");
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/touch.txt" ); verifier.verifyFilePresent("target/touch.txt");
verifier.verifyFileNotPresent( "subproject/target/touch.txt" ); verifier.verifyFileNotPresent("subproject/target/touch.txt");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,13 +30,10 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenITmng0294MergeGlobalAndUserSettingsTest public class MavenITmng0294MergeGlobalAndUserSettingsTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng0294MergeGlobalAndUserSettingsTest() public MavenITmng0294MergeGlobalAndUserSettingsTest() {
{ super(ALL_MAVEN_VERSIONS);
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -47,24 +42,21 @@ public class MavenITmng0294MergeGlobalAndUserSettingsTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG294() public void testitMNG294() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0294");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0294" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() ); Verifier verifier = new Verifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "user-settings.xml" ); verifier.addCliArgument("user-settings.xml");
// dedicated CLI option only available since MNG-3914 // dedicated CLI option only available since MNG-3914
verifier.addCliArgument( "--global-settings" ); verifier.addCliArgument("--global-settings");
verifier.addCliArgument( "global-settings.xml" ); verifier.addCliArgument("global-settings.xml");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-touch:touch" ); verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/test.txt" ); verifier.verifyFilePresent("target/test.txt");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenITmng0377PluginLookupFromPrefixTest public class MavenITmng0377PluginLookupFromPrefixTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0377PluginLookupFromPrefixTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0377PluginLookupFromPrefixTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -47,24 +42,21 @@ public class MavenITmng0377PluginLookupFromPrefixTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG377() public void testitMNG377() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0377");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0377" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteArtifacts( "org.apache.maven.its.mng0377" ); verifier.deleteArtifacts("org.apache.maven.its.mng0377");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "-Dtouch.outputFile=target/file.txt" ); verifier.addCliArgument("-Dtouch.outputFile=target/file.txt");
verifier.addCliArgument( "itprefix:touch" ); verifier.addCliArgument("itprefix:touch");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/file.txt" ); verifier.verifyFilePresent("target/file.txt");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,13 +30,10 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenITmng0449PluginVersionResolutionTest public class MavenITmng0449PluginVersionResolutionTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng0449PluginVersionResolutionTest() public MavenITmng0449PluginVersionResolutionTest() {
{ super("[2.0,)");
super( "[2.0,)" );
} }
/** /**
@ -48,42 +43,34 @@ public class MavenITmng0449PluginVersionResolutionTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitLifecycleInvocation() public void testitLifecycleInvocation() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0449");
{ testDir = new File(testDir, "lifecycle");
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0449" );
testDir = new File( testDir, "lifecycle" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
try try {
{ verifier.deleteArtifacts("org.apache.maven.its.mng0449");
verifier.deleteArtifacts( "org.apache.maven.its.mng0449" ); } catch (Exception e) {
}
catch ( Exception e )
{
// when we run Maven embedded, the plugin class realm locks the artifacts so we can't delete them // when we run Maven embedded, the plugin class realm locks the artifacts so we can't delete them
} }
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.filterFile( "../settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
// Maven 3.x prefers RELEASE over LATEST (see MNG-4206) // Maven 3.x prefers RELEASE over LATEST (see MNG-4206)
if ( matchesVersionRange( "(,3.0-alpha-3)" ) ) if (matchesVersionRange("(,3.0-alpha-3)")) {
{ verifier.verifyFileNotPresent("target/touch-release.txt");
verifier.verifyFileNotPresent( "target/touch-release.txt" ); verifier.verifyFilePresent("target/touch-snapshot.txt");
verifier.verifyFilePresent( "target/touch-snapshot.txt" ); } else {
verifier.verifyFilePresent("target/touch-release.txt");
verifier.verifyFileNotPresent("target/touch-snapshot.txt");
} }
else verifier.verifyFilePresent("target/package.txt");
{
verifier.verifyFilePresent( "target/touch-release.txt" );
verifier.verifyFileNotPresent( "target/touch-snapshot.txt" );
}
verifier.verifyFilePresent( "target/package.txt" );
} }
/** /**
@ -93,41 +80,32 @@ public class MavenITmng0449PluginVersionResolutionTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitCliInvocation() public void testitCliInvocation() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0449");
{ testDir = new File(testDir, "direct");
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0449" );
testDir = new File( testDir, "direct" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
try try {
{ verifier.deleteArtifacts("org.apache.maven.its.mng0449");
verifier.deleteArtifacts( "org.apache.maven.its.mng0449" ); } catch (Exception e) {
}
catch ( Exception e )
{
// when we run Maven embedded, the plugin class realm locks the artifacts so we can't delete them // when we run Maven embedded, the plugin class realm locks the artifacts so we can't delete them
} }
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.filterFile( "../settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "org.apache.maven.its.mng0449:maven-it-plugin-a:touch" ); verifier.addCliArgument("org.apache.maven.its.mng0449:maven-it-plugin-a:touch");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
// Maven 3.x prefers RELEASE over LATEST (see MNG-4206) // Maven 3.x prefers RELEASE over LATEST (see MNG-4206)
if ( matchesVersionRange( "(,3.0-alpha-3)" ) ) if (matchesVersionRange("(,3.0-alpha-3)")) {
{ verifier.verifyFileNotPresent("target/touch-release.txt");
verifier.verifyFileNotPresent( "target/touch-release.txt" ); verifier.verifyFilePresent("target/touch-snapshot.txt");
verifier.verifyFilePresent( "target/touch-snapshot.txt" ); } else {
} verifier.verifyFilePresent("target/touch-release.txt");
else verifier.verifyFileNotPresent("target/touch-snapshot.txt");
{
verifier.verifyFilePresent( "target/touch-release.txt" );
verifier.verifyFileNotPresent( "target/touch-snapshot.txt" );
} }
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,13 +30,10 @@ import org.junit.jupiter.api.Test;
* *
* @author Benjamin Bentmann * @author Benjamin Bentmann
*/ */
public class MavenITmng0461TolerateMissingDependencyPomTest public class MavenITmng0461TolerateMissingDependencyPomTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng0461TolerateMissingDependencyPomTest() public MavenITmng0461TolerateMissingDependencyPomTest() {
{ super("[2.0.3,3.0-alpha-1),[3.0-alpha-2,)");
super( "[2.0.3,3.0-alpha-1),[3.0-alpha-2,)" );
} }
/** /**
@ -47,24 +42,21 @@ public class MavenITmng0461TolerateMissingDependencyPomTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit() public void testit() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0461");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0461" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteArtifacts( "org.apache.maven.its.mng0461" ); verifier.deleteArtifacts("org.apache.maven.its.mng0461");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
List<String> classpath = verifier.loadLines( "target/classpath.txt", "UTF-8" ); List<String> classpath = verifier.loadLines("target/classpath.txt", "UTF-8");
assertTrue( classpath.toString(), classpath.contains( "dep-0.1.jar" ) ); assertTrue(classpath.toString(), classpath.contains("dep-0.1.jar"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Properties; import java.util.Properties;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -33,13 +31,10 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenITmng0469ReportConfigTest public class MavenITmng0469ReportConfigTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng0469ReportConfigTest() public MavenITmng0469ReportConfigTest() {
{ super("[2.0.0,)");
super( "[2.0.0,)" );
} }
/** /**
@ -48,18 +43,16 @@ public class MavenITmng0469ReportConfigTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitBuildConfigDominantDuringBuild() public void testitBuildConfigDominantDuringBuild() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0469/test1");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0469/test1" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-configuration:2.1-SNAPSHOT:config" ); verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-configuration:2.1-SNAPSHOT:config");
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/build.txt" ); verifier.verifyFilePresent("target/build.txt");
verifier.verifyFileNotPresent( "target/reporting.txt" ); verifier.verifyFileNotPresent("target/reporting.txt");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
@ -69,29 +62,25 @@ public class MavenITmng0469ReportConfigTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitBuildConfigIrrelevantForReports() public void testitBuildConfigIrrelevantForReports() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0469/test2");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0469/test2" );
Verifier verifier = newVerifier( testDir.getAbsolutePath(), "remote" ); Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote");
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.setAutoclean(false);
if ( matchesVersionRange( "(,3.0-alpha-1)" ) ) if (matchesVersionRange("(,3.0-alpha-1)")) {
{ verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-site:2.1-SNAPSHOT:generate");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-site:2.1-SNAPSHOT:generate" );
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/site/info.properties" ); verifier.verifyFilePresent("target/site/info.properties");
} } else {
else verifier.addCliArgument("validate");
{
verifier.addCliArgument( "validate" );
verifier.execute(); verifier.execute();
Properties props = verifier.loadProperties( "target/config.properties" ); Properties props = verifier.loadProperties("target/config.properties");
assertEquals( "maven-it-plugin-site", props.getProperty( "project.reporting.plugins.0.artifactId" ) ); assertEquals("maven-it-plugin-site", props.getProperty("project.reporting.plugins.0.artifactId"));
assertNotEquals( "fail.properties", props.getProperty( "project.reporting.plugins.0.configuration.children.infoFile.0.value" ) ); assertNotEquals(
"fail.properties",
props.getProperty("project.reporting.plugins.0.configuration.children.infoFile.0.value"));
} }
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,14 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Arrays;
import java.util.List;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -34,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author Brett Porter * @author Brett Porter
* *
*/ */
public class MavenITmng0471CustomLifecycleTest public class MavenITmng0471CustomLifecycleTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0471CustomLifecycleTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0471CustomLifecycleTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -48,21 +41,19 @@ public class MavenITmng0471CustomLifecycleTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG471() public void testitMNG471() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0471");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0471" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArguments( "org.apache.maven.its.plugins:maven-it-plugin-fork:fork", verifier.addCliArguments(
"org.apache.maven.its.plugins:maven-it-plugin-fork:fork-goal" ); "org.apache.maven.its.plugins:maven-it-plugin-fork:fork",
"org.apache.maven.its.plugins:maven-it-plugin-fork:fork-goal");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/forked/touch.txt" ); verifier.verifyFilePresent("target/forked/touch.txt");
verifier.verifyFilePresent( "target/forked2/touch.txt" ); verifier.verifyFilePresent("target/forked2/touch.txt");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,14 +16,14 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.VerificationException;
import java.io.File; import java.io.File;
import java.util.Properties; import java.util.Properties;
import org.apache.maven.shared.verifier.VerificationException;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -34,12 +32,9 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenITmng0479OverrideCentralRepoTest public class MavenITmng0479OverrideCentralRepoTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0479OverrideCentralRepoTest() {
{ super("[2.0.3,3.0-alpha-1),[3.0-beta-3,)");
public MavenITmng0479OverrideCentralRepoTest()
{
super( "[2.0.3,3.0-alpha-1),[3.0-beta-3,)" );
} }
/** /**
@ -48,73 +43,67 @@ public class MavenITmng0479OverrideCentralRepoTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitModel() public void testitModel() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0479");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0479" );
// Phase 1: Ensure the test plugin is downloaded before the test cuts off access to central // Phase 1: Ensure the test plugin is downloaded before the test cuts off access to central
File child1 = new File( testDir, "setup" ); File child1 = new File(testDir, "setup");
Verifier verifier = newVerifier( child1.getAbsolutePath() ); Verifier verifier = newVerifier(child1.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-expression:2.1-SNAPSHOT:eval" ); verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-expression:2.1-SNAPSHOT:eval");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
// Phase 2: Now run the test // Phase 2: Now run the test
File child2 = new File( testDir, "test" ); File child2 = new File(testDir, "test");
verifier = newVerifier( child2.getAbsolutePath() ); verifier = newVerifier(child2.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-expression:2.1-SNAPSHOT:eval" ); verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-expression:2.1-SNAPSHOT:eval");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/expression.properties" ); verifier.verifyFilePresent("target/expression.properties");
Properties props = verifier.loadProperties( "target/expression.properties" ); Properties props = verifier.loadProperties("target/expression.properties");
int count = Integer.parseInt( props.getProperty( "project.repositories", "0" ) ); int count = Integer.parseInt(props.getProperty("project.repositories", "0"));
assertTrue( count > 0 ); assertTrue(count > 0);
for ( int i = 0; i < count; i++ ) for (int i = 0; i < count; i++) {
{
String key = "project.repositories." + i; String key = "project.repositories." + i;
if ( "central".equals( props.getProperty( key + ".id" ) ) ) if ("central".equals(props.getProperty(key + ".id"))) {
{ assertEquals("mng-0479", props.getProperty(key + ".name"));
assertEquals( "mng-0479", props.getProperty( key + ".name" ) ); assertTrue(props.getProperty(key + ".url").endsWith("/target/mng-0479"));
assertTrue( props.getProperty( key + ".url" ).endsWith( "/target/mng-0479" ) );
assertEquals( "false", props.getProperty( key + ".releases.enabled" ) ); assertEquals("false", props.getProperty(key + ".releases.enabled"));
assertEquals( "ignore", props.getProperty( key + ".releases.checksumPolicy" ) ); assertEquals("ignore", props.getProperty(key + ".releases.checksumPolicy"));
assertEquals( "always", props.getProperty( key + ".releases.updatePolicy" ) ); assertEquals("always", props.getProperty(key + ".releases.updatePolicy"));
assertEquals( "true", props.getProperty( key + ".snapshots.enabled" ) ); assertEquals("true", props.getProperty(key + ".snapshots.enabled"));
assertEquals( "fail", props.getProperty( key + ".snapshots.checksumPolicy" ) ); assertEquals("fail", props.getProperty(key + ".snapshots.checksumPolicy"));
assertEquals( "never", props.getProperty( key + ".snapshots.updatePolicy" ) ); assertEquals("never", props.getProperty(key + ".snapshots.updatePolicy"));
} }
} }
count = Integer.parseInt( props.getProperty( "project.pluginRepositories", "0" ) ); count = Integer.parseInt(props.getProperty("project.pluginRepositories", "0"));
for ( int i = 0; i < count; i++ ) for (int i = 0; i < count; i++) {
{
String key = "project.pluginRepositories." + i; String key = "project.pluginRepositories." + i;
if ( "central".equals( props.getProperty( key + ".id" ) ) ) if ("central".equals(props.getProperty(key + ".id"))) {
{ assertEquals("mng-0479", props.getProperty(key + ".name"));
assertEquals( "mng-0479", props.getProperty( key + ".name" ) ); assertTrue(props.getProperty(key + ".url").endsWith("/target/mng-0479"));
assertTrue( props.getProperty( key + ".url" ).endsWith( "/target/mng-0479" ) );
assertEquals( "false", props.getProperty( key + ".releases.enabled" ) ); assertEquals("false", props.getProperty(key + ".releases.enabled"));
assertEquals( "ignore", props.getProperty( key + ".releases.checksumPolicy" ) ); assertEquals("ignore", props.getProperty(key + ".releases.checksumPolicy"));
assertEquals( "always", props.getProperty( key + ".releases.updatePolicy" ) ); assertEquals("always", props.getProperty(key + ".releases.updatePolicy"));
assertEquals( "true", props.getProperty( key + ".snapshots.enabled" ) ); assertEquals("true", props.getProperty(key + ".snapshots.enabled"));
assertEquals( "fail", props.getProperty( key + ".snapshots.checksumPolicy" ) ); assertEquals("fail", props.getProperty(key + ".snapshots.checksumPolicy"));
assertEquals( "never", props.getProperty( key + ".snapshots.updatePolicy" ) ); assertEquals("never", props.getProperty(key + ".snapshots.updatePolicy"));
} }
} }
} }
@ -125,91 +114,79 @@ public class MavenITmng0479OverrideCentralRepoTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitResolution() public void testitResolution() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0479");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0479" );
Verifier verifier = newVerifier( new File( testDir, "test-1" ).getAbsolutePath() ); Verifier verifier = newVerifier(new File(testDir, "test-1").getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteArtifacts( "org.apache.maven.its.mng0479" ); verifier.deleteArtifacts("org.apache.maven.its.mng0479");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/touch.txt" ); verifier.verifyFilePresent("target/touch.txt");
verifier.verifyArtifactPresent( "org.apache.maven.its.mng0479", "parent", "0.1-SNAPSHOT", "pom" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng0479", "parent", "0.1-SNAPSHOT", "pom");
verifier.verifyArtifactPresent( "org.apache.maven.its.mng0479", "a", "0.1-SNAPSHOT", "jar" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng0479", "a", "0.1-SNAPSHOT", "jar");
verifier.verifyArtifactPresent( "org.apache.maven.its.mng0479", "a", "0.1-SNAPSHOT", "pom" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng0479", "a", "0.1-SNAPSHOT", "pom");
verifier.verifyArtifactPresent( "org.apache.maven.its.mng0479", "a-parent", "0.1-SNAPSHOT", "pom" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng0479", "a-parent", "0.1-SNAPSHOT", "pom");
verifier.verifyArtifactPresent( "org.apache.maven.its.mng0479", "b", "0.1-SNAPSHOT", "jar" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng0479", "b", "0.1-SNAPSHOT", "jar");
verifier.verifyArtifactPresent( "org.apache.maven.its.mng0479", "b", "0.1-SNAPSHOT", "pom" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng0479", "b", "0.1-SNAPSHOT", "pom");
verifier = newVerifier( new File( testDir, "test-2" ).getAbsolutePath() ); verifier = newVerifier(new File(testDir, "test-2").getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
try try {
{ verifier.addCliArgument("validate");
verifier.addCliArgument( "validate" );
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
fail( "Build should have failed to resolve parent POM" ); fail("Build should have failed to resolve parent POM");
} } catch (VerificationException e) {
catch ( VerificationException e )
{
// expected // expected
} }
verifier.verifyArtifactNotPresent( "org.apache.maven.its.mng0479", "parent", "0.1", "pom" ); verifier.verifyArtifactNotPresent("org.apache.maven.its.mng0479", "parent", "0.1", "pom");
verifier = newVerifier( new File( testDir, "test-3" ).getAbsolutePath() ); verifier = newVerifier(new File(testDir, "test-3").getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
try try {
{ verifier.addCliArgument("org.apache.maven.its.mng0479:maven-mng0479-plugin:0.1-SNAPSHOT:touch");
verifier.addCliArgument( "org.apache.maven.its.mng0479:maven-mng0479-plugin:0.1-SNAPSHOT:touch" );
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
fail( "Build should have failed to resolve direct dependency" ); fail("Build should have failed to resolve direct dependency");
} } catch (VerificationException e) {
catch ( VerificationException e )
{
// expected // expected
} }
verifier.verifyArtifactNotPresent( "org.apache.maven.its.mng0479", "a", "0.1", "jar" ); verifier.verifyArtifactNotPresent("org.apache.maven.its.mng0479", "a", "0.1", "jar");
verifier.verifyArtifactNotPresent( "org.apache.maven.its.mng0479", "a", "0.1", "pom" ); verifier.verifyArtifactNotPresent("org.apache.maven.its.mng0479", "a", "0.1", "pom");
verifier = newVerifier( new File( testDir, "test-4" ).getAbsolutePath() ); verifier = newVerifier(new File(testDir, "test-4").getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
try try {
{ verifier.addCliArgument("org.apache.maven.its.mng0479:maven-mng0479-plugin:0.1-SNAPSHOT:touch");
verifier.addCliArgument( "org.apache.maven.its.mng0479:maven-mng0479-plugin:0.1-SNAPSHOT:touch" );
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
fail( "Build should have failed to resolve transitive dependency" ); fail("Build should have failed to resolve transitive dependency");
} } catch (VerificationException e) {
catch ( VerificationException e )
{
// expected // expected
} }
verifier.verifyArtifactNotPresent( "org.apache.maven.its.mng0479", "b", "0.1", "jar" ); verifier.verifyArtifactNotPresent("org.apache.maven.its.mng0479", "b", "0.1", "jar");
verifier.verifyArtifactNotPresent( "org.apache.maven.its.mng0479", "b", "0.1", "pom" ); verifier.verifyArtifactNotPresent("org.apache.maven.its.mng0479", "b", "0.1", "pom");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenITmng0496IgnoreUnknownPluginParametersTest public class MavenITmng0496IgnoreUnknownPluginParametersTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0496IgnoreUnknownPluginParametersTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0496IgnoreUnknownPluginParametersTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -47,18 +42,15 @@ public class MavenITmng0496IgnoreUnknownPluginParametersTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG496() public void testitMNG496() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0496");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0496" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-log-file:2.1-SNAPSHOT:reset" ); verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-log-file:2.1-SNAPSHOT:reset");
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/file.txt" ); verifier.verifyFilePresent("target/file.txt");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Collection; import java.util.Collection;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -33,16 +31,13 @@ import org.junit.jupiter.api.Test;
* @author Brett Porter * @author Brett Porter
* *
*/ */
public class MavenITmng0505VersionRangeTest public class MavenITmng0505VersionRangeTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
/** /**
* Oleg 2009.04.30: the same functionality but simpler - no multiple ranges - syntax * Oleg 2009.04.30: the same functionality but simpler - no multiple ranges - syntax
* is tested in MNG-4150 * is tested in MNG-4150
*/ */
public MavenITmng0505VersionRangeTest() public MavenITmng0505VersionRangeTest() {
{ super("(,3.0-alpha-1),[3.0-alpha-3,)");
super( "(,3.0-alpha-1),[3.0-alpha-3,)" );
} }
/** /**
@ -51,28 +46,25 @@ public class MavenITmng0505VersionRangeTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG505() public void testitMNG505() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0505");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0505" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteArtifacts( "org.apache.maven.its.mng0505" ); verifier.deleteArtifacts("org.apache.maven.its.mng0505");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Collection<String> artifacts = verifier.loadLines( "target/artifacts.txt", "UTF-8" ); Collection<String> artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8");
assertEquals( 4, artifacts.size() ); assertEquals(4, artifacts.size());
assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.mng0505:a:jar:1.1" ) ); assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng0505:a:jar:1.1"));
assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.mng0505:b:jar:1.0" ) ); assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng0505:b:jar:1.0"));
assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.mng0505:c:jar:3.8" ) ); assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng0505:c:jar:3.8"));
assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.mng0505:d:jar:2.1.1" ) ); assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng0505:d:jar:2.1.1"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -33,12 +31,9 @@ import org.junit.jupiter.api.Test;
* @author Brett Porter * @author Brett Porter
* *
*/ */
public class MavenITmng0507ArtifactRelocationTest public class MavenITmng0507ArtifactRelocationTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0507ArtifactRelocationTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0507ArtifactRelocationTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -47,29 +42,26 @@ public class MavenITmng0507ArtifactRelocationTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG507() public void testitMNG507() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0507");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0507" );
Verifier verifier = newVerifier( testDir.getAbsolutePath(), "remote" ); Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote");
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteArtifacts( "org.apache.maven", "maven-core-it-support", "1.1" ); verifier.deleteArtifacts("org.apache.maven", "maven-core-it-support", "1.1");
verifier.deleteArtifacts( "org.apache.maven", "maven-core-it-support-old-location", "1.1" ); verifier.deleteArtifacts("org.apache.maven", "maven-core-it-support-old-location", "1.1");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyArtifactPresent( "org.apache.maven", "maven-core-it-support", "1.1", "jar" ); verifier.verifyArtifactPresent("org.apache.maven", "maven-core-it-support", "1.1", "jar");
verifier.verifyArtifactPresent( "org.apache.maven", "maven-core-it-support", "1.1", "pom" ); verifier.verifyArtifactPresent("org.apache.maven", "maven-core-it-support", "1.1", "pom");
verifier.verifyArtifactPresent( "org.apache.maven", "maven-core-it-support-old-location", "1.1", "pom" ); verifier.verifyArtifactPresent("org.apache.maven", "maven-core-it-support-old-location", "1.1", "pom");
verifier.verifyArtifactNotPresent( "org.apache.maven", "maven-core-it-support-old-location", "1.1", "jar" ); verifier.verifyArtifactNotPresent("org.apache.maven", "maven-core-it-support-old-location", "1.1", "jar");
List<String> artifacts = verifier.loadLines( "target/artifacts.txt", "UTF-8" ); List<String> artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8");
assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven:maven-core-it-support:jar:1.1" ) ); assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven:maven-core-it-support:jar:1.1"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenITmng0522InheritedPluginMgmtConfigTest public class MavenITmng0522InheritedPluginMgmtConfigTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0522InheritedPluginMgmtConfigTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0522InheritedPluginMgmtConfigTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -46,20 +41,17 @@ public class MavenITmng0522InheritedPluginMgmtConfigTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG522() public void testitMNG522() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0522");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0522" );
Verifier verifier = newVerifier( new File( testDir, "child-project" ).getAbsolutePath() ); Verifier verifier = newVerifier(new File(testDir, "child-project").getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "process-resources" ); verifier.addCliArgument("process-resources");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/plugin-mngt-config-1.txt" ); verifier.verifyFilePresent("target/plugin-mngt-config-1.txt");
verifier.verifyFilePresent( "target/plugin-mngt-config-2.txt" ); verifier.verifyFilePresent("target/plugin-mngt-config-2.txt");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,15 +16,15 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.eclipse.jetty.security.ConstraintMapping; import org.eclipse.jetty.security.ConstraintMapping;
import org.eclipse.jetty.security.ConstraintSecurityHandler; import org.eclipse.jetty.security.ConstraintSecurityHandler;
import org.eclipse.jetty.security.HashLoginService; import org.eclipse.jetty.security.HashLoginService;
@ -49,9 +47,7 @@ import static org.eclipse.jetty.util.security.Constraint.__BASIC_AUTH;
* *
* @author Benjamin Bentmann * @author Benjamin Bentmann
*/ */
public class MavenITmng0553SettingsAuthzEncryptionTest public class MavenITmng0553SettingsAuthzEncryptionTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
private File testDir; private File testDir;
@ -59,59 +55,52 @@ public class MavenITmng0553SettingsAuthzEncryptionTest
private int port; private int port;
public MavenITmng0553SettingsAuthzEncryptionTest() public MavenITmng0553SettingsAuthzEncryptionTest() {
{ super("[2.1.0,3.0-alpha-1),[3.0-alpha-3,)");
super( "[2.1.0,3.0-alpha-1),[3.0-alpha-3,)" );
} }
@BeforeEach @BeforeEach
protected void setUp() protected void setUp() throws Exception {
throws Exception testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0553");
{
testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0553" );
Constraint constraint = new Constraint( __BASIC_AUTH, "user" ); Constraint constraint = new Constraint(__BASIC_AUTH, "user");
constraint.setAuthenticate( true ); constraint.setAuthenticate(true);
ConstraintMapping constraintMapping = new ConstraintMapping(); ConstraintMapping constraintMapping = new ConstraintMapping();
constraintMapping.setConstraint( constraint ); constraintMapping.setConstraint(constraint);
constraintMapping.setPathSpec( "/*" ); constraintMapping.setPathSpec("/*");
HashLoginService userRealm = new HashLoginService( "TestRealm" ); HashLoginService userRealm = new HashLoginService("TestRealm");
UserStore userStore = new UserStore(); UserStore userStore = new UserStore();
userStore.addUser( "testuser", new Password( "testtest" ), new String[] { "user" } ); userStore.addUser("testuser", new Password("testtest"), new String[] {"user"});
userRealm.setUserStore( userStore ); userRealm.setUserStore(userStore);
server = new Server( 0 ); server = new Server(0);
ConstraintSecurityHandler securityHandler = new ConstraintSecurityHandler(); ConstraintSecurityHandler securityHandler = new ConstraintSecurityHandler();
securityHandler.setLoginService( userRealm ); securityHandler.setLoginService(userRealm);
securityHandler.setAuthMethod( __BASIC_AUTH ); securityHandler.setAuthMethod(__BASIC_AUTH);
securityHandler.setConstraintMappings( new ConstraintMapping[] { constraintMapping } ); securityHandler.setConstraintMappings(new ConstraintMapping[] {constraintMapping});
ResourceHandler repoHandler = new ResourceHandler(); ResourceHandler repoHandler = new ResourceHandler();
repoHandler.setResourceBase( new File( testDir, "repo" ).getAbsolutePath() ); repoHandler.setResourceBase(new File(testDir, "repo").getAbsolutePath());
HandlerList handlerList = new HandlerList(); HandlerList handlerList = new HandlerList();
handlerList.addHandler( securityHandler ); handlerList.addHandler(securityHandler);
handlerList.addHandler( repoHandler ); handlerList.addHandler(repoHandler);
handlerList.addHandler( new DefaultHandler() ); handlerList.addHandler(new DefaultHandler());
server.setHandler( handlerList ); server.setHandler(handlerList);
server.start(); server.start();
if ( server.isFailed() ) if (server.isFailed()) {
{ fail("Couldn't bind the server socket to a free port!");
fail( "Couldn't bind the server socket to a free port!" );
} }
port = ( (NetworkConnector) server.getConnectors()[0] ).getLocalPort(); port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort();
System.out.println( "Bound server socket to the port " + port ); System.out.println("Bound server socket to the port " + port);
} }
@AfterEach @AfterEach
protected void tearDown() protected void tearDown() throws Exception {
throws Exception if (server != null) {
{
if ( server != null )
{
server.stop(); server.stop();
server.join(); server.join();
} }
@ -123,27 +112,25 @@ public class MavenITmng0553SettingsAuthzEncryptionTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitBasic() public void testitBasic() throws Exception {
throws Exception testDir = new File(testDir, "test-1");
{
testDir = new File( testDir, "test-1" );
Map<String, String> filterProps = new HashMap<>(); Map<String, String> filterProps = new HashMap<>();
filterProps.put( "@port@", Integer.toString( port ) ); filterProps.put("@port@", Integer.toString(port));
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteArtifacts( "org.apache.maven.its.mng0553" ); verifier.deleteArtifacts("org.apache.maven.its.mng0553");
verifier.verifyArtifactNotPresent( "org.apache.maven.its.mng0553", "a", "0.1-SNAPSHOT", "jar" ); verifier.verifyArtifactNotPresent("org.apache.maven.its.mng0553", "a", "0.1-SNAPSHOT", "jar");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps);
setUserHome( verifier, new File( testDir, "userhome" ) ); setUserHome(verifier, new File(testDir, "userhome"));
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyArtifactPresent( "org.apache.maven.its.mng0553", "a", "0.1-SNAPSHOT", "jar" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng0553", "a", "0.1-SNAPSHOT", "jar");
} }
/** /**
@ -153,35 +140,37 @@ public class MavenITmng0553SettingsAuthzEncryptionTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitRelocation() public void testitRelocation() throws Exception {
throws Exception testDir = new File(testDir, "test-2");
{
testDir = new File( testDir, "test-2" );
Map<String, String> filterProps = new HashMap<>(); Map<String, String> filterProps = new HashMap<>();
filterProps.put( "@port@", Integer.toString( port ) ); filterProps.put("@port@", Integer.toString(port));
// NOTE: The upper-case scheme name is essential part of the test // NOTE: The upper-case scheme name is essential part of the test
String secUrl = "FILE://" + new File( testDir, "relocated-settings-security.xml" ).toURI().getRawPath(); String secUrl = "FILE://"
filterProps.put( "@relocation@", secUrl ); + new File(testDir, "relocated-settings-security.xml").toURI().getRawPath();
filterProps.put("@relocation@", secUrl);
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteArtifacts( "org.apache.maven.its.mng0553" ); verifier.deleteArtifacts("org.apache.maven.its.mng0553");
verifier.verifyArtifactNotPresent( "org.apache.maven.its.mng0553", "a", "0.1-SNAPSHOT", "jar" ); verifier.verifyArtifactNotPresent("org.apache.maven.its.mng0553", "a", "0.1-SNAPSHOT", "jar");
// NOTE: The tilde ~ in the file name is essential part of the test // NOTE: The tilde ~ in the file name is essential part of the test
verifier.filterFile( "security-template.xml", "settings~security.xml", "UTF-8", filterProps ); verifier.filterFile("security-template.xml", "settings~security.xml", "UTF-8", filterProps);
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps);
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
// NOTE: The selection of the Turkish language for the JVM locale is essential part of the test // NOTE: The selection of the Turkish language for the JVM locale is essential part of the test
verifier.setEnvironmentVariable( "MAVEN_OPTS", "-Dsettings.security=" + new File( testDir, "settings~security.xml" ).getAbsolutePath() + " -Duser.language=tr" ); verifier.setEnvironmentVariable(
verifier.addCliArgument( "validate" ); "MAVEN_OPTS",
"-Dsettings.security=" + new File(testDir, "settings~security.xml").getAbsolutePath()
+ " -Duser.language=tr");
verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyArtifactPresent( "org.apache.maven.its.mng0553", "a", "0.1-SNAPSHOT", "jar" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng0553", "a", "0.1-SNAPSHOT", "jar");
} }
/** /**
@ -190,46 +179,41 @@ public class MavenITmng0553SettingsAuthzEncryptionTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitEncryption() public void testitEncryption() throws Exception {
throws Exception requiresMavenVersion("[2.1.0,3.0-alpha-1),[3.0-alpha-7,)");
{
requiresMavenVersion( "[2.1.0,3.0-alpha-1),[3.0-alpha-7,)" );
testDir = new File( testDir, "test-3" ); testDir = new File(testDir, "test-3");
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
setUserHome( verifier, new File( testDir, "userhome" ) ); setUserHome(verifier, new File(testDir, "userhome"));
verifier.addCliArgument( "--encrypt-master-password" ); verifier.addCliArgument("--encrypt-master-password");
verifier.addCliArgument( "test" ); verifier.addCliArgument("test");
verifier.setLogFileName( "log-emp.txt" ); verifier.setLogFileName("log-emp.txt");
verifier.addCliArgument( "-e" ); verifier.addCliArgument("-e");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
List<String> log = verifier.loadLines( verifier.getLogFileName(), null ); List<String> log = verifier.loadLines(verifier.getLogFileName(), null);
assertNotNull( findPassword( log ) ); assertNotNull(findPassword(log));
verifier = newVerifier( testDir.getAbsolutePath() ); verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
setUserHome( verifier, new File( testDir, "userhome" ) ); setUserHome(verifier, new File(testDir, "userhome"));
verifier.addCliArgument( "--encrypt-password" ); verifier.addCliArgument("--encrypt-password");
verifier.addCliArgument( "testpass" ); verifier.addCliArgument("testpass");
verifier.setLogFileName( "log-ep.txt" ); verifier.setLogFileName("log-ep.txt");
verifier.addCliArgument( "-e" ); verifier.addCliArgument("-e");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
log = verifier.loadLines( verifier.getLogFileName(), null ); log = verifier.loadLines(verifier.getLogFileName(), null);
assertNotNull( findPassword( log ) ); assertNotNull(findPassword(log));
} }
private String findPassword( List<String> log ) private String findPassword(List<String> log) {
{ for (String line : log) {
for ( String line : log ) if (line.matches(".*\\{[A-Za-z0-9+/=]+\\}.*")) {
{
if ( line.matches( ".*\\{[A-Za-z0-9+/=]+\\}.*" ) )
{
return line; return line;
} }
} }
@ -237,17 +221,13 @@ public class MavenITmng0553SettingsAuthzEncryptionTest
return null; return null;
} }
private void setUserHome( Verifier verifier, File home ) private void setUserHome(Verifier verifier, File home) {
{
// NOTE: We set the user.home directory instead of say settings.security to reflect Maven's normal behavior // NOTE: We set the user.home directory instead of say settings.security to reflect Maven's normal behavior
String path = home.getAbsolutePath(); String path = home.getAbsolutePath();
if ( path.indexOf( ' ' ) < 0 ) if (path.indexOf(' ') < 0) {
{ verifier.setEnvironmentVariable("MAVEN_OPTS", "-Duser.home=" + path);
verifier.setEnvironmentVariable( "MAVEN_OPTS", "-Duser.home=" + path ); } else {
} verifier.setEnvironmentVariable("MAVEN_OPTS", "\"-Duser.home=" + path + "\"");
else
{
verifier.setEnvironmentVariable( "MAVEN_OPTS", "\"-Duser.home=" + path + "\"" );
} }
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenITmng0557UserSettingsCliOptionTest public class MavenITmng0557UserSettingsCliOptionTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0557UserSettingsCliOptionTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0557UserSettingsCliOptionTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -46,21 +41,18 @@ public class MavenITmng0557UserSettingsCliOptionTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG557() public void testitMNG557() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0557");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0557" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-touch:touch" ); verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/test.txt" ); verifier.verifyFilePresent("target/test.txt");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -34,12 +32,9 @@ import org.junit.jupiter.api.Test;
* *
*/ */
@Disabled @Disabled
public class MavenITmng0612NewestConflictResolverTest public class MavenITmng0612NewestConflictResolverTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0612NewestConflictResolverTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0612NewestConflictResolverTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -48,24 +43,22 @@ public class MavenITmng0612NewestConflictResolverTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG612() public void testitMNG612() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0612/dependency");
{ Verifier verifier = newVerifier(testDir.getAbsolutePath());
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0612/dependency" ); verifier.addCliArgument("install");
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
verifier.addCliArgument( "install" );
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0612/plugin" ); testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0612/plugin");
verifier = newVerifier( testDir.getAbsolutePath() ); verifier = newVerifier(testDir.getAbsolutePath());
verifier.addCliArgument( "install" ); verifier.addCliArgument("install");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0612/project" ); testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0612/project");
verifier = newVerifier( testDir.getAbsolutePath() ); verifier = newVerifier(testDir.getAbsolutePath());
verifier.addCliArgument( "verify" ); verifier.addCliArgument("verify");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -33,12 +31,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenITmng0666IgnoreLegacyPomTest public class MavenITmng0666IgnoreLegacyPomTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0666IgnoreLegacyPomTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0666IgnoreLegacyPomTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -48,26 +43,23 @@ public class MavenITmng0666IgnoreLegacyPomTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG666() public void testitMNG666() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0666");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0666" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteArtifacts( "org.apache.maven.its.it0059" ); verifier.deleteArtifacts("org.apache.maven.its.it0059");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
// don't verify error free log // don't verify error free log
verifier.verifyArtifactPresent( "org.apache.maven.its.it0059", "test", "3.8.1", "jar" ); verifier.verifyArtifactPresent("org.apache.maven.its.it0059", "test", "3.8.1", "jar");
List<String> artifacts = verifier.loadLines( "target/artifacts.txt", "UTF-8" ); List<String> artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8");
assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.it0059:test:jar:3.8.1" ) ); assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.it0059:test:jar:3.8.1"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Properties; import java.util.Properties;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -34,13 +32,10 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenITmng0674PluginParameterAliasTest public class MavenITmng0674PluginParameterAliasTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng0674PluginParameterAliasTest() public MavenITmng0674PluginParameterAliasTest() {
{ super("[3.0,)");
super( "[3.0,)" );
} }
/** /**
@ -49,23 +44,21 @@ public class MavenITmng0674PluginParameterAliasTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitLifecycle() public void testitLifecycle() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0674");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0674" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.setLogFileName( "log-lifecycle.txt" ); verifier.setLogFileName("log-lifecycle.txt");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Properties props = verifier.loadProperties( "target/config.properties" ); Properties props = verifier.loadProperties("target/config.properties");
assertEquals( "MNG-674-1", props.getProperty( "aliasParam" ) ); assertEquals("MNG-674-1", props.getProperty("aliasParam"));
assertEquals( "MNG-674-2", props.getProperty( "aliasDefaultExpressionParam" ) ); assertEquals("MNG-674-2", props.getProperty("aliasDefaultExpressionParam"));
assertEquals( "MNG-4997", props.getProperty( "aliasStringParams.0" ) ); assertEquals("MNG-4997", props.getProperty("aliasStringParams.0"));
} }
/** /**
@ -74,23 +67,20 @@ public class MavenITmng0674PluginParameterAliasTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitCli() public void testitCli() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0674");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0674" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.setLogFileName( "log-cli.txt" ); verifier.setLogFileName("log-cli.txt");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-configuration:config" ); verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-configuration:config");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Properties props = verifier.loadProperties( "target/config.properties" ); Properties props = verifier.loadProperties("target/config.properties");
assertEquals( "MNG-674-1", props.getProperty( "aliasParam" ) ); assertEquals("MNG-674-1", props.getProperty("aliasParam"));
assertEquals( "MNG-674-2", props.getProperty( "aliasDefaultExpressionParam" ) ); assertEquals("MNG-674-2", props.getProperty("aliasDefaultExpressionParam"));
assertEquals( "MNG-4997", props.getProperty( "aliasStringParams.0" ) ); assertEquals("MNG-4997", props.getProperty("aliasStringParams.0"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Properties; import java.util.Properties;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -33,12 +31,9 @@ import org.junit.jupiter.api.Test;
* @author Brett Porter * @author Brett Porter
* *
*/ */
public class MavenITmng0680ParentBasedirTest public class MavenITmng0680ParentBasedirTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0680ParentBasedirTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0680ParentBasedirTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -47,25 +42,22 @@ public class MavenITmng0680ParentBasedirTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG680() public void testitMNG680() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0680");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0680" );
testDir = testDir.getCanonicalFile(); testDir = testDir.getCanonicalFile();
File subDir = new File( testDir, "subproject" ); File subDir = new File(testDir, "subproject");
Verifier verifier = newVerifier( subDir.getAbsolutePath() ); Verifier verifier = newVerifier(subDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Properties props = verifier.loadProperties( "target/basedir.properties" ); Properties props = verifier.loadProperties("target/basedir.properties");
assertEquals( subDir, new File( props.getProperty( "project.basedir" ) ) ); assertEquals(subDir, new File(props.getProperty("project.basedir")));
assertEquals( testDir, new File( props.getProperty( "project.parent.basedir" ) ) ); assertEquals(testDir, new File(props.getProperty("project.parent.basedir")));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,13 +30,10 @@ import org.junit.jupiter.api.Test;
* @author Brett Porter * @author Brett Porter
* *
*/ */
public class MavenITmng0761MissingSnapshotDistRepoTest public class MavenITmng0761MissingSnapshotDistRepoTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng0761MissingSnapshotDistRepoTest() public MavenITmng0761MissingSnapshotDistRepoTest() {
{ super(ALL_MAVEN_VERSIONS);
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -48,20 +43,17 @@ public class MavenITmng0761MissingSnapshotDistRepoTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG761() public void testitMNG761() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0761");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0761" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteArtifacts( "org.apache.maven.its.mng0761" ); verifier.deleteArtifacts("org.apache.maven.its.mng0761");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/repo/org/apache/maven/its/mng0761/test/1.0-SNAPSHOT/test-1.0-*.jar" ); verifier.verifyFilePresent("target/repo/org/apache/maven/its/mng0761/test/1.0-SNAPSHOT/test-1.0-*.jar");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,10 +16,7 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.VerificationException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -34,6 +29,9 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
import org.apache.maven.shared.verifier.VerificationException;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.NetworkConnector; import org.eclipse.jetty.server.NetworkConnector;
import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Request;
@ -47,13 +45,10 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenITmng0768OfflineModeTest public class MavenITmng0768OfflineModeTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng0768OfflineModeTest() public MavenITmng0768OfflineModeTest() {
{ super(ALL_MAVEN_VERSIONS);
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -62,77 +57,68 @@ public class MavenITmng0768OfflineModeTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG768() public void testitMNG768() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0768");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0768" );
final List<String> requestedUris = Collections.synchronizedList( new ArrayList<String>() ); final List<String> requestedUris = Collections.synchronizedList(new ArrayList<String>());
Handler repoHandler = new AbstractHandler() Handler repoHandler = new AbstractHandler() {
{ public void handle(
public void handle( String target, Request baseRequest, HttpServletRequest request, String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
HttpServletResponse response ) throws IOException {
throws IOException System.out.println("Handling " + request.getMethod() + " " + request.getRequestURL());
{
System.out.println( "Handling " + request.getMethod() + " " + request.getRequestURL() );
requestedUris.add( request.getRequestURI() ); requestedUris.add(request.getRequestURI());
PrintWriter writer = response.getWriter(); PrintWriter writer = response.getWriter();
response.setStatus( HttpServletResponse.SC_OK ); response.setStatus(HttpServletResponse.SC_OK);
if ( request.getRequestURI().endsWith( ".pom" ) ) if (request.getRequestURI().endsWith(".pom")) {
{ writer.println("<project>");
writer.println( "<project>" ); writer.println(" <modelVersion>4.0.0</modelVersion>");
writer.println( " <modelVersion>4.0.0</modelVersion>" ); writer.println(" <groupId>org.apache.maven.its.mng0768</groupId>");
writer.println( " <groupId>org.apache.maven.its.mng0768</groupId>" ); writer.println(" <artifactId>dep</artifactId>");
writer.println( " <artifactId>dep</artifactId>" ); writer.println(" <version>0.1</version>");
writer.println( " <version>0.1</version>" ); writer.println("</project>");
writer.println( "</project>" ); } else if (request.getRequestURI().endsWith(".jar")) {
} writer.println("empty");
else if ( request.getRequestURI().endsWith( ".jar" ) ) } else if (request.getRequestURI().endsWith(".md5")
{ || request.getRequestURI().endsWith(".sha1")) {
writer.println( "empty" ); response.setStatus(HttpServletResponse.SC_NOT_FOUND);
}
else if ( request.getRequestURI().endsWith( ".md5" ) || request.getRequestURI().endsWith( ".sha1" ) )
{
response.setStatus( HttpServletResponse.SC_NOT_FOUND );
} }
( (Request) request ).setHandled( true ); ((Request) request).setHandled(true);
} }
}; };
Server server = new Server( 0 ); Server server = new Server(0);
server.setHandler( repoHandler ); server.setHandler(repoHandler);
try try {
{
server.start(); server.start();
if ( server.isFailed() ) if (server.isFailed()) {
{ fail("Couldn't bind the server socket to a free port!");
fail( "Couldn't bind the server socket to a free port!" );
} }
int port = ( (NetworkConnector) server.getConnectors()[0] ).getLocalPort(); int port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort();
{ {
// phase 1: run build in online mode to fill local repo // phase 1: run build in online mode to fill local repo
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteArtifacts( "org.apache.maven.its.mng0768" ); verifier.deleteArtifacts("org.apache.maven.its.mng0768");
verifier.setLogFileName( "log1.txt" ); verifier.setLogFileName("log1.txt");
Properties props = new Properties(); Properties props = new Properties();
props.put( "@port@", Integer.toString( port ) ); props.put("@port@", Integer.toString(port));
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", props ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", props);
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile" ); verifier.addCliArgument(
"org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile");
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/compile.txt" ); verifier.verifyFilePresent("target/compile.txt");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
@ -140,51 +126,48 @@ public class MavenITmng0768OfflineModeTest
{ {
// phase 2: run build in offline mode to check it still passes, without network accesses // phase 2: run build in offline mode to check it still passes, without network accesses
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "-o" ); verifier.addCliArgument("-o");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.setLogFileName( "log2.txt" ); verifier.setLogFileName("log2.txt");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile" ); verifier.addCliArgument(
"org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile");
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/compile.txt" ); verifier.verifyFilePresent("target/compile.txt");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
assertTrue( requestedUris.toString(), requestedUris.isEmpty() ); assertTrue(requestedUris.toString(), requestedUris.isEmpty());
{ {
// phase 3: delete test artifact and run build in offline mode to check it fails now // phase 3: delete test artifact and run build in offline mode to check it fails now
// NOTE: Adding the settings again to offer Maven the bad choice of using the remote repo // NOTE: Adding the settings again to offer Maven the bad choice of using the remote repo
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteArtifacts( "org.apache.maven.its.mng0768" ); verifier.deleteArtifacts("org.apache.maven.its.mng0768");
verifier.addCliArgument( "-o" ); verifier.addCliArgument("-o");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.setLogFileName( "log3.txt" ); verifier.setLogFileName("log3.txt");
try try {
{ verifier.addCliArgument(
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile" ); "org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
fail( "Build did not fail to resolve missing dependency although Maven ought to work offline!" ); fail("Build did not fail to resolve missing dependency although Maven ought to work offline!");
} } catch (VerificationException e) {
catch( VerificationException e )
{
// expected, should fail // expected, should fail
} }
} }
System.out.println( "Bound server socket to the port " + port ); System.out.println("Bound server socket to the port " + port);
assertTrue( requestedUris.toString(), requestedUris.isEmpty() ); assertTrue(requestedUris.toString(), requestedUris.isEmpty());
} } finally {
finally
{
server.stop(); server.stop();
server.join(); server.join();
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenITmng0773SettingsProfileReactorPollutionTest public class MavenITmng0773SettingsProfileReactorPollutionTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0773SettingsProfileReactorPollutionTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0773SettingsProfileReactorPollutionTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -46,18 +41,15 @@ public class MavenITmng0773SettingsProfileReactorPollutionTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG773() public void testitMNG773() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0773");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0773" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenITmng0781PluginConfigVsExecConfigTest public class MavenITmng0781PluginConfigVsExecConfigTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0781PluginConfigVsExecConfigTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0781PluginConfigVsExecConfigTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -47,20 +42,17 @@ public class MavenITmng0781PluginConfigVsExecConfigTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG0781() public void testitMNG0781() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0781");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0781" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "process-resources" ); verifier.addCliArgument("process-resources");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/exec-level.txt" ); verifier.verifyFilePresent("target/exec-level.txt");
verifier.verifyFilePresent( "target/resources-resources.txt" ); verifier.verifyFilePresent("target/resources-resources.txt");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenITmng0786ProfileAwareReactorTest public class MavenITmng0786ProfileAwareReactorTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0786ProfileAwareReactorTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0786ProfileAwareReactorTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -47,22 +42,19 @@ public class MavenITmng0786ProfileAwareReactorTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG0786() public void testitMNG0786() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0786");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0786" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "sub1/target" ); verifier.deleteDirectory("sub1/target");
verifier.deleteDirectory( "sub2/target" ); verifier.deleteDirectory("sub2/target");
verifier.addCliArgument( "-Dexpression.outputFile=target/expression.properties" ); verifier.addCliArgument("-Dexpression.outputFile=target/expression.properties");
verifier.addCliArgument( "-Dactivate=anything" ); verifier.addCliArgument("-Dactivate=anything");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-expression:2.1-SNAPSHOT:eval" ); verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-expression:2.1-SNAPSHOT:eval");
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "sub1/target/expression.properties" ); verifier.verifyFilePresent("sub1/target/expression.properties");
verifier.verifyFilePresent( "sub2/target/expression.properties" ); verifier.verifyFilePresent("sub2/target/expression.properties");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Properties; import java.util.Properties;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -33,12 +31,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenITmng0814ExplicitProfileActivationTest public class MavenITmng0814ExplicitProfileActivationTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0814ExplicitProfileActivationTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0814ExplicitProfileActivationTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -47,22 +42,19 @@ public class MavenITmng0814ExplicitProfileActivationTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG814() public void testitMNG814() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0814");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0814" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "-P" ); verifier.addCliArgument("-P");
verifier.addCliArgument( "test-profile" ); verifier.addCliArgument("test-profile");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Properties props = verifier.loadProperties( "target/profile.properties" ); Properties props = verifier.loadProperties("target/profile.properties");
assertEquals( "PASSED", props.getProperty( "project.properties.testProp" ) ); assertEquals("PASSED", props.getProperty("project.properties.testProp"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,14 +16,14 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -34,12 +32,9 @@ import org.junit.jupiter.api.Test;
* @author Brett Porter * @author Brett Porter
* *
*/ */
public class MavenITmng0818WarDepsNotTransitiveTest public class MavenITmng0818WarDepsNotTransitiveTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0818WarDepsNotTransitiveTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0818WarDepsNotTransitiveTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -48,24 +43,21 @@ public class MavenITmng0818WarDepsNotTransitiveTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG0818() public void testitMNG0818() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0818");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0818" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteArtifacts( "org.apache.maven.its.it0080" ); verifier.deleteArtifacts("org.apache.maven.its.it0080");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Collection<String> artifacts = verifier.loadLines( "target/artifacts.txt", "UTF-8" ); Collection<String> artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8");
assertEquals( Collections.singletonList( "org.apache.maven.its.it0080:war:war:0.1" ), artifacts ); assertEquals(Collections.singletonList("org.apache.maven.its.it0080:war:war:0.1"), artifacts);
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Collection; import java.util.Collection;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -33,12 +31,9 @@ import org.junit.jupiter.api.Test;
* @author Brett Porter * @author Brett Porter
* *
*/ */
public class MavenITmng0820ConflictResolutionTest public class MavenITmng0820ConflictResolutionTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0820ConflictResolutionTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0820ConflictResolutionTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -47,28 +42,25 @@ public class MavenITmng0820ConflictResolutionTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG0820() public void testitMNG0820() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0820");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0820" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteArtifacts( "org.apache.maven.its.mng0820" ); verifier.deleteArtifacts("org.apache.maven.its.mng0820");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Collection<String> artifacts = verifier.loadLines( "target/artifacts.txt", "UTF-8" ); Collection<String> artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8");
assertEquals( 3, artifacts.size() ); assertEquals(3, artifacts.size());
assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.mng0820:d:jar:2.0" ) ); assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng0820:d:jar:2.0"));
assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.mng0820:c:jar:1.4" ) ); assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng0820:c:jar:1.4"));
assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.mng0820:a:jar:1.0" ) ); assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng0820:a:jar:1.0"));
assertFalse( artifacts.toString(), artifacts.contains( "org.apache.maven.its.mng0505:b:jar:1.0" ) ); assertFalse(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng0505:b:jar:1.0"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,14 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Arrays;
import java.util.List;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -34,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenITmng0823MojoContextPassingTest public class MavenITmng0823MojoContextPassingTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0823MojoContextPassingTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0823MojoContextPassingTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -48,19 +41,17 @@ public class MavenITmng0823MojoContextPassingTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG0823() public void testitMNG0823() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0823");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0823" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArguments( "org.apache.maven.its.plugins:maven-it-plugin-context-passing:throw", verifier.addCliArguments(
"org.apache.maven.its.plugins:maven-it-plugin-context-passing:catch" ); "org.apache.maven.its.plugins:maven-it-plugin-context-passing:throw",
"org.apache.maven.its.plugins:maven-it-plugin-context-passing:catch");
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/thrown-value" ); verifier.verifyFilePresent("target/thrown-value");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,9 +16,7 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -28,6 +24,8 @@ import java.util.Date;
import java.util.Locale; import java.util.Locale;
import org.apache.maven.shared.utils.io.FileUtils; import org.apache.maven.shared.utils.io.FileUtils;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -35,15 +33,12 @@ import org.junit.jupiter.api.Test;
* *
* @author Slawomir Jaranowski * @author Slawomir Jaranowski
*/ */
public class MavenITmng0828PluginConfigValuesInDebugTest public class MavenITmng0828PluginConfigValuesInDebugTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
private static final String NL = System.lineSeparator(); private static final String NL = System.lineSeparator();
public MavenITmng0828PluginConfigValuesInDebugTest() public MavenITmng0828PluginConfigValuesInDebugTest() {
{ super(ALL_MAVEN_VERSIONS);
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -52,70 +47,70 @@ public class MavenITmng0828PluginConfigValuesInDebugTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG0828() public void testitMNG0828() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0828");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0828" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "-X" ); verifier.addCliArgument("-X");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
String log = FileUtils.fileRead( new File( verifier.getBasedir(), verifier.getLogFileName() ) ); String log = FileUtils.fileRead(new File(verifier.getBasedir(), verifier.getLogFileName()));
checkLog( log, "[DEBUG] (f) aliasDefaultExpressionParam = test" ); checkLog(log, "[DEBUG] (f) aliasDefaultExpressionParam = test");
checkLog( log, "[DEBUG] (f) basedir = " + testDir.getCanonicalPath() ); checkLog(log, "[DEBUG] (f) basedir = " + testDir.getCanonicalPath());
checkLog( log, checkLog(
"[DEBUG] (f) beanParam = org.apache.maven.plugin.coreit.Bean[fieldParam=field, setterParam=setter, setterCalled=true]" ); log,
checkLog( log, "[DEBUG] (f) booleanParam = true" ); "[DEBUG] (f) beanParam = org.apache.maven.plugin.coreit.Bean[fieldParam=field, setterParam=setter, setterCalled=true]");
checkLog( log, "[DEBUG] (f) byteParam = 42" ); checkLog(log, "[DEBUG] (f) booleanParam = true");
checkLog( log, "[DEBUG] (f) byteParam = 42" ); checkLog(log, "[DEBUG] (f) byteParam = 42");
checkLog( log, "[DEBUG] (f) characterParam = X" ); checkLog(log, "[DEBUG] (f) byteParam = 42");
checkLog(log, "[DEBUG] (f) characterParam = X");
Date date = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss.S a", Locale.US ).parse( "2008-11-09 11:59:03.0 AM" ); Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S a", Locale.US).parse("2008-11-09 11:59:03.0 AM");
checkLog( log, "[DEBUG] (f) dateParam = " + date ); checkLog(log, "[DEBUG] (f) dateParam = " + date);
checkLog( log, "[DEBUG] (f) defaultParam = maven-core-it" ); checkLog(log, "[DEBUG] (f) defaultParam = maven-core-it");
checkLog( log, "[DEBUG] (f) defaultParamWithExpression = org.apache.maven.its.mng0828:test1:1.0-SNAPSHOT" ); checkLog(log, "[DEBUG] (f) defaultParamWithExpression = org.apache.maven.its.mng0828:test1:1.0-SNAPSHOT");
// new line of dumping dom is not guaranteed, but all items should be present // new line of dumping dom is not guaranteed, but all items should be present
checkLog( log, "[DEBUG] (f) domParam = <domParam><echo>one</echo>" ); checkLog(log, "[DEBUG] (f) domParam = <domParam><echo>one</echo>");
checkLog( log, "<echo>two</echo>" ); checkLog(log, "<echo>two</echo>");
checkLog( log, "<echo>three</echo>" ); checkLog(log, "<echo>three</echo>");
checkLog( log, "<echo>four</echo>" ); checkLog(log, "<echo>four</echo>");
checkLog( log, "</domParam>" ); checkLog(log, "</domParam>");
checkLog( log, "[DEBUG] (f) doubleParam = -1.5" ); checkLog(log, "[DEBUG] (f) doubleParam = -1.5");
checkLog( log, "[DEBUG] (f) fieldParam = field" ); checkLog(log, "[DEBUG] (f) fieldParam = field");
checkLog( log, "[DEBUG] (f) fileParam = " + new File( testDir, "pom.xml" ).getCanonicalPath() ); checkLog(log, "[DEBUG] (f) fileParam = " + new File(testDir, "pom.xml").getCanonicalPath());
checkLog( log, "[DEBUG] (f) floatParam = 0.0" ); checkLog(log, "[DEBUG] (f) floatParam = 0.0");
checkLog( log, "[DEBUG] (f) integerParam = 0" ); checkLog(log, "[DEBUG] (f) integerParam = 0");
checkLog( log, "[DEBUG] (f) listParam = [one, two, three, four]" ); checkLog(log, "[DEBUG] (f) listParam = [one, two, three, four]");
checkLog( log, "[DEBUG] (f) longParam = 9876543210" ); checkLog(log, "[DEBUG] (f) longParam = 9876543210");
// Map items order is not guaranteed, so only check begin of params ... // Map items order is not guaranteed, so only check begin of params ...
checkLog( log, "[DEBUG] (f) mapParam = {key" ); checkLog(log, "[DEBUG] (f) mapParam = {key");
checkLog( log, "[DEBUG] (f) propertiesFile = " checkLog(
+ new File( testDir, "target/plugin-config.properties" ).getCanonicalPath() ); log,
"[DEBUG] (f) propertiesFile = "
+ new File(testDir, "target/plugin-config.properties").getCanonicalPath());
// Properties item order is not guaranteed, so only check begin of params ... // Properties item order is not guaranteed, so only check begin of params ...
checkLog( log, "[DEBUG] (f) propertiesParam = {key" ); checkLog(log, "[DEBUG] (f) propertiesParam = {key");
checkLog( log, "[DEBUG] (f) setParam = [item]" ); checkLog(log, "[DEBUG] (f) setParam = [item]");
checkLog( log, "[DEBUG] (f) shortParam = -12345" ); checkLog(log, "[DEBUG] (f) shortParam = -12345");
checkLog( log, "[DEBUG] (f) stringParam = Hello World!" ); checkLog(log, "[DEBUG] (f) stringParam = Hello World!");
checkLog( log, "[DEBUG] (f) stringParams = [one, two, three, four]" ); checkLog(log, "[DEBUG] (f) stringParams = [one, two, three, four]");
checkLog( log, "[DEBUG] (f) urlParam = http://maven.apache.org/" ); checkLog(log, "[DEBUG] (f) urlParam = http://maven.apache.org/");
checkLog( log, "[DEBUG] (s) setterParam = setter" ); checkLog(log, "[DEBUG] (s) setterParam = setter");
} }
private void checkLog( String log, String expected ) private void checkLog(String log, String expected) {
{ assertTrue(
assertTrue( NL + ">>>" + NL + log + "<<<" + NL + NL + "does not contains: " + NL + expected + NL, NL + ">>>" + NL + log + "<<<" + NL + NL + "does not contains: " + NL + expected + NL,
log.contains( expected ) ); log.contains(expected));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.VerificationException;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.VerificationException;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -33,12 +31,9 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenITmng0836PluginParentResolutionTest public class MavenITmng0836PluginParentResolutionTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0836PluginParentResolutionTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0836PluginParentResolutionTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -49,39 +44,30 @@ public class MavenITmng0836PluginParentResolutionTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG836() public void testitMNG836() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0836");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0836" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteArtifacts( "org.apache.maven.its.mng836" ); verifier.deleteArtifacts("org.apache.maven.its.mng836");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
// Maven 3.x aims to separate plugins and project dependencies (MNG-4191) // Maven 3.x aims to separate plugins and project dependencies (MNG-4191)
if ( matchesVersionRange( "(,3.0-alpha-1),(3.0-alpha-1,3.0-alpha-7)" ) ) if (matchesVersionRange("(,3.0-alpha-1),(3.0-alpha-1,3.0-alpha-7)")) {
{ verifier.addCliArgument("validate");
verifier.addCliArgument( "validate" );
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} } else {
else try {
{ verifier.addCliArgument("validate");
try
{
verifier.addCliArgument( "validate" );
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
fail( "Plugin parent POM was erroneously resolved from non-plugin repository." ); fail("Plugin parent POM was erroneously resolved from non-plugin repository.");
} } catch (VerificationException e) {
catch ( VerificationException e )
{
// expected // expected
} }
} }
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Properties; import java.util.Properties;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -33,13 +31,10 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenITmng0848UserPropertyOverridesDefaultValueTest public class MavenITmng0848UserPropertyOverridesDefaultValueTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng0848UserPropertyOverridesDefaultValueTest() public MavenITmng0848UserPropertyOverridesDefaultValueTest() {
{ super(ALL_MAVEN_VERSIONS);
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -48,22 +43,19 @@ public class MavenITmng0848UserPropertyOverridesDefaultValueTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG848() public void testitMNG848() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0848");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0848" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "-Dconfig.aliasDefaultExpressionParam=PASSED" ); verifier.addCliArgument("-Dconfig.aliasDefaultExpressionParam=PASSED");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Properties configProps = verifier.loadProperties( "target/config.properties" ); Properties configProps = verifier.loadProperties("target/config.properties");
assertEquals( "maven-core-it", configProps.getProperty( "defaultParam" ) ); assertEquals("maven-core-it", configProps.getProperty("defaultParam"));
assertEquals( "PASSED", configProps.getProperty( "aliasDefaultExpressionParam" ) ); assertEquals("PASSED", configProps.getProperty("aliasDefaultExpressionParam"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Properties; import java.util.Properties;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -34,13 +32,10 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenITmng0866EvaluateDefaultValueTest public class MavenITmng0866EvaluateDefaultValueTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng0866EvaluateDefaultValueTest() public MavenITmng0866EvaluateDefaultValueTest() {
{ super(ALL_MAVEN_VERSIONS);
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -49,21 +44,20 @@ public class MavenITmng0866EvaluateDefaultValueTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG866() public void testitMNG866() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0866");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0866" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Properties configProps = verifier.loadProperties( "target/config.properties" ); Properties configProps = verifier.loadProperties("target/config.properties");
assertEquals( "maven-core-it", configProps.getProperty( "defaultParam" ) ); assertEquals("maven-core-it", configProps.getProperty("defaultParam"));
assertEquals( "org.apache.maven.its.mng0866:test:1.0-SNAPSHOT", configProps.getProperty( "defaultParamWithExpression" ) ); assertEquals(
"org.apache.maven.its.mng0866:test:1.0-SNAPSHOT",
configProps.getProperty("defaultParamWithExpression"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,13 +30,10 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenITmng0870ReactorAwarePluginDiscoveryTest public class MavenITmng0870ReactorAwarePluginDiscoveryTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng0870ReactorAwarePluginDiscoveryTest() public MavenITmng0870ReactorAwarePluginDiscoveryTest() {
{ super(ALL_MAVEN_VERSIONS);
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -48,23 +43,20 @@ public class MavenITmng0870ReactorAwarePluginDiscoveryTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG0870() public void testitMNG0870() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0870");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0870" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "project/target" ); verifier.deleteDirectory("project/target");
verifier.deleteArtifacts( "org.apache.maven.its.mng0870" ); verifier.deleteArtifacts("org.apache.maven.its.mng0870");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "initialize" ); verifier.addCliArgument("initialize");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "project/target/touch.txt" ); verifier.verifyFilePresent("project/target/touch.txt");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,13 +30,10 @@ import org.junit.jupiter.api.Test;
* *
* @author Benjamin Bentmann * @author Benjamin Bentmann
*/ */
public class MavenITmng0947OptionalDependencyTest public class MavenITmng0947OptionalDependencyTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng0947OptionalDependencyTest() public MavenITmng0947OptionalDependencyTest() {
{ super(ALL_MAVEN_VERSIONS);
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -48,40 +43,37 @@ public class MavenITmng0947OptionalDependencyTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit() public void testit() throws Exception {
throws Exception failingMavenVersions("(,3.1.0-alpha-1)");
{
failingMavenVersions( "(,3.1.0-alpha-1)" );
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0947" ); File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0947");
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteArtifacts( "org.apache.maven.its.mng0947" ); verifier.deleteArtifacts("org.apache.maven.its.mng0947");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
List<String> compile = verifier.loadLines( "target/compile.txt", "UTF-8" ); List<String> compile = verifier.loadLines("target/compile.txt", "UTF-8");
assertTrue( compile.toString(), compile.contains( "org.apache.maven.its.mng0947:d:jar:0.1 (optional)" ) ); assertTrue(compile.toString(), compile.contains("org.apache.maven.its.mng0947:d:jar:0.1 (optional)"));
assertTrue( compile.toString(), compile.contains( "org.apache.maven.its.mng0947:e:jar:0.1 (optional)" ) ); assertTrue(compile.toString(), compile.contains("org.apache.maven.its.mng0947:e:jar:0.1 (optional)"));
assertEquals( 2, compile.size() ); assertEquals(2, compile.size());
List<String> runtime = verifier.loadLines( "target/runtime.txt", "UTF-8" ); List<String> runtime = verifier.loadLines("target/runtime.txt", "UTF-8");
assertTrue( runtime.toString(), runtime.contains( "org.apache.maven.its.mng0947:c:jar:0.1" ) ); assertTrue(runtime.toString(), runtime.contains("org.apache.maven.its.mng0947:c:jar:0.1"));
assertTrue( runtime.toString(), runtime.contains( "org.apache.maven.its.mng0947:d:jar:0.1 (optional)" ) ); assertTrue(runtime.toString(), runtime.contains("org.apache.maven.its.mng0947:d:jar:0.1 (optional)"));
assertTrue( runtime.toString(), runtime.contains( "org.apache.maven.its.mng0947:e:jar:0.1 (optional)" ) ); assertTrue(runtime.toString(), runtime.contains("org.apache.maven.its.mng0947:e:jar:0.1 (optional)"));
assertEquals( 3, runtime.size() ); assertEquals(3, runtime.size());
List<String> test = verifier.loadLines( "target/test.txt", "UTF-8" ); List<String> test = verifier.loadLines("target/test.txt", "UTF-8");
assertTrue( test.toString(), test.contains( "org.apache.maven.its.mng0947:c:jar:0.1" ) ); assertTrue(test.toString(), test.contains("org.apache.maven.its.mng0947:c:jar:0.1"));
assertTrue( test.toString(), test.contains( "org.apache.maven.its.mng0947:d:jar:0.1 (optional)" ) ); assertTrue(test.toString(), test.contains("org.apache.maven.its.mng0947:d:jar:0.1 (optional)"));
assertTrue( test.toString(), test.contains( "org.apache.maven.its.mng0947:e:jar:0.1 (optional)" ) ); assertTrue(test.toString(), test.contains("org.apache.maven.its.mng0947:e:jar:0.1 (optional)"));
assertEquals( 3, test.size() ); assertEquals(3, test.size());
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Properties; import java.util.Properties;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -33,12 +31,9 @@ import org.junit.jupiter.api.Test;
* @author Brett Porter * @author Brett Porter
* *
*/ */
public class MavenITmng0956ComponentInjectionViaProjectLevelPluginDepTest public class MavenITmng0956ComponentInjectionViaProjectLevelPluginDepTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0956ComponentInjectionViaProjectLevelPluginDepTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0956ComponentInjectionViaProjectLevelPluginDepTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -47,23 +42,20 @@ public class MavenITmng0956ComponentInjectionViaProjectLevelPluginDepTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG0956() public void testitMNG0956() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0956");
{ Verifier verifier = newVerifier(testDir.getAbsolutePath());
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0956" ); verifier.setAutoclean(false);
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.deleteArtifacts("org.apache.maven.its.mng0956");
verifier.deleteDirectory( "target" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.deleteArtifacts( "org.apache.maven.its.mng0956" ); verifier.addCliArgument("--settings");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("validate");
verifier.addCliArgument( "settings.xml" );
verifier.addCliArgument( "validate" );
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Properties apiProps = verifier.loadProperties( "target/component.properties" ); Properties apiProps = verifier.loadProperties("target/component.properties");
assertEquals( "true", apiProps.getProperty( "org.apache.maven.plugin.coreit.DefaultTestComponent" ) ); assertEquals("true", apiProps.getProperty("org.apache.maven.plugin.coreit.DefaultTestComponent"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenITmng0985NonExecutedPluginMgmtGoalsTest public class MavenITmng0985NonExecutedPluginMgmtGoalsTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng0985NonExecutedPluginMgmtGoalsTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng0985NonExecutedPluginMgmtGoalsTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -48,17 +43,14 @@ public class MavenITmng0985NonExecutedPluginMgmtGoalsTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG0985() public void testitMNG0985() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0985");
{ Verifier verifier = newVerifier(testDir.getAbsolutePath());
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0985" ); verifier.setAutoclean(false);
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.addCliArgument("initialize");
verifier.deleteDirectory( "target" );
verifier.addCliArgument( "initialize" );
verifier.execute(); verifier.execute();
verifier.verifyFileNotPresent( "target/unexpected.txt" ); verifier.verifyFileNotPresent("target/unexpected.txt");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenITmng1021EqualAttachmentBuildNumberTest public class MavenITmng1021EqualAttachmentBuildNumberTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng1021EqualAttachmentBuildNumberTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng1021EqualAttachmentBuildNumberTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -47,54 +42,48 @@ public class MavenITmng1021EqualAttachmentBuildNumberTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG1021() public void testitMNG1021() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1021");
{ Verifier verifier = newVerifier(testDir.getAbsolutePath());
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-1021" ); verifier.setAutoclean(false);
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); verifier.deleteDirectory("repo");
verifier.setAutoclean( false ); verifier.deleteArtifacts("org.apache.maven.its.mng1021");
verifier.deleteDirectory( "repo" ); verifier.addCliArgument("initialize");
verifier.deleteArtifacts( "org.apache.maven.its.mng1021" );
verifier.addCliArgument( "initialize" );
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyArtifactPresent( "org.apache.maven.its.mng1021", "test", "1-SNAPSHOT", "pom" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng1021", "test", "1-SNAPSHOT", "pom");
verifier.verifyArtifactPresent( "org.apache.maven.its.mng1021", "test", "1-SNAPSHOT", "jar" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng1021", "test", "1-SNAPSHOT", "jar");
String dir = "repo/org/apache/maven/its/mng1021/test/"; String dir = "repo/org/apache/maven/its/mng1021/test/";
String snapshot = getSnapshotVersion( new File( testDir, dir + "1-SNAPSHOT" ) ); String snapshot = getSnapshotVersion(new File(testDir, dir + "1-SNAPSHOT"));
assertTrue( snapshot, snapshot.endsWith( "-1" ) ); assertTrue(snapshot, snapshot.endsWith("-1"));
verifier.verifyFilePresent( dir + "maven-metadata.xml" ); verifier.verifyFilePresent(dir + "maven-metadata.xml");
verifier.verifyFilePresent( dir + "maven-metadata.xml.md5" ); verifier.verifyFilePresent(dir + "maven-metadata.xml.md5");
verifier.verifyFilePresent( dir + "maven-metadata.xml.sha1" ); verifier.verifyFilePresent(dir + "maven-metadata.xml.sha1");
verifier.verifyFilePresent( dir + "1-SNAPSHOT/maven-metadata.xml" ); verifier.verifyFilePresent(dir + "1-SNAPSHOT/maven-metadata.xml");
verifier.verifyFilePresent( dir + "1-SNAPSHOT/maven-metadata.xml.md5" ); verifier.verifyFilePresent(dir + "1-SNAPSHOT/maven-metadata.xml.md5");
verifier.verifyFilePresent( dir + "1-SNAPSHOT/maven-metadata.xml.sha1" ); verifier.verifyFilePresent(dir + "1-SNAPSHOT/maven-metadata.xml.sha1");
verifier.verifyFilePresent( dir + "1-SNAPSHOT/test-" + snapshot + ".pom" ); verifier.verifyFilePresent(dir + "1-SNAPSHOT/test-" + snapshot + ".pom");
verifier.verifyFilePresent( dir + "1-SNAPSHOT/test-" + snapshot + ".pom.md5" ); verifier.verifyFilePresent(dir + "1-SNAPSHOT/test-" + snapshot + ".pom.md5");
verifier.verifyFilePresent( dir + "1-SNAPSHOT/test-" + snapshot + ".pom.sha1" ); verifier.verifyFilePresent(dir + "1-SNAPSHOT/test-" + snapshot + ".pom.sha1");
verifier.verifyFilePresent( dir + "1-SNAPSHOT/test-" + snapshot + ".jar" ); verifier.verifyFilePresent(dir + "1-SNAPSHOT/test-" + snapshot + ".jar");
verifier.verifyFilePresent( dir + "1-SNAPSHOT/test-" + snapshot + ".jar.md5" ); verifier.verifyFilePresent(dir + "1-SNAPSHOT/test-" + snapshot + ".jar.md5");
verifier.verifyFilePresent( dir + "1-SNAPSHOT/test-" + snapshot + ".jar.sha1" ); verifier.verifyFilePresent(dir + "1-SNAPSHOT/test-" + snapshot + ".jar.sha1");
verifier.verifyFilePresent( dir + "1-SNAPSHOT/test-" + snapshot + "-it.jar" ); verifier.verifyFilePresent(dir + "1-SNAPSHOT/test-" + snapshot + "-it.jar");
verifier.verifyFilePresent( dir + "1-SNAPSHOT/test-" + snapshot + "-it.jar.md5" ); verifier.verifyFilePresent(dir + "1-SNAPSHOT/test-" + snapshot + "-it.jar.md5");
verifier.verifyFilePresent( dir + "1-SNAPSHOT/test-" + snapshot + "-it.jar.sha1" ); verifier.verifyFilePresent(dir + "1-SNAPSHOT/test-" + snapshot + "-it.jar.sha1");
} }
private String getSnapshotVersion( File artifactDir ) private String getSnapshotVersion(File artifactDir) {
{
File[] files = artifactDir.listFiles(); File[] files = artifactDir.listFiles();
for ( File file : files ) for (File file : files) {
{
String name = file.getName(); String name = file.getName();
if ( name.endsWith( ".pom" ) ) if (name.endsWith(".pom")) {
{ return name.substring("test-".length(), name.length() - ".pom".length());
return name.substring( "test-".length(), name.length() - ".pom".length() );
} }
} }
throw new IllegalStateException( "POM not found in " + artifactDir ); throw new IllegalStateException("POM not found in " + artifactDir);
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,12 +30,9 @@ import org.junit.jupiter.api.Test;
* @author John Casey * @author John Casey
* *
*/ */
public class MavenITmng1052PluginMgmtConfigTest public class MavenITmng1052PluginMgmtConfigTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng1052PluginMgmtConfigTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng1052PluginMgmtConfigTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -48,18 +43,15 @@ public class MavenITmng1052PluginMgmtConfigTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG1052() public void testitMNG1052() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1052");
{ Verifier verifier = newVerifier(testDir.getAbsolutePath());
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-1052" ); verifier.setAutoclean(false);
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); verifier.deleteDirectory("target");
verifier.setAutoclean( false ); verifier.addCliArgument("process-resources");
verifier.deleteDirectory( "target" );
verifier.addCliArgument( "process-resources" );
verifier.execute(); verifier.execute();
verifier.verifyFilePresent( "target/plugin-management.txt" ); verifier.verifyFilePresent("target/plugin-management.txt");
verifier.verifyFileNotPresent( "target/resources-resources.txt" ); verifier.verifyFileNotPresent("target/resources-resources.txt");
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -31,13 +29,10 @@ import org.junit.jupiter.api.Test;
* *
* @author Benjamin Bentmann * @author Benjamin Bentmann
*/ */
public class MavenITmng1073AggregatorForksReactorTest public class MavenITmng1073AggregatorForksReactorTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng1073AggregatorForksReactorTest() public MavenITmng1073AggregatorForksReactorTest() {
{ super(ALL_MAVEN_VERSIONS);
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -46,27 +41,26 @@ public class MavenITmng1073AggregatorForksReactorTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitForkLifecycle() public void testitForkLifecycle() throws Exception {
throws Exception
{
// excluded 2.1.x and 2.2.x due to MNG-4325 // excluded 2.1.x and 2.2.x due to MNG-4325
requiresMavenVersion( "[2.0,2.1.0),[3.0-alpha-3,)" ); requiresMavenVersion("[2.0,2.1.0),[3.0-alpha-3,)");
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-1073" ); File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1073");
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteDirectory( "sub-1/target" ); verifier.deleteDirectory("sub-1/target");
verifier.deleteDirectory( "sub-2/target" ); verifier.deleteDirectory("sub-2/target");
verifier.setLogFileName( "log-lifecycle.txt" ); verifier.setLogFileName("log-lifecycle.txt");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-fork:2.1-SNAPSHOT:fork-lifecycle-aggregator" ); verifier.addCliArgument(
"org.apache.maven.its.plugins:maven-it-plugin-fork:2.1-SNAPSHOT:fork-lifecycle-aggregator");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/forked/touch.txt" ); verifier.verifyFilePresent("target/forked/touch.txt");
verifier.verifyFilePresent( "sub-1/target/forked/touch.txt" ); verifier.verifyFilePresent("sub-1/target/forked/touch.txt");
verifier.verifyFilePresent( "sub-2/target/forked/touch.txt" ); verifier.verifyFilePresent("sub-2/target/forked/touch.txt");
} }
/** /**
@ -75,24 +69,21 @@ public class MavenITmng1073AggregatorForksReactorTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitForkGoal() public void testitForkGoal() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1073");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-1073" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteDirectory( "sub-1/target" ); verifier.deleteDirectory("sub-1/target");
verifier.deleteDirectory( "sub-2/target" ); verifier.deleteDirectory("sub-2/target");
verifier.setLogFileName( "log-goal.txt" ); verifier.setLogFileName("log-goal.txt");
verifier.addCliArgument( "org.apache.maven.its.plugins:maven-it-plugin-fork:2.1-SNAPSHOT:fork-goal-aggregator" ); verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-fork:2.1-SNAPSHOT:fork-goal-aggregator");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/touch.txt" ); verifier.verifyFilePresent("target/touch.txt");
verifier.verifyFilePresent( "sub-1/target/touch.txt" ); verifier.verifyFilePresent("sub-1/target/touch.txt");
verifier.verifyFilePresent( "sub-2/target/touch.txt" ); verifier.verifyFilePresent("sub-2/target/touch.txt");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,13 +30,10 @@ import org.junit.jupiter.api.Test;
* @author Brett Porter * @author Brett Porter
* *
*/ */
public class MavenITmng1088ReactorPluginResolutionTest public class MavenITmng1088ReactorPluginResolutionTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng1088ReactorPluginResolutionTest() public MavenITmng1088ReactorPluginResolutionTest() {
{ super(ALL_MAVEN_VERSIONS);
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -49,24 +44,21 @@ public class MavenITmng1088ReactorPluginResolutionTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG1088() public void testitMNG1088() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1088");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-1088" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "client/target" ); verifier.deleteDirectory("client/target");
verifier.deleteArtifacts( "org.apache.maven.its.mng1088" ); verifier.deleteArtifacts("org.apache.maven.its.mng1088");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
// NOTE: It's essential part of the test to invoke a phase before "compile" // NOTE: It's essential part of the test to invoke a phase before "compile"
verifier.addCliArgument( "initialize" ); verifier.addCliArgument("initialize");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "client/target/touch.txt" ); verifier.verifyFilePresent("client/target/touch.txt");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,13 +30,10 @@ import org.junit.jupiter.api.Test;
* *
* @author Benjamin Bentmann * @author Benjamin Bentmann
*/ */
public class MavenITmng1142VersionRangeIntersectionTest public class MavenITmng1142VersionRangeIntersectionTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng1142VersionRangeIntersectionTest() public MavenITmng1142VersionRangeIntersectionTest() {
{ super("[2.0.7,3.0-alpha-1),[3.0,)");
super( "[2.0.7,3.0-alpha-1),[3.0,)" );
} }
/** /**
@ -48,10 +43,8 @@ public class MavenITmng1142VersionRangeIntersectionTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitAB() public void testitAB() throws Exception {
throws Exception testit("test-ab");
{
testit( "test-ab" );
} }
/** /**
@ -61,33 +54,28 @@ public class MavenITmng1142VersionRangeIntersectionTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitBA() public void testitBA() throws Exception {
throws Exception testit("test-ba");
{
testit( "test-ba" );
} }
private void testit( String project ) private void testit(String project) throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1142");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-1142" );
Verifier verifier = newVerifier( new File( testDir, project ).getAbsolutePath() ); Verifier verifier = newVerifier(new File(testDir, project).getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteArtifacts( "org.apache.maven.its.mng1142" ); verifier.deleteArtifacts("org.apache.maven.its.mng1142");
verifier.addCliArgument( "-s" ); verifier.addCliArgument("-s");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.filterFile( "../settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
List<String> classpath = verifier.loadLines( "target/classpath.txt", "UTF-8" ); List<String> classpath = verifier.loadLines("target/classpath.txt", "UTF-8");
assertFalse( classpath.toString(), classpath.contains( "a-1.1.2.jar" ) ); assertFalse(classpath.toString(), classpath.contains("a-1.1.2.jar"));
assertTrue( classpath.toString(), classpath.contains( "a-1.1.1.jar" ) ); assertTrue(classpath.toString(), classpath.contains("a-1.1.1.jar"));
assertTrue( classpath.toString(), classpath.contains( "b-0.1.jar" ) ); assertTrue(classpath.toString(), classpath.contains("b-0.1.jar"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Collections;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,13 +29,10 @@ import org.junit.jupiter.api.Test;
* *
* @author Benjamin Bentmann * @author Benjamin Bentmann
*/ */
public class MavenITmng1144MultipleDefaultGoalsTest public class MavenITmng1144MultipleDefaultGoalsTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng1144MultipleDefaultGoalsTest() public MavenITmng1144MultipleDefaultGoalsTest() {
{ super("[3.0-alpha-7,)");
super( "[3.0-alpha-7,)" );
} }
/** /**
@ -47,19 +41,16 @@ public class MavenITmng1144MultipleDefaultGoalsTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testit() public void testit() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1144");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-1144" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyFilePresent( "target/clean-clean.txt" ); verifier.verifyFilePresent("target/clean-clean.txt");
verifier.verifyFilePresent( "target/resources-resources.txt" ); verifier.verifyFilePresent("target/resources-resources.txt");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Collection; import java.util.Collection;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -33,12 +31,9 @@ import org.junit.jupiter.api.Test;
* @author Brett Porter * @author Brett Porter
* *
*/ */
public class MavenITmng1233WarDepWithProvidedScopeTest public class MavenITmng1233WarDepWithProvidedScopeTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng1233WarDepWithProvidedScopeTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng1233WarDepWithProvidedScopeTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -47,33 +42,34 @@ public class MavenITmng1233WarDepWithProvidedScopeTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG1233() public void testitMNG1233() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1233");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-1233" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteArtifacts( "org.apache.maven.its.it0083" ); verifier.deleteArtifacts("org.apache.maven.its.it0083");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Collection<String> compileArtifacts = verifier.loadLines( "target/compile.txt", "UTF-8" ); Collection<String> compileArtifacts = verifier.loadLines("target/compile.txt", "UTF-8");
assertTrue( compileArtifacts.toString(), assertTrue(
compileArtifacts.contains( "org.apache.maven.its.it0083:direct-dep:jar:0.1" ) ); compileArtifacts.toString(),
assertTrue( compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.it0083:direct-dep:jar:0.1"));
compileArtifacts.contains( "org.apache.maven.its.it0083:trans-dep:jar:0.1" ) ); assertTrue(
compileArtifacts.toString(),
compileArtifacts.contains("org.apache.maven.its.it0083:trans-dep:jar:0.1"));
Collection<String> runtimeArtifacts = verifier.loadLines( "target/runtime.txt", "UTF-8" ); Collection<String> runtimeArtifacts = verifier.loadLines("target/runtime.txt", "UTF-8");
assertTrue( runtimeArtifacts.toString(), assertTrue(
runtimeArtifacts.contains( "org.apache.maven.its.it0083:direct-dep:jar:0.1" ) ); runtimeArtifacts.toString(),
assertFalse( runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.it0083:direct-dep:jar:0.1"));
runtimeArtifacts.contains( "org.apache.maven.its.it0083:trans-dep:jar:0.1" ) ); assertFalse(
runtimeArtifacts.toString(),
runtimeArtifacts.contains("org.apache.maven.its.it0083:trans-dep:jar:0.1"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Properties; import java.util.Properties;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -33,13 +31,10 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenITmng1323AntrunDependenciesTest public class MavenITmng1323AntrunDependenciesTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng1323AntrunDependenciesTest() public MavenITmng1323AntrunDependenciesTest() {
{ super("[3.0-alpha-1,)");
super( "[3.0-alpha-1,)" );
} }
/** /**
@ -49,42 +44,39 @@ public class MavenITmng1323AntrunDependenciesTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG1323() public void testitMNG1323() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1323");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-1323" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteDirectory( "a/target" ); verifier.deleteDirectory("a/target");
verifier.deleteDirectory( "b/target" ); verifier.deleteDirectory("b/target");
verifier.deleteDirectory( "c/target" ); verifier.deleteDirectory("c/target");
verifier.deleteArtifacts( "org.apache.maven.its.mng1323" ); verifier.deleteArtifacts("org.apache.maven.its.mng1323");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Properties pclProps; Properties pclProps;
pclProps = verifier.loadProperties( "target/pcl.properties" ); pclProps = verifier.loadProperties("target/pcl.properties");
assertNull( pclProps.getProperty( "org.apache.maven.its.mng1323.ClassA" ) ); assertNull(pclProps.getProperty("org.apache.maven.its.mng1323.ClassA"));
assertNull( pclProps.getProperty( "org.apache.maven.its.mng1323.ClassB" ) ); assertNull(pclProps.getProperty("org.apache.maven.its.mng1323.ClassB"));
pclProps = verifier.loadProperties( "a/target/pcl.properties" ); pclProps = verifier.loadProperties("a/target/pcl.properties");
assertNotNull( pclProps.getProperty( "org.apache.maven.its.mng1323.ClassA" ) ); assertNotNull(pclProps.getProperty("org.apache.maven.its.mng1323.ClassA"));
assertNull( pclProps.getProperty( "org.apache.maven.its.mng1323.ClassB" ) ); assertNull(pclProps.getProperty("org.apache.maven.its.mng1323.ClassB"));
pclProps = verifier.loadProperties( "b/target/pcl.properties" ); pclProps = verifier.loadProperties("b/target/pcl.properties");
assertNull( pclProps.getProperty( "org.apache.maven.its.mng1323.ClassA" ) ); assertNull(pclProps.getProperty("org.apache.maven.its.mng1323.ClassA"));
assertNotNull( pclProps.getProperty( "org.apache.maven.its.mng1323.ClassB" ) ); assertNotNull(pclProps.getProperty("org.apache.maven.its.mng1323.ClassB"));
pclProps = verifier.loadProperties( "c/target/pcl.properties" ); pclProps = verifier.loadProperties("c/target/pcl.properties");
assertNull( pclProps.getProperty( "org.apache.maven.its.mng1323.ClassA" ) ); assertNull(pclProps.getProperty("org.apache.maven.its.mng1323.ClassA"));
assertNull( pclProps.getProperty( "org.apache.maven.its.mng1323.ClassB" ) ); assertNull(pclProps.getProperty("org.apache.maven.its.mng1323.ClassB"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,12 +16,12 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,13 +30,10 @@ import org.junit.jupiter.api.Test;
* @author Benjamin Bentmann * @author Benjamin Bentmann
* *
*/ */
public class MavenITmng1349ChecksumFormatsTest public class MavenITmng1349ChecksumFormatsTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng1349ChecksumFormatsTest() public MavenITmng1349ChecksumFormatsTest() {
{ super("(2.0.10,2.1.0-M1),(2.1.0-M1,)");
super( "(2.0.10,2.1.0-M1),(2.1.0-M1,)" );
} }
/** /**
@ -47,38 +42,35 @@ public class MavenITmng1349ChecksumFormatsTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG1349() public void testitMNG1349() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1349");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-1349" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteArtifacts( "org.apache.maven.its.mng1349" ); verifier.deleteArtifacts("org.apache.maven.its.mng1349");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.verifyArtifactPresent( "org.apache.maven.its.mng1349", "md5-a", "0.1", "jar" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "md5-a", "0.1", "jar");
verifier.verifyArtifactPresent( "org.apache.maven.its.mng1349", "md5-a", "0.1", "pom" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "md5-a", "0.1", "pom");
verifier.verifyArtifactPresent( "org.apache.maven.its.mng1349", "md5-b", "0.1", "jar" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "md5-b", "0.1", "jar");
verifier.verifyArtifactPresent( "org.apache.maven.its.mng1349", "md5-b", "0.1", "pom" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "md5-b", "0.1", "pom");
verifier.verifyArtifactPresent( "org.apache.maven.its.mng1349", "md5-c", "0.1", "jar" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "md5-c", "0.1", "jar");
verifier.verifyArtifactPresent( "org.apache.maven.its.mng1349", "md5-c", "0.1", "pom" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "md5-c", "0.1", "pom");
verifier.verifyArtifactPresent( "org.apache.maven.its.mng1349", "sha1-a", "0.1", "jar" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "sha1-a", "0.1", "jar");
verifier.verifyArtifactPresent( "org.apache.maven.its.mng1349", "sha1-a", "0.1", "pom" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "sha1-a", "0.1", "pom");
verifier.verifyArtifactPresent( "org.apache.maven.its.mng1349", "sha1-b", "0.1", "jar" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "sha1-b", "0.1", "jar");
verifier.verifyArtifactPresent( "org.apache.maven.its.mng1349", "sha1-b", "0.1", "pom" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "sha1-b", "0.1", "pom");
verifier.verifyArtifactPresent( "org.apache.maven.its.mng1349", "sha1-c", "0.1", "jar" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "sha1-c", "0.1", "jar");
verifier.verifyArtifactPresent( "org.apache.maven.its.mng1349", "sha1-c", "0.1", "pom" ); verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "sha1-c", "0.1", "pom");
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -34,67 +32,59 @@ import org.junit.jupiter.api.Test;
* @author <a href="mailto:hboutemy@apache.org">Hervé Boutemy</a> * @author <a href="mailto:hboutemy@apache.org">Hervé Boutemy</a>
* *
*/ */
public class MavenITmng1412DependenciesOrderTest public class MavenITmng1412DependenciesOrderTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng1412DependenciesOrderTest() public MavenITmng1412DependenciesOrderTest() {
{ super("(2.0.8,)"); // 2.0.9+
super( "(2.0.8,)" ); // 2.0.9+
} }
@Test @Test
public void testitMNG1412() public void testitMNG1412() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1412");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-1412" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.deleteArtifacts( "org.apache.maven.its.mng1412" ); verifier.deleteArtifacts("org.apache.maven.its.mng1412");
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8" ); verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument( "--settings" ); verifier.addCliArgument("--settings");
verifier.addCliArgument( "settings.xml" ); verifier.addCliArgument("settings.xml");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
List<String> compileArtifacts = verifier.loadLines( "target/compile-artifacts.txt", "UTF-8" ); List<String> compileArtifacts = verifier.loadLines("target/compile-artifacts.txt", "UTF-8");
assertArtifactOrder( compileArtifacts ); assertArtifactOrder(compileArtifacts);
List<String> compileClassPath = verifier.loadLines( "target/compile-classpath.txt", "UTF-8" ); List<String> compileClassPath = verifier.loadLines("target/compile-classpath.txt", "UTF-8");
assertClassPathOrder( compileClassPath.subList( 1, compileClassPath.size() ) ); assertClassPathOrder(compileClassPath.subList(1, compileClassPath.size()));
List<String> runtimeArtifacts = verifier.loadLines( "target/runtime-artifacts.txt", "UTF-8" ); List<String> runtimeArtifacts = verifier.loadLines("target/runtime-artifacts.txt", "UTF-8");
assertArtifactOrder( runtimeArtifacts ); assertArtifactOrder(runtimeArtifacts);
List<String> runtimeClassPath = verifier.loadLines( "target/runtime-classpath.txt", "UTF-8" ); List<String> runtimeClassPath = verifier.loadLines("target/runtime-classpath.txt", "UTF-8");
assertClassPathOrder( runtimeClassPath.subList( 1, runtimeClassPath.size() ) ); assertClassPathOrder(runtimeClassPath.subList(1, runtimeClassPath.size()));
List<String> testArtifacts = verifier.loadLines( "target/test-artifacts.txt", "UTF-8" ); List<String> testArtifacts = verifier.loadLines("target/test-artifacts.txt", "UTF-8");
assertArtifactOrder( testArtifacts ); assertArtifactOrder(testArtifacts);
List<String> testClassPath = verifier.loadLines( "target/test-classpath.txt", "UTF-8" ); List<String> testClassPath = verifier.loadLines("target/test-classpath.txt", "UTF-8");
assertClassPathOrder( testClassPath.subList( 2, testClassPath.size() ) ); assertClassPathOrder(testClassPath.subList(2, testClassPath.size()));
} }
private void assertArtifactOrder( List<String> artifacts ) private void assertArtifactOrder(List<String> artifacts) {
{ assertEquals(4, artifacts.size());
assertEquals( 4, artifacts.size() ); assertEquals("org.apache.maven.its.mng1412:a:jar:0.1", artifacts.get(0));
assertEquals( "org.apache.maven.its.mng1412:a:jar:0.1", artifacts.get( 0 ) ); assertEquals("org.apache.maven.its.mng1412:c:jar:0.1", artifacts.get(1));
assertEquals( "org.apache.maven.its.mng1412:c:jar:0.1", artifacts.get( 1 ) ); assertEquals("org.apache.maven.its.mng1412:b:jar:0.1", artifacts.get(2));
assertEquals( "org.apache.maven.its.mng1412:b:jar:0.1", artifacts.get( 2 ) ); assertEquals("org.apache.maven.its.mng1412:d:jar:0.1", artifacts.get(3));
assertEquals( "org.apache.maven.its.mng1412:d:jar:0.1", artifacts.get( 3 ) );
} }
private void assertClassPathOrder( List<String> classpath ) private void assertClassPathOrder(List<String> classpath) {
{ assertEquals(4, classpath.size());
assertEquals( 4, classpath.size() ); assertEquals("a-0.1.jar", classpath.get(0));
assertEquals( "a-0.1.jar", classpath.get( 0 ) ); assertEquals("c-0.1.jar", classpath.get(1));
assertEquals( "c-0.1.jar", classpath.get( 1 ) ); assertEquals("b-0.1.jar", classpath.get(2));
assertEquals( "b-0.1.jar", classpath.get( 2 ) ); assertEquals("d-0.1.jar", classpath.get(3));
assertEquals( "d-0.1.jar", classpath.get( 3 ) );
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import java.io.File; import java.io.File;
import java.util.Properties; import java.util.Properties;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,12 +30,9 @@ import org.junit.jupiter.api.Test;
* *
* *
*/ */
public class MavenITmng1415QuotedSystemPropertiesTest public class MavenITmng1415QuotedSystemPropertiesTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase public MavenITmng1415QuotedSystemPropertiesTest() {
{ super(ALL_MAVEN_VERSIONS);
public MavenITmng1415QuotedSystemPropertiesTest()
{
super( ALL_MAVEN_VERSIONS );
} }
/** /**
@ -46,21 +41,18 @@ public class MavenITmng1415QuotedSystemPropertiesTest
* @throws Exception in case of failure * @throws Exception in case of failure
*/ */
@Test @Test
public void testitMNG1415() public void testitMNG1415() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1415");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-1415" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
verifier.deleteDirectory( "target" ); verifier.deleteDirectory("target");
verifier.addCliArgument( "-Dtest.property=Test Property" ); verifier.addCliArgument("-Dtest.property=Test Property");
verifier.addCliArgument( "validate" ); verifier.addCliArgument("validate");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
Properties props = verifier.loadProperties( "target/cli.properties" ); Properties props = verifier.loadProperties("target/cli.properties");
assertEquals( "Test Property", props.getProperty( "stringParam" ) ); assertEquals("Test Property", props.getProperty("stringParam"));
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.maven.it;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -18,13 +16,13 @@ package org.apache.maven.it;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.maven.it;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.VerificationException;
import java.io.File; import java.io.File;
import org.apache.maven.shared.verifier.VerificationException;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
@ -32,37 +30,28 @@ import org.junit.jupiter.api.Test;
* *
* *
*/ */
public class MavenITmng1491ReactorArtifactIdCollisionTest public class MavenITmng1491ReactorArtifactIdCollisionTest extends AbstractMavenIntegrationTestCase {
extends AbstractMavenIntegrationTestCase
{
public MavenITmng1491ReactorArtifactIdCollisionTest() public MavenITmng1491ReactorArtifactIdCollisionTest() {
{ super(ALL_MAVEN_VERSIONS);
super( ALL_MAVEN_VERSIONS );
} }
@Test @Test
public void testitMNG1491() public void testitMNG1491() throws Exception {
throws Exception File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1491");
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-1491" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() ); Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean( false ); verifier.setAutoclean(false);
try try {
{ verifier.addCliArgument("initialize");
verifier.addCliArgument( "initialize" );
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
fail( "Build should fail due to duplicate artifactId's in the reactor." ); fail("Build should fail due to duplicate artifactId's in the reactor.");
} } catch (VerificationException e) {
catch( VerificationException e )
{
// expected. // expected.
} }
} }
} }

Some files were not shown because too many files have changed in this diff Show More