mirror of https://github.com/apache/openjpa.git
OPENJPA-1529 Committing test case updates contributed by Dianne Richards.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@915904 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fb57d61322
commit
8ef5a5dda1
|
@ -32,6 +32,7 @@ public class TestCacheModeInvalid extends AbstractCacheTestCase {
|
|||
public void setUp() {}
|
||||
|
||||
public void testInvalidElement() {
|
||||
boolean exceptionCaught = false;
|
||||
try {
|
||||
Map<String, Object> propertiesMap = getPropertiesMap("openjpa.DataCache", "true",
|
||||
"openjpa.QueryCache", "true",
|
||||
|
@ -40,10 +41,12 @@ public class TestCacheModeInvalid extends AbstractCacheTestCase {
|
|||
emf = (OpenJPAEntityManagerFactorySPI) OpenJPAPersistence.createEntityManagerFactory("cache-mode-invalid",
|
||||
"META-INF/caching-persistence-invalid.xml", propertiesMap );
|
||||
} catch (Throwable e) {
|
||||
exceptionCaught = true;
|
||||
assertException(e, org.apache.openjpa.util.GeneralException.class);
|
||||
String msg = e.getMessage();
|
||||
assertTrue(msg.contains("org.xml.sax.SAXException"));
|
||||
}
|
||||
assertTrue(exceptionCaught);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,15 +32,18 @@ public class TestPropertyCacheModeInvalid extends AbstractCacheTestCase {
|
|||
public void setUp() {}
|
||||
|
||||
public void testInvalidPropertyValue() {
|
||||
boolean exceptionCaught = false;
|
||||
try {
|
||||
Map<String, Object> propertyMap = new HashMap<String, Object>();
|
||||
propertyMap.put("javax.persistence.sharedCache.mode", "INVALID");
|
||||
emf = createEntityManagerFactory("cache-mode-empty",propertyMap);
|
||||
} catch (Throwable e) {
|
||||
exceptionCaught = true;
|
||||
assertException(e, java.lang.IllegalArgumentException.class);
|
||||
String msg = e.getMessage();
|
||||
assertTrue(msg.contains("javax.persistence.SharedCacheMode.INVALID"));
|
||||
}
|
||||
assertTrue(exceptionCaught);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue