You are viewing a plain text version of this content. The canonical link for it is here.
Posted to surefire-commits@maven.apache.org by jd...@apache.org on 2007/10/26 22:27:48 UTC
svn commit: r588770 -
/maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkConfigurationTest.java
Author: jdcasey
Date: Fri Oct 26 13:27:48 2007
New Revision: 588770
URL: http://svn.apache.org/viewvc?rev=588770&view=rev
Log:
Adding a unit test.
Added:
maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkConfigurationTest.java (with props)
Added: maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkConfigurationTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkConfigurationTest.java?rev=588770&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkConfigurationTest.java (added)
+++ maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkConfigurationTest.java Fri Oct 26 13:27:48 2007
@@ -0,0 +1,34 @@
+package org.apache.maven.surefire.booter;
+
+import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collections;
+
+import junit.framework.TestCase;
+
+public class ForkConfigurationTest
+ extends TestCase
+{
+
+ public void testCreateCommandLine_UseSystemClassLoaderForkOnce_ShouldConstructManifestOnlyJar()
+ throws IOException, SurefireBooterForkException
+ {
+ ForkConfiguration config = new ForkConfiguration();
+ config.setForkMode( ForkConfiguration.FORK_ONCE );
+ config.setUseSystemClassLoader( true );
+ config.setWorkingDirectory( new File( "." ).getCanonicalFile() );
+ config.setJvmExecutable( "java" );
+
+ File cpElement = File.createTempFile( "ForkConfigurationTest.", ".file" );
+ cpElement.deleteOnExit();
+
+ Commandline cli = config.createCommandLine( Collections.singletonList( cpElement.getAbsolutePath() ), config.isUseSystemClassLoader() );
+
+ String line = StringUtils.join( cli.getCommandline(), " " );
+ assertTrue( line.indexOf( "-jar" ) > -1 );
+ }
+
+}
Propchange: maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkConfigurationTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkConfigurationTest.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"