db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r584524 - in /db/torque: runtime/trunk/src/java/org/apache/torque/TorqueRuntimeException.java runtime/trunk/src/test/org/apache/torque/TorqueRuntimeExceptionTest.java site/trunk/xdocs/changes.xml
Date Sun, 14 Oct 2007 10:25:54 GMT
Author: tfischer
Date: Sun Oct 14 03:25:43 2007
New Revision: 584524

URL: http://svn.apache.org/viewvc?rev=584524&view=rev
Log:
Corrected invalid cast in TorqueRuntimeException.splitStackTrace.
Fixes TORQUE-103.

Added:
    db/torque/runtime/trunk/src/test/org/apache/torque/TorqueRuntimeExceptionTest.java
Modified:
    db/torque/runtime/trunk/src/java/org/apache/torque/TorqueRuntimeException.java
    db/torque/site/trunk/xdocs/changes.xml

Modified: db/torque/runtime/trunk/src/java/org/apache/torque/TorqueRuntimeException.java
URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/TorqueRuntimeException.java?rev=584524&r1=584523&r2=584524&view=diff
==============================================================================
--- db/torque/runtime/trunk/src/java/org/apache/torque/TorqueRuntimeException.java (original)
+++ db/torque/runtime/trunk/src/java/org/apache/torque/TorqueRuntimeException.java Sun Oct
14 03:25:43 2007
@@ -222,6 +222,6 @@
         {
             list.add(st.nextToken());
         }
-        return (String[]) list.toArray();
+        return (String[]) list.toArray(new String[list.size()]); 
     }
 }

Added: db/torque/runtime/trunk/src/test/org/apache/torque/TorqueRuntimeExceptionTest.java
URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/test/org/apache/torque/TorqueRuntimeExceptionTest.java?rev=584524&view=auto
==============================================================================
--- db/torque/runtime/trunk/src/test/org/apache/torque/TorqueRuntimeExceptionTest.java (added)
+++ db/torque/runtime/trunk/src/test/org/apache/torque/TorqueRuntimeExceptionTest.java Sun
Oct 14 03:25:43 2007
@@ -0,0 +1,43 @@
+package org.apache.torque;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+/**
+ * Tests the class TorqueRuntimeException
+ */
+public class TorqueRuntimeExceptionTest extends BaseTestCase
+{
+    /**
+     * Creates a new instance.
+     *
+     * @param name the name of the test case.
+     */
+    public TorqueRuntimeExceptionTest(String name)
+    {
+        super(name);
+    }
+
+    /**
+     * Tests whether printstackTrace works.
+     */
+    public void testPrintStackTrace()
+    {
+        StringWriter stringWriter = new StringWriter();
+        PrintWriter writer = new PrintWriter(stringWriter);
+        try
+        {
+            throw new TorqueRuntimeException();
+        }
+        catch (TorqueRuntimeException e)
+        {
+            e.printStackTrace(writer);
+            assertTrue(stringWriter.toString().startsWith(
+                    "org.apache.torque.TorqueRuntimeException"));
+            assertTrue(stringWriter.toString().indexOf(
+                    "org.apache.torque.TorqueRuntimeExceptionTest.testPrintStackTrace")
+                        > 0);
+        }
+        
+    }
+}

Modified: db/torque/site/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/db/torque/site/trunk/xdocs/changes.xml?rev=584524&r1=584523&r2=584524&view=diff
==============================================================================
--- db/torque/site/trunk/xdocs/changes.xml (original)
+++ db/torque/site/trunk/xdocs/changes.xml Sun Oct 14 03:25:43 2007
@@ -31,6 +31,9 @@
 
   <body>
   <release version="3.3-RC3" date="in SVN">
+    <action type="fix" dev="tfischer" issue="TORQUE-103" due-to="Jonathan Purvis">
+      Corrected invalid cast in TorqueRuntimeException.splitStackTrace.
+    </action>
     <action type="fix" dev="tfischer" issue="TORQUE-104" due-to="Sylvain Benoist">
       Remove 'COMMENT ON...' output from generated SQL for Sybase 
       as these commands do not exist in Sybase's sql.



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message