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
This commit is contained in:
Marc Prud'hommeaux 2007-02-11 02:35:33 +00:00
parent ecf428bd69
commit 7d0839f9ff
1 changed files with 13 additions and 3 deletions

View File

@ -180,9 +180,19 @@ public abstract class CompanyModelTest extends SingleEMTest {
// the classes statically // the classes statically
factoryClasses = impls; factoryClasses = impls;
try { try {
Collection obs = (Collection) new XMLDecoder final List<Exception> exceptions = new LinkedList<Exception>();
(CompanyModelTest.class. XMLDecoder decoder = new XMLDecoder(CompanyModelTest.class.
getResourceAsStream("companies.xml")).readObject(); 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); assertNotNull(obs);