Author: jverhaeg(a)redhat.com
Date: 2008-08-26 17:10:10 -0400 (Tue, 26 Aug 2008)
New Revision: 473
Modified:
trunk/dna-integration-tests/src/test/java/org/jboss/dna/tests/integration/jackrabbit/JackrabbitInMemoryTest.java
Log:
Added some tests to verify the inner workings of JackRabbit, which gives us the necessary
information to maximize our JCR implementation's compatibility with JackRabbit.
Modified:
trunk/dna-integration-tests/src/test/java/org/jboss/dna/tests/integration/jackrabbit/JackrabbitInMemoryTest.java
===================================================================
---
trunk/dna-integration-tests/src/test/java/org/jboss/dna/tests/integration/jackrabbit/JackrabbitInMemoryTest.java 2008-08-26
20:03:36 UTC (rev 472)
+++
trunk/dna-integration-tests/src/test/java/org/jboss/dna/tests/integration/jackrabbit/JackrabbitInMemoryTest.java 2008-08-26
21:10:10 UTC (rev 473)
@@ -21,7 +21,10 @@
*/
package org.jboss.dna.tests.integration.jackrabbit;
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsNull.notNullValue;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
import javax.jcr.Node;
import javax.jcr.Repository;
import javax.jcr.Session;
@@ -157,4 +160,25 @@
this.session.exportDocumentView("/jcr:system", System.out, true,
false);
}
+ @Test
+ public void shouldNotHaveNamePropertyForNodes() throws Exception {
+ Node node = session.getRootNode().addNode("test");
+ assertThat(node, notNullValue());
+ assertThat(node.hasProperty("jcr:name"), is(false));
+ }
+
+ @Test
+ public void shouldNotHaveUuidPropertyForNonReferenceableNodes() throws Exception {
+ Node node = session.getRootNode().addNode("test");
+ assertThat(node, notNullValue());
+ assertThat(node.hasProperty("jcr:uuid"), is(false));
+ }
+
+ @Test
+ public void shouldHaveUuidPropertyForReferenceableNodes() throws Exception {
+ Node node = session.getRootNode().addNode("test");
+ node.addMixin("mix:referenceable");
+ assertThat(node, notNullValue());
+ assertThat(node.hasProperty("jcr:uuid"), is(true));
+ }
}
Show replies by date