jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r520400 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ReferencesTest.java
Date Tue, 20 Mar 2007 14:16:23 GMT
Author: reschke
Date: Tue Mar 20 07:16:22 2007
New Revision: 520400

URL: http://svn.apache.org/viewvc?view=rev&rev=520400
Log:
fix indentation

Modified:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ReferencesTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ReferencesTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ReferencesTest.java?view=diff&rev=520400&r1=520399&r2=520400
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ReferencesTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ReferencesTest.java
Tue Mar 20 07:16:22 2007
@@ -35,132 +35,132 @@
      */
     public void testReferences() throws RepositoryException {
         Node n1 = testRootNode.addNode(nodeName1, testNodeType);
-	n1.addMixin(mixReferenceable);
+        n1.addMixin(mixReferenceable);
         // with some impls. the mixin type has only affect upon save
         testRootNode.save();
 
         // create references: n2.p1 -> n1
-	Node n2 = testRootNode.addNode(nodeName2, testNodeType);
-	Property p1 = n2.setProperty(propertyName1, new Value[]{superuser.getValueFactory().createValue(n1)});
-	testRootNode.save();
-	PropertyIterator iter = n1.getReferences();
-	if (iter.hasNext()) {
-	    assertEquals("Wrong referer", iter.nextProperty().getPath(), p1.getPath());
-	} else {
-	    fail("no referer");
-	}
-
-	// create references: n3.p1 -> n1
-	Node n3 = testRootNode.addNode(nodeName3, testNodeType);
-	n3.setProperty(propertyName1, n1);
-	testRootNode.save();
-	iter = n1.getReferences();
-	while (iter.hasNext()) {
-	    Property p = iter.nextProperty();
-	    if (n2 != null && p.getParent().getPath().equals(n2.getPath())) {
-		n2 = null;
-	    } else if (n3 != null && p.getParent().getPath().equals(n3.getPath())) {
-		n3 = null;
-	    } else {
-		fail("too many referers: " + p.getPath());
-	    }
-	}
-	if (n2 != null) {
-	    fail("referer not in references set: " + n2.getPath());
-	}
-	if (n3 != null) {
-	    fail("referer not in references set: " + n3.getPath());
-	}
-
-	// remove reference n3.p1 -> n1
-	testRootNode.getNode(nodeName3).getProperty(propertyName1).remove();
-	testRootNode.save();
-	iter = n1.getReferences();
-	if (iter.hasNext()) {
-	    assertEquals("Wrong referer", iter.nextProperty().getParent().getPath(), testRootNode.getNode(nodeName2).getPath());
-	} else {
-	    fail("no referer");
-	}
-	if (iter.hasNext()) {
-	    fail("too many referers: " + iter.nextProperty().getPath());
-	}
-
-	// remove reference n2.p1 -> n1
-	testRootNode.getNode(nodeName2).getProperty(propertyName1).setValue(new Value[0]);
-	testRootNode.save();
-	iter = n1.getReferences();
-	if (iter.hasNext()) {
-	    fail("too many referers: " + iter.nextProperty().getPath());
-	}
+        Node n2 = testRootNode.addNode(nodeName2, testNodeType);
+        Property p1 = n2.setProperty(propertyName1, new Value[]{superuser.getValueFactory().createValue(n1)});
+        testRootNode.save();
+        PropertyIterator iter = n1.getReferences();
+        if (iter.hasNext()) {
+            assertEquals("Wrong referer", iter.nextProperty().getPath(), p1.getPath());
+        } else {
+            fail("no referer");
+        }
+
+        // create references: n3.p1 -> n1
+        Node n3 = testRootNode.addNode(nodeName3, testNodeType);
+        n3.setProperty(propertyName1, n1);
+        testRootNode.save();
+        iter = n1.getReferences();
+        while (iter.hasNext()) {
+            Property p = iter.nextProperty();
+            if (n2 != null && p.getParent().getPath().equals(n2.getPath())) {
+                n2 = null;
+            } else if (n3 != null && p.getParent().getPath().equals(n3.getPath()))
{
+                n3 = null;
+            } else {
+                fail("too many referers: " + p.getPath());
+            }
+        }
+        if (n2 != null) {
+            fail("referer not in references set: " + n2.getPath());
+        }
+        if (n3 != null) {
+            fail("referer not in references set: " + n3.getPath());
+        }
+
+        // remove reference n3.p1 -> n1
+        testRootNode.getNode(nodeName3).getProperty(propertyName1).remove();
+        testRootNode.save();
+        iter = n1.getReferences();
+        if (iter.hasNext()) {
+            assertEquals("Wrong referer", iter.nextProperty().getParent().getPath(), testRootNode.getNode(nodeName2).getPath());
+        } else {
+            fail("no referer");
+        }
+        if (iter.hasNext()) {
+            fail("too many referers: " + iter.nextProperty().getPath());
+        }
+
+        // remove reference n2.p1 -> n1
+        testRootNode.getNode(nodeName2).getProperty(propertyName1).setValue(new Value[0]);
+        testRootNode.save();
+        iter = n1.getReferences();
+        if (iter.hasNext()) {
+            fail("too many referers: " + iter.nextProperty().getPath());
+        }
     }
 
     /**
      * Tests Property.getNode();
      */
     public void testReferenceTarget() throws RepositoryException {
-	Node n1 = testRootNode.addNode(nodeName1, testNodeType);
-	n1.addMixin(mixReferenceable);
+        Node n1 = testRootNode.addNode(nodeName1, testNodeType);
+        n1.addMixin(mixReferenceable);
         // with some impls. the mixin type has only affect upon save
         testRootNode.save();
 
         // create references: n2.p1 -> n1
-	Node n2 = testRootNode.addNode(nodeName2, testNodeType);
-	n2.setProperty(propertyName1, n1);
-	testRootNode.save();
-	assertEquals("Wrong reference target.", n2.getProperty(propertyName1).getNode(), n1);
-	n2.remove();
-	testRootNode.save();
+        Node n2 = testRootNode.addNode(nodeName2, testNodeType);
+        n2.setProperty(propertyName1, n1);
+        testRootNode.save();
+        assertEquals("Wrong reference target.", n2.getProperty(propertyName1).getNode(),
n1);
+        n2.remove();
+        testRootNode.save();
     }
 
     /**
      * Tests changing a reference property
      */
     public void testAlterReference() throws RepositoryException {
-	Node n1 = testRootNode.addNode(nodeName1, testNodeType);
-	n1.addMixin(mixReferenceable);
-	Node n2 = testRootNode.addNode(nodeName2, testNodeType);
-	n2.addMixin(mixReferenceable);
+        Node n1 = testRootNode.addNode(nodeName1, testNodeType);
+        n1.addMixin(mixReferenceable);
+        Node n2 = testRootNode.addNode(nodeName2, testNodeType);
+        n2.addMixin(mixReferenceable);
         // with some impls. the mixin type has only affect upon save
         testRootNode.save();
 
         // create references: n3.p1 -> n1
-	Node n3 = testRootNode.addNode(nodeName3, testNodeType);
-	n3.setProperty(propertyName1, n1);
-	testRootNode.save();
-	assertEquals("Wrong reference target.", n3.getProperty(propertyName1).getNode(), n1);
-	PropertyIterator iter = n1.getReferences();
-	if (iter.hasNext()) {
-	    assertEquals("Wrong referer", iter.nextProperty().getParent().getPath(), n3.getPath());
-	} else {
-	    fail("no referer");
-	}
-	if (iter.hasNext()) {
-	    fail("too many referers: " + iter.nextProperty().getPath());
-	}
-	// change reference: n3.p1 -> n2
-	n3.setProperty(propertyName1, n2);
-	n3.save();
-	assertEquals("Wrong reference target.", n3.getProperty(propertyName1).getNode(), n2);
-	iter = n1.getReferences();
-	if (iter.hasNext()) {
-	    fail("too many referers: " + iter.nextProperty().getPath());
-	}
-	iter = n2.getReferences();
-	if (iter.hasNext()) {
-	    assertEquals("Wrong referer", iter.nextProperty().getParent().getPath(), n3.getPath());
-	} else {
-	    fail("no referers");
-	}
-	if (iter.hasNext()) {
-	    fail("too many referers: " + iter.nextProperty().getPath());
-	}
-
-	// clear reference by overwriting by other type
-	n3.setProperty(propertyName1, "Hello, world.");
-	n3.save();
-	iter = n2.getReferences();
-	if (iter.hasNext()) {
-	    fail("too many referers: " + iter.nextProperty().getPath());
-	}
+        Node n3 = testRootNode.addNode(nodeName3, testNodeType);
+        n3.setProperty(propertyName1, n1);
+        testRootNode.save();
+        assertEquals("Wrong reference target.", n3.getProperty(propertyName1).getNode(),
n1);
+        PropertyIterator iter = n1.getReferences();
+        if (iter.hasNext()) {
+            assertEquals("Wrong referer", iter.nextProperty().getParent().getPath(), n3.getPath());
+        } else {
+            fail("no referer");
+        }
+        if (iter.hasNext()) {
+            fail("too many referers: " + iter.nextProperty().getPath());
+        }
+        // change reference: n3.p1 -> n2
+        n3.setProperty(propertyName1, n2);
+        n3.save();
+        assertEquals("Wrong reference target.", n3.getProperty(propertyName1).getNode(),
n2);
+        iter = n1.getReferences();
+        if (iter.hasNext()) {
+            fail("too many referers: " + iter.nextProperty().getPath());
+        }
+        iter = n2.getReferences();
+        if (iter.hasNext()) {
+            assertEquals("Wrong referer", iter.nextProperty().getParent().getPath(), n3.getPath());
+        } else {
+            fail("no referers");
+        }
+        if (iter.hasNext()) {
+            fail("too many referers: " + iter.nextProperty().getPath());
+        }
+
+        // clear reference by overwriting by other type
+        n3.setProperty(propertyName1, "Hello, world.");
+        n3.save();
+        iter = n2.getReferences();
+        if (iter.hasNext()) {
+            fail("too many referers: " + iter.nextProperty().getPath());
+        }
     }
 }



Mime
View raw message