servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r582835 - in /incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests: pom.xml src/test/java/org/apache/servicemix/tooling/AbstractArchetypeTest.java
Date Mon, 08 Oct 2007 14:33:28 GMT
Author: gnodet
Date: Mon Oct  8 07:33:25 2007
New Revision: 582835

URL: http://svn.apache.org/viewvc?rev=582835&view=rev
Log:
Fix archetype integration tests

Modified:
    incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/pom.xml
    incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/src/test/java/org/apache/servicemix/tooling/AbstractArchetypeTest.java

Modified: incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/pom.xml?rev=582835&r1=582834&r2=582835&view=diff
==============================================================================
--- incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/pom.xml (original)
+++ incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/pom.xml Mon Oct  8
07:33:25 2007
@@ -168,6 +168,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-archetype-plugin</artifactId>
+        <version>1.0-alpha-4</version>
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
@@ -179,10 +180,6 @@
             <include>**/*Test.*</include>
           </includes>
           <excludes>
-            <exclude>**/BindingComponent*</exclude>
-            <exclude>**/Jsr181*</exclude>
-            <exclude>**/ServiceEngine*</exclude>
-            <exclude>**/EmbeddedSimple*</exclude>
           </excludes>
         </configuration>
       </plugin>

Modified: incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/src/test/java/org/apache/servicemix/tooling/AbstractArchetypeTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/src/test/java/org/apache/servicemix/tooling/AbstractArchetypeTest.java?rev=582835&r1=582834&r2=582835&view=diff
==============================================================================
--- incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/src/test/java/org/apache/servicemix/tooling/AbstractArchetypeTest.java
(original)
+++ incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/src/test/java/org/apache/servicemix/tooling/AbstractArchetypeTest.java
Mon Oct  8 07:33:25 2007
@@ -21,9 +21,9 @@
 import java.net.URL;
 import java.util.Collections;
 import java.util.Properties;
+import java.util.UUID;
 
 import junit.framework.TestCase;
-
 import org.apache.maven.cli.ConsoleDownloadMonitor;
 import org.apache.maven.embedder.MavenEmbedder;
 import org.apache.maven.embedder.MavenEmbedderConsoleLogger;
@@ -41,7 +41,7 @@
     private MavenEmbedder maven;
     private Properties sysProps = System.getProperties();
     private String version;
-    
+
     protected void setUp() throws Exception {
         maven = new MavenEmbedder();
         maven.setOffline(true);
@@ -84,23 +84,20 @@
         props.setProperty("archetypeArtifactId", artifactId);
         props.setProperty("archetypeVersion", version);
         props.setProperty("groupId", "sample");
-        props.setProperty("artifactId", "sample");
+        props.setProperty("artifactId", UUID.randomUUID().toString());
+        props.setProperty("user.dir", targetDir.getAbsolutePath());
         props.setProperty("basedir", targetDir.getAbsolutePath());
-        
-        MavenProject parent = maven.readProject(getDefaultArchetypePom());
+
+        MavenProject parent = maven.readProject(getDefaultArchetypePom(new File(targetDir,
"pom.xml")));
         System.setProperties((Properties) sysProps.clone());
-        System.setProperty("user.dir", targetDir.getAbsolutePath());
-        maven.execute(parent, 
+        maven.execute(parent,
                       Collections.singletonList("archetype:create"), 
                       eventMonitor, 
                       new ConsoleDownloadMonitor(), 
                       props, 
                       targetDir);
-
         System.setProperties((Properties) sysProps.clone());
-        targetDir = new File(targetDir, "sample");
-        System.setProperty("user.dir", targetDir.getAbsolutePath());
-        System.setProperty("basedir", targetDir.getAbsolutePath());
+        targetDir = new File(targetDir, props.getProperty("artifactId"));
         MavenProject prj = maven.readProject(new File(targetDir, "pom.xml"));
         maven.execute(prj, 
                       Collections.singletonList("package"), 
@@ -110,9 +107,8 @@
                       targetDir);
     }
 
-    private File getDefaultArchetypePom() throws IOException {
+    private File getDefaultArchetypePom(File pomFile) throws IOException {
         URL archetypePom = getClass().getClassLoader().getResource("archetype-pom.xml");
-        File pomFile = File.createTempFile("archetypePom", "xml");
         FileUtils.copyURLToFile(archetypePom, pomFile);
         return pomFile;
     }



Mime
View raw message