Author: marco.rietveld
Date: 2012-02-22 11:54:19 -0500 (Wed, 22 Feb 2012)
New Revision: 7067
Modified:
jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/command/AbstractGetObjectBaseCommand.java
jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/persistence/PersistenceService.java
jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/Jbpm3430/JBPM3430Test.java
jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/command/ChangeProcessInstanceVersionCommandTest.java
jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/jbpm3235/JBPM3235Test.java
jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/persistence/db/custom.hibernate.cfg.xml
jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/seam/custom.job.executor.jbpm.cfg.xml
Log:
Test and NPE fixes.
Modified:
jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/command/AbstractGetObjectBaseCommand.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/command/AbstractGetObjectBaseCommand.java 2012-02-22
02:27:13 UTC (rev 7066)
+++
jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/command/AbstractGetObjectBaseCommand.java 2012-02-22
16:54:19 UTC (rev 7067)
@@ -113,15 +113,19 @@
retrieveNode(token.getNode());
// Hibernate.initialize(token.getAvailableTransitions());
- for (Iterator iter = token.getChildren().values().iterator(); iter.hasNext();) {
- retrieveToken((Token) iter.next());
+ if( token.getChildren() != null ) {
+ for (Iterator iter = token.getChildren().values().iterator(); iter.hasNext();) {
+ retrieveToken((Token) iter.next());
+ }
}
}
protected void retrieveNode(Node node) {
- Hibernate.initialize(node);
- // Hibernate.initialize(node.getLeavingTransitions());
- if (node.getSuperState() != null) retrieveNode(node.getSuperState());
+ if( node != null ) {
+ Hibernate.initialize(node);
+ // Hibernate.initialize(node.getLeavingTransitions());
+ if (node.getSuperState() != null) retrieveNode(node.getSuperState());
+ }
}
public void retrieveVariables(ProcessInstance pi) {
Modified:
jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/persistence/PersistenceService.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/persistence/PersistenceService.java 2012-02-22
02:27:13 UTC (rev 7066)
+++
jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/persistence/PersistenceService.java 2012-02-22
16:54:19 UTC (rev 7067)
@@ -27,7 +27,6 @@
import org.jbpm.db.LoggingSession;
import org.jbpm.db.TaskMgmtSession;
import org.jbpm.svc.Service;
-import org.jbpm.tx.TxService;
public interface PersistenceService extends Service {
@@ -40,13 +39,6 @@
TaskMgmtSession getTaskMgmtSession();
Object getCustomSession(Class sessionClass);
- /** @deprecated call {@link TxService#isRollbackOnly()} instead */
- boolean isRollbackOnly();
- /** @deprecated call {@link TxService#setRollbackOnly()} instead */
- void setRollbackOnly();
- /** @deprecated call {@link TxService#setRollbackOnly()} instead */
- void setRollbackOnly(boolean isRollbackOnly);
-
void setGraphSession(GraphSession graphSession);
void setLoggingSession(LoggingSession loggingSession);
void setJobSession(JobSession jobSession);
Modified:
jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/Jbpm3430/JBPM3430Test.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/Jbpm3430/JBPM3430Test.java 2012-02-22
02:27:13 UTC (rev 7066)
+++
jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/Jbpm3430/JBPM3430Test.java 2012-02-22
16:54:19 UTC (rev 7067)
@@ -66,7 +66,13 @@
private static final String PROCESS_NAME = "jbpm3430";
+ boolean doNotRunUnlessManually = true;
+
protected void setUp() throws Exception {
+ if( doNotRunUnlessManually ) {
+ return;
+ }
+
super.setUp();
setUpAndEnsureCleanDatabase();
@@ -174,9 +180,8 @@
// DBG
private static final SimpleDateFormat sdf = new
SimpleDateFormat("HH:mm:ss,SSS");
+
- boolean doNotRunUnlessManually = true;
-
public void testTimerScheduling() throws Exception {
if( doNotRunUnlessManually ) {
return;
Modified:
jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/command/ChangeProcessInstanceVersionCommandTest.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/command/ChangeProcessInstanceVersionCommandTest.java 2012-02-22
02:27:13 UTC (rev 7066)
+++
jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/command/ChangeProcessInstanceVersionCommandTest.java 2012-02-22
16:54:19 UTC (rev 7067)
@@ -401,7 +401,7 @@
fail("Exception expected, saying that theTask2 is missing in new
version");
}
catch (JbpmException ex) {
- assert ex.getMessage().indexOf("theTask2") != -1 : ex.getMessage();
+ assertTrue( ex.getMessage(), ex.getMessage().indexOf("theTask2") != -1
);
}
// now supply a mapping for the missing task
Modified:
jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/jbpm3235/JBPM3235Test.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/jbpm3235/JBPM3235Test.java 2012-02-22
02:27:13 UTC (rev 7066)
+++
jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/jbpm3235/JBPM3235Test.java 2012-02-22
16:54:19 UTC (rev 7067)
@@ -33,6 +33,7 @@
import org.jbpm.db.AbstractDbTestCase;
import org.jbpm.db.JobSession;
import org.jbpm.db.hibernate.HibernateHelper;
+import org.jbpm.graph.def.EventCallback;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
@@ -65,7 +66,7 @@
private int numJobsToAdd = 10;
// Make sure this test does not run in Hudson
- private boolean thisIsAnAutomatedTest = false;
+ private boolean thisIsAnAutomatedTest = true;
private boolean startWithCleanDatabase = false;
private boolean cleanDatabaseAfterTest = false;
@@ -119,6 +120,8 @@
closeJbpmContext();
log.info("### END " + getName() + " ####################");
+ EventCallback.clear();
+ super.tearDown();
}
//
Modified:
jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/persistence/db/custom.hibernate.cfg.xml
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/persistence/db/custom.hibernate.cfg.xml 2012-02-22
02:27:13 UTC (rev 7066)
+++
jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/persistence/db/custom.hibernate.cfg.xml 2012-02-22
16:54:19 UTC (rev 7067)
@@ -13,6 +13,7 @@
<property
name="hibernate.connection.url">jdbc:hsqldb:.</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"></property>
+ <property name="hibernate.show_sql">false</property>
<property
name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
</session-factory>
Modified:
jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/seam/custom.job.executor.jbpm.cfg.xml
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/seam/custom.job.executor.jbpm.cfg.xml 2012-02-22
02:27:13 UTC (rev 7066)
+++
jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/seam/custom.job.executor.jbpm.cfg.xml 2012-02-22
16:54:19 UTC (rev 7067)
@@ -5,9 +5,7 @@
<field name="nbrOfThreads"><int value="1"
/></field>
<field name="idleInterval"><int value="5000"
/></field>
<field name="maxIdleInterval"><int value="3600000"
/></field> <!-- 1 hour -->
- <field name="historyMaxSize"><int value="20"
/></field>
<field name="maxLockTime"><int value="600000"
/></field> <!-- 10 minutes -->
<field name="lockMonitorInterval"><int value="60000"
/></field> <!-- 1 minute -->
- <field name="lockBufferTime"><int value="5000"
/></field> <!-- 5 seconds -->
</bean>
</jbpm-configuration>
\ No newline at end of file