From 7d0839f9ff14644050133a19edcb61d030432602 Mon Sep 17 00:00:00 2001 From: Marc Prud'hommeaux Date: Sun, 11 Feb 2007 02:35:33 +0000 Subject: [PATCH] Added extra debugging logic to make sure the default company model deserailizes from the companies.xml file. git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@505825 13f79535-47bb-0310-9956-ffa450edef68 --- .../models/company/CompanyModelTest.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/CompanyModelTest.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/CompanyModelTest.java index c2dd863d3..73d41a7b4 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/CompanyModelTest.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/CompanyModelTest.java @@ -180,9 +180,19 @@ public abstract class CompanyModelTest extends SingleEMTest { // the classes statically factoryClasses = impls; try { - Collection obs = (Collection) new XMLDecoder - (CompanyModelTest.class. - getResourceAsStream("companies.xml")).readObject(); + final List exceptions = new LinkedList(); + 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);