Trying to diagnose a build failure on a remote server...

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@629184 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2008-02-19 18:40:29 +00:00
parent 4bc04c413b
commit 8c34003044
1 changed files with 6 additions and 2 deletions

View File

@ -24,6 +24,7 @@ import org.apache.maven.execution.MavenExecutionRequest;
import org.apache.maven.execution.MavenExecutionResult;
import org.apache.maven.lifecycle.LifecycleExecutionException;
import org.apache.maven.settings.Settings;
import org.codehaus.plexus.logging.Logger;
import org.codehaus.plexus.util.FileUtils;
import java.io.File;
@ -76,12 +77,13 @@ public class EmbedderOfflineTest
MavenExecutionRequest request = new DefaultMavenExecutionRequest()
.setSettings( settings )
.setShowErrors( true )
.setLoggingLevel( Logger.LEVEL_DEBUG )
.setBaseDirectory( targetDirectory )
.setGoals( Collections.singletonList( "deploy" ) );
MavenExecutionResult result = maven.execute( request );
assertTrue( result.hasExceptions() );
assertTrue( "Deployment should have failed.", result.hasExceptions() );
List exceptions = result.getExceptions();
assertEquals( 1, exceptions.size() );
@ -90,8 +92,10 @@ public class EmbedderOfflineTest
LifecycleExecutionException top = (LifecycleExecutionException) exceptions.get( 0 );
top.printStackTrace();
assertNotNull( top.getCause().getCause() );
assertTrue( top.getCause().getCause().getMessage().indexOf( "System is offline" ) > -1 );
assertTrue( "Deployment should fail due to offline status.", top.getCause().getCause().getMessage().indexOf( "System is offline" ) > -1 );
}
}