[jbpm-commits] JBoss JBPM SVN: r6364 - in jbpm4/trunk/modules: jpdl/src/test/java/org/jbpm/jpdl and 6 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu May 20 22:10:13 EDT 2010


Author: alex.guizar at jboss.com
Date: 2010-05-20 22:10:12 -0400 (Thu, 20 May 2010)
New Revision: 6364

Added:
   jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/test/
   jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/test/JbpmTestExtensionsImpl.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/test/JbpmTestExtensionsImpl.java
Removed:
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/test/JbpmTestExtensionsImpl.java
Modified:
   jbpm4/trunk/modules/jpdl/pom.xml
   jbpm4/trunk/modules/pvm/pom.xml
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/Clock.java
   jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestExtensions.java
Log:
JBPM-2839: move jbpm-test-base dependency of jbpm-pvm to test scope
disentangle compilation dependency on jbpm-test-base due to JbpmTestExtensions

Modified: jbpm4/trunk/modules/jpdl/pom.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/pom.xml	2010-05-21 00:11:58 UTC (rev 6363)
+++ jbpm4/trunk/modules/jpdl/pom.xml	2010-05-21 02:10:12 UTC (rev 6364)
@@ -64,6 +64,12 @@
           <excludes>
             <exclude>org/jbpm/test/update/ProcessUpdateTest.java</exclude>
           </excludes>
+          <systemProperties>
+            <property>
+              <name>org.jbpm.test.JbpmTestExtensions</name>
+              <value>org.jbpm.jpdl.test.JbpmTestExtensionsImpl</value>
+            </property>
+          </systemProperties>
         </configuration>
       </plugin>
     </plugins>

Added: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/test/JbpmTestExtensionsImpl.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/test/JbpmTestExtensionsImpl.java	                        (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/test/JbpmTestExtensionsImpl.java	2010-05-21 02:10:12 UTC (rev 6364)
@@ -0,0 +1,43 @@
+/*
+ * 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.jpdl.test;
+
+import java.util.Date;
+
+import org.jbpm.pvm.internal.util.Clock;
+import org.jbpm.test.JbpmTestExtensions;
+
+/**
+ * @author Tom Baeyens
+ */
+public class JbpmTestExtensionsImpl extends JbpmTestExtensions {
+
+  @Override
+  public Date getExplicitTime() {
+    return Clock.getExplicitTime();
+  }
+
+  @Override
+  public void setExplicitTime(Date explicitTime) {
+    Clock.setExplicitTime(explicitTime);
+  }
+}


Property changes on: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/test/JbpmTestExtensionsImpl.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + native

Modified: jbpm4/trunk/modules/pvm/pom.xml
===================================================================
--- jbpm4/trunk/modules/pvm/pom.xml	2010-05-21 00:11:58 UTC (rev 6363)
+++ jbpm4/trunk/modules/pvm/pom.xml	2010-05-21 02:10:12 UTC (rev 6364)
@@ -182,6 +182,12 @@
             <exclude>**/*TestCase.java</exclude>
             <exclude>org/jbpm/examples/bpmn/gateway/exclusive/ExclusiveGateway*</exclude>
           </excludes>
+          <systemProperties>
+            <property>
+              <name>org.jbpm.test.JbpmTestExtensions</name>
+              <value>org.jbpm.pvm.test.JbpmTestExtensionsImpl</value>
+            </property>
+          </systemProperties>
         </configuration>
       </plugin>
     </plugins>

Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/test/JbpmTestExtensionsImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/test/JbpmTestExtensionsImpl.java	2010-05-21 00:11:58 UTC (rev 6363)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/test/JbpmTestExtensionsImpl.java	2010-05-21 02:10:12 UTC (rev 6364)
@@ -1,42 +0,0 @@
-/*
- * 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.pvm.internal.test;
-
-import java.util.Date;
-
-import org.jbpm.pvm.internal.util.Clock;
-import org.jbpm.test.JbpmTestExtensions;
-
-
-/**
- * @author Tom Baeyens
- */
-public class JbpmTestExtensionsImpl extends JbpmTestExtensions {
-
-  public Date getExplicitTime() {
-    return Clock.getExplicitTime();
-  }
-
-  public void setExplicitTime(Date explicitTime) {
-    Clock.setExplicitTime(explicitTime);
-  }
-}

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/Clock.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/Clock.java	2010-05-21 00:11:58 UTC (rev 6363)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/Clock.java	2010-05-21 02:10:12 UTC (rev 6364)
@@ -2,8 +2,12 @@
 
 import java.util.Date;
 
-public abstract class Clock {
+public class Clock {
   
+  private Clock() {
+    // prevent instantiation
+  }
+  
   protected static Date explicitTime = null;
   
   public static Date getTime() {

Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/test/JbpmTestExtensionsImpl.java (from rev 6362, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/test/JbpmTestExtensionsImpl.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/test/JbpmTestExtensionsImpl.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/test/JbpmTestExtensionsImpl.java	2010-05-21 02:10:12 UTC (rev 6364)
@@ -0,0 +1,43 @@
+/*
+ * 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.pvm.test;
+
+import java.util.Date;
+
+import org.jbpm.pvm.internal.util.Clock;
+import org.jbpm.test.JbpmTestExtensions;
+
+/**
+ * @author Tom Baeyens
+ */
+public class JbpmTestExtensionsImpl extends JbpmTestExtensions {
+
+  @Override
+  public Date getExplicitTime() {
+    return Clock.getExplicitTime();
+  }
+
+  @Override
+  public void setExplicitTime(Date explicitTime) {
+    Clock.setExplicitTime(explicitTime);
+  }
+}

Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestExtensions.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestExtensions.java	2010-05-21 00:11:58 UTC (rev 6363)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestExtensions.java	2010-05-21 02:10:12 UTC (rev 6364)
@@ -25,26 +25,38 @@
 
 import org.jbpm.api.JbpmException;
 
-
 /**
  * @author Tom Baeyens
  */
 public abstract class JbpmTestExtensions {
-  
-  protected static JbpmTestExtensions instance = instantiateJbpmTestExtentions(); 
 
+  private static final String PROPERTY_NAME = "org.jbpm.test.JbpmTestExtensions";
+  private static final JbpmTestExtensions instance = instantiateJbpmTestExtentions();
+
   protected static JbpmTestExtensions instantiateJbpmTestExtentions() {
-    ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
-    JbpmTestExtensions newInstance;
+    String implClassName = System.getProperty(PROPERTY_NAME);
+    if (implClassName == null) {
+      throw new JbpmException("system property not specified: " + PROPERTY_NAME);
+    }
+
     try {
-      Class<?> implClass = Class.forName("org.jbpm.pvm.internal.test.JbpmTestExtensionsImpl", true, contextClassLoader);
-      newInstance = (JbpmTestExtensions) implClass.newInstance();
-    } catch (Exception e) {
-      throw new JbpmException("couldn't load jbpm test extensions", e);
+      ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+      Class<?> implClass = Class.forName(implClassName, false, contextClassLoader);
+      try {
+        return (JbpmTestExtensions) implClass.newInstance();
+      }
+      catch (InstantiationException e) {
+        throw new JbpmException("failed to instantiate " + implClass, e);
+      }
+      catch (IllegalAccessException e) {
+        throw new JbpmException(JbpmTestExtensions.class + " has no access to " + implClass, e);
+      }
     }
-    return newInstance;
+    catch (ClassNotFoundException e) {
+      throw new JbpmException("could not find class " + implClassName, e);
+    }
   }
-  
+
   public static JbpmTestExtensions getJbpmTestExtensions() {
     return instance;
   }



More information about the jbpm-commits mailing list