Commits

hani  committed 189b66a

Split tests into their own idea module
Fix a failing query test for jdbc store (timestamp check should go up a second to ensure persistence has happened)
Cache workflow descriptors

  • Participants
  • Parent commits a122d76

Comments (0)

Files changed (15)

File osworkflow.iml

   <component name="ModuleRootManager" />
   <component name="NewModuleRootManager">
     <output url="file://$MODULE_DIR$/build/java" />
-    <output-test url="file://$MODULE_DIR$/build/java-test" />
     <content url="file://$MODULE_DIR$">
       <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
     </content>
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="module-library">
       <library>
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/build/junit-3.8.1.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
           <root url="jar://$MODULE_DIR$/lib/optional/xwork-1.0-beta2.jar!/" />
         </CLASSES>
         <JAVADOC />
     <orderEntry type="module-library">
       <library>
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/optional/commons-dbcp.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/optional/commons-lang-2.0.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/optional/commons-pool.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/optional/cglib2.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/optional/commons-beanutils-1.6.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/optional/ehcache.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/optional/commons-collections-2.1.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/build/simple-jndi.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/build/mckoidb.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/build/xmlunit1.0.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
           <root url="jar://$MODULE_DIR$/lib/build/jta.jar!/" />
         </CLASSES>
         <JAVADOC />
     <orderEntry type="module-library">
       <library>
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/build/log4j-1.2.8.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
           <root url="jar://$MODULE_DIR$/lib/optional/velocity-dep-1.4.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
       </library>
     </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/lib/optional/commons-lang-2.0.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
     <orderEntryProperties />
   </component>
   <component name="RetroweaverPlugin">

File osworkflow.ipr

     <modules>
       <module fileurl="file://$PROJECT_DIR$/src/designer/designer.iml" filepath="$PROJECT_DIR$/src/designer/designer.iml" />
       <module fileurl="file://$PROJECT_DIR$/osworkflow.iml" filepath="$PROJECT_DIR$/osworkflow.iml" />
+      <module fileurl="file://$PROJECT_DIR$/src/test/tests.iml" filepath="$PROJECT_DIR$/src/test/tests.iml" />
     </modules>
   </component>
   <component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="false" project-jdk-name="1.4" />

File src/test/com/opensymphony/workflow/spi/AbstractFunctionalWorkflowTest.java

 
         // --------------------- START_DATE+HISTORY_STEPS -------------------------------------------------
         //there should be two step that have been started
-        query = new WorkflowExpressionQuery(new FieldExpression(FieldExpression.START_DATE, FieldExpression.HISTORY_STEPS, FieldExpression.LT, new Date()));
+        query = new WorkflowExpressionQuery(new FieldExpression(FieldExpression.START_DATE, FieldExpression.HISTORY_STEPS, FieldExpression.LT, new Date(System.currentTimeMillis() + 1000)));
         workflows = workflow.query(query);
-        assertEquals("Expected to find 1 workflow step in the history", 1, workflows.size());
+        assertEquals("Expected to find 1 workflow step in the history for entry #" + workflowId, 1, workflows.size());
 
         // --------------------- FINISH_DATE+HISTORY_STEPS -------------------------------------------
         query = new WorkflowExpressionQuery(new FieldExpression(FieldExpression.FINISH_DATE, FieldExpression.HISTORY_STEPS, FieldExpression.LT, new Date(System.currentTimeMillis() + 1000)));

File src/test/com/opensymphony/workflow/spi/hibernate/NewSpringHibernateFunctionalWorkflowTestCase.java

     protected String getWorkflowName() {
         return "example";
     }
-  
+
     protected void tearDown() throws Exception {
-      DatabaseHelper.runScript(getClass().getResource("/scripts/jdbc/dropschema.sql"), "jdbc/DefaultDS");
+        DatabaseHelper.runScript(getClass().getResource("/scripts/jdbc/dropschema.sql"), "jdbc/DefaultDS");
     }
-    
 }

File src/test/com/opensymphony/workflow/spi/hibernate/SpringHibernateFunctionalWorkflowTestCase.java

     protected String getWorkflowName() {
         return "example";
     }
-  
+
     protected void tearDown() throws Exception {
         DatabaseHelper.runScript(getClass().getResource("/scripts/jdbc/dropschema.sql"), "jdbc/DefaultDS");
     }

File src/test/com/opensymphony/workflow/spi/hibernate3/NewSpringHibernateFunctionalWorkflowTestCase.java

     protected String getWorkflowName() {
         return "example";
     }
-  
+
     protected void tearDown() throws Exception {
         DatabaseHelper.runScript(getClass().getResource("/scripts/jdbc/dropschema.sql"), "jdbc/DefaultDS");
     }

File src/test/new-osworkflow-hibernate.xml

 <osworkflow>
-	  <!-- The hibernate store requires that you specify the session factory in ConfigLoader.persistenceArgs
-	       See javadocs for the store -->
-    <persistence class="com.opensymphony.workflow.spi.hibernate.NewHibernateWorkflowStore" />
-    <factory class="com.opensymphony.workflow.loader.URLWorkflowFactory" />
+  <!-- The hibernate store requires that you specify the session factory in ConfigLoader.persistenceArgs
+       See javadocs for the store -->
+  <persistence class="com.opensymphony.workflow.spi.hibernate.NewHibernateWorkflowStore" />
+  <factory class="com.opensymphony.workflow.loader.URLWorkflowFactory">
+    <property key="cache" value="true" />
+  </factory>
 </osworkflow>

File src/test/new-osworkflow-hibernate3.xml

 <osworkflow>
-	  <!-- The hibernate store requires that you specify the session factory in ConfigLoader.persistenceArgs
-	       See javadocs for the store -->
-    <persistence class="com.opensymphony.workflow.spi.hibernate3.NewHibernateWorkflowStore" />
-    <factory class="com.opensymphony.workflow.loader.URLWorkflowFactory" />
+  <!-- The hibernate store requires that you specify the session factory in ConfigLoader.persistenceArgs
+       See javadocs for the store -->
+  <persistence class="com.opensymphony.workflow.spi.hibernate3.NewHibernateWorkflowStore" />
+  <factory class="com.opensymphony.workflow.loader.URLWorkflowFactory">
+    <property key="cache" value="true" />
+  </factory>
 </osworkflow>

File src/test/osworkflow-hibernate.xml

 <osworkflow>
-	  <!-- The hibernate store requires that you specify the session factory in ConfigLoader.persistenceArgs
-	       See javadocs for the store -->
-    <persistence class="com.opensymphony.workflow.spi.hibernate.HibernateWorkflowStore" />
-    <factory class="com.opensymphony.workflow.loader.URLWorkflowFactory" />
+  <!-- The hibernate store requires that you specify the session factory in ConfigLoader.persistenceArgs
+       See javadocs for the store -->
+  <persistence class="com.opensymphony.workflow.spi.hibernate.HibernateWorkflowStore" />
+  <factory class="com.opensymphony.workflow.loader.URLWorkflowFactory">
+    <property key="cache" value="true" />
+  </factory>
 </osworkflow>

File src/test/osworkflow-jdbc.xml

-<osworkflow>
-  <persistence class="com.opensymphony.workflow.spi.jdbc.JDBCWorkflowStore">
-    <!-- For jdbc persistence, all are required. -->
-    <property key="datasource" value="jdbc/DefaultDS"/>
-    <!-- McKoi -->
-    <property key="entry.sequence" value="SELECT NEXTVAL('SEQ_OS_WFENTRY')"/>
-    <property key="step.sequence" value="SELECT NEXTVAL('SEQ_OS_CURRENTSTEPS')"/>
-
-    <property key="entry.table" value="OS_WFENTRY"/>
-    <property key="entry.id" value="ID"/>
-    <property key="entry.name" value="NAME"/>
-    <property key="entry.state" value="STATE"/>
-    <property key="history.table" value="OS_HISTORYSTEP"/>
-    <property key="current.table" value="OS_CURRENTSTEP"/>
-    <property key="historyPrev.table" value="OS_HISTORYSTEP_PREV"/>
-    <property key="currentPrev.table" value="OS_CURRENTSTEP_PREV"/>
-    <property key="step.id" value="ID"/>
-    <property key="step.entryId" value="ENTRY_ID"/>
-    <property key="step.stepId" value="STEP_ID"/>
-    <property key="step.actionId" value="ACTION_ID"/>
-    <property key="step.owner" value="OWNER"/>
-    <property key="step.caller" value="CALLER"/>
-    <property key="step.startDate" value="START_DATE"/>
-    <property key="step.finishDate" value="FINISH_DATE"/>
-    <property key="step.dueDate" value="DUE_DATE"/>
-    <property key="step.status" value="STATUS"/>
-    <property key="step.previousId" value="PREVIOUS_ID"/>
-  </persistence>
-  <factory class="com.opensymphony.workflow.loader.URLWorkflowFactory"/>
-</osworkflow>
+<osworkflow>
+  <persistence class="com.opensymphony.workflow.spi.jdbc.JDBCWorkflowStore">
+    <!-- For jdbc persistence, all are required. -->
+    <property key="datasource" value="jdbc/DefaultDS"/>
+    <!-- McKoi -->
+    <property key="entry.sequence" value="SELECT NEXTVAL('SEQ_OS_WFENTRY')"/>
+    <property key="step.sequence" value="SELECT NEXTVAL('SEQ_OS_CURRENTSTEPS')"/>
+
+    <property key="entry.table" value="OS_WFENTRY"/>
+    <property key="entry.id" value="ID"/>
+    <property key="entry.name" value="NAME"/>
+    <property key="entry.state" value="STATE"/>
+    <property key="history.table" value="OS_HISTORYSTEP"/>
+    <property key="current.table" value="OS_CURRENTSTEP"/>
+    <property key="historyPrev.table" value="OS_HISTORYSTEP_PREV"/>
+    <property key="currentPrev.table" value="OS_CURRENTSTEP_PREV"/>
+    <property key="step.id" value="ID"/>
+    <property key="step.entryId" value="ENTRY_ID"/>
+    <property key="step.stepId" value="STEP_ID"/>
+    <property key="step.actionId" value="ACTION_ID"/>
+    <property key="step.owner" value="OWNER"/>
+    <property key="step.caller" value="CALLER"/>
+    <property key="step.startDate" value="START_DATE"/>
+    <property key="step.finishDate" value="FINISH_DATE"/>
+    <property key="step.dueDate" value="DUE_DATE"/>
+    <property key="step.status" value="STATUS"/>
+    <property key="step.previousId" value="PREVIOUS_ID"/>
+  </persistence>
+  <factory class="com.opensymphony.workflow.loader.URLWorkflowFactory">
+    <property key="cache" value="true" />
+  </factory>
+</osworkflow>

File src/test/osworkflow-ofbiz.xml

 <osworkflow>
   <persistence class="com.opensymphony.workflow.spi.ofbiz.OfbizWorkflowStore" />
-  <factory class="com.opensymphony.workflow.loader.URLWorkflowFactory"/>
+  <factory class="com.opensymphony.workflow.loader.URLWorkflowFactory">
+    <property key="cache" value="true" />
+  </factory>
 </osworkflow>

File src/test/osworkflow-prevayler.xml

-<osworkflow>
-    <persistence class="com.opensymphony.workflow.spi.prevayler.PrevaylerWorkflowStore">
-	     <property key="transient" value="true" />
-	</persistence>
-    <factory class="com.opensymphony.workflow.loader.URLWorkflowFactory" />
-</osworkflow>
+<osworkflow>
+    <persistence class="com.opensymphony.workflow.spi.prevayler.PrevaylerWorkflowStore">
+	     <property key="transient" value="true" />
+	</persistence>
+  <factory class="com.opensymphony.workflow.loader.URLWorkflowFactory">
+    <property key="cache" value="true" />
+  </factory>
+</osworkflow>

File src/test/osworkflow.xml

-<osworkflow>
-    <persistence class="com.opensymphony.workflow.spi.memory.MemoryWorkflowStore"/>
-    <factory class="com.opensymphony.workflow.loader.URLWorkflowFactory" />
-</osworkflow>
+<osworkflow>
+    <persistence class="com.opensymphony.workflow.spi.memory.MemoryWorkflowStore"/>
+    <factory class="com.opensymphony.workflow.loader.URLWorkflowFactory" />
+</osworkflow>

File src/test/scripts/jdbc/mckoi.sql

-DROP TABLE IF EXISTS QRTZ_JOB_LISTENERS;
-DROP TABLE IF EXISTS QRTZ_TRIGGER_LISTENERS;
-DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS;
-DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS;
-DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE;
-DROP TABLE IF EXISTS QRTZ_LOCKS;
-DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS;
-DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS;
-DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS;
-DROP TABLE IF EXISTS QRTZ_TRIGGERS;
-DROP TABLE IF EXISTS QRTZ_JOB_DETAILS;
-DROP TABLE IF EXISTS QRTZ_CALENDARS;
-DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE;
-
-DROP TABLE IF EXISTS OS_PROPERTYENTRY;
-DROP TABLE IF EXISTS OS_CURRENTSTEP_PREV;
-DROP TABLE IF EXISTS OS_HISTORYSTEP_PREV;
-DROP TABLE IF EXISTS OS_CURRENTSTEP;
-DROP TABLE IF EXISTS OS_HISTORYSTEP;
-DROP TABLE IF EXISTS OS_WFENTRY;
-
-DROP SEQUENCE SEQ_OS_WFENTRY;
-DROP SEQUENCE SEQ_OS_CURRENTSTEPS;
-
 CREATE SEQUENCE SEQ_OS_WFENTRY INCREMENT 2 START 10;
 CREATE SEQUENCE SEQ_OS_CURRENTSTEPS INCREMENT 2 START 10;
 

File src/test/tests.iml

+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+  <component name="ModuleRootManager" />
+  <component name="NewModuleRootManager">
+    <exclude-output />
+    <output-test url="file://$MODULE_DIR$/../../build/test" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$" isTestSource="true" />
+    </content>
+    <orderEntry type="jdk" jdkName="1.5" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/optional/commons-pool.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/build/mckoidb.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/build/clover.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/optional/commons-beanutils-1.6.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/build/xmlunit1.0.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/build/simple-jndi.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/build/junit-3.8.1.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/optional/commons-dbcp.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/optional/commons-collections-2.1.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/optional/cglib2.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/optional/ehcache.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/build/log4j-1.2.8.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module" module-name="osworkflow" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/core/propertyset-1.3-25Jan05.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/core/oscore-2.2.2.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/core/commons-logging.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/optional/commons-lang-2.0.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/optional/osuser-1.0-dev-2Feb05.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/optional/hibernate3.0.5.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/optional/hibernate-2.1.7c.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/optional/spring-1.2.5.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntryProperties />
+  </component>
+  <component name="VcsManagerConfiguration">
+    <option name="ACTIVE_VCS_NAME" value="CVS" />
+    <option name="USE_PROJECT_VCS" value="false" />
+  </component>
+</module>
+