adjust the embedder tests:

- remove a number of downloads from central that were slowing the build significantly
- ensure the tests will run with a repo manager and no central access
- ensure the tests will run offline if the local repository is populated

The technique for populating the repository is very hacky. We really need the tests to be doing this themselves. Perhaps moving these IT-like tests into the IT section and alongside the core ITs is the way to go - but this is a start.


git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@669222 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2008-06-18 16:56:56 +00:00
parent 08f3ac7ab4
commit 3acaa63cf8
34 changed files with 227 additions and 485 deletions

View File

@ -106,6 +106,40 @@ under the License.
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<!-- These aren't used by the build, but need to be in the local repository for
some tests to work offline. Look to improve them.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>2.3</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.2</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.2</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.0</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.3</version>
<extensions>true</extensions>
</plugin>
</plugins> </plugins>
</build> </build>

View File

@ -17,7 +17,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -17,7 +17,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -23,7 +23,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -25,7 +25,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -22,7 +22,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -25,7 +25,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -17,7 +17,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -22,7 +22,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -23,7 +23,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -28,7 +28,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -18,4 +18,10 @@
</dependency> </dependency>
</dependencies> </dependencies>
<repositories>
<repository>
<id>repo</id>
<url>file://localhost/${basedir}/local-repo</url>
</repository>
</repositories>
</project> </project>

View File

@ -23,7 +23,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -17,7 +17,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -18,7 +18,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -25,7 +25,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -10,7 +10,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -13,4 +13,10 @@
</dependency> </dependency>
</dependencies> </dependencies>
<repositories>
<repository>
<id>repo</id>
<url>file://localhost/${basedir}/local-repo</url>
</repository>
</repositories>
</project> </project>

View File

@ -17,7 +17,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -17,7 +17,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -17,7 +17,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -17,7 +17,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -22,7 +22,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -10,7 +10,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -19,6 +19,8 @@ package org.apache.maven.embedder;
* under the License. * under the License.
*/ */
import java.io.File;
import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.PlexusTestCase;
public abstract class AbstractEmbedderTestCase public abstract class AbstractEmbedderTestCase

View File

@ -1,5 +1,24 @@
package org.apache.maven.embedder; package org.apache.maven.embedder;
/*
* 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.
*/
import org.apache.maven.artifact.handler.ArtifactHandler; import org.apache.maven.artifact.handler.ArtifactHandler;
import org.apache.maven.execution.DefaultMavenExecutionRequest; import org.apache.maven.execution.DefaultMavenExecutionRequest;
import org.apache.maven.execution.MavenExecutionRequest; import org.apache.maven.execution.MavenExecutionRequest;

View File

@ -33,7 +33,7 @@ public class EmbedderUsingEclipsePluginTest
public void testRunningEclipsePlugin() public void testRunningEclipsePlugin()
throws Exception throws Exception
{ {
File basedir = runWithProject( "eclipse:eclipse" ); File basedir = runWithProject( "org.apache.maven.plugins:maven-eclipse-plugin:2.3:eclipse" );
assertFileExists( new File( basedir, ".classpath" ) ); assertFileExists( new File( basedir, ".classpath" ) );

View File

@ -46,7 +46,7 @@ public class EmbedderUsingScmPluginTest
p.setProperty( "connectionUrl", "scm:svn:http://svn.apache.org/repos/asf/maven/components/trunk/maven-embedder" ); p.setProperty( "connectionUrl", "scm:svn:http://svn.apache.org/repos/asf/maven/components/trunk/maven-embedder" );
File basedir = runWithProject( "scm:diff", p ); File basedir = runWithProject( "org.apache.maven.plugins:maven-scm-plugin:1.0:diff", p );
} }
} }
} }

View File

@ -1,10 +1,34 @@
package org.apache.maven.error; package org.apache.maven.error;
import org.apache.commons.httpclient.HttpClient; /*
import org.apache.commons.httpclient.HttpConnectionManager; * Licensed to the Apache Software Foundation (ASF) under one
import org.apache.commons.httpclient.HttpException; * or more contributor license agreements. See the NOTICE file
import org.apache.commons.httpclient.HttpStatus; * distributed with this work for additional information
import org.apache.commons.httpclient.methods.GetMethod; * 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.
*/
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import junit.framework.TestCase;
import org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException; import org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException;
import org.apache.maven.embedder.Configuration; import org.apache.maven.embedder.Configuration;
import org.apache.maven.embedder.DefaultConfiguration; import org.apache.maven.embedder.DefaultConfiguration;
@ -14,30 +38,15 @@ import org.apache.maven.errors.CoreErrorReporter;
import org.apache.maven.execution.DefaultMavenExecutionRequest; import org.apache.maven.execution.DefaultMavenExecutionRequest;
import org.apache.maven.execution.MavenExecutionRequest; import org.apache.maven.execution.MavenExecutionRequest;
import org.apache.maven.execution.MavenExecutionResult; import org.apache.maven.execution.MavenExecutionResult;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.plugin.PluginManagerException; import org.apache.maven.plugin.PluginManagerException;
import org.apache.maven.settings.Settings; import org.apache.maven.settings.Settings;
import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.easymock.MockControl; import org.easymock.MockControl;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import junit.framework.TestCase;
public class ErrorReporterPointcutTest public class ErrorReporterPointcutTest
extends TestCase extends TestCase
{ {
private static final int ONE_SECOND = 1000;
private MockControl reporterCtl; private MockControl reporterCtl;
private CoreErrorReporter reporter; private CoreErrorReporter reporter;
@ -46,10 +55,6 @@ public class ErrorReporterPointcutTest
private String basedir; private String basedir;
private static boolean isOffline;
private static boolean offlineIsSet = false;
public void setUp() public void setUp()
throws Exception throws Exception
{ {
@ -84,74 +89,6 @@ public class ErrorReporterPointcutTest
maven.stop(); maven.stop();
} }
private boolean checkOnline()
{
if ( !offlineIsSet )
{
HttpClient client = new HttpClient();
GetMethod get = new GetMethod(
"http://repo1.maven.org/maven2/org/apache/maven/maven-core/2.0/maven-core-2.0.pom" );
HttpConnectionManager mgr = client.getHttpConnectionManager();
mgr.getParams().setConnectionTimeout( 3 * ONE_SECOND );
try
{
int result = client.executeMethod( get );
if ( result == HttpStatus.SC_OK )
{
String body = get.getResponseBodyAsString();
new MavenXpp3Reader().read( new StringReader( body ) );
isOffline = false;
}
else
{
System.out.println( "Got HTTP status of: " + result );
System.out.println( "System is offline" );
isOffline = true;
}
}
catch ( HttpException e )
{
System.out.println( "Got error: " + e.getMessage() );
System.out.println( "System is offline" );
isOffline = true;
}
catch ( IOException e )
{
System.out.println( "Got error: " + e.getMessage() );
System.out.println( "System is offline" );
isOffline = true;
}
catch ( XmlPullParserException e )
{
System.out.println( "Got error: " + e.getMessage() );
System.out.println( "System is offline" );
isOffline = true;
}
finally
{
offlineIsSet = true;
}
}
if ( isOffline )
{
String method = getTestMethodName();
System.out.println( "Test: " + method
+ " requires an access to the Maven central repository. SKIPPING." );
return false;
}
return true;
}
private String getTestMethodName()
{
String method = new Throwable().getStackTrace()[2].getMethodName();
return method;
}
private File prepareProjectDir( String basename ) private File prepareProjectDir( String basename )
throws IOException throws IOException
{ {
@ -186,13 +123,8 @@ public class ErrorReporterPointcutTest
private void buildTestAccessory( File basedir ) private void buildTestAccessory( File basedir )
{ {
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( basedir ) MavenExecutionRequest request =
.setShowErrors( true ) createRequest( basedir, new DummyCoreErrorReporter() ).setGoals( Arrays.asList( "clean", "install" ) );
.setErrorReporter( new DummyCoreErrorReporter() )
.setGoals( Arrays.asList( new String[] {
"clean",
"install"
} ) );
MavenExecutionResult result = maven.execute( request ); MavenExecutionResult result = maven.execute( request );
@ -202,6 +134,16 @@ public class ErrorReporterPointcutTest
} }
} }
private MavenExecutionRequest createRequest( File basedir, CoreErrorReporter reporter )
{
return createRequest( reporter ).setBaseDirectory( basedir );
}
private MavenExecutionRequest createRequest( CoreErrorReporter reporter )
{
return new DefaultMavenExecutionRequest().setShowErrors( true ).setErrorReporter( reporter );
}
private void reportExceptions( MavenExecutionResult result, private void reportExceptions( MavenExecutionResult result,
File basedir ) File basedir )
{ {
@ -221,9 +163,8 @@ public class ErrorReporterPointcutTest
writer.write( basedir.getPath() ); writer.write( basedir.getPath() );
writer.write( "\nEncountered the following errors:" ); writer.write( "\nEncountered the following errors:" );
for ( Iterator it = result.getExceptions().iterator(); it.hasNext(); ) for ( Throwable error : (Collection<Throwable>) result.getExceptions() )
{ {
Throwable error = (Throwable) it.next();
writer.write( "\n\n" ); writer.write( "\n\n" );
error.printStackTrace( pWriter ); error.printStackTrace( pWriter );
} }
@ -256,13 +197,9 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( project ) MavenExecutionRequest request =
.setLocalRepositoryPath( localRepo ) createRequest( project, reporter ).setLocalRepositoryPath( localRepo ).setGoals(
.setShowErrors( true ) Arrays.asList( "initialize" ) );
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -272,11 +209,6 @@ public class ErrorReporterPointcutTest
public void testReportAggregatedMojoFailureException() public void testReportAggregatedMojoFailureException()
throws IOException throws IOException
{ {
if ( !checkOnline() )
{
return;
}
File projectDir = prepareProjectDir( "aggregate-mojo-failure"); File projectDir = prepareProjectDir( "aggregate-mojo-failure");
buildTestAccessory( new File( projectDir, "plugin" ) ); buildTestAccessory( new File( projectDir, "plugin" ) );
@ -289,12 +221,9 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( basedir ) MavenExecutionRequest request =
.setShowErrors( true ) createRequest( basedir, reporter ).setGoals(
.setErrorReporter( reporter ) Arrays.asList( "org.apache.maven.errortest:aggregate-mojo-failure-maven-plugin:1:test" ) );
.setGoals( Arrays.asList( new String[] {
"org.apache.maven.errortest:aggregate-mojo-failure-maven-plugin:1:test"
} ) );
maven.execute( request ); maven.execute( request );
@ -304,11 +233,6 @@ public class ErrorReporterPointcutTest
public void testReportAttemptToOverrideUneditableMojoParameter() public void testReportAttemptToOverrideUneditableMojoParameter()
throws IOException throws IOException
{ {
if ( !checkOnline() )
{
return;
}
File projectDir = prepareProjectDir( "config-rdonly-mojo-param"); File projectDir = prepareProjectDir( "config-rdonly-mojo-param");
buildTestAccessory( new File( projectDir, "plugin" ) ); buildTestAccessory( new File( projectDir, "plugin" ) );
@ -328,12 +252,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( basedir ) MavenExecutionRequest request = createRequest( basedir, reporter ).setGoals( Arrays.asList( "initialize" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -343,11 +262,6 @@ public class ErrorReporterPointcutTest
public void testReportErrorApplyingMojoConfiguration() public void testReportErrorApplyingMojoConfiguration()
throws IOException throws IOException
{ {
if ( !checkOnline() )
{
return;
}
File projectDir = prepareProjectDir( "mojo-config-error"); File projectDir = prepareProjectDir( "mojo-config-error");
File plugin = new File( projectDir, "plugin" ); File plugin = new File( projectDir, "plugin" );
File project = new File( projectDir, "project" ); File project = new File( projectDir, "project" );
@ -360,12 +274,9 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( project ) MavenExecutionRequest request =
.setShowErrors( true ) createRequest( project, reporter ).setGoals(
.setErrorReporter( reporter ) Arrays.asList( "org.apache.maven.errortest:mojo-config-error-maven-plugin:1:test" ) );
.setGoals( Arrays.asList( new String[] {
"org.apache.maven.errortest:mojo-config-error-maven-plugin:1:test"
} ) );
maven.execute( request ); maven.execute( request );
@ -391,12 +302,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( project ) MavenExecutionRequest request = createRequest( project, reporter ).setGoals( Arrays.asList( "initialize" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -406,11 +312,6 @@ public class ErrorReporterPointcutTest
public void testReportErrorFormulatingBuildPlan() public void testReportErrorFormulatingBuildPlan()
throws IOException throws IOException
{ {
if ( !checkOnline() )
{
return;
}
File projectDir = prepareProjectDir( "bad-build-plan" ); File projectDir = prepareProjectDir( "bad-build-plan" );
buildTestAccessory( new File( projectDir, "plugin" ) ); buildTestAccessory( new File( projectDir, "plugin" ) );
@ -423,12 +324,9 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( basedir ) MavenExecutionRequest request =
.setShowErrors( true ) createRequest( basedir, reporter ).setGoals(
.setErrorReporter( reporter ) Arrays.asList( "org.apache.maven.errortest:bad-build-plan-maven-plugin:1:test" ) );
.setGoals( Arrays.asList( new String[] {
"org.apache.maven.errortest:bad-build-plan-maven-plugin:1:test"
} ) );
maven.execute( request ); maven.execute( request );
@ -438,13 +336,7 @@ public class ErrorReporterPointcutTest
public void testReportErrorInterpolatingModel_UsingProjectInstance() public void testReportErrorInterpolatingModel_UsingProjectInstance()
throws IOException throws IOException
{ {
if ( !checkOnline() )
{
return;
}
File projectDir = prepareProjectDir( "interp-from-project"); File projectDir = prepareProjectDir( "interp-from-project");
File localRepo = new File( projectDir, "local-repo" );
File project = new File( projectDir, "project" ); File project = new File( projectDir, "project" );
reporter.reportErrorInterpolatingModel( null, null, null ); reporter.reportErrorInterpolatingModel( null, null, null );
@ -453,13 +345,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( project ) MavenExecutionRequest request = createRequest( project, reporter ).setGoals( Arrays.asList( "compile" ) );
.setLocalRepositoryPath( localRepo )
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"compile"
} ) );
maven.execute( request ); maven.execute( request );
@ -483,13 +369,9 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( project ) MavenExecutionRequest request =
.setSettings( settings ) createRequest( project, reporter ).setSettings( settings ).setGoals(
.setShowErrors( true ) Arrays.asList( "org.apache.maven.errortest:err-loading-plugin-maven-plugin:1:test" ) );
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"org.apache.maven.errortest:err-loading-plugin-maven-plugin:1:test"
} ) );
maven.execute( request ); maven.execute( request );
@ -499,11 +381,6 @@ public class ErrorReporterPointcutTest
public void testReportErrorManagingRealmForExtension() public void testReportErrorManagingRealmForExtension()
throws IOException throws IOException
{ {
if ( !checkOnline() )
{
return;
}
File projectDir = prepareProjectDir( "ext-realm-error" ); File projectDir = prepareProjectDir( "ext-realm-error" );
buildTestAccessory( new File( projectDir, "ext" ) ); buildTestAccessory( new File( projectDir, "ext" ) );
@ -516,12 +393,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( project ) MavenExecutionRequest request = createRequest( project, reporter ).setGoals( Arrays.asList( "initialize" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -541,13 +413,9 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( project ) MavenExecutionRequest request =
.setLocalRepositoryPath( localRepo ) createRequest( project, reporter ).setLocalRepositoryPath( localRepo ).setGoals(
.setShowErrors( true ) Arrays.asList( "initialize" ) );
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -567,13 +435,9 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( project ) MavenExecutionRequest request =
.setShowErrors( true ) createRequest( project, reporter ).setLocalRepositoryPath( localRepo ).setGoals(
.setLocalRepositoryPath( localRepo ) Arrays.asList( "initialize" ) );
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -597,13 +461,8 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( project ) MavenExecutionRequest request =
.setShowErrors( true ) createRequest( project, reporter ).setSettings( settings ).setGoals( Arrays.asList( "initialize" ) );
.setSettings( settings )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -629,13 +488,9 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( project ) MavenExecutionRequest request =
.setShowErrors( true ) createRequest( project, reporter ).setLocalRepositoryPath( localRepo ).setGoals(
.setLocalRepositoryPath( localRepo ) Arrays.asList( "initialize" ) );
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -660,13 +515,9 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( project ) MavenExecutionRequest request =
.setShowErrors( true ) createRequest( project, reporter ).setLocalRepositoryPath( localRepo ).setGoals(
.setLocalRepositoryPath( localRepo ) Arrays.asList( "initialize" ) );
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -684,12 +535,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request = createRequest( projectDir, reporter ).setGoals( Arrays.asList( "initialize" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -707,12 +553,9 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request =
.setShowErrors( true ) createRequest( projectDir, reporter ).setGoals(
.setErrorReporter( reporter ) Arrays.asList( "org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile" ) );
.setGoals( Arrays.asList( new String[] {
"compiler:compile"
} ) );
maven.execute( request ); maven.execute( request );
@ -735,13 +578,8 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request =
.setShowErrors( true ) createRequest( projectDir, reporter ).setSettings( settings ).setGoals( Arrays.asList( "invalid:test" ) );
.setSettings( settings )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"invalid:test"
} ) );
maven.execute( request ); maven.execute( request );
@ -756,11 +594,8 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setShowErrors( true ) MavenExecutionRequest request =
.setErrorReporter( reporter ) createRequest( reporter ).setGoals( Arrays.asList( "name:of:invalid:direct:mojo:for:test" ) );
.setGoals( Arrays.asList( new String[] {
"name:of:invalid:direct:mojo:for:test"
} ) );
maven.execute( request ); maven.execute( request );
@ -770,11 +605,6 @@ public class ErrorReporterPointcutTest
public void testReportMissingRequiredMojoParameter() public void testReportMissingRequiredMojoParameter()
throws IOException throws IOException
{ {
if ( !checkOnline() )
{
return;
}
File projectDir = prepareProjectDir( "missing-req-mojo-param" ); File projectDir = prepareProjectDir( "missing-req-mojo-param" );
buildTestAccessory( new File( projectDir, "plugin" ) ); buildTestAccessory( new File( projectDir, "plugin" ) );
@ -787,12 +617,9 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( basedir ) MavenExecutionRequest request =
.setShowErrors( true ) createRequest( basedir, reporter ).setGoals(
.setErrorReporter( reporter ) Arrays.asList( "org.apache.maven.errortest:missing-req-mojo-param-maven-plugin:1:test" ) );
.setGoals( Arrays.asList( new String[] {
"org.apache.maven.errortest:missing-req-mojo-param-maven-plugin:1:test"
} ) );
maven.execute( request ); maven.execute( request );
@ -802,11 +629,6 @@ public class ErrorReporterPointcutTest
public void testReportMojoExecutionException() public void testReportMojoExecutionException()
throws IOException throws IOException
{ {
if ( !checkOnline() )
{
return;
}
File projectDir = prepareProjectDir( "mojo-exec-err" ); File projectDir = prepareProjectDir( "mojo-exec-err" );
buildTestAccessory( new File( projectDir, "plugin" ) ); buildTestAccessory( new File( projectDir, "plugin" ) );
@ -819,12 +641,9 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( basedir ) MavenExecutionRequest request =
.setShowErrors( true ) createRequest( basedir, reporter ).setGoals(
.setErrorReporter( reporter ) Arrays.asList( "org.apache.maven.errortest:mojo-exec-err-maven-plugin:1:test" ) );
.setGoals( Arrays.asList( new String[] {
"org.apache.maven.errortest:mojo-exec-err-maven-plugin:1:test"
} ) );
maven.execute( request ); maven.execute( request );
@ -834,11 +653,6 @@ public class ErrorReporterPointcutTest
public void testReportMojoLookupError() public void testReportMojoLookupError()
throws IOException throws IOException
{ {
if ( !checkOnline() )
{
return;
}
File projectDir = prepareProjectDir( "mojo-lookup-err" ); File projectDir = prepareProjectDir( "mojo-lookup-err" );
buildTestAccessory( new File( projectDir, "plugin" ) ); buildTestAccessory( new File( projectDir, "plugin" ) );
@ -849,12 +663,9 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request =
.setShowErrors( true ) createRequest( projectDir, reporter ).setGoals(
.setErrorReporter( reporter ) Arrays.asList( "org.apache.maven.errortest:mojo-lookup-err-maven-plugin:1:test" ) );
.setGoals( Arrays.asList( new String[] {
"org.apache.maven.errortest:mojo-lookup-err-maven-plugin:1:test"
} ) );
maven.execute( request ); maven.execute( request );
@ -869,9 +680,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setShowErrors( true ) MavenExecutionRequest request = createRequest( reporter ).setGoals( Collections.EMPTY_LIST );
.setErrorReporter( reporter )
.setGoals( Collections.EMPTY_LIST );
maven.execute( request ); maven.execute( request );
@ -889,12 +698,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request = createRequest( projectDir, reporter ).setGoals( Arrays.asList( "initialize" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -914,12 +718,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request = createRequest( projectDir, reporter ).setGoals( Arrays.asList( "compile" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"compile"
} ) );
maven.execute( request ); maven.execute( request );
@ -929,13 +728,7 @@ public class ErrorReporterPointcutTest
public void testReportProjectDependenciesUnresolvable() public void testReportProjectDependenciesUnresolvable()
throws IOException throws IOException
{ {
if ( !checkOnline() )
{
return;
}
File projectDir = prepareProjectDir( "err-resolving-project-dep" ); File projectDir = prepareProjectDir( "err-resolving-project-dep" );
File localRepo = new File( projectDir, "local-repo" );
File project = new File( projectDir, "project" ); File project = new File( projectDir, "project" );
reporter.reportProjectDependenciesUnresolvable( null, null, null ); reporter.reportProjectDependenciesUnresolvable( null, null, null );
@ -944,13 +737,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( project ) MavenExecutionRequest request = createRequest( project, reporter ).setGoals( Arrays.asList( "compile" ) );
.setShowErrors( true )
.setLocalRepositoryPath( localRepo )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"compile"
} ) );
maven.execute( request ); maven.execute( request );
@ -968,13 +755,8 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request =
.setShowErrors( true ) createRequest( projectDir, reporter ).setGoals( Arrays.asList( "clean", "package" ) );
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"clean",
"package"
} ) );
maven.execute( request ); maven.execute( request );
@ -998,13 +780,8 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( project ) MavenExecutionRequest request =
.setShowErrors( true ) createRequest( project, reporter ).setSettings( settings ).setGoals( Arrays.asList( "initialize" ) );
.setSettings( settings )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -1022,12 +799,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request = createRequest( projectDir, reporter ).setGoals( Arrays.asList( "initialize" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -1037,11 +809,6 @@ public class ErrorReporterPointcutTest
public void testReportActivatorLookupError() public void testReportActivatorLookupError()
throws IOException throws IOException
{ {
if ( !checkOnline() )
{
return;
}
File projectDir = prepareProjectDir( "profile-activator-lookup-err" ); File projectDir = prepareProjectDir( "profile-activator-lookup-err" );
buildTestAccessory( new File( projectDir, "ext" ) ); buildTestAccessory( new File( projectDir, "ext" ) );
@ -1054,12 +821,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( project ) MavenExecutionRequest request = createRequest( project, reporter ).setGoals( Arrays.asList( "initialize" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -1077,12 +839,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request = createRequest( projectDir, reporter ).setGoals( Arrays.asList( "compile" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"compile"
} ) );
maven.execute( request ); maven.execute( request );
@ -1100,12 +857,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request = createRequest( projectDir, reporter ).setGoals( Arrays.asList( "initialize" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -1123,12 +875,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request = createRequest( projectDir, reporter ).setGoals( Arrays.asList( "initialize" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -1146,12 +893,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request = createRequest( projectDir, reporter ).setGoals( Arrays.asList( "compile" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"compile"
} ) );
maven.execute( request ); maven.execute( request );
@ -1169,12 +911,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request = createRequest( projectDir, reporter ).setGoals( Arrays.asList( "compile" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"compile"
} ) );
maven.execute( request ); maven.execute( request );
@ -1192,12 +929,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request = createRequest( projectDir, reporter ).setGoals( Arrays.asList( "compile" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"compile"
} ) );
maven.execute( request ); maven.execute( request );
@ -1218,12 +950,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request = createRequest( projectDir, reporter ).setGoals( Arrays.asList( "initialize" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -1241,12 +968,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request = createRequest( projectDir, reporter ).setGoals( Arrays.asList( "initialize" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -1265,12 +987,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( childDir ) MavenExecutionRequest request = createRequest( childDir, reporter ).setGoals( Arrays.asList( "initialize" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -1289,12 +1006,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( childDir ) MavenExecutionRequest request = createRequest( childDir, reporter ).setGoals( Arrays.asList( "initialize" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -1312,12 +1024,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request = createRequest( projectDir, reporter ).setGoals( Arrays.asList( "initialize" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -1335,21 +1042,17 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setPom( new File( MavenExecutionRequest request =
projectDir, createRequest( reporter ).setPom( new File( projectDir, "pom.xml" ) ).setGoals(
"pom.xml" ) ) Arrays.asList( "initialize" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
reporterCtl.verify(); reporterCtl.verify();
} }
// FIXME: Something keeps flip-flopping about this test, between the two reporter methods below...need to revisit this pronto. // FIXME: Something keeps flip-flopping about this test, between the two reporter methods below...need to revisit
// this pronto.
// public void testReportErrorCreatingArtifactRepository_fromProfilesXml() // public void testReportErrorCreatingArtifactRepository_fromProfilesXml()
// throws IOException // throws IOException
// { // {
@ -1396,13 +1099,8 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request =
.setSettings( settings ) createRequest( projectDir, reporter ).setSettings( settings ).setGoals( Arrays.asList( "initialize" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -1420,12 +1118,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request = createRequest( projectDir, reporter ).setGoals( Arrays.asList( "initialize" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -1443,12 +1136,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request = createRequest( projectDir, reporter ).setGoals( Arrays.asList( "initialize" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -1466,12 +1154,7 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request = createRequest( projectDir, reporter ).setGoals( Arrays.asList( "initialize" ) );
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request ); maven.execute( request );
@ -1496,13 +1179,9 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( projectDir ) MavenExecutionRequest request =
.setSettings( settings ) createRequest( projectDir, reporter ).setSettings( settings ).setGoals(
.setShowErrors( true ) Arrays.asList( "missing-direct-invoke-mojo:test" ) );
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"missing-direct-invoke-mojo:test"
} ) );
MavenExecutionResult result = maven.execute( request ); MavenExecutionResult result = maven.execute( request );
@ -1531,13 +1210,9 @@ public class ErrorReporterPointcutTest
reporterCtl.replay(); reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( project ) MavenExecutionRequest request =
.setSettings( settings ) createRequest( project, reporter ).setSettings( settings ).setGoals(
.setShowErrors( true ) Arrays.asList( "duplicated-attachments:test" ) );
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"duplicated-attachments:test"
} ) );
MavenExecutionResult result = maven.execute( request ); MavenExecutionResult result = maven.execute( request );

View File

@ -4,7 +4,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -4,7 +4,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version> <version>2.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

View File

@ -40,7 +40,7 @@ under the License.
<plugin> <plugin>
<!-- it's here just for the extensions tag --> <!-- it's here just for the extensions tag -->
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>RELEASE</version> <version>2.3</version>
<extensions>true</extensions> <extensions>true</extensions>
</plugin> </plugin>
</plugins> </plugins>