openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mprud...@apache.org
Subject svn commit: r505825 - /incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/CompanyModelTest.java
Date Sun, 11 Feb 2007 02:35:33 GMT
Author: mprudhom
Date: Sat Feb 10 18:35:33 2007
New Revision: 505825

URL: http://svn.apache.org/viewvc?view=rev&rev=505825
Log:
Added extra debugging logic to make sure the default company model deserailizes from the companies.xml
file.

Modified:
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/CompanyModelTest.java

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/CompanyModelTest.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/CompanyModelTest.java?view=diff&rev=505825&r1=505824&r2=505825
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/CompanyModelTest.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/CompanyModelTest.java
Sat Feb 10 18:35:33 2007
@@ -180,9 +180,19 @@
             // the classes statically
             factoryClasses = impls;
             try {
-                Collection obs = (Collection) new XMLDecoder
-                    (CompanyModelTest.class.
-                        getResourceAsStream("companies.xml")).readObject();
+                final List<Exception> exceptions = new LinkedList<Exception>();
+                XMLDecoder decoder = new XMLDecoder(CompanyModelTest.class.
+                    getResourceAsStream("companies.xml"));
+                decoder.setExceptionListener(new ExceptionListener() {
+                    public void exceptionThrown(Exception e) {
+                        exceptions.add(e);
+                    }
+                });
+                Collection obs = (Collection) decoder.readObject();
+
+                if (exceptions.size() > 0) {
+                    throw new IllegalStateException(exceptions.get(0));
+                }
 
                 assertNotNull(obs);
 



Mime
View raw message