OPENJPA-1695 OutOfMemoryError from CacheMarshallerImpl.setInputUrlFromResourceLocation

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@954979 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ravi Prakash Palacherla 2010-06-15 17:47:02 +00:00
parent 152e5d2d4f
commit efa71484df
2 changed files with 11 additions and 3 deletions

View File

@ -223,7 +223,7 @@ public class CacheMarshallerImpl
List list = new ArrayList();
for (Enumeration e = cl.getResources(_inputResourceLocation);
e.hasMoreElements(); )
list.add(e);
list.add(e.nextElement());
if (list.size() > 1) {
if (_consumeErrors) {

View File

@ -31,8 +31,9 @@ public class TestCacheMarshaller
"default(Id=" + getClass().getName() + ", ValidationPolicy="
+ OpenJPAVersionAndConfigurationTypeValidationPolicy.class
.getName()
+ ", InputURL=file:target/" + getClass().getName() + ".ser"
+ ", OutputFile=target/"
+ ", InputURL=file:target/test-classes/"
+ getClass().getName() + ".ser"
+ ", OutputFile=target/test-classes/"
+ getClass().getName() + ".ser)"
});
emf.createEntityManager().close();
@ -67,4 +68,11 @@ public class TestCacheMarshaller
cm.store(o);
assertEquals(o, cm.load());
}
public void testendConfiguration() {
((CacheMarshallerImpl)cm).setInputURL(null);
((CacheMarshallerImpl)cm)
.setInputResource(getClass().getName() + ".ser");
((CacheMarshallerImpl)cm).endConfiguration();
}
}