harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r588627 - in /harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans: EventSetDescriptorTest.java PersistenceDelegateTest.java XMLEncoderTest.java
Date Fri, 26 Oct 2007 12:33:06 GMT
Author: odeakin
Date: Fri Oct 26 05:33:05 2007
New Revision: 588627

URL: http://svn.apache.org/viewvc?rev=588627&view=rev
Log:
Let JUnit deal with unexpected Exceptions rather than catching them ourselves.

Modified:
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java?rev=588627&r1=588626&r2=588627&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java
Fri Oct 26 05:33:05 2007
@@ -1273,15 +1273,9 @@
     /**
      * The test checks the constructor
      */
-    public void testEventSetDescriptorConstructor() {
-        try {
-            new EventSetDescriptor(OtherBean.class, "sample",
-                    SampleListener.class, "fireSampleEvent");
-        } catch (Exception e) {
-            fail("Exception of " + e.getClass() + " class with message "
-                    + e.getMessage() + " is thrown");
-        }
-
+    public void testEventSetDescriptorConstructor() throws Exception {
+        new EventSetDescriptor(OtherBean.class, "sample",
+                SampleListener.class, "fireSampleEvent");
     }
     
     //Regression Test

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java?rev=588627&r1=588626&r2=588627&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java
Fri Oct 26 05:33:05 2007
@@ -1242,19 +1242,15 @@
             return true;
         }
     }
-    public void test_writeExpression_writeObject() {
+    public void test_writeExpression_writeObject() throws Exception {
         ByteArrayOutputStream output = new ByteArrayOutputStream();
         XMLEncoder encoder = new XMLEncoder( output );
 
         Date date = new Date(2007, 06, 26);
         Expression expression = new Expression( date, "toString", null );
         String date_string = null;
-        try {
-                date_string = (String) expression.getValue();
-        } catch (Exception e ) {
-                System.out.println("Failed to get the date value.");
-                e.printStackTrace();
-        }
+        date_string = (String) expression.getValue();
+
         DummyBean bean = new DummyBean( date_string );
         // The expression knows about the date object.
         encoder.writeExpression( expression );

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java?rev=588627&r1=588626&r2=588627&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java
Fri Oct 26 05:33:05 2007
@@ -428,9 +428,6 @@
 
         try {
             e.writeObject(new Boolean(true));
-        } catch (Exception excp) {
-            fail("Exception " + excp.getClass() + " is thrown: "
-                    + excp.getMessage());
         } finally {
             e.close();
         }
@@ -450,9 +447,6 @@
 
         try {
             e.writeObject(new Byte((byte) 123));
-        } catch (Exception excp) {
-            fail("Exception " + excp.getClass() + " is thrown: "
-                    + excp.getMessage());
         } finally {
             e.close();
         }
@@ -472,9 +466,6 @@
 
         try {
             e.writeObject(new Character('a'));
-        } catch (Exception excp) {
-            fail("Exception " + excp.getClass() + " is thrown: "
-                    + excp.getMessage());
         } finally {
             e.close();
         }
@@ -494,9 +485,6 @@
 
         try {
             e.writeObject(Object.class);
-        } catch (Exception excp) {
-            fail("Exception " + excp.getClass() + " is thrown: "
-                    + excp.getMessage());
         } finally {
             e.close();
         }
@@ -516,9 +504,6 @@
 
         try {
             e.writeObject(new Double(0.01));
-        } catch (Exception excp) {
-            fail("Exception " + excp.getClass() + " is thrown: "
-                    + excp.getMessage());
         } finally {
             e.close();
         }
@@ -538,9 +523,6 @@
 
         try {
             e.writeObject(new Float((float) 0.01));
-        } catch (Exception excp) {
-            fail("Exception " + excp.getClass() + " is thrown: "
-                    + excp.getMessage());
         } finally {
             e.close();
         }
@@ -560,9 +542,6 @@
 
         try {
             e.writeObject(new Integer(1));
-        } catch (Exception excp) {
-            fail("Exception " + excp.getClass() + " is thrown: "
-                    + excp.getMessage());
         } finally {
             e.close();
         }
@@ -582,9 +561,6 @@
 
         try {
             e.writeObject(new Long(1));
-        } catch (Exception excp) {
-            fail("Exception " + excp.getClass() + " is thrown: "
-                    + excp.getMessage());
         } finally {
             e.close();
         }
@@ -604,9 +580,6 @@
 
         try {
             e.writeObject(new Short((short) 1));
-        } catch (Exception excp) {
-            fail("Exception " + excp.getClass() + " is thrown: "
-                    + excp.getMessage());
         } finally {
             e.close();
         }
@@ -626,9 +599,6 @@
 
         try {
             e.writeObject(new String("hello"));
-        } catch (Exception excp) {
-            fail("Exception " + excp.getClass() + " is thrown: "
-                    + excp.getMessage());
         } finally {
             e.close();
         }
@@ -648,9 +618,6 @@
 
         try {
             e.writeObject(new int[] { 1, 2, 3 });
-        } catch (Exception excp) {
-            fail("Exception " + excp.getClass() + " is thrown: "
-                    + excp.getMessage());
         } finally {
             e.close();
         }
@@ -670,9 +637,6 @@
 
         try {
             e.writeObject(null);
-        } catch (Exception excp) {
-            fail("Exception " + excp.getClass() + " is thrown: "
-                    + excp.getMessage());
         } finally {
             e.close();
         }
@@ -701,9 +665,6 @@
         try {
             e.writeObject(bean1);
             e.writeObject(bean2);
-        } catch (Exception excp) {
-            fail("Exception " + excp.getClass() + " is thrown: "
-                    + excp.getMessage());
         } finally {
             e.close();
         }
@@ -739,9 +700,6 @@
             // e.writeObject(object);
             e.writeObject(a);
             e.writeObject(object);
-        } catch (Exception excp) {
-            fail("Exception " + excp.getClass() + " is thrown: "
-                    + excp.getMessage());
         } finally {
             e.close();
         }



Mime
View raw message