[jbpm-commits] JBoss JBPM SVN: r4090 - jbpm3/branches/jbpm-3.2.6.GA/modules/core/src/test/java/org/jbpm.

do-not-reply at jboss.org do-not-reply at jboss.org
Sat Feb 28 17:57:08 EST 2009


Author: thomas.diesler at jboss.com
Date: 2009-02-28 17:57:08 -0500 (Sat, 28 Feb 2009)
New Revision: 4090

Modified:
   jbpm3/branches/jbpm-3.2.6.GA/modules/core/src/test/java/org/jbpm/JbpmConfigurationTest.java
Log:
[JBPM-2074] Try to catch the creator ot the JbpmContext

Modified: jbpm3/branches/jbpm-3.2.6.GA/modules/core/src/test/java/org/jbpm/JbpmConfigurationTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2.6.GA/modules/core/src/test/java/org/jbpm/JbpmConfigurationTest.java	2009-02-28 22:42:36 UTC (rev 4089)
+++ jbpm3/branches/jbpm-3.2.6.GA/modules/core/src/test/java/org/jbpm/JbpmConfigurationTest.java	2009-02-28 22:57:08 UTC (rev 4090)
@@ -128,11 +128,19 @@
     // 'jbpm.cfg.xml' or the static method JbpmConfiguration.Configs.setDefaultObjectFactory
     // to specify the configuration information.
 
-    JbpmConfiguration.Configs.setDefaultObjectFactory(ObjectFactoryParser.parseXmlString(
-        "<jbpm-configuration>" + 
-        "  <string name='myproperty'>myvalue</string>" + 
-        "</jbpm-configuration>"));
-    assertEquals("myvalue", JbpmConfiguration.Configs.getString("myproperty"));
+    JbpmContext.logCreateStackTrace = true;
+    try
+    {
+      JbpmConfiguration.Configs.setDefaultObjectFactory(ObjectFactoryParser.parseXmlString(
+          "<jbpm-configuration>" + 
+          "  <string name='myproperty'>myvalue</string>" + 
+          "</jbpm-configuration>"));
+      assertEquals("myvalue", JbpmConfiguration.Configs.getString("myproperty"));
+    }
+    finally
+    {
+      JbpmContext.logCreateStackTrace = false;
+    }
   }
 
   public static class CustomObjectFactory implements ObjectFactory
@@ -163,28 +171,20 @@
 
   public void testDomainModelConfigsWithJbpmContext()
   {
-    JbpmContext.logCreateStackTrace = true;
+    JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseXmlString(
+        "<jbpm-configuration>" + 
+        "  <jbpm-context name='default.jbpm.context' />" + 
+        "  <string name='myproperty'>myvalueinacontext</string>" + 
+        "</jbpm-configuration>");
+
+    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
     try
     {
-      JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseXmlString(
-          "<jbpm-configuration>" + 
-          "  <jbpm-context name='default.jbpm.context' />" + 
-          "  <string name='myproperty'>myvalueinacontext</string>" + 
-          "</jbpm-configuration>");
-
-      JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
-      try
-      {
-        assertEquals("myvalueinacontext", JbpmConfiguration.Configs.getString("myproperty"));
-      }
-      finally
-      {
-        jbpmContext.close();
-      }
+      assertEquals("myvalueinacontext", JbpmConfiguration.Configs.getString("myproperty"));
     }
     finally
     {
-      JbpmContext.logCreateStackTrace = false;
+      jbpmContext.close();
     }
   }
 




More information about the jbpm-commits mailing list