[jbpm-commits] JBoss JBPM SVN: r1829 - jbpm3/trunk/modules/jpdl/core/src/test/java/org/jbpm/job/executor.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Aug 6 03:05:21 EDT 2008


Author: alex.guizar at jboss.com
Date: 2008-08-06 03:05:21 -0400 (Wed, 06 Aug 2008)
New Revision: 1829

Added:
   jbpm3/trunk/modules/jpdl/core/src/test/java/org/jbpm/job/executor/NoJobExecutorDbTest.java
Log:
wrote test case to reproduce exception described in JBPM-1452

Added: jbpm3/trunk/modules/jpdl/core/src/test/java/org/jbpm/job/executor/NoJobExecutorDbTest.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/test/java/org/jbpm/job/executor/NoJobExecutorDbTest.java	                        (rev 0)
+++ jbpm3/trunk/modules/jpdl/core/src/test/java/org/jbpm/job/executor/NoJobExecutorDbTest.java	2008-08-06 07:05:21 UTC (rev 1829)
@@ -0,0 +1,60 @@
+/*
+ * 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.job.executor;
+
+import junit.framework.TestCase;
+
+import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmContext;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+
+/**
+ * Test case or JBPM-1452
+ * @author Alejandro Guizar
+ */
+public class NoJobExecutorDbTest extends TestCase {
+
+  private JbpmContext jbpmContext;
+
+  private static JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseXmlString(
+	  "<jbpm-configuration>" +
+	  "  <null name='jbpm.job.executor' />" +
+	  "</jbpm-configuration>");
+
+  public void setUp() throws Exception {
+	jbpmContext = jbpmConfiguration.createJbpmContext();
+  }
+
+  public void tearDown() throws Exception {
+	jbpmContext.close();
+  }
+
+  public void testJobExecutorDoesNotExist() {
+	// check the job executor is properly nullified
+    assertNull(jbpmContext.getObjectFactory().createObject("jbpm.job.executor"));
+    // start and end a process instance, confirm no exception gets thrown
+	jbpmContext.deployProcessDefinition(new ProcessDefinition("Audit"));
+	ProcessInstance processInstance = jbpmContext.newProcessInstanceForUpdate("Audit");
+	processInstance.end();
+  }
+}




More information about the jbpm-commits mailing list