maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r588060 - in /maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder: MavenEmbedderProjectWithExtensionReadingTest.java MavenEmbedderTest.java
Date Wed, 24 Oct 2007 22:25:49 GMT
Author: carlos
Date: Wed Oct 24 15:25:48 2007
New Revision: 588060

URL: http://svn.apache.org/viewvc?rev=588060&view=rev
Log:
Store the pom File object in the execution request instead of its path

Modified:
    maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderProjectWithExtensionReadingTest.java
    maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java

Modified: maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderProjectWithExtensionReadingTest.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderProjectWithExtensionReadingTest.java?rev=588060&r1=588059&r2=588060&view=diff
==============================================================================
--- maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderProjectWithExtensionReadingTest.java
(original)
+++ maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderProjectWithExtensionReadingTest.java
Wed Oct 24 15:25:48 2007
@@ -21,7 +21,7 @@
         throws Exception
     {
         MavenExecutionRequest request = new DefaultMavenExecutionRequest().setShowErrors(
true )
-            .setPomFile( new File( basedir, "src/test/resources/pom2.xml" ).getAbsolutePath()
);
+            .setPom( new File( basedir, "src/test/resources/pom2.xml" ) );
 
         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
 

Modified: maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java?rev=588060&r1=588059&r2=588060&view=diff
==============================================================================
--- maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java
(original)
+++ maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java
Wed Oct 24 15:25:48 2007
@@ -141,10 +141,9 @@
 
         FileUtils.copyDirectoryStructure( testDirectory, targetDirectory );
 
-        MavenExecutionRequest request =
-            new DefaultMavenExecutionRequest().setPomFile( new File( targetDirectory, "pom.xml"
)
-                .getAbsolutePath() )
-                .setShowErrors( true ).setGoals( Arrays.asList( new String[]{"package"} )
);
+        MavenExecutionRequest request = new DefaultMavenExecutionRequest()
+            .setPom( new File( targetDirectory, "pom.xml" ) ).setShowErrors( true )
+            .setGoals( Arrays.asList( new String[] { "package" } ) );
 
         MavenExecutionResult result = maven.execute( request );
 
@@ -171,8 +170,8 @@
         // Check with profile not active
 
         MavenExecutionRequest requestWithoutProfile = new DefaultMavenExecutionRequest()
-            .setPomFile( new File( targetDirectory, "pom.xml" ).getAbsolutePath() ).setShowErrors(
true )
-            .setGoals( Arrays.asList( new String[]{"validate"} ) );
+            .setPom( new File( targetDirectory, "pom.xml" ) ).setShowErrors( true )
+            .setGoals( Arrays.asList( new String[] { "validate" } ) );
 
         MavenExecutionResult r0 = maven.execute( requestWithoutProfile );
 
@@ -188,11 +187,11 @@
 
         // Check with profile activated
 
-        MavenExecutionRequest request =
-            new DefaultMavenExecutionRequest().setPomFile( new File( targetDirectory, "pom.xml"
)
-                .getAbsolutePath() )
-                .setShowErrors( true ).setGoals( Arrays.asList( new String[]{"validate"}
) )
-                .addActiveProfile( "embedderProfile" );
+        MavenExecutionRequest request = new DefaultMavenExecutionRequest()
+            .setPom( new File( targetDirectory, "pom.xml" ) )
+            .setShowErrors( true )
+            .setGoals( Arrays.asList( new String[] { "validate" } ) )
+            .addActiveProfile( "embedderProfile" );
 
         MavenExecutionResult r1 = maven.execute( request );
 
@@ -235,8 +234,8 @@
         writer.close();
 
         /* execute maven */
-        MavenExecutionRequest request = new DefaultMavenExecutionRequest().setPomFile( pom.getAbsolutePath()
)
-            .setShowErrors( true ).setGoals( Arrays.asList( new String[] { "package" } )
);
+        MavenExecutionRequest request = new DefaultMavenExecutionRequest().setPom( pom ).setShowErrors(
true )
+            .setGoals( Arrays.asList( new String[] { "package" } ) );
 
         MavenExecutionResult result = maven.execute( request );
 
@@ -254,7 +253,7 @@
         writer.close();
 
         /* execute Maven */
-        request = new DefaultMavenExecutionRequest().setPomFile( pom.getAbsolutePath() ).setShowErrors(
true )
+        request = new DefaultMavenExecutionRequest().setPom( pom ).setShowErrors( true )
             .setGoals( Arrays.asList( new String[] { "package" } ) );
         result = maven.execute( request );
 
@@ -311,8 +310,7 @@
     public void testProjectReading()
         throws Exception
     {
-        MavenExecutionRequest request = new DefaultMavenExecutionRequest().setShowErrors(
true )
-            .setPomFile( getPomFile().getAbsolutePath() );
+        MavenExecutionRequest request = new DefaultMavenExecutionRequest().setShowErrors(
true ).setPom( getPomFile() );
 
         MavenExecutionResult result = maven.readProjectWithDependencies( request );
 



Mime
View raw message