You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by tr...@apache.org on 2005/04/28 18:27:49 UTC
svn commit: r165159 [1/2] - in
/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit: core/query/
init/ test/api/ test/api/nodetype/ test/api/observation/ test/api/query/
test/api/version/
Author: tripod
Date: Thu Apr 28 09:27:46 2005
New Revision: 165159
URL: http://svn.apache.org/viewcvs?rev=165159&view=rev
Log:
- adapting tck to latest api 0.16.4.1
Modified:
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/query/SimpleQueryTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/init/NodeTestData.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/init/PropertyTestData.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/ReferencesTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyAssumeTypeTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyConstraintViolationExceptionTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyStringTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyValueTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueBinaryTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueBooleanTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueConstraintViolationExceptionTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueDateTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueDoubleTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueLongTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueReferenceTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueStringTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/TreeComparator.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyBinaryTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyBooleanTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyDateTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyDoubleTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyLongTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyMultipleTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyNameTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyPathTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyStringTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/NodeTypeUtil.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/observation/PropertyChangedTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/AbstractQueryLevel2Test.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/version/CheckinTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/version/RemoveVersionTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/version/VersionGraphTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/version/VersionTest.java
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/query/SimpleQueryTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/query/SimpleQueryTest.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/query/SimpleQueryTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/query/SimpleQueryTest.java Thu Apr 28 09:27:46 2005
@@ -91,12 +91,12 @@
Node n = testRootNode.addNode("marcel");
Calendar marcel = Calendar.getInstance();
marcel.set(1976, 4, 20, 15, 40);
- n.setProperty("birth", new Value[]{new DateValue(marcel)});
+ n.setProperty("birth", new Value[]{superuser.getValueFactory().createValue(marcel)});
n = testRootNode.addNode("vanessa");
Calendar vanessa = Calendar.getInstance();
vanessa.set(1975, 4, 10, 13, 30);
- n.setProperty("birth", new Value[]{new DateValue(vanessa)});
+ n.setProperty("birth", new Value[]{superuser.getValueFactory().createValue(vanessa)});
testRootNode.save();
@@ -113,11 +113,11 @@
public void testDoubleField() throws Exception {
Node n = testRootNode.addNode("node1");
- n.setProperty("value", new Value[]{new DoubleValue(1.9928375d)});
+ n.setProperty("value", new Value[]{superuser.getValueFactory().createValue(1.9928375d)});
n = testRootNode.addNode("node2");
- n.setProperty("value", new Value[]{new DoubleValue(0.0d)});
+ n.setProperty("value", new Value[]{superuser.getValueFactory().createValue(0.0d)});
n = testRootNode.addNode("node3");
- n.setProperty("value", new Value[]{new DoubleValue(-1.42982475d)});
+ n.setProperty("value", new Value[]{superuser.getValueFactory().createValue(-1.42982475d)});
testRootNode.save();
@@ -139,11 +139,11 @@
public void testLongField() throws Exception {
Node n = testRootNode.addNode("node1");
- n.setProperty("value", new Value[]{new LongValue(1)});
+ n.setProperty("value", new Value[]{superuser.getValueFactory().createValue(1)});
n = testRootNode.addNode("node2");
- n.setProperty("value", new Value[]{new LongValue(0)});
+ n.setProperty("value", new Value[]{superuser.getValueFactory().createValue(0)});
n = testRootNode.addNode("node3");
- n.setProperty("value", new Value[]{new LongValue(-1)});
+ n.setProperty("value", new Value[]{superuser.getValueFactory().createValue(-1)});
testRootNode.save();
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/init/NodeTestData.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/init/NodeTestData.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/init/NodeTestData.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/init/NodeTestData.java Thu Apr 28 09:27:46 2005
@@ -19,7 +19,6 @@
import javax.jcr.RepositoryException;
import javax.jcr.Node;
import javax.jcr.Value;
-import javax.jcr.ReferenceValue;
import java.util.StringTokenizer;
import java.util.Calendar;
import java.io.ByteArrayOutputStream;
@@ -108,8 +107,8 @@
Node multiReference = dataRoot.addNode("multiReference");
Value[] refs = new Value[2];
- refs[0] = new ReferenceValue(resource);
- refs[1] = new ReferenceValue(resReference);
+ refs[0] = superuser.getValueFactory().createValue(resource);
+ refs[1] = superuser.getValueFactory().createValue(resReference);
multiReference.setProperty("ref", refs);
log.println("Adding node: " + multiReference.getPath());
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/init/PropertyTestData.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/init/PropertyTestData.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/init/PropertyTestData.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/init/PropertyTestData.java Thu Apr 28 09:27:46 2005
@@ -20,7 +20,7 @@
import javax.jcr.RepositoryException;
import javax.jcr.Node;
-import javax.jcr.PathValue;
+import javax.jcr.PropertyType;
import java.io.IOException;
import java.util.StringTokenizer;
import java.util.Calendar;
@@ -61,7 +61,7 @@
Calendar c = Calendar.getInstance();
c.set(2005, 6, 18, 17, 30);
dataRoot.setProperty("calendar", c);
- dataRoot.setProperty("path", PathValue.valueOf("/"));
+ dataRoot.setProperty("path", superuser.getValueFactory().createValue("/", PropertyType.PATH));
dataRoot.setProperty("multi", new String[]{"one", "two", "three"});
superuser.save();
}
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/ReferencesTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/ReferencesTest.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/ReferencesTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/ReferencesTest.java Thu Apr 28 09:27:46 2005
@@ -38,7 +38,7 @@
n1.addMixin(mixReferenceable);
// create references: n2.p1 -> n1
Node n2 = testRootNode.addNode(nodeName2, testNodeType);
- Property p1 = n2.setProperty(propertyName1, new Value[]{new ReferenceValue(n1)});
+ Property p1 = n2.setProperty(propertyName1, new Value[]{superuser.getValueFactory().createValue(n1)});
testRootNode.save();
PropertyIterator iter = n1.getReferences();
if (iter.hasNext()) {
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyAssumeTypeTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyAssumeTypeTest.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyAssumeTypeTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyAssumeTypeTest.java Thu Apr 28 09:27:46 2005
@@ -27,7 +27,6 @@
import javax.jcr.PropertyType;
import javax.jcr.RepositoryException;
import javax.jcr.Property;
-import javax.jcr.PathValue;
/**
* <code>SetPropertyAssumeTypeTest</code> tests if when setting a property
@@ -66,14 +65,14 @@
public void setUp() throws Exception {
super.setUp();
- binaryValue = NodeTypeUtil.getValueOfType(PropertyType.BINARY);
- booleanValue = NodeTypeUtil.getValueOfType(PropertyType.BOOLEAN);
- dateValue = NodeTypeUtil.getValueOfType(PropertyType.DATE);
- doubleValue = NodeTypeUtil.getValueOfType(PropertyType.DOUBLE);
- longValue = NodeTypeUtil.getValueOfType(PropertyType.LONG);
- nameValue = NodeTypeUtil.getValueOfType(PropertyType.NAME);
- pathValue = NodeTypeUtil.getValueOfType(PropertyType.PATH);
- stringValue = NodeTypeUtil.getValueOfType(PropertyType.STRING);
+ binaryValue = NodeTypeUtil.getValueOfType(superuser, PropertyType.BINARY);
+ booleanValue = NodeTypeUtil.getValueOfType(superuser, PropertyType.BOOLEAN);
+ dateValue = NodeTypeUtil.getValueOfType(superuser, PropertyType.DATE);
+ doubleValue = NodeTypeUtil.getValueOfType(superuser, PropertyType.DOUBLE);
+ longValue = NodeTypeUtil.getValueOfType(superuser, PropertyType.LONG);
+ nameValue = NodeTypeUtil.getValueOfType(superuser, PropertyType.NAME);
+ pathValue = NodeTypeUtil.getValueOfType(superuser, PropertyType.PATH);
+ stringValue = NodeTypeUtil.getValueOfType(superuser, PropertyType.STRING);
binaryValues = new Value[] {binaryValue};
booleanValues = new Value[] {booleanValue};
@@ -97,7 +96,7 @@
Property prop;
// create an extra value for BINARY property to avoid IllegalStateException
- Value stringValueForBinary = NodeTypeUtil.getValueOfType(PropertyType.STRING);
+ Value stringValueForBinary = NodeTypeUtil.getValueOfType(superuser, PropertyType.STRING);
prop = testNode.setProperty(testPropName, stringValueForBinary, PropertyType.BINARY);
assertEquals("setProperty(String, Value, int) of a property of type undefined " +
"must assume the property type of the type parameter.",
@@ -129,7 +128,7 @@
prop.getType());
// create a PathValue that is convertible to the value of name property
- Value valueConvertibleToName = PathValue.valueOf(nameValue.getString());
+ Value valueConvertibleToName = superuser.getValueFactory().createValue(nameValue.getString(), PropertyType.PATH);
prop = testNode.setProperty(testPropName, valueConvertibleToName, PropertyType.NAME);
assertEquals("setProperty(String, Value, int) of a property of type undefined " +
"must assume the property type of the type parameter.",
@@ -162,7 +161,7 @@
// create an extra value for BINARY property to avoid IllegalStateException
Value stringValuesForBinary[] =
- new Value[] {NodeTypeUtil.getValueOfType(PropertyType.STRING)};
+ new Value[] {NodeTypeUtil.getValueOfType(superuser, PropertyType.STRING)};
prop = testNode.setProperty(testPropName, stringValuesForBinary, PropertyType.BINARY);
assertEquals("setProperty(String, Value, int) of a property of type undefined " +
"must assume the property type of the type parameter.",
@@ -195,7 +194,7 @@
// create a PathValue that is convertible to the value of name property
Value valuesConvertibleToName[] =
- new Value[] {PathValue.valueOf(nameValue.getString())};
+ new Value[] {superuser.getValueFactory().createValue(nameValue.getString(), PropertyType.PATH)};
prop = testNode.setProperty(testPropName, valuesConvertibleToName, PropertyType.NAME);
assertEquals("setProperty(String, Value, int) of a property of type undefined " +
"must assume the property type of the type parameter.",
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyConstraintViolationExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyConstraintViolationExceptionTest.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyConstraintViolationExceptionTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyConstraintViolationExceptionTest.java Thu Apr 28 09:27:46 2005
@@ -24,7 +24,6 @@
import javax.jcr.PropertyType;
import javax.jcr.Value;
import javax.jcr.Node;
-import javax.jcr.ReferenceValue;
import javax.jcr.nodetype.PropertyDefinition;
import javax.jcr.nodetype.ConstraintViolationException;
import javax.jcr.nodetype.NodeTypeManager;
@@ -62,7 +61,7 @@
}
// find a Value that does not satisfy the ValueConstraints of propDef
- Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, false);
if (valueNotSatisfied == null) {
throw new NotExecutableException("No boolean property def with " +
"testable value constraints has been found");
@@ -121,7 +120,7 @@
}
// find a Value that does not satisfy the ValueConstraints of propDef
- Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, false);
if (valueNotSatisfied == null) {
throw new NotExecutableException("No date property def with " +
"testable value constraints has been found");
@@ -180,7 +179,7 @@
}
// find a Value that does not satisfy the ValueConstraints of propDef
- Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, false);
if (valueNotSatisfied == null) {
throw new NotExecutableException("No double property def with " +
"testable value constraints has been found");
@@ -239,8 +238,8 @@
}
// find a Value that does not satisfy the ValueConstraints of propDef
- Value valueNotSatisfied1 = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
- Value valueNotSatisfied2 = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value valueNotSatisfied1 = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, false);
+ Value valueNotSatisfied2 = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, false);
if (valueNotSatisfied1 == null || valueNotSatisfied2 == null) {
throw new NotExecutableException("No binary property def with " +
"testable value constraints has been found");
@@ -299,7 +298,7 @@
}
// find a Value that does not satisfy the ValueConstraints of propDef
- Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, false);
if (valueNotSatisfied == null) {
throw new NotExecutableException("No long property def with " +
"testable value constraints has been found");
@@ -412,7 +411,7 @@
// test of signature setProperty(String name, Value value)
try {
- node.setProperty(propDef.getName(), new ReferenceValue(nodeNotSatisfied));
+ node.setProperty(propDef.getName(), superuser.getValueFactory().createValue(nodeNotSatisfied));
node.save();
fail("setProperty(String name, Value value) must throw a " +
"ConstraintViolationException if the change would violate a " +
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyStringTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyStringTest.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyStringTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyStringTest.java Thu Apr 28 09:27:46 2005
@@ -21,7 +21,6 @@
import javax.jcr.Value;
import javax.jcr.Node;
-import javax.jcr.StringValue;
import javax.jcr.ValueFormatException;
import javax.jcr.PropertyType;
@@ -67,13 +66,13 @@
sArrayNull[1] = null;
sArrayNull[2] = null;
- vArray1[0] = new StringValue("a");
- vArray1[1] = new StringValue("b");
- vArray1[2] = new StringValue("c");
-
- vArray2[0] = new StringValue("x");
- vArray2[1] = new StringValue("y");
- vArray2[2] = new StringValue("z");
+ vArray1[0] = superuser.getValueFactory().createValue("a");
+ vArray1[1] = superuser.getValueFactory().createValue("b");
+ vArray1[2] = superuser.getValueFactory().createValue("c");
+
+ vArray2[0] = superuser.getValueFactory().createValue("x");
+ vArray2[1] = superuser.getValueFactory().createValue("y");
+ vArray2[2] = superuser.getValueFactory().createValue("z");
}
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyValueTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyValueTest.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyValueTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetPropertyValueTest.java Thu Apr 28 09:27:46 2005
@@ -21,9 +21,6 @@
import javax.jcr.Value;
import javax.jcr.Node;
-import javax.jcr.StringValue;
-import javax.jcr.BooleanValue;
-import javax.jcr.LongValue;
import javax.jcr.ValueFormatException;
import javax.jcr.PropertyType;
@@ -43,8 +40,8 @@
private Node testNode;
- private Value v1 = new StringValue("abc");
- private Value v2 = new StringValue("xyz");
+ private Value v1;
+ private Value v2;
private Value[] vArray1 = new Value[3];
private Value[] vArray2 = new Value[3];
@@ -56,20 +53,23 @@
super.setUp();
testNode = testRootNode.addNode(nodeName1, testNodeType);
- vArray1[0] = new StringValue("a");
- vArray1[1] = new StringValue("b");
- vArray1[2] = new StringValue("c");
-
- vArray2[0] = new StringValue("x");
- vArray2[1] = new StringValue("y");
- vArray2[2] = new StringValue("z");
-
- vArrayMixed[0] = new StringValue("abc");
- vArrayMixed[1] = new BooleanValue(true);
- vArrayMixed[2] = new LongValue(2147483650L);
+ v1 = superuser.getValueFactory().createValue("abc");
+ v2 = superuser.getValueFactory().createValue("xyz");
- vArrayWithNulls[1] = new StringValue("a");
- vArrayWithNulls[3] = new StringValue("z");
+ vArray1[0] = superuser.getValueFactory().createValue("a");
+ vArray1[1] = superuser.getValueFactory().createValue("b");
+ vArray1[2] = superuser.getValueFactory().createValue("c");
+
+ vArray2[0] = superuser.getValueFactory().createValue("x");
+ vArray2[1] = superuser.getValueFactory().createValue("y");
+ vArray2[2] = superuser.getValueFactory().createValue("z");
+
+ vArrayMixed[0] = superuser.getValueFactory().createValue("abc");
+ vArrayMixed[1] = superuser.getValueFactory().createValue(true);
+ vArrayMixed[2] = superuser.getValueFactory().createValue(2147483650L);
+
+ vArrayWithNulls[1] = superuser.getValueFactory().createValue("a");
+ vArrayWithNulls[3] = superuser.getValueFactory().createValue("z");
}
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueBinaryTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueBinaryTest.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueBinaryTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueBinaryTest.java Thu Apr 28 09:27:46 2005
@@ -21,7 +21,6 @@
import javax.jcr.Property;
import javax.jcr.Value;
import javax.jcr.RepositoryException;
-import javax.jcr.BinaryValue;
import javax.jcr.Node;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
@@ -45,7 +44,7 @@
/**
* The binary value
*/
- private BinaryValue value;
+ private Value value;
/**
* The binary data
@@ -67,13 +66,13 @@
// initialize some binary value
data = createRandomString(10).getBytes();
- value = new BinaryValue(new ByteArrayInputStream(data));
+ value = superuser.getValueFactory().createValue(new ByteArrayInputStream(data));
// create a new node under the testRootNode
node = testRootNode.addNode(nodeName1, testNodeType);
// create a new single-value property and save it
- property1 = node.setProperty(propertyName1, new BinaryValue(new ByteArrayInputStream(new byte[0])));
+ property1 = node.setProperty(propertyName1, superuser.getValueFactory().createValue(new ByteArrayInputStream(new byte[0])));
superuser.save();
}
@@ -118,7 +117,7 @@
* the parent Node
*/
public void testRemoveBooleanParent() throws RepositoryException {
- property1.setValue((BinaryValue) null);
+ property1.setValue((Value) null);
node.save();
try {
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueBooleanTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueBooleanTest.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueBooleanTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueBooleanTest.java Thu Apr 28 09:27:46 2005
@@ -21,7 +21,6 @@
import javax.jcr.Property;
import javax.jcr.Value;
import javax.jcr.RepositoryException;
-import javax.jcr.BooleanValue;
import javax.jcr.Node;
import javax.jcr.PathNotFoundException;
@@ -43,7 +42,7 @@
/**
* The boolean value
*/
- private BooleanValue value;
+ private Value value;
/**
* The node with the boolean property
@@ -59,7 +58,7 @@
super.setUp();
// initialize some boolean value
- value = new BooleanValue(true);
+ value = superuser.getValueFactory().createValue(true);
// create a new node under the testRootNode
node = testRootNode.addNode(nodeName1, testNodeType);
@@ -94,7 +93,7 @@
* the Session
*/
public void testRemoveBooleanSession() throws RepositoryException {
- property1.setValue((BooleanValue) null);
+ property1.setValue((Value) null);
superuser.save();
try {
@@ -110,7 +109,7 @@
* the parent Node
*/
public void testRemoveBooleanParent() throws RepositoryException {
- property1.setValue((BooleanValue) null);
+ property1.setValue((Value) null);
node.save();
try {
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueConstraintViolationExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueConstraintViolationExceptionTest.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueConstraintViolationExceptionTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueConstraintViolationExceptionTest.java Thu Apr 28 09:27:46 2005
@@ -25,7 +25,6 @@
import javax.jcr.Value;
import javax.jcr.Node;
import javax.jcr.Property;
-import javax.jcr.ReferenceValue;
import javax.jcr.nodetype.PropertyDefinition;
import javax.jcr.nodetype.ConstraintViolationException;
import javax.jcr.nodetype.NodeTypeManager;
@@ -62,15 +61,15 @@
}
// find a Value that does not satisfy the ValueConstraints of propDef
- Value valueNotSatisfied1 = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
- Value valueNotSatisfied2 = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value valueNotSatisfied1 = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, false);
+ Value valueNotSatisfied2 = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, false);
if (valueNotSatisfied1 == null || valueNotSatisfied2 == null) {
throw new NotExecutableException("No binary property def with " +
"testable value constraints has been found");
}
// find a Value that does satisfy the ValueConstraints of propDef
- Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, true);
+ Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, true);
if (valueSatisfied == null) {
throw new NotExecutableException("The value constraints do not allow any value.");
}
@@ -130,14 +129,14 @@
}
// find a Value that does not satisfy the ValueConstraints of propDef
- Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, false);
if (valueNotSatisfied == null) {
throw new NotExecutableException("No boolean property def with " +
"testable value constraints has been found");
}
// find a Value that does satisfy the ValueConstraints of propDef
- Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, true);
+ Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, true);
if (valueSatisfied == null) {
throw new NotExecutableException("The value constraints do not allow any value.");
}
@@ -197,14 +196,14 @@
}
// find a Value that does not satisfy the ValueConstraints of propDef
- Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, false);
if (valueNotSatisfied == null) {
throw new NotExecutableException("No date property def with " +
"testable value constraints has been found");
}
// find a Value that does satisfy the ValueConstraints of propDef
- Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, true);
+ Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, true);
if (valueSatisfied == null) {
throw new NotExecutableException("The value constraints do not allow any value.");
}
@@ -264,14 +263,14 @@
}
// find a Value that does not satisfy the ValueConstraints of propDef
- Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, false);
if (valueNotSatisfied == null) {
throw new NotExecutableException("No double property def with " +
"testable value constraints has been found");
}
// find a Value that does satisfy the ValueConstraints of propDef
- Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, true);
+ Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, true);
if (valueSatisfied == null) {
throw new NotExecutableException("The value constraints do not allow any value.");
}
@@ -331,14 +330,14 @@
}
// find a Value that does not satisfy the ValueConstraints of propDef
- Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, false);
if (valueNotSatisfied == null) {
throw new NotExecutableException("No long property def with " +
"testable value constraints has been found");
}
// find a Value that does satisfy the ValueConstraints of propDef
- Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, true);
+ Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, true);
if (valueSatisfied == null) {
throw new NotExecutableException("The value constraints do not allow any value.");
}
@@ -462,7 +461,7 @@
// test of signature setValue(Value value)
try {
- prop.setValue(new ReferenceValue(nodeNotSatisfied));
+ prop.setValue(superuser.getValueFactory().createValue(nodeNotSatisfied));
node.save();
fail("setValue(Value value) must throw a ConstraintViolationException " +
"if the change would violate a node type constraint " +
@@ -490,14 +489,14 @@
}
// find a Value that does not satisfy the ValueConstraints of propDef
- Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, false);
if (valueNotSatisfied == null) {
throw new NotExecutableException("No multiple binary property def with " +
"testable value constraints has been found");
}
// find a Value that does satisfy the ValueConstraints of propDef
- Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, true);
+ Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, true);
if (valueSatisfied == null) {
throw new NotExecutableException("The value constraints do not allow any value.");
}
@@ -545,14 +544,14 @@
}
// find a Value that does not satisfy the ValueConstraints of propDef
- Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, false);
if (valueNotSatisfied == null) {
throw new NotExecutableException("No multiple boolean property def with " +
"testable value constraints has been found");
}
// find a Value that does satisfy the ValueConstraints of propDef
- Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, true);
+ Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, true);
if (valueSatisfied == null) {
throw new NotExecutableException("The value constraints do not allow any value.");
}
@@ -601,14 +600,14 @@
}
// find a Value that does not satisfy the ValueConstraints of propDef
- Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, false);
if (valueNotSatisfied == null) {
throw new NotExecutableException("No multiple date property def with " +
"testable value constraints has been found");
}
// find a Value that does satisfy the ValueConstraints of propDef
- Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, true);
+ Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, true);
if (valueSatisfied == null) {
throw new NotExecutableException("The value constraints do not allow any value.");
}
@@ -656,14 +655,14 @@
}
// find a Value that does not satisfy the ValueConstraints of propDef
- Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, false);
if (valueNotSatisfied == null) {
throw new NotExecutableException("No multiple double property def with " +
"testable value constraints has been found");
}
// find a Value that does satisfy the ValueConstraints of propDef
- Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, true);
+ Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, true);
if (valueSatisfied == null) {
throw new NotExecutableException("The value constraints do not allow any value.");
}
@@ -712,14 +711,14 @@
}
// find a Value that does not satisfy the ValueConstraints of propDef
- Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value valueNotSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, false);
if (valueNotSatisfied == null) {
throw new NotExecutableException("No multiple long property def with " +
"testable value constraints has been found");
}
// find a Value that does satisfy the ValueConstraints of propDef
- Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, true);
+ Value valueSatisfied = NodeTypeUtil.getValueAccordingToValueConstraints(superuser, propDef, true);
if (valueSatisfied == null) {
throw new NotExecutableException("The value constraints do not allow any value.");
}
@@ -806,7 +805,7 @@
// create a referenceable node satisfying the constraint
nodeSatisfied = testRootNode.addNode(nodeName3, nodeTypeSatisfied);
nodeSatisfied.addMixin(mixReferenceable);
- Value valueSatisfied = new ReferenceValue(nodeSatisfied);
+ Value valueSatisfied = superuser.getValueFactory().createValue(nodeSatisfied);
// create a referenceable node not satisfying the constraint
nodeNotSatisfied = testRootNode.addNode(nodeName4, nodeTypeNotSatisfied);
@@ -821,7 +820,7 @@
// test of signature setValue(Value value)
try {
- Value valueNotSatisfied = new ReferenceValue(nodeNotSatisfied);
+ Value valueNotSatisfied = superuser.getValueFactory().createValue(nodeNotSatisfied);
prop.setValue(new Value[]{valueNotSatisfied});
node.save();
fail("setValue(Value[] values) must throw a ConstraintViolationException " +
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueDateTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueDateTest.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueDateTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueDateTest.java Thu Apr 28 09:27:46 2005
@@ -21,7 +21,6 @@
import javax.jcr.Property;
import javax.jcr.Value;
import javax.jcr.RepositoryException;
-import javax.jcr.DateValue;
import javax.jcr.Node;
import javax.jcr.PathNotFoundException;
import java.util.GregorianCalendar;
@@ -45,7 +44,7 @@
/**
* The date value
*/
- private DateValue value;
+ private Value value;
/**
* The node with the date property
@@ -61,7 +60,7 @@
super.setUp();
// initialize some date value
- value = new DateValue(GregorianCalendar.getInstance());
+ value = superuser.getValueFactory().createValue(GregorianCalendar.getInstance());
// create a new node under the testRootNode
node = testRootNode.addNode(nodeName1, testNodeType);
@@ -98,7 +97,7 @@
* the parent Node
*/
public void testRemoveDateParent() throws RepositoryException {
- property1.setValue((DateValue) null);
+ property1.setValue((Value) null);
node.save();
try {
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueDoubleTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueDoubleTest.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueDoubleTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueDoubleTest.java Thu Apr 28 09:27:46 2005
@@ -21,7 +21,6 @@
import javax.jcr.Property;
import javax.jcr.Value;
import javax.jcr.RepositoryException;
-import javax.jcr.DoubleValue;
import javax.jcr.Node;
import javax.jcr.PathNotFoundException;
@@ -43,7 +42,7 @@
/**
* The double value
*/
- private DoubleValue value;
+ private Value value;
/**
* The node with the double property
@@ -59,7 +58,7 @@
super.setUp();
// initialize some double value
- value = new DoubleValue(93845.94d);
+ value = superuser.getValueFactory().createValue(93845.94d);
// create a new node under the testRootNode
node = testRootNode.addNode(nodeName1, testNodeType);
@@ -94,7 +93,7 @@
* the Session
*/
public void testRemoveDoubleSession() throws RepositoryException {
- property1.setValue((DoubleValue) null);
+ property1.setValue((Value) null);
superuser.save();
try {
@@ -110,7 +109,7 @@
* the parent Node
*/
public void testRemoveDoubleParent() throws RepositoryException {
- property1.setValue((DoubleValue) null);
+ property1.setValue((Value) null);
node.save();
try {
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueLongTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueLongTest.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueLongTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueLongTest.java Thu Apr 28 09:27:46 2005
@@ -21,7 +21,6 @@
import javax.jcr.Property;
import javax.jcr.Value;
import javax.jcr.RepositoryException;
-import javax.jcr.LongValue;
import javax.jcr.Node;
import javax.jcr.PathNotFoundException;
@@ -43,7 +42,7 @@
/**
* The long value
*/
- private LongValue value;
+ private Value value;
/**
* The node with the long property
@@ -59,7 +58,7 @@
super.setUp();
// initialize some long value
- value = new LongValue(73057230);
+ value = superuser.getValueFactory().createValue(73057230);
// create a new node under the testRootNode
node = testRootNode.addNode(nodeName1, testNodeType);
@@ -94,7 +93,7 @@
* the parent Node
*/
public void testRemoveLongParent() throws RepositoryException {
- property1.setValue((LongValue) null);
+ property1.setValue((Value) null);
node.save();
try {
@@ -110,7 +109,7 @@
* the Session
*/
public void testRemoveLongSession() throws RepositoryException {
- property1.setValue((LongValue) null);
+ property1.setValue((Value) null);
superuser.save();
try {
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueReferenceTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueReferenceTest.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueReferenceTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueReferenceTest.java Thu Apr 28 09:27:46 2005
@@ -23,7 +23,6 @@
import javax.jcr.Value;
import javax.jcr.RepositoryException;
import javax.jcr.Node;
-import javax.jcr.ReferenceValue;
import javax.jcr.PathNotFoundException;
/**
@@ -46,7 +45,7 @@
/**
* The reference value
*/
- private ReferenceValue value;
+ private Value value;
/**
* The node with the reference property
@@ -70,7 +69,7 @@
ensureReferenceable(node);
// initialize some reference value
- value = new ReferenceValue(node);
+ value = superuser.getValueFactory().createValue(node);
// create a new single-value property and save it
property1 = node.setProperty(propertyName1, value);
@@ -102,7 +101,7 @@
* the Session
*/
public void testRemoveNodeSession() throws RepositoryException {
- property1.setValue((ReferenceValue) null);
+ property1.setValue((Value) null);
superuser.save();
try {
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueStringTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueStringTest.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueStringTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueStringTest.java Thu Apr 28 09:27:46 2005
@@ -21,7 +21,6 @@
import javax.jcr.Property;
import javax.jcr.Value;
import javax.jcr.Node;
-import javax.jcr.StringValue;
import javax.jcr.RepositoryException;
import javax.jcr.ValueFormatException;
import javax.jcr.PathNotFoundException;
@@ -59,8 +58,8 @@
super.setUp();
// initialize some multi-value properties
- sv1 = new StringValue(PROP_VALUE_1);
- sv2 = new StringValue(PROP_VALUE_2);
+ sv1 = superuser.getValueFactory().createValue(PROP_VALUE_1);
+ sv2 = superuser.getValueFactory().createValue(PROP_VALUE_2);
mv1 = new Value[]{sv1};
mv2 = new Value[]{sv1, sv2};
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/TreeComparator.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/TreeComparator.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/TreeComparator.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/TreeComparator.java Thu Apr 28 09:27:46 2005
@@ -24,8 +24,6 @@
import javax.jcr.Item;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
-import javax.jcr.NameValue;
-import javax.jcr.PathValue;
import javax.jcr.NodeIterator;
import javax.jcr.PropertyIterator;
import javax.jcr.Property;
@@ -230,9 +228,9 @@
// Boolean
pt.setProperty(sc.booleanTestProperty, true);
// Name
- pt.setProperty(sc.nameTestProperty, NameValue.valueOf(jcrPrimaryType));
+ pt.setProperty(sc.nameTestProperty, superuser.getValueFactory().createValue(jcrPrimaryType, PropertyType.NAME));
// Path
- pt.setProperty(sc.pathTestProperty, PathValue.valueOf("paths/dont/have/to/point/anywhere"));
+ pt.setProperty(sc.pathTestProperty, superuser.getValueFactory().createValue("paths/dont/have/to/point/anywhere", PropertyType.PATH));
// Reference: Note that I only check if the node exists. We do not specify what happens with
// the UUID during serialization.
if (!referenceable.isNodeType(mixReferenceable)) {
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyBinaryTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyBinaryTest.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyBinaryTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyBinaryTest.java Thu Apr 28 09:27:46 2005
@@ -82,42 +82,42 @@
NodeType nodeType = propDef.getDeclaringNodeType();
- Value stringValue = NodeTypeUtil.getValueOfType(PropertyType.STRING);
+ Value stringValue = NodeTypeUtil.getValueOfType(session, PropertyType.STRING);
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Binary and value is a StringValue",
nodeType.canSetProperty(propDef.getName(), stringValue));
- Value binaryValue = NodeTypeUtil.getValueOfType(PropertyType.BINARY);
+ Value binaryValue = NodeTypeUtil.getValueOfType(session, PropertyType.BINARY);
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Binary and value is a BinaryValue",
nodeType.canSetProperty(propDef.getName(), binaryValue));
- Value dateValue = NodeTypeUtil.getValueOfType(PropertyType.DATE);
+ Value dateValue = NodeTypeUtil.getValueOfType(session, PropertyType.DATE);
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Binary and value is a DateValue",
nodeType.canSetProperty(propDef.getName(), dateValue));
- Value doubleValue = NodeTypeUtil.getValueOfType(PropertyType.DOUBLE);
+ Value doubleValue = NodeTypeUtil.getValueOfType(session, PropertyType.DOUBLE);
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Binary and value is a DoubleValue",
nodeType.canSetProperty(propDef.getName(), doubleValue));
- Value longValue = NodeTypeUtil.getValueOfType(PropertyType.LONG);
+ Value longValue = NodeTypeUtil.getValueOfType(session, PropertyType.LONG);
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Binary and value is a LongValue",
nodeType.canSetProperty(propDef.getName(), longValue));
- Value booleanValue = NodeTypeUtil.getValueOfType(PropertyType.BOOLEAN);
+ Value booleanValue = NodeTypeUtil.getValueOfType(session, PropertyType.BOOLEAN);
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Binary and value is a BooleanValue",
nodeType.canSetProperty(propDef.getName(), booleanValue));
- Value nameValue = NodeTypeUtil.getValueOfType(PropertyType.NAME);
+ Value nameValue = NodeTypeUtil.getValueOfType(session, PropertyType.NAME);
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Binary and value is a NameValue",
nodeType.canSetProperty(propDef.getName(), nameValue));
- Value pathValue = NodeTypeUtil.getValueOfType(PropertyType.PATH);
+ Value pathValue = NodeTypeUtil.getValueOfType(session, PropertyType.PATH);
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Binary and value is a PathValue",
nodeType.canSetProperty(propDef.getName(), pathValue));
@@ -141,9 +141,9 @@
NodeType nodeType = propDef.getDeclaringNodeType();
- Value binaryValue = NodeTypeUtil.getValueOfType(PropertyType.BINARY);
+ Value binaryValue = NodeTypeUtil.getValueOfType(session, PropertyType.BINARY);
- Value stringValue = NodeTypeUtil.getValueOfType(PropertyType.STRING);
+ Value stringValue = NodeTypeUtil.getValueOfType(session, PropertyType.STRING);
Value stringValues[] = new Value[] {stringValue};
assertTrue("canSetProperty(String propertyName, Value[] values) must return " +
"true if the property is of type Binary and values are of type StringValue",
@@ -154,37 +154,37 @@
"true if the property is of type Binary and values are of type BinaryValue",
nodeType.canSetProperty(propDef.getName(), binaryValues));
- Value dateValue = NodeTypeUtil.getValueOfType(PropertyType.DATE);
+ Value dateValue = NodeTypeUtil.getValueOfType(session, PropertyType.DATE);
Value dateValues[] = new Value[] {dateValue};
assertTrue("canSetProperty(String propertyName, Value[] values) must return " +
"true if the property is of type Binary and values are of type DateValue",
nodeType.canSetProperty(propDef.getName(), dateValues));
- Value doubleValue = NodeTypeUtil.getValueOfType(PropertyType.DOUBLE);
+ Value doubleValue = NodeTypeUtil.getValueOfType(session, PropertyType.DOUBLE);
Value doubleValues[] = new Value[] {doubleValue};
assertTrue("canSetProperty(String propertyName, Value[] values) must return " +
"true if the property is of type Binary and values are of type DoubleValue",
nodeType.canSetProperty(propDef.getName(), doubleValues));
- Value longValue = NodeTypeUtil.getValueOfType(PropertyType.LONG);
+ Value longValue = NodeTypeUtil.getValueOfType(session, PropertyType.LONG);
Value longValues[] = new Value[] {longValue};
assertTrue("canSetProperty(String propertyName, Value[] values) must return " +
"true if the property is of type Binary and values are of type LongValue",
nodeType.canSetProperty(propDef.getName(), longValues));
- Value booleanValue = NodeTypeUtil.getValueOfType(PropertyType.BOOLEAN);
+ Value booleanValue = NodeTypeUtil.getValueOfType(session, PropertyType.BOOLEAN);
Value booleanValues[] = new Value[] {booleanValue};
assertTrue("canSetProperty(String propertyName, Value[] values) must return " +
"true if the property is of type Binary and values are of type BooleanValue",
nodeType.canSetProperty(propDef.getName(), booleanValues));
- Value nameValue = NodeTypeUtil.getValueOfType(PropertyType.NAME);
+ Value nameValue = NodeTypeUtil.getValueOfType(session, PropertyType.NAME);
Value nameValues[] = new Value[] {nameValue};
assertTrue("canSetProperty(String propertyName, Value[] values) must return " +
"true if the property is of type Binary and values are of type NameValue",
nodeType.canSetProperty(propDef.getName(), nameValues));
- Value pathValue = NodeTypeUtil.getValueOfType(PropertyType.PATH);
+ Value pathValue = NodeTypeUtil.getValueOfType(session, PropertyType.PATH);
Value pathValues[] = new Value[] {pathValue};
assertTrue("canSetProperty(String propertyName, Value[] values) must return " +
"true if the property is of type Binary and values are of type PathValue",
@@ -206,7 +206,7 @@
"testable value constraints has been found");
}
- Value value = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value value = NodeTypeUtil.getValueAccordingToValueConstraints(session, propDef, false);
if (value == null) {
throw new NotExecutableException("No binary property def with " +
"testable value constraints has been found");
@@ -234,7 +234,7 @@
"testable value constraints has been found");
}
- Value value = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value value = NodeTypeUtil.getValueAccordingToValueConstraints(session, propDef, false);
if (value == null) {
throw new NotExecutableException("No multiple binary property def with " +
"testable value constraints has been found");
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyBooleanTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyBooleanTest.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyBooleanTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyBooleanTest.java Thu Apr 28 09:27:46 2005
@@ -82,43 +82,43 @@
NodeType nodeType = propDef.getDeclaringNodeType();
- Value stringValue = NodeTypeUtil.getValueOfType(PropertyType.STRING);
+ Value stringValue = NodeTypeUtil.getValueOfType(session, PropertyType.STRING);
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Boolean and value is a StringValue",
nodeType.canSetProperty(propDef.getName(), stringValue));
- Value binaryValue = NodeTypeUtil.getValueOfType(PropertyType.BINARY);
+ Value binaryValue = NodeTypeUtil.getValueOfType(session, PropertyType.BINARY);
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Boolean and value is a BinaryValue" +
"in UTF-8",
nodeType.canSetProperty(propDef.getName(), binaryValue));
- Value dateValue = NodeTypeUtil.getValueOfType(PropertyType.DATE);
+ Value dateValue = NodeTypeUtil.getValueOfType(session, PropertyType.DATE);
assertFalse("canSetProperty(String propertyName, Value value) must return " +
"false if the property is of type Boolean and value is a DateValue",
nodeType.canSetProperty(propDef.getName(), dateValue));
- Value doubleValue = NodeTypeUtil.getValueOfType(PropertyType.DOUBLE);
+ Value doubleValue = NodeTypeUtil.getValueOfType(session, PropertyType.DOUBLE);
assertFalse("canSetProperty(String propertyName, Value value) must return " +
"false if the property is of type Boolean and value is a DoubleValue",
nodeType.canSetProperty(propDef.getName(), doubleValue));
- Value longValue = NodeTypeUtil.getValueOfType(PropertyType.LONG);
+ Value longValue = NodeTypeUtil.getValueOfType(session, PropertyType.LONG);
assertFalse("canSetProperty(String propertyName, Value value) must return " +
"false if the property is of type Boolean and value is a LongValue",
nodeType.canSetProperty(propDef.getName(), longValue));
- Value booleanValue = NodeTypeUtil.getValueOfType(PropertyType.BOOLEAN);
+ Value booleanValue = NodeTypeUtil.getValueOfType(session, PropertyType.BOOLEAN);
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Boolean and value is a BooleanValue",
nodeType.canSetProperty(propDef.getName(), booleanValue));
- Value nameValue = NodeTypeUtil.getValueOfType(PropertyType.NAME);
+ Value nameValue = NodeTypeUtil.getValueOfType(session, PropertyType.NAME);
assertFalse("canSetProperty(String propertyName, Value value) must return " +
"false if the property is of type Boolean and value is a NameValue",
nodeType.canSetProperty(propDef.getName(), nameValue));
- Value pathValue = NodeTypeUtil.getValueOfType(PropertyType.PATH);
+ Value pathValue = NodeTypeUtil.getValueOfType(session, PropertyType.PATH);
assertFalse("canSetProperty(String propertyName, Value value) must return " +
"false if the property is of type Boolean and value is a PathValue",
nodeType.canSetProperty(propDef.getName(), pathValue));
@@ -143,33 +143,33 @@
NodeType nodeType = propDef.getDeclaringNodeType();
- Value booleanValue = NodeTypeUtil.getValueOfType(PropertyType.BOOLEAN);
+ Value booleanValue = NodeTypeUtil.getValueOfType(session, PropertyType.BOOLEAN);
- Value stringValue = NodeTypeUtil.getValueOfType(PropertyType.STRING);
+ Value stringValue = NodeTypeUtil.getValueOfType(session, PropertyType.STRING);
Value stringValues[] = new Value[] {stringValue};
assertTrue("canSetProperty(String propertyName, Value[] values) must return " +
"true if the property is of type Boolean and values are of type StringValue",
nodeType.canSetProperty(propDef.getName(), stringValues));
- Value binaryValue = NodeTypeUtil.getValueOfType(PropertyType.BINARY);
+ Value binaryValue = NodeTypeUtil.getValueOfType(session, PropertyType.BINARY);
Value binaryValues[] = new Value[] {binaryValue};
assertTrue("canSetProperty(String propertyName, Value[] values) must return " +
"true if the property is of type Boolean and values are of type BinaryValue",
nodeType.canSetProperty(propDef.getName(), binaryValues));
- Value dateValue = NodeTypeUtil.getValueOfType(PropertyType.DATE);
+ Value dateValue = NodeTypeUtil.getValueOfType(session, PropertyType.DATE);
Value dateValues[] = new Value[] {booleanValue, dateValue};
assertFalse("canSetProperty(String propertyName, Value[] values) must return " +
"false if the property is of type Boolean and values are of type DateValue",
nodeType.canSetProperty(propDef.getName(), dateValues));
- Value doubleValue = NodeTypeUtil.getValueOfType(PropertyType.DOUBLE);
+ Value doubleValue = NodeTypeUtil.getValueOfType(session, PropertyType.DOUBLE);
Value doubleValues[] = new Value[] {booleanValue, doubleValue};
assertFalse("canSetProperty(String propertyName, Value[] values) must return " +
"false if the property is of type Boolean and values are of type DoubleValue",
nodeType.canSetProperty(propDef.getName(), doubleValues));
- Value longValue = NodeTypeUtil.getValueOfType(PropertyType.LONG);
+ Value longValue = NodeTypeUtil.getValueOfType(session, PropertyType.LONG);
Value longValues[] = new Value[] {booleanValue, longValue};
assertFalse("canSetProperty(String propertyName, Value[] values) must return " +
"false if the property is of type Boolean and values are of type LongValue",
@@ -180,13 +180,13 @@
"true if the property is of type Boolean and values are of type BooleanValue",
nodeType.canSetProperty(propDef.getName(), booleanValues));
- Value nameValue = NodeTypeUtil.getValueOfType(PropertyType.NAME);
+ Value nameValue = NodeTypeUtil.getValueOfType(session, PropertyType.NAME);
Value nameValues[] = new Value[] {booleanValue, nameValue};
assertFalse("canSetProperty(String propertyName, Value[] values) must return " +
"false if the property is of type Boolean and values are of type NameValue",
nodeType.canSetProperty(propDef.getName(), nameValues));
- Value pathValue = NodeTypeUtil.getValueOfType(PropertyType.PATH);
+ Value pathValue = NodeTypeUtil.getValueOfType(session, PropertyType.PATH);
Value pathValues[] = new Value[] {booleanValue, pathValue};
assertFalse("canSetProperty(String propertyName, Value[] values) must return " +
"false if the property is of type Boolean and values are of type PathValue",
@@ -208,7 +208,7 @@
"testable value constraints has been found");
}
- Value value = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value value = NodeTypeUtil.getValueAccordingToValueConstraints(session, propDef, false);
if (value == null) {
throw new NotExecutableException("No boolean property def with " +
"testable value constraints has been found");
@@ -236,7 +236,7 @@
"testable value constraints has been found");
}
- Value value = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value value = NodeTypeUtil.getValueAccordingToValueConstraints(session, propDef, false);
if (value == null) {
throw new NotExecutableException("No multiple boolean property def with " +
"testable value constraints has been found");
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyDateTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyDateTest.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyDateTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyDateTest.java Thu Apr 28 09:27:46 2005
@@ -19,11 +19,9 @@
import org.apache.jackrabbit.test.AbstractJCRTest;
import org.apache.jackrabbit.test.NotExecutableException;
-import javax.jcr.BinaryValue;
import javax.jcr.PropertyType;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
-import javax.jcr.StringValue;
import javax.jcr.Value;
import javax.jcr.nodetype.NodeType;
import javax.jcr.nodetype.PropertyDefinition;
@@ -84,58 +82,58 @@
NodeType nodeType = propDef.getDeclaringNodeType();
- Value anyStringValue = NodeTypeUtil.getValueOfType(PropertyType.STRING);
+ Value anyStringValue = NodeTypeUtil.getValueOfType(session, PropertyType.STRING);
assertFalse("canSetProperty(String propertyName, Value value) must return " +
"false if the property is of type Date and value is a StringValue " +
"not in date format",
nodeType.canSetProperty(propDef.getName(), anyStringValue));
- StringValue dateStringValue =
- new StringValue(NodeTypeUtil.getValueOfType(PropertyType.DATE).getString());
+ Value dateStringValue =
+ superuser.getValueFactory().createValue(NodeTypeUtil.getValueOfType(session, PropertyType.DATE).getString());
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Date and value is a StringValue " +
"in date format",
nodeType.canSetProperty(propDef.getName(), dateStringValue));
- Value anyBinaryValue = NodeTypeUtil.getValueOfType(PropertyType.BINARY);
+ Value anyBinaryValue = NodeTypeUtil.getValueOfType(session, PropertyType.BINARY);
assertFalse("canSetProperty(String propertyName, Value value) must return " +
"false if the property is of type Date and value is a UTF-8 " +
"BinaryValue not in date format",
nodeType.canSetProperty(propDef.getName(), anyBinaryValue));
- BinaryValue dateBinaryValue =
- new BinaryValue(NodeTypeUtil.getValueOfType(PropertyType.DATE).getString());
+ Value dateBinaryValue =
+ superuser.getValueFactory().createValue(NodeTypeUtil.getValueOfType(session, PropertyType.DATE).getString(), PropertyType.BINARY);
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Date and value is a UTF-8 " +
"BinaryValue in date format",
nodeType.canSetProperty(propDef.getName(), dateBinaryValue));
- Value dateValue = NodeTypeUtil.getValueOfType(PropertyType.DATE);
+ Value dateValue = NodeTypeUtil.getValueOfType(session, PropertyType.DATE);
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Date and value is a DateValue",
nodeType.canSetProperty(propDef.getName(), dateValue));
- Value doubleValue = NodeTypeUtil.getValueOfType(PropertyType.DOUBLE);
+ Value doubleValue = NodeTypeUtil.getValueOfType(session, PropertyType.DOUBLE);
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Date and value is a DoubleValue",
nodeType.canSetProperty(propDef.getName(), doubleValue));
- Value longValue = NodeTypeUtil.getValueOfType(PropertyType.LONG);
+ Value longValue = NodeTypeUtil.getValueOfType(session, PropertyType.LONG);
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Date and value is a LongValue",
nodeType.canSetProperty(propDef.getName(), longValue));
- Value booleanValue = NodeTypeUtil.getValueOfType(PropertyType.BOOLEAN);
+ Value booleanValue = NodeTypeUtil.getValueOfType(session, PropertyType.BOOLEAN);
assertFalse("canSetProperty(String propertyName, Value value) must return " +
"false if the property is of type Date and value is a BooleanValue",
nodeType.canSetProperty(propDef.getName(), booleanValue));
- Value nameValue = NodeTypeUtil.getValueOfType(PropertyType.NAME);
+ Value nameValue = NodeTypeUtil.getValueOfType(session, PropertyType.NAME);
assertFalse("canSetProperty(String propertyName, Value value) must return " +
"false if the property is of type Date and value is a NameValue",
nodeType.canSetProperty(propDef.getName(), nameValue));
- Value pathValue = NodeTypeUtil.getValueOfType(PropertyType.PATH);
+ Value pathValue = NodeTypeUtil.getValueOfType(session, PropertyType.PATH);
assertFalse("canSetProperty(String propertyName, Value value) must return " +
"false if the property is of type Date and value is a PathValue",
nodeType.canSetProperty(propDef.getName(), pathValue));
@@ -159,9 +157,9 @@
NodeType nodeType = propDef.getDeclaringNodeType();
- Value dateValue = NodeTypeUtil.getValueOfType(PropertyType.DATE);
+ Value dateValue = NodeTypeUtil.getValueOfType(session, PropertyType.DATE);
- Value anyStringValue = NodeTypeUtil.getValueOfType(PropertyType.STRING);
+ Value anyStringValue = NodeTypeUtil.getValueOfType(session, PropertyType.STRING);
// note: for assertFalse, use first value of requested type to check
// if not only first value is checked
Value anyStringValues[] = new Value[] {dateValue, anyStringValue};
@@ -170,8 +168,8 @@
"not in date format",
nodeType.canSetProperty(propDef.getName(), anyStringValues));
- StringValue dateStringValue =
- new StringValue(NodeTypeUtil.getValueOfType(PropertyType.DATE).getString());
+ Value dateStringValue =
+ superuser.getValueFactory().createValue(NodeTypeUtil.getValueOfType(session, PropertyType.DATE).getString());
Value dateStringValues[] = new Value[] {dateStringValue};
assertTrue("canSetProperty(String propertyName, Value[] values) must return " +
"true if the property is of type Date and values are of type StringValue " +
@@ -183,46 +181,46 @@
"true if the property is of type Date and values are of type DateValue",
nodeType.canSetProperty(propDef.getName(), dateValues));
- Value anyBinaryValue = NodeTypeUtil.getValueOfType(PropertyType.BINARY);
+ Value anyBinaryValue = NodeTypeUtil.getValueOfType(session, PropertyType.BINARY);
Value anyBinaryValues[] = new Value[] {dateValue, anyBinaryValue};
assertFalse("canSetProperty(String propertyName, Value[] values) must return " +
"false if the property is of type Date and values are of type BinaryValue" +
"in UTF-8 but not in date format",
nodeType.canSetProperty(propDef.getName(), anyBinaryValues));
- BinaryValue dateBinaryValue =
- new BinaryValue(NodeTypeUtil.getValueOfType(PropertyType.DATE).getString());
+ Value dateBinaryValue =
+ superuser.getValueFactory().createValue(NodeTypeUtil.getValueOfType(session, PropertyType.DATE).getString(), PropertyType.BINARY);
Value dateBinaryValues[] = new Value[] {dateBinaryValue};
assertTrue("canSetProperty(String propertyName, Value[] values) must return " +
"true if the property is of type Date and values are of type BinaryValue" +
"in UTF-8 and in date format",
nodeType.canSetProperty(propDef.getName(), dateBinaryValues));
- Value doubleValue = NodeTypeUtil.getValueOfType(PropertyType.DOUBLE);
+ Value doubleValue = NodeTypeUtil.getValueOfType(session, PropertyType.DOUBLE);
Value doubleValues[] = new Value[] {doubleValue};
assertTrue("canSetProperty(String propertyName, Value[] values) must return " +
"true if the property is of type Date and values are of type DoubleValue",
nodeType.canSetProperty(propDef.getName(), doubleValues));
- Value longValue = NodeTypeUtil.getValueOfType(PropertyType.LONG);
+ Value longValue = NodeTypeUtil.getValueOfType(session, PropertyType.LONG);
Value longValues[] = new Value[] {longValue};
assertTrue("canSetProperty(String propertyName, Value[] values) must return " +
"true if the property is of type Date and values are of type LongValue",
nodeType.canSetProperty(propDef.getName(), longValues));
- Value booleanValue = NodeTypeUtil.getValueOfType(PropertyType.BOOLEAN);
+ Value booleanValue = NodeTypeUtil.getValueOfType(session, PropertyType.BOOLEAN);
Value booleanValues[] = new Value[] {dateValue, booleanValue};
assertFalse("canSetProperty(String propertyName, Value[] values) must return " +
"false if the property is of type Date and values are of type BooleanValue",
nodeType.canSetProperty(propDef.getName(), booleanValues));
- Value nameValue = NodeTypeUtil.getValueOfType(PropertyType.NAME);
+ Value nameValue = NodeTypeUtil.getValueOfType(session, PropertyType.NAME);
Value nameValues[] = new Value[] {dateValue, nameValue};
assertFalse("canSetProperty(String propertyName, Value[] values) must return " +
"false if the property is of type Date and values are of type NameValue",
nodeType.canSetProperty(propDef.getName(), nameValues));
- Value pathValue = NodeTypeUtil.getValueOfType(PropertyType.PATH);
+ Value pathValue = NodeTypeUtil.getValueOfType(session, PropertyType.PATH);
Value pathValues[] = new Value[] {dateValue, pathValue};
assertFalse("canSetProperty(String propertyName, Value[] values) must return " +
"false if the property is of type Date and values are of type PathValue",
@@ -244,7 +242,7 @@
"testable value constraints has been found");
}
- Value value = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value value = NodeTypeUtil.getValueAccordingToValueConstraints(session, propDef, false);
if (value == null) {
throw new NotExecutableException("No date property def with " +
"testable value constraints has been found");
@@ -272,7 +270,7 @@
"testable value constraints has been found");
}
- Value value = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value value = NodeTypeUtil.getValueAccordingToValueConstraints(session, propDef, false);
if (value == null) {
throw new NotExecutableException("No multiple date property def with " +
"testable value constraints has been found");
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyDoubleTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyDoubleTest.java?rev=165159&r1=165158&r2=165159&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyDoubleTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyDoubleTest.java Thu Apr 28 09:27:46 2005
@@ -19,11 +19,9 @@
import org.apache.jackrabbit.test.AbstractJCRTest;
import org.apache.jackrabbit.test.NotExecutableException;
-import javax.jcr.BinaryValue;
import javax.jcr.PropertyType;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
-import javax.jcr.StringValue;
import javax.jcr.Value;
import javax.jcr.nodetype.NodeType;
import javax.jcr.nodetype.PropertyDefinition;
@@ -84,58 +82,58 @@
NodeType nodeType = propDef.getDeclaringNodeType();
- Value anyStringValue = NodeTypeUtil.getValueOfType(PropertyType.STRING);
+ Value anyStringValue = NodeTypeUtil.getValueOfType(session, PropertyType.STRING);
assertFalse("canSetProperty(String propertyName, Value value) must return " +
"false if the property is of type Double and value is a StringValue " +
"that is not convertible to a DoubleValue",
nodeType.canSetProperty(propDef.getName(), anyStringValue));
Value doubleStringValue =
- new StringValue(NodeTypeUtil.getValueOfType(PropertyType.DOUBLE).getString());
+ superuser.getValueFactory().createValue(NodeTypeUtil.getValueOfType(session, PropertyType.DOUBLE).getString());
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Double and value is a StringValue " +
"that is convertible to a DoubleValue",
nodeType.canSetProperty(propDef.getName(), doubleStringValue));
- Value anyBinaryValue = NodeTypeUtil.getValueOfType(PropertyType.BINARY);
+ Value anyBinaryValue = NodeTypeUtil.getValueOfType(session, PropertyType.BINARY);
assertFalse("canSetProperty(String propertyName, Value value) must return " +
"false if the property is of type Double and value is a UTF-8 " +
"BinaryValue that is not convertible to a DoubleValue",
nodeType.canSetProperty(propDef.getName(), anyBinaryValue));
Value doubleBinaryValue =
- new BinaryValue(NodeTypeUtil.getValueOfType(PropertyType.DOUBLE).getString());
+ superuser.getValueFactory().createValue(NodeTypeUtil.getValueOfType(session, PropertyType.DOUBLE).getString(), PropertyType.BINARY);
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Double and value is a UTF-8 " +
"BinaryValue that is convertible to a DoubleValue",
nodeType.canSetProperty(propDef.getName(), doubleBinaryValue));
- Value dateValue = NodeTypeUtil.getValueOfType(PropertyType.DATE);
+ Value dateValue = NodeTypeUtil.getValueOfType(session, PropertyType.DATE);
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Double and value is a DateValue",
nodeType.canSetProperty(propDef.getName(), dateValue));
- Value doubleValue = NodeTypeUtil.getValueOfType(PropertyType.DOUBLE);
+ Value doubleValue = NodeTypeUtil.getValueOfType(session, PropertyType.DOUBLE);
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Double and value is a DoubleValue",
nodeType.canSetProperty(propDef.getName(), doubleValue));
- Value longValue = NodeTypeUtil.getValueOfType(PropertyType.LONG);
+ Value longValue = NodeTypeUtil.getValueOfType(session, PropertyType.LONG);
assertTrue("canSetProperty(String propertyName, Value value) must return " +
"true if the property is of type Double and value is a LongValue",
nodeType.canSetProperty(propDef.getName(), longValue));
- Value booleanValue = NodeTypeUtil.getValueOfType(PropertyType.BOOLEAN);
+ Value booleanValue = NodeTypeUtil.getValueOfType(session, PropertyType.BOOLEAN);
assertFalse("canSetProperty(String propertyName, Value value) must return " +
"false if the property is of type Double and value is a BooleanValue",
nodeType.canSetProperty(propDef.getName(), booleanValue));
- Value nameValue = NodeTypeUtil.getValueOfType(PropertyType.NAME);
+ Value nameValue = NodeTypeUtil.getValueOfType(session, PropertyType.NAME);
assertFalse("canSetProperty(String propertyName, Value value) must return " +
"false if the property is of type Double and value is a NameValue",
nodeType.canSetProperty(propDef.getName(), nameValue));
- Value pathValue = NodeTypeUtil.getValueOfType(PropertyType.PATH);
+ Value pathValue = NodeTypeUtil.getValueOfType(session, PropertyType.PATH);
assertFalse("canSetProperty(String propertyName, Value value) must return " +
"false if the property is of type Double and value is a PathValue",
nodeType.canSetProperty(propDef.getName(), pathValue));
@@ -159,9 +157,9 @@
NodeType nodeType = propDef.getDeclaringNodeType();
- Value doubleValue = NodeTypeUtil.getValueOfType(PropertyType.DOUBLE);
+ Value doubleValue = NodeTypeUtil.getValueOfType(session, PropertyType.DOUBLE);
- Value anyStringValue = NodeTypeUtil.getValueOfType(PropertyType.STRING);
+ Value anyStringValue = NodeTypeUtil.getValueOfType(session, PropertyType.STRING);
Value anyStringValues[] = new Value[] {doubleValue, anyStringValue};
assertFalse("canSetProperty(String propertyName, Value[] values) must return " +
"false if the property is of type Double and values are of type StringValue " +
@@ -169,14 +167,14 @@
nodeType.canSetProperty(propDef.getName(), anyStringValues));
Value doubleStringValue =
- new StringValue(NodeTypeUtil.getValueOfType(PropertyType.DOUBLE).getString());
+ superuser.getValueFactory().createValue(NodeTypeUtil.getValueOfType(session, PropertyType.DOUBLE).getString());
Value doubleStringValues[] = new Value[] {doubleStringValue};
assertTrue("canSetProperty(String propertyName, Value[] values) must return " +
"true if the property is of type Double and values are of type StringValue " +
"that are convertible to DoubleValues",
nodeType.canSetProperty(propDef.getName(), doubleStringValues));
- Value anyBinaryValue = NodeTypeUtil.getValueOfType(PropertyType.BINARY);
+ Value anyBinaryValue = NodeTypeUtil.getValueOfType(session, PropertyType.BINARY);
Value anyBinaryValues[] = new Value[] {doubleValue, anyBinaryValue};
assertFalse("canSetProperty(String propertyName, Value[] values) must return " +
"false if the property is of type Double and values are of type BinaryValue " +
@@ -184,14 +182,14 @@
nodeType.canSetProperty(propDef.getName(), anyBinaryValues));
Value doubleBinaryValue =
- new BinaryValue(NodeTypeUtil.getValueOfType(PropertyType.DOUBLE).getString());
+ superuser.getValueFactory().createValue(NodeTypeUtil.getValueOfType(session, PropertyType.DOUBLE).getString(), PropertyType.BINARY);
Value doubleBinaryValues[] = new Value[] {doubleBinaryValue};
assertTrue("canSetProperty(String propertyName, Value[] values) must return " +
"true if the property is of type Double and values are of type BinaryValue " +
"that are convertible to DoubleValues",
nodeType.canSetProperty(propDef.getName(), doubleBinaryValues));
- Value dateValue = NodeTypeUtil.getValueOfType(PropertyType.DATE);
+ Value dateValue = NodeTypeUtil.getValueOfType(session, PropertyType.DATE);
Value dateValues[] = new Value[] {dateValue};
assertTrue("canSetProperty(String propertyName, Value[] values) must return " +
"true if the property is of type Double and values are of type DateValue",
@@ -202,25 +200,25 @@
"true if the property is of type Double and values are of type DoubleValue",
nodeType.canSetProperty(propDef.getName(), doubleValues));
- Value longValue = NodeTypeUtil.getValueOfType(PropertyType.LONG);
+ Value longValue = NodeTypeUtil.getValueOfType(session, PropertyType.LONG);
Value longValues[] = new Value[] {longValue};
assertTrue("canSetProperty(String propertyName, Value[] values) must return " +
"true if the property is of type Double and values are of type LongValue",
nodeType.canSetProperty(propDef.getName(), longValues));
- Value booleanValue = NodeTypeUtil.getValueOfType(PropertyType.BOOLEAN);
+ Value booleanValue = NodeTypeUtil.getValueOfType(session, PropertyType.BOOLEAN);
Value booleanValues[] = new Value[] {doubleValue, booleanValue};
assertFalse("canSetProperty(String propertyName, Value[] values) must return " +
"false if the property is of type Double and values are of type BooleanValue",
nodeType.canSetProperty(propDef.getName(), booleanValues));
- Value nameValue = NodeTypeUtil.getValueOfType(PropertyType.NAME);
+ Value nameValue = NodeTypeUtil.getValueOfType(session, PropertyType.NAME);
Value nameValues[] = new Value[] {doubleValue, nameValue};
assertFalse("canSetProperty(String propertyName, Value[] values) must return " +
"false if the property is of type Double and values are of type NameValue",
nodeType.canSetProperty(propDef.getName(), nameValues));
- Value pathValue = NodeTypeUtil.getValueOfType(PropertyType.PATH);
+ Value pathValue = NodeTypeUtil.getValueOfType(session, PropertyType.PATH);
Value pathValues[] = new Value[] {doubleValue, pathValue};
assertFalse("canSetProperty(String propertyName, Value[] values) must return " +
"false if the property is of type Double and values are of type PathValue",
@@ -242,7 +240,7 @@
"testable value constraints has been found");
}
- Value value = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value value = NodeTypeUtil.getValueAccordingToValueConstraints(session, propDef, false);
if (value == null) {
throw new NotExecutableException("No double property def with " +
"testable value constraints has been found");
@@ -270,7 +268,7 @@
"testable value constraints has been found");
}
- Value value = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
+ Value value = NodeTypeUtil.getValueAccordingToValueConstraints(session, propDef, false);
if (value == null) {
throw new NotExecutableException("No multiple double property def with " +
"testable value constraints has been found");