jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r577855 - in /jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api: AbstractImportXmlTest.java SerializationTest.java
Date Thu, 20 Sep 2007 18:31:31 GMT
Author: jukka
Date: Thu Sep 20 11:31:31 2007
New Revision: 577855

URL: http://svn.apache.org/viewvc?rev=577855&view=rev
Log:
1.3: Merged revision 567695 (JCR-1069)

Modified:
    jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/AbstractImportXmlTest.java
    jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SerializationTest.java

Modified: jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/AbstractImportXmlTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/AbstractImportXmlTest.java?rev=577855&r1=577854&r2=577855&view=diff
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/AbstractImportXmlTest.java
(original)
+++ jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/AbstractImportXmlTest.java
Thu Sep 20 11:31:31 2007
@@ -135,31 +135,43 @@
     public void setUp() throws Exception {
         super.setUp();
 
-        dom = factory.newDocumentBuilder();
-        file = File.createTempFile("docViewImportTest", ".xml");
-        log.print("Tempfile: " + file.getAbsolutePath());
-        session = superuser;
-        workspace = session.getWorkspace();
-        // create the target nodes for the imports
-        target = testRoot + "/target";
-        targetNode = createAncestors(target);
-        refTarget = testRoot + "/refTarget";
-        refTargetNode = createAncestors(refTarget);
-
-        nsp = workspace.getNamespaceRegistry();
-        ntManager = workspace.getNodeTypeManager();
-
-        // construct a namespace not existing in the repository
-        unusedPrefix = getUnusedPrefix();
-        unusedURI = getUnusedURI();
-        referenced = nodeName1;
-        referencing = nodeName2;
-        // test if jcr:uuid of mix:referenceable node type is respected
-        respectMixRef = isMixRefRespected();
+        try {
+            dom = factory.newDocumentBuilder();
+            file = File.createTempFile("docViewImportTest", ".xml");
+            log.print("Tempfile: " + file.getAbsolutePath());
+            session = superuser;
+            workspace = session.getWorkspace();
+            // create the target nodes for the imports
+            target = testRoot + "/target";
+            targetNode = createAncestors(target);
+            refTarget = testRoot + "/refTarget";
+            refTargetNode = createAncestors(refTarget);
+  
+            nsp = workspace.getNamespaceRegistry();
+            ntManager = workspace.getNodeTypeManager();
+  
+            // construct a namespace not existing in the repository
+            unusedPrefix = getUnusedPrefix();
+            unusedURI = getUnusedURI();
+            referenced = nodeName1;
+            referencing = nodeName2;
+            // test if jcr:uuid of mix:referenceable node type is respected
+            respectMixRef = isMixRefRespected();
+        }
+        catch (Exception ex) {
+            if (file != null) {
+                file.delete();
+                file = null;
+            }
+            throw (ex);
+        }
     }
 
     public void tearDown() throws Exception {
-        file.delete();
+        if (file != null) {
+            file.delete();
+            file = null;
+        }
         super.tearDown();
     }
 

Modified: jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SerializationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SerializationTest.java?rev=577855&r1=577854&r2=577855&view=diff
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SerializationTest.java
(original)
+++ jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SerializationTest.java
Thu Sep 20 11:31:31 2007
@@ -74,18 +74,30 @@
     public void setUp() throws RepositoryException, Exception {
         super.setUp();
 
-        session = superuser;
-        workspace = session.getWorkspace();
-        file = File.createTempFile("test", ".xml");
-        log.print("Tempfile: " + file.getAbsolutePath());
-
-        SerializationContext sc = new SerializationContext(this);
-        treeComparator = new TreeComparator(sc, session);
-        treeComparator.createComplexTree(treeComparator.WORKSPACE);
+        try {
+            session = superuser;
+            workspace = session.getWorkspace();
+            file = File.createTempFile("serializationTest", ".xml");
+            log.print("Tempfile: " + file.getAbsolutePath());
+  
+            SerializationContext sc = new SerializationContext(this);
+            treeComparator = new TreeComparator(sc, session);
+            treeComparator.createComplexTree(treeComparator.WORKSPACE);
+        }
+        catch (Exception ex) {
+            if (file != null) {
+                file.delete();
+                file = null;
+            }
+            throw (ex);
+        }
     }
 
     public void tearDown() throws Exception {
-        file.delete();
+        if (file != null) {
+            file.delete();
+            file = null;
+        }
         if (session != null && session.isLive()) {
             session.logout();
         }



Mime
View raw message