[jbpm-commits] JBoss JBPM SVN: r5425 - in jbpm4/trunk: modules and 12 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Aug 4 17:23:42 EDT 2009


Author: tom.baeyens at jboss.com
Date: 2009-08-04 17:23:42 -0400 (Tue, 04 Aug 2009)
New Revision: 5425

Added:
   jbpm4/trunk/modules/test-cactus/
   jbpm4/trunk/modules/test-cactus/.classpath
   jbpm4/trunk/modules/test-cactus/.project
   jbpm4/trunk/modules/test-cactus/pom.xml
   jbpm4/trunk/modules/test-cactus/src/
   jbpm4/trunk/modules/test-cactus/src/main/
   jbpm4/trunk/modules/test-cactus/src/main/java/
   jbpm4/trunk/modules/test-cactus/src/main/java/org/
   jbpm4/trunk/modules/test-cactus/src/main/java/org/jbpm/
   jbpm4/trunk/modules/test-cactus/src/main/java/org/jbpm/cactustool/
   jbpm4/trunk/modules/test-cactus/src/main/java/org/jbpm/cactustool/CactusTestGenerator.java
   jbpm4/trunk/modules/test-cactus/src/main/resources/
   jbpm4/trunk/modules/test-cactus/src/test/
   jbpm4/trunk/modules/test-cactus/src/test/java/
   jbpm4/trunk/modules/test-cactus/src/test/java/org/
   jbpm4/trunk/modules/test-cactus/src/test/java/org/jbpm/
   jbpm4/trunk/modules/test-cactus/src/test/java/org/jbpm/test/
   jbpm4/trunk/modules/test-cactus/src/test/resources/
   jbpm4/trunk/modules/test-cactus/target/
Modified:
   jbpm4/trunk/modules/examples/pom.xml
   jbpm4/trunk/pom.xml
Log:
JBPM-2409 JBPM-2411 introducing the test-cactus module

Modified: jbpm4/trunk/modules/examples/pom.xml
===================================================================
--- jbpm4/trunk/modules/examples/pom.xml	2009-08-04 16:17:15 UTC (rev 5424)
+++ jbpm4/trunk/modules/examples/pom.xml	2009-08-04 21:23:42 UTC (rev 5425)
@@ -67,6 +67,32 @@
       <scope>test</scope>
     </dependency>
   </dependencies>
+  
+  
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-jar-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>generate-test-jar</id>
+            <phase>package</phase>
+            <goals>
+              <goal>test-jar</goal>
+            </goals>
+            <configuration>
+              <excludes>
+                <exclude>jbpm.cfg.xml</exclude>
+                <exclude>jbpm.hibernate.cfg.xml</exclude>
+                <exclude>jbpm.mail.properties</exclude>
+                <exclude>logging.properties</exclude>
+              </excludes> 
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
 
   <profiles>
     <!-- -Ddatabase= -->

Added: jbpm4/trunk/modules/test-cactus/.classpath
===================================================================
--- jbpm4/trunk/modules/test-cactus/.classpath	                        (rev 0)
+++ jbpm4/trunk/modules/test-cactus/.classpath	2009-08-04 21:23:42 UTC (rev 5425)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/classes" path="src/main/java"/>
+	<classpathentry kind="src" output="target/classes" path="src/main/resources"/>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>


Property changes on: jbpm4/trunk/modules/test-cactus/.classpath
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/test-cactus/.project
===================================================================
--- jbpm4/trunk/modules/test-cactus/.project	                        (rev 0)
+++ jbpm4/trunk/modules/test-cactus/.project	2009-08-04 21:23:42 UTC (rev 5425)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>test-cactus</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+	</natures>
+</projectDescription>


Property changes on: jbpm4/trunk/modules/test-cactus/.project
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/test-cactus/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-cactus/pom.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-cactus/pom.xml	2009-08-04 21:23:42 UTC (rev 5425)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!--                                                                        -->
+<!--  JBoss, the OpenSource J2EE webOS                                      -->
+<!--                                                                        -->
+<!--  Distributable under LGPL license.                                     -->
+<!--  See terms of license at http://www.gnu.org.                           -->
+<!--                                                                        -->
+<!-- ====================================================================== -->
+
+<!-- $Id: pom.xml 5319 2009-07-17 10:03:46Z tom.baeyens at jboss.com $ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <name>jBPM 4 - Cactus</name>
+  <groupId>org.jbpm.jbpm4</groupId>
+  <artifactId>jbpm-cactus</artifactId>
+  <packaging>war</packaging>
+
+  <!-- Parent -->
+  <parent>
+    <groupId>org.jbpm.jbpm4</groupId>
+    <artifactId>jbpm</artifactId>
+    <version>4.1-SNAPSHOT</version>
+    <relativePath>../../pom.xml</relativePath>
+  </parent>
+
+  <!-- Dependencies --> 
+  <dependencies>
+    <dependency>
+      <groupId>org.jbpm.jbpm4</groupId>
+      <artifactId>jbpm-examples</artifactId>
+      <version>4.1-SNAPSHOT</version>
+      <classifier>tests</classifier>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>cactus</groupId>
+      <artifactId>cactus</artifactId>
+      <version> 13-1.7.1</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+    </dependency>
+  </dependencies>
+
+  <!-- Plugins -->
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>generate-cactus-test-suite</id>
+            <phase>generate-test-sources</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <tasks>
+                <property name="test_classpath" refid="maven.test.classpath"/>
+                <echo message="${test_classpath}" />
+                <java classname="org.jbpm.cactustool.CactusTestGenerator">
+                  <classpath path="${test_classpath}"/>
+                  <arg line="src/test/java ../examples/src/test/java" />
+                </java>
+              </tasks>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>         
+    </plugins>
+  </build>
+
+</project>


Property changes on: jbpm4/trunk/modules/test-cactus/pom.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/test-cactus/src/main/java/org/jbpm/cactustool/CactusTestGenerator.java
===================================================================
--- jbpm4/trunk/modules/test-cactus/src/main/java/org/jbpm/cactustool/CactusTestGenerator.java	                        (rev 0)
+++ jbpm4/trunk/modules/test-cactus/src/main/java/org/jbpm/cactustool/CactusTestGenerator.java	2009-08-04 21:23:42 UTC (rev 5425)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.cactustool;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.PrintWriter;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class CactusTestGenerator {
+
+  public static void main(String[] args) {
+    try {
+      if (args==null) {
+        log("syntax: java -cp ... org.jbpm.cactustool.CactusTestGenerator testdestroot testsrcroot1 testsrcroot2 ...");
+      }
+      
+      String testFileName = args[0]+"/org/jbpm/test/AllIntegrationTests.java";
+      File testFile = new File(testFileName);
+      FileOutputStream fos = new FileOutputStream(testFile);
+      PrintWriter out = new PrintWriter(fos);
+      log("generating java class "+testFile.getCanonicalPath());
+      
+      out.println("package org.jbpm.test;");
+      out.println();
+      out.println("import junit.framework.Test;");
+      out.println("import org.apache.cactus.ServletTestSuite;");
+      out.println();
+      out.println("public class AllIntegrationTests {");
+      out.println();
+      out.println("  public static Test suite() {");
+      out.println("    Test suite = new ServletTestSuite();");
+      
+      for (int i=1; i<args.length; i++) {
+        String testSrcRoot = args[i];
+        scanForTestClasses(testSrcRoot, "", out); 
+      }
+
+      out.println("    return suite;");
+      out.println("  }");
+      out.println("}");
+      
+      out.close();
+      
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
+  }
+
+  private static void scanForTestClasses(String dirPath, String packageName, PrintWriter out) throws Exception {
+    File dirFile = new File(dirPath);
+    log("scanning dir "+dirFile.getCanonicalPath());
+    File[] dirContentFiles = dirFile.listFiles();
+    if (dirContentFiles!=null) {
+      for (File file : dirContentFiles) {
+        String fileName = file.getName();
+        if (file.isFile() && file.getName().endsWith("Test.java")) {
+          String className = packageName + "." + fileName.substring(0, fileName.length()-5);
+          log("  adding "+className);
+          out.println("    suite.addTestSuite(" + className + ");");
+
+        } else if (file.isDirectory()) {
+          String subDirPath = dirPath+"/"+fileName;
+          String subPackageName = ("".equals(packageName) ? fileName : packageName+"."+fileName);
+          scanForTestClasses(subDirPath, subPackageName, out);
+        }
+      }
+    }
+  }
+
+  private static void log(String msg) {
+    System.out.println(msg);
+  }
+}


Property changes on: jbpm4/trunk/modules/test-cactus/src/main/java/org/jbpm/cactustool/CactusTestGenerator.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml	2009-08-04 16:17:15 UTC (rev 5424)
+++ jbpm4/trunk/pom.xml	2009-08-04 21:23:42 UTC (rev 5425)
@@ -396,13 +396,22 @@
       </plugin>
       <plugin>
         <artifactId>maven-jar-plugin</artifactId>
-        <configuration>
-          <archive>
-            <manifest>
-              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
-            </manifest>
-          </archive>
-        </configuration>
+        <executions>
+          <execution>
+            <id>generate-jar</id>
+            <phase>package</phase>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+            <configuration>
+              <archive>
+                <manifest>
+                  <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+                </manifest>
+              </archive>
+            </configuration>
+          </execution>
+        </executions>
       </plugin>
       <plugin>
         <artifactId>maven-surefire-plugin</artifactId>



More information about the jbpm-commits mailing list