jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r598488 - /jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/PrepareTestRepository.java
Date Tue, 27 Nov 2007 01:29:15 GMT
Author: jukka
Date: Mon Nov 26 17:29:14 2007
New Revision: 598488

URL: http://svn.apache.org/viewvc?rev=598488&view=rev
Log:
JCR-1235: Check if test node types already exist before registering them

Modified:
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/PrepareTestRepository.java

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/PrepareTestRepository.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/PrepareTestRepository.java?rev=598488&r1=598487&r2=598488&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/PrepareTestRepository.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/PrepareTestRepository.java
Mon Nov 26 17:29:14 2007
@@ -42,13 +42,15 @@
 
     public void testPrepareTestRepository()
             throws RepositoryException, IOException {
-        InputStream xml = getClass().getResourceAsStream("test-nodetypes.xml");
-        try {
-            JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
+        JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
             superuser.getWorkspace().getNodeTypeManager();
-            manager.registerNodeTypes(xml, JackrabbitNodeTypeManager.TEXT_XML);
-        } finally {
-            xml.close();
+        if (!manager.hasNodeType("test:versionable")) {
+            InputStream xml = getClass().getResourceAsStream("test-nodetypes.xml");
+            try {
+                manager.registerNodeTypes(xml, JackrabbitNodeTypeManager.TEXT_XML);
+            } finally {
+                xml.close();
+            }
         }
 
         Node data = getOrAddNode(superuser.getRootNode(), "testdata");



Mime
View raw message