jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r355033 - /incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SetPropertyAssumeTypeTest.java
Date Thu, 08 Dec 2005 08:11:38 GMT
Author: mreutegg
Date: Thu Dec  8 00:11:31 2005
New Revision: 355033

URL: http://svn.apache.org/viewcvs?rev=355033&view=rev
Log:
Fix test case
See: http://thread.gmane.org/gmane.comp.apache.jackrabbit.devel/4492

Modified:
    incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SetPropertyAssumeTypeTest.java

Modified: incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SetPropertyAssumeTypeTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SetPropertyAssumeTypeTest.java?rev=355033&r1=355032&r2=355033&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SetPropertyAssumeTypeTest.java
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SetPropertyAssumeTypeTest.java
Thu Dec  8 00:11:31 2005
@@ -18,6 +18,7 @@
 
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.apache.jackrabbit.test.NotExecutableException;
+import org.apache.jackrabbit.test.ISO8601;
 import org.apache.jackrabbit.test.api.nodetype.NodeTypeUtil;
 
 import javax.jcr.nodetype.PropertyDefinition;
@@ -27,6 +28,8 @@
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
 import javax.jcr.Property;
+import java.util.Calendar;
+import java.util.Date;
 
 /**
  * <code>SetPropertyAssumeTypeTest</code> tests if when setting a property
@@ -440,7 +443,10 @@
         String testPropName = propDef.getName();
 
         try {
-            testNode.setProperty(testPropName, stringValue, PropertyType.DATE);
+            Calendar cal = Calendar.getInstance();
+            cal.setTime(new Date(0));
+            Value v = superuser.getValueFactory().createValue(ISO8601.format(cal));
+            testNode.setProperty(testPropName, v, PropertyType.DATE);
             testRootNode.save();
             fail("Node.setProperty(String, Value, int) must throw a " +
                  "ConstraintViolationExcpetion if the type parameter and the " +
@@ -474,7 +480,9 @@
         String testPropName = propDef.getName();
 
         try {
-            testNode.setProperty(testPropName, "abc", PropertyType.DATE);
+            Calendar cal = Calendar.getInstance();
+            cal.setTime(new Date(0));
+            testNode.setProperty(testPropName, ISO8601.format(cal), PropertyType.DATE);
             testRootNode.save();
             fail("Node.setProperty(String, Value, int) must throw a " +
                  "ConstraintViolationExcpetion if the type parameter and the " +



Mime
View raw message