[jbpm-commits] JBoss JBPM SVN: r3985 - in jbpm3/branches/jbpm-3.2.5.SP/modules/core/src: main/resources/org/jbpm/graph/log and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Sat Feb 21 06:53:37 EST 2009


Author: thomas.diesler at jboss.com
Date: 2009-02-21 06:53:36 -0500 (Sat, 21 Feb 2009)
New Revision: 3985

Modified:
   jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/java/org/jbpm/graph/log/ActionLog.java
   jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.hbm.xml
   jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/graph/log/ActionLogDbTest.java
Log:
[JBPM-2056] Restore strictly compatible jbpm322 schema

Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/java/org/jbpm/graph/log/ActionLog.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/java/org/jbpm/graph/log/ActionLog.java	2009-02-21 11:34:33 UTC (rev 3984)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/java/org/jbpm/graph/log/ActionLog.java	2009-02-21 11:53:36 UTC (rev 3985)
@@ -35,9 +35,6 @@
   protected Action action = null;
   protected String exception = null;
   
-  // [JBPM-2057] Do not truncate long messages/exceptions
-  protected String exceptionExt = null;
-
   public ActionLog()
   {
   }
@@ -66,11 +63,7 @@
   {
     StringWriter stringWriter = new StringWriter();
     throwable.printStackTrace(new PrintWriter(stringWriter));
-    String exString = stringWriter.toString();
-    if (exString.length() > 4000)
-      exceptionExt = exString;
-    else
-      exception = exString;
+    exception = stringWriter.toString();
   }
 
   public Action getAction()
@@ -85,6 +78,6 @@
 
   public String getException()
   {
-    return exceptionExt != null ? exceptionExt : exception;
+    return exception;
   }
 }

Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.hbm.xml	2009-02-21 11:34:33 UTC (rev 3984)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.hbm.xml	2009-02-21 11:53:36 UTC (rev 3985)
@@ -9,7 +9,6 @@
   <subclass name="org.jbpm.graph.log.ActionLog" extends="org.jbpm.logging.log.CompositeLog" discriminator-value="A">
 
     <property name="exception" column="EXCEPTION_" type="string" length="4000"/>
-    <property name="exceptionExt" column="EXCEPTION_EXT_" type="text"/>
 
     <many-to-one name="action" column="ACTION_" class="org.jbpm.graph.def.Action" foreign-key="FK_LOG_ACTION" />
 

Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/graph/log/ActionLogDbTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/graph/log/ActionLogDbTest.java	2009-02-21 11:34:33 UTC (rev 3984)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/graph/log/ActionLogDbTest.java	2009-02-21 11:53:36 UTC (rev 3985)
@@ -42,37 +42,31 @@
     session.delete(action);
   }
 
-  // [JBPM-2057] Do not truncate long messages/exceptions
   public void testActionExceptionLog()
   {
+    RuntimeException rte = getRuntimeException();
+    StringWriter stwr = new StringWriter();
+    PrintWriter prwr = new PrintWriter(stwr);
+    rte.printStackTrace(prwr);
+    
     ActionLog actionLog = new ActionLog();
-    actionLog.setException(getRuntimeException());
+    actionLog.setException(rte);
     actionLog = (ActionLog)saveAndReload(actionLog);
     
     String rteStr = actionLog.getException();
-    assertNotNull(rteStr);
-    assertTrue("Exception string longer than 4000", rteStr.length() > 4000);
+    assertNotNull("Exception not null", rteStr);
+    assertEquals("Exception string", stwr.toString().length(), rteStr.length());
     
     session.delete(actionLog);
   }
 
   private RuntimeException getRuntimeException()
   {
-    int level = 0;
-    RuntimeException rte = new RuntimeException("level " + (level++));
-    while (true)
+    RuntimeException rte = new RuntimeException("level 0");
+    for (int level = 0; level < 10; level++)
     {
-      StringWriter stwr = new StringWriter();
-      PrintWriter prwr = new PrintWriter(stwr);
-      rte.printStackTrace(prwr);
-      
-      String rteStr = stwr.toString();
-      if (rteStr.length() > 4000)
-        break;
-      
-      rte = new RuntimeException("level " + (level++), rte);
+      rte = new RuntimeException("level " + level, rte);
     }
-
     return rte;
   }
 }




More information about the jbpm-commits mailing list