summaryrefslogtreecommitdiff
path: root/src/main/java/org/apache/maven/plugin/nar/NarTestMojo.java
diff options
context:
space:
mode:
authorMark Donszelmann <Mark.Donszelmann@gmail.com>2009-11-05 21:26:19 +0100
committerMark Donszelmann <Mark.Donszelmann@gmail.com>2009-11-05 21:26:19 +0100
commit61a6c410ce1aa476628dfcf4b0ec1fdf40306b4a (patch)
tree3504389d9abec8098690598782230ec7945fcee8 /src/main/java/org/apache/maven/plugin/nar/NarTestMojo.java
parentbfaf912f7f41b87cf3add73fefe1d86dbefe6abc (diff)
downloadmaven-nar-plugin-61a6c410ce1aa476628dfcf4b0ec1fdf40306b4a.tar.gz
maven-nar-plugin-61a6c410ce1aa476628dfcf4b0ec1fdf40306b4a.tar.bz2
maven-nar-plugin-61a6c410ce1aa476628dfcf4b0ec1fdf40306b4a.tar.xz
maven-nar-plugin-61a6c410ce1aa476628dfcf4b0ec1fdf40306b4a.zip
Fixed NAR-24
Diffstat (limited to 'src/main/java/org/apache/maven/plugin/nar/NarTestMojo.java')
-rw-r--r--src/main/java/org/apache/maven/plugin/nar/NarTestMojo.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/main/java/org/apache/maven/plugin/nar/NarTestMojo.java b/src/main/java/org/apache/maven/plugin/nar/NarTestMojo.java
index bc7d487..215771d 100644
--- a/src/main/java/org/apache/maven/plugin/nar/NarTestMojo.java
+++ b/src/main/java/org/apache/maven/plugin/nar/NarTestMojo.java
@@ -77,15 +77,14 @@ public class NarTestMojo
// run if requested
if ( test.shouldRun() )
{
- String name = "target/test-nar/bin/" + getAOL() + "/" + test.getName();
+ String name = getTargetDirectory().getPath() + "/bin/" + getAOL() + "/" + test.getName();
getLog().info( "Running test " + name );
File workingDir = getMavenProject().getBasedir();
getLog().info( " in " + workingDir );
List args = test.getArgs();
int result =
- NarUtil.runCommand( getMavenProject().getBasedir() + "/" + name,
- (String[]) args.toArray( new String[args.size()] ), workingDir,
+ NarUtil.runCommand( name, (String[]) args.toArray( new String[args.size()] ), workingDir,
generateEnvironment( test, getLog() ), getLog() );
if ( result != 0 )
throw new MojoFailureException( "Test " + name + " failed with exit code: " + result + " 0x"
@@ -100,12 +99,13 @@ public class NarTestMojo
{
MavenProject project = getMavenProject();
// FIXME NAR-90, we could make dure we get the final name from layout
- File executable = new File(getLayout().getLibDirectory( super.getTargetDirectory(), getAOL().toString(), library.getType() ), project.getArtifactId() );
+ File executable =
+ new File( getLayout().getLibDirectory( super.getTargetDirectory(), getAOL().toString(),
+ library.getType() ), project.getArtifactId() );
getLog().info( "Running executable " + executable );
List args = library.getArgs();
int result =
- NarUtil.runCommand( executable.getPath(),
- (String[]) args.toArray( new String[args.size()] ), null,
+ NarUtil.runCommand( executable.getPath(), (String[]) args.toArray( new String[args.size()] ), null,
generateEnvironment( library, getLog() ), getLog() );
if ( result != 0 )
throw new MojoFailureException( "Test " + executable + " failed with exit code: " + result + " 0x"
@@ -131,8 +131,9 @@ public class NarTestMojo
Library lib = (Library) i.next();
if ( lib.getType().equals( Library.SHARED ) )
{
- File path = getLayout().getLibDirectory( super.getTargetDirectory(), getAOL().toString(), lib.getType() );
- getLog().debug( "Adding path to shared library: "+path );
+ File path =
+ getLayout().getLibDirectory( super.getTargetDirectory(), getAOL().toString(), lib.getType() );
+ getLog().debug( "Adding path to shared library: " + path );
sharedPaths.add( path );
}
}