openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jrba...@apache.org
Subject svn commit: r915904 - in /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa: TestCacheModeInvalid.java TestPropertyCacheModeInvalid.java
Date Wed, 24 Feb 2010 18:09:01 GMT
Author: jrbauer
Date: Wed Feb 24 18:09:01 2010
New Revision: 915904

URL: http://svn.apache.org/viewvc?rev=915904&view=rev
Log:
OPENJPA-1529 Committing test case updates contributed by Dianne Richards.

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeInvalid.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeInvalid.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeInvalid.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeInvalid.java?rev=915904&r1=915903&r2=915904&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeInvalid.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeInvalid.java
Wed Feb 24 18:09:01 2010
@@ -32,6 +32,7 @@
     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 @@
             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

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeInvalid.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeInvalid.java?rev=915904&r1=915903&r2=915904&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeInvalid.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeInvalid.java
Wed Feb 24 18:09:01 2010
@@ -32,15 +32,18 @@
     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



Mime
View raw message