[jboss-svn-commits] JBL Code SVN: r34729 - in labs/jbossrules/branches/5_1_20100802_esteban_diega: drools-compiler/src/test/resources/org/drools/integrationtests and 1 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Aug 15 16:26:57 EDT 2010


Author: eaa
Date: 2010-08-15 16:26:56 -0400 (Sun, 15 Aug 2010)
New Revision: 34729

Modified:
   labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-compiler/src/test/java/org/drools/integrationtests/ProcessNodeExceptionOccurredEventTest.java
   labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-compiler/src/test/resources/org/drools/integrationtests/ProcessNodeExceptionOccurredEventTest_2.rf
   labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-core/src/main/java/org/drools/workflow/instance/impl/NodeInstanceImpl.java
Log:
JBRULES-2595: Extend ProcessEventListener to add support for low-level exceptions occurred in a process execution
	- The listener is now notified for any Throwable and not just for RuntimeExceptions
	- Updated Test scenario

Modified: labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-compiler/src/test/java/org/drools/integrationtests/ProcessNodeExceptionOccurredEventTest.java
===================================================================
--- labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-compiler/src/test/java/org/drools/integrationtests/ProcessNodeExceptionOccurredEventTest.java	2010-08-15 20:12:40 UTC (rev 34728)
+++ labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-compiler/src/test/java/org/drools/integrationtests/ProcessNodeExceptionOccurredEventTest.java	2010-08-15 20:26:56 UTC (rev 34729)
@@ -313,12 +313,11 @@
         ksession.startProcess("org.drools.test.process1");
 
         assertEquals(1, workItemIds.size());
-        
         try {
             //After the WI is completed, an action node is executed. This
-            //Action Node is suposed to fail.
+            //Action Node is suposed to fail (throws an error).
             ksession.getWorkItemManager().completeWorkItem(workItemIds.get(0), null);
-            fail("An exception should occurr!");
+            fail("An error should occurr!");
         } catch (MyBusinessException ex) {
             System.out.println("\tMyBusinessException");
             assertEquals("flow", ex.getProcessName());

Modified: labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-compiler/src/test/resources/org/drools/integrationtests/ProcessNodeExceptionOccurredEventTest_2.rf
===================================================================
--- labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-compiler/src/test/resources/org/drools/integrationtests/ProcessNodeExceptionOccurredEventTest_2.rf	2010-08-15 20:12:40 UTC (rev 34728)
+++ labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-compiler/src/test/resources/org/drools/integrationtests/ProcessNodeExceptionOccurredEventTest_2.rf	2010-08-15 20:26:56 UTC (rev 34729)
@@ -54,7 +54,7 @@
 
     <actionNode id="4" name="Illegal Action Node" x="186" y="97" width="80" height="48" >
       <action type="expression" dialect="java" >
-        throw new java.lang.IllegalAccessException("This is illegal!");
+        throw new java.lang.IllegalAccessError("This is illegal!");
       </action>
     </actionNode>
 

Modified: labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-core/src/main/java/org/drools/workflow/instance/impl/NodeInstanceImpl.java
===================================================================
--- labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-core/src/main/java/org/drools/workflow/instance/impl/NodeInstanceImpl.java	2010-08-15 20:12:40 UTC (rev 34728)
+++ labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-core/src/main/java/org/drools/workflow/instance/impl/NodeInstanceImpl.java	2010-08-15 20:26:56 UTC (rev 34729)
@@ -119,12 +119,12 @@
         } catch (ProcessNodeExecutionException ex) {
             //We don't want to wrap a ProcessNodeExecutionException again.
             throw ex;
-        } catch (RuntimeException ex) {
+        } catch (Throwable t) {
             if (!hidden) {
-                ((EventSupport) workingMemory).getRuleFlowEventSupport().fireRuleFlowNodeExceptionOccurred(processInstance, this, ex, workingMemory);
+                ((EventSupport) workingMemory).getRuleFlowEventSupport().fireRuleFlowNodeExceptionOccurred(processInstance, this, t, workingMemory);
             }
             //The exception is wrapped in a ProcessNodeExecutionException
-            throw new ProcessNodeExecutionException(ex);
+            throw new ProcessNodeExecutionException(t);
         }
         if (!hidden) {
             ((EventSupport) workingMemory).getRuleFlowEventSupport().fireAfterRuleFlowNodeTriggered(this, (InternalWorkingMemory) workingMemory);



More information about the jboss-svn-commits mailing list