jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1005450 - /jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/JcrUtilsTest.java
Date Thu, 07 Oct 2010 14:02:15 GMT
Author: jukka
Date: Thu Oct  7 14:02:15 2010
New Revision: 1005450

URL: http://svn.apache.org/viewvc?rev=1005450&view=rev
Log:
JCR-2771: Simplified Repository URI format for JNDI lookups

Extend the test case to cover also the case of a missing repository

Modified:
    jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/JcrUtilsTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/JcrUtilsTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/JcrUtilsTest.java?rev=1005450&r1=1005449&r2=1005450&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/JcrUtilsTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/JcrUtilsTest.java
Thu Oct  7 14:02:15 2010
@@ -20,6 +20,7 @@ import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Map;
 
+import javax.jcr.RepositoryException;
 import javax.naming.InitialContext;
 
 public class JcrUtilsTest extends MockCase {
@@ -57,6 +58,13 @@ public class JcrUtilsTest extends MockCa
         assertTrue(repository == JcrUtils.getRepository(
                 "jndi://org.osjava.sj.memory.MemoryContextFactory/repository"
                 + "?org.osjava.sj.jndi.shared=true"));
+
+        try {
+            JcrUtils.getRepository(
+                    "jndi://org.osjava.sj.memory.MemoryContextFactory/missing");
+            fail("Repository lookup failure should throw an exception");
+        } catch (RepositoryException expected) {
+        }
     }
 
 }



Mime
View raw message