jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r164063 - in /incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api: BooleanPropertyTest.java DatePropertyTest.java DoublePropertyTest.java LongPropertyTest.java NamePropertyTest.java PathPropertyTest.java StringPropertyTest.java nodetype/CanSetPropertyBooleanTest.java
Date Thu, 21 Apr 2005 14:06:47 GMT
Author: mreutegg
Date: Thu Apr 21 07:06:46 2005
New Revision: 164063

URL: http://svn.apache.org/viewcvs?rev=164063&view=rev
Log:
Fix broken test cases, identified by Maxim.

Modified:
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/BooleanPropertyTest.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/DatePropertyTest.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/DoublePropertyTest.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/LongPropertyTest.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NamePropertyTest.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/PathPropertyTest.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/StringPropertyTest.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyBooleanTest.java

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/BooleanPropertyTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/BooleanPropertyTest.java?rev=164063&r1=164062&r2=164063&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/BooleanPropertyTest.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/BooleanPropertyTest.java
Thu Apr 21 07:06:46 2005
@@ -25,8 +25,8 @@
 import java.io.InputStream;
 
 /**
- * Tests a boolean property. If the workspace does not contain a node with
- * a boolean property a {@link org.apache.jackrabbit.test.NotExecutableException}
+ * Tests a boolean property. If the workspace does not contain a node with a
+ * boolean property a {@link org.apache.jackrabbit.test.NotExecutableException}
  * is thrown.
  *
  * @test
@@ -38,6 +38,7 @@
 
     /**
      * Returns {@link javax.jcr.PropertyType#BOOLEAN}.
+     *
      * @return {@link javax.jcr.PropertyType#BOOLEAN}.
      */
     protected int getPropertyType() {
@@ -46,8 +47,8 @@
 
     /**
      * Tests that Property.getBoolean() delivers the same as Value.getBoolean()
-     * and that in case of a multivalue property Property.getBoolean()
-     * throws a ValueFormatException.
+     * and that in case of a multivalue property Property.getBoolean() throws a
+     * ValueFormatException.
      */
     public void testValue() throws RepositoryException {
         if (multiple) {
@@ -58,54 +59,55 @@
             } catch (ValueFormatException vfe) {
                 // ok
             }
+        } else {
+            boolean bool = prop.getValue().getBoolean();
+            boolean otherBool = prop.getBoolean();
+            assertTrue("Value.getBoolean() and Property.getBoolean() " +
+                    "return different values.", bool == otherBool);
         }
-        boolean bool = prop.getValue().getBoolean();
-        boolean otherBool = prop.getBoolean();
-        assertTrue("Value.getBoolean() and Property.getBoolean() " +
-                "return different values.", bool == otherBool) ;
     }
 
     /**
-      * Tests failure of conversion from Boolean type to Date type.
-      */
-     public void testGetDate() throws RepositoryException {
-         try {
-             Value val = PropertyUtil.getValue(prop);
-             val.getDate();
-             fail("Conversion from a Boolean value to a Date value " +
-                     "should throw a ValueFormatException");
-         } catch (ValueFormatException vfe) {
-             //ok
-         }
-     }
-
-     /**
-      * Tests failure from Boolean type to Double type.
-      */
-     public void testGetDouble() throws RepositoryException {
-         try {
-             Value val = PropertyUtil.getValue(prop);
-             val.getDouble();
-             fail("Conversion from a Boolean value to a Double value " +
-                     "should throw a ValueFormatException");
-         } catch (ValueFormatException vfe) {
-             //ok
-         }
-     }
-
-     /**
-      * Tests failure of conversion from Boolean type to Long type.
-      */
-     public void testGetLong() throws RepositoryException {
-         try {
-             Value val = PropertyUtil.getValue(prop);
-             val.getLong();
-             fail("Conversion from a Boolean value to a Long value " +
-                     "should throw a ValueFormatException");
-         } catch (ValueFormatException vfe) {
-             //ok
-         }
-     }
+     * Tests failure of conversion from Boolean type to Date type.
+     */
+    public void testGetDate() throws RepositoryException {
+        try {
+            Value val = PropertyUtil.getValue(prop);
+            val.getDate();
+            fail("Conversion from a Boolean value to a Date value " +
+                    "should throw a ValueFormatException");
+        } catch (ValueFormatException vfe) {
+            //ok
+        }
+    }
+
+    /**
+     * Tests failure from Boolean type to Double type.
+     */
+    public void testGetDouble() throws RepositoryException {
+        try {
+            Value val = PropertyUtil.getValue(prop);
+            val.getDouble();
+            fail("Conversion from a Boolean value to a Double value " +
+                    "should throw a ValueFormatException");
+        } catch (ValueFormatException vfe) {
+            //ok
+        }
+    }
+
+    /**
+     * Tests failure of conversion from Boolean type to Long type.
+     */
+    public void testGetLong() throws RepositoryException {
+        try {
+            Value val = PropertyUtil.getValue(prop);
+            val.getLong();
+            fail("Conversion from a Boolean value to a Long value " +
+                    "should throw a ValueFormatException");
+        } catch (ValueFormatException vfe) {
+            //ok
+        }
+    }
 
     /**
      * Tests conversion from Boolean type to Binary type.
@@ -137,11 +139,14 @@
             fail("Stream method call after a non stream method call " +
                     "should throw an IllegalStateException");
         } catch (IllegalStateException ise) {
-           // ok
-        }
-        finally {
-            if (in != null) in.close();
-            if (ins != null) ins.close();
+            // ok
+        } finally {
+            if (in != null) {
+                in.close();
+            }
+            if (ins != null) {
+                ins.close();
+            }
         }
     }
 
@@ -157,16 +162,16 @@
     }
 
     /**
-     * Tests if Value.getType() returns the same as Property.getType()
-     * and also tests that prop.getDefinition().getRequiredType() returns
-     * the same type in case it is not of Undefined type.
+     * Tests if Value.getType() returns the same as Property.getType() and also
+     * tests that prop.getDefinition().getRequiredType() returns the same type
+     * in case it is not of Undefined type.
      */
     public void testGetType() throws RepositoryException {
         assertTrue("Value.getType() returns wrong type.",
                 PropertyUtil.checkGetType(prop, PropertyType.BOOLEAN));
     }
 
-   /**
+    /**
      * Tests failure of conversion from Boolean type to Reference type.
      */
     public void testAsReference() throws RepositoryException {
@@ -178,8 +183,7 @@
             } catch (ValueFormatException vfe) {
                 //ok
             }
-        }
-        else {
+        } else {
             try {
                 prop.getNode();
                 fail("Property.getNode() called on a multivalue property " +
@@ -190,7 +194,7 @@
         }
     }
 
-   /**
+    /**
      * Tests the Property.getLength() method. The length returned is either -1
      * or it is the length of the string received by conversion.
      */
@@ -204,8 +208,7 @@
             } catch (ValueFormatException vfe) {
                 // ok
             }
-        }
-        else {
+        } else {
             long length = prop.getLength();
             if (length > -1) {
                 assertEquals("Property.getLength() returns wrong number of bytes.",
@@ -225,12 +228,11 @@
             for (int i = 0; i < lengths.length; i++) {
                 if (lengths[i] > -1) {
                     assertEquals("Property.getLengths() returns " +
-                        "wrong array of the lengths of a multivalue property.",
-                        values[i].getString().length(), lengths[i]);
+                            "wrong array of the lengths of a multivalue property.",
+                            values[i].getString().length(), lengths[i]);
                 }
             }
-        }
-        else {
+        } else {
             try {
                 prop.getLengths();
                 fail("Property.getLengths() called on a sinlge value property " +

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/DatePropertyTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/DatePropertyTest.java?rev=164063&r1=164062&r2=164063&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/DatePropertyTest.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/DatePropertyTest.java
Thu Apr 21 07:06:46 2005
@@ -58,12 +58,12 @@
             } catch (ValueFormatException vfe) {
                 // ok
             }
+        } else {
+            Calendar calendar = prop.getValue().getDate();
+            Calendar calendar2 = prop.getDate();
+            assertEquals("Value.getDate() and Property.getDate() return different values.",
+                    calendar, calendar2);
         }
-        // Calendar returned?
-        Calendar calendar = prop.getValue().getDate();
-        Calendar calendar2 = prop.getDate();
-        assertTrue("Value.getDate() and Property.getDate() return different values.",
-                calendar.getTimeInMillis() == calendar2.getTimeInMillis());
     }
 
     /**
@@ -75,9 +75,9 @@
         // correct format:  YYYY-MM-DDThh:mm:ss.sssTZD
         // month(01-12), day(01-31), hours(00-23), minutes(00-59), seconds(00-59),
         // TZD(Z or +hh:mm or -hh:mm)
-        //String aDay="2005-01-19T15:34:15.917+01:00";
+        // String aDay="2005-01-19T15:34:15.917+01:00";
         String date = val.getString();
-        System.out.println("date str = " + date);
+        log.println("date str = " + date);
         boolean match = PropertyUtil.isDateFormat(prop.getString());
         assertTrue("Date not in correct String format.", match);
     }

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/DoublePropertyTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/DoublePropertyTest.java?rev=164063&r1=164062&r2=164063&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/DoublePropertyTest.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/DoublePropertyTest.java
Thu Apr 21 07:06:46 2005
@@ -26,9 +26,9 @@
 import java.io.InputStream;
 
 /**
- * Tests a double property. If the workspace does not contain a node with a double
- * property a {@link org.apache.jackrabbit.test.NotExecutableException} is
- * thrown.
+ * Tests a double property. If the workspace does not contain a node with a
+ * double property a {@link org.apache.jackrabbit.test.NotExecutableException}
+ * is thrown.
  *
  * @test
  * @sources DoublePropertyTest.java
@@ -39,15 +39,17 @@
 
     /**
      * Returns {@link javax.jcr.PropertyType#DOUBLE}.
+     *
      * @return {@link javax.jcr.PropertyType#DOUBLE}.
      */
     protected int getPropertyType() {
         return PropertyType.DOUBLE;
     }
 
-   /**
+    /**
      * tests that Property.getDouble() delivers the same as Value.getDouble()
-     * and if in case of a multivalue property a ValueFormatException is thrown.
+     * and if in case of a multivalue property a ValueFormatException is
+     * thrown.
      */
     public void testValue() throws RepositoryException {
         if (multiple) {
@@ -58,10 +60,11 @@
             } catch (ValueFormatException vfe) {
                 // ok
             }
+        } else {
+            double d = prop.getValue().getDouble();
+            double dd = prop.getDouble();
+            assertTrue("Value.getDouble() and Property.getDouble() return different values.",
d == dd);
         }
-        double d = prop.getValue().getDouble();
-        double dd = prop.getDouble();
-        assertTrue("Value.getDouble() and Property.getDouble() return different values.",
d == dd) ;
     }
 
     /**
@@ -87,7 +90,8 @@
         assertEquals("Conversion from Double value to Date value is not correct.",
                 calendar.getTimeInMillis(), new Double(val.getDouble()).longValue());
     }
-     /**
+
+    /**
      * tests the conversion from a Double to a Long Value
      */
     public void testGetLong() throws RepositoryException {
@@ -100,7 +104,7 @@
     /**
      * tests conversion from Double type to Binary type
      */
-   public void testGetStream() throws RepositoryException, IOException {
+    public void testGetStream() throws RepositoryException, IOException {
         Value val = PropertyUtil.getValue(prop);
         BufferedInputStream in = new BufferedInputStream(val.getStream());
         Value otherVal = prop.getValue();
@@ -109,7 +113,7 @@
         // if yet utf-8 encoded these bytes should be equal
         // to the ones received from the stream
         int i = 0;
-        byte b = b = (byte) in.read();
+        byte b = (byte) in.read();
         while (b != -1) {
             assertTrue("Double as a Stream is not utf-8 encoded.",
                     b == utf8bytes[i]);
@@ -128,11 +132,14 @@
             fail("Stream method call after a non stream method call " +
                     "should throw an IllegalStateException.");
         } catch (IllegalStateException ise) {
-           // ok
-        }
-        finally {
-            if (in != null) in.close();
-            if (ins != null) ins.close();
+            // ok
+        } finally {
+            if (in != null) {
+                in.close();
+            }
+            if (ins != null) {
+                ins.close();
+            }
         }
     }
 
@@ -146,17 +153,17 @@
         assertEquals("Conversion from Double value to String value is not correct.", str,
otherStr);
     }
 
-   /**
-     * Tests if Value.getType() returns the same as Property.getType()
-     * and also tests that prop.getDefinition().getRequiredType() returns
-     * the same type in case it is not of Undefined type.
+    /**
+     * Tests if Value.getType() returns the same as Property.getType() and also
+     * tests that prop.getDefinition().getRequiredType() returns the same type
+     * in case it is not of Undefined type.
      */
     public void testGetType() throws RepositoryException {
         assertTrue("Value.getType() returns wrong type.",
                 PropertyUtil.checkGetType(prop, PropertyType.DOUBLE));
     }
 
-   /**
+    /**
      * tests failure of conversion from Double type to Reference type
      */
     public void testAsReference() throws RepositoryException {
@@ -168,8 +175,7 @@
             } catch (ValueFormatException vfe) {
                 //ok
             }
-        }
-        else {
+        } else {
             try {
                 prop.getNode();
                 fail("Property.getNode() called on a multivalue property " +
@@ -180,7 +186,7 @@
         }
     }
 
-   /**
+    /**
      * Tests the Property.getLength() method. The length returned is either -1
      * or it is the length of the string received by conversion.
      */
@@ -194,8 +200,7 @@
             } catch (ValueFormatException vfe) {
                 // ok
             }
-        }
-        else {
+        } else {
             long length = prop.getLength();
             if (length > -1) {
                 assertEquals("Property.getLength() returns wrong number of bytes.",
@@ -215,12 +220,11 @@
             for (int i = 0; i < lengths.length; i++) {
                 if (lengths[i] > -1) {
                     assertEquals("Property.getLengths() returns " +
-                        "wrong array of the lengths of a multivalue property.",
-                        values[i].getString().length(), lengths[i]);
+                            "wrong array of the lengths of a multivalue property.",
+                            values[i].getString().length(), lengths[i]);
                 }
             }
-        }
-        else {
+        } else {
             try {
                 prop.getLengths();
                 fail("Property.getLengths() called on a sinlge value property " +

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/LongPropertyTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/LongPropertyTest.java?rev=164063&r1=164062&r2=164063&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/LongPropertyTest.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/LongPropertyTest.java
Thu Apr 21 07:06:46 2005
@@ -59,10 +59,11 @@
             } catch (ValueFormatException vfe) {
                 // ok
             }
+        } else {
+            long l = prop.getValue().getLong();
+            long ll = prop.getLong();
+            assertEquals("Value.getLong() and Property.getLong() return different values.",
l, ll);
         }
-        long l = prop.getValue().getLong();
-        long ll = prop.getLong();
-        assertEquals("Value.getLong() and Property.getLong() return different values.", l,
ll);
     }
 
     /**

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NamePropertyTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NamePropertyTest.java?rev=164063&r1=164062&r2=164063&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NamePropertyTest.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NamePropertyTest.java
Thu Apr 21 07:06:46 2005
@@ -35,6 +35,7 @@
 
     /**
      * Returns {@link javax.jcr.PropertyType#NAME}.
+     *
      * @return {@link javax.jcr.PropertyType#NAME}.
      */
     protected int getPropertyType() {
@@ -43,16 +44,19 @@
 
     /**
      * Tests conversion from Name type to String type.
+     *
      * @throws RepositoryException
      */
     public void testGetString() throws RepositoryException {
         Value val = PropertyUtil.getValue(prop);
-        assertTrue("Not a valid Name property: "+prop.getName(),
-                PropertyUtil.checkNameFormat(val.getString(),session));
+        assertTrue("Not a valid Name property: " + prop.getName(),
+                PropertyUtil.checkNameFormat(val.getString(), session));
 
     }
+
     /**
      * Tests failure of conversion from Name type to Boolean type.
+     *
      * @throws RepositoryException
      */
     public void testGetBoolean() throws RepositoryException {
@@ -60,7 +64,7 @@
             Value val = PropertyUtil.getValue(prop);
             val.getBoolean();
             fail("Conversion from a Name value to a Boolean value " +
-                        "should throw a ValueFormatException.");
+                    "should throw a ValueFormatException.");
         } catch (ValueFormatException vfe) {
             //ok
         }
@@ -68,6 +72,7 @@
 
     /**
      * Tests failure of conversion from Name type to Date type.
+     *
      * @throws RepositoryException
      */
     public void testGetDate() throws RepositoryException {
@@ -75,7 +80,7 @@
             Value val = PropertyUtil.getValue(prop);
             val.getDate();
             fail("Conversion from a Name value to a Date value " +
-                        "should throw a ValueFormatException.");
+                    "should throw a ValueFormatException.");
         } catch (ValueFormatException vfe) {
             //ok
         }
@@ -83,6 +88,7 @@
 
     /**
      * Tests failure from Name type to Double type.
+     *
      * @throws RepositoryException
      */
     public void testGetDouble() throws RepositoryException {
@@ -90,7 +96,7 @@
             Value val = PropertyUtil.getValue(prop);
             val.getDouble();
             fail("Conversion from a Name value to a Double value " +
-                        "should throw a ValueFormatException.");
+                    "should throw a ValueFormatException.");
         } catch (ValueFormatException vfe) {
             //ok
         }
@@ -98,6 +104,7 @@
 
     /**
      * Tests failure of conversion from Name type to Long type.
+     *
      * @throws RepositoryException
      */
     public void testGetLong() throws RepositoryException {
@@ -105,16 +112,17 @@
             Value val = PropertyUtil.getValue(prop);
             val.getLong();
             fail("Conversion from a Name value to a Long value " +
-                        "should throw a ValueFormatException.");
+                    "should throw a ValueFormatException.");
         } catch (ValueFormatException vfe) {
             //ok
         }
     }
 
     /**
-     * Tests if Value.getType() returns the same as Property.getType()
-     * and also tests that prop.getDefinition().getRequiredType() returns
-     * the same type in case it is not of Undefined type.
+     * Tests if Value.getType() returns the same as Property.getType() and also
+     * tests that prop.getDefinition().getRequiredType() returns the same type
+     * in case it is not of Undefined type.
+     *
      * @throws RepositoryException
      */
     public void testGetType() throws RepositoryException {
@@ -122,8 +130,9 @@
                 PropertyUtil.checkGetType(prop, PropertyType.NAME));
     }
 
-   /**
+    /**
      * Tests failure of conversion from Name type to Reference type.
+     *
      * @throws RepositoryException
      */
     public void testAsReference() throws RepositoryException {
@@ -135,8 +144,7 @@
             } catch (ValueFormatException vfe) {
                 //ok
             }
-        }
-        else {
+        } else {
             try {
                 prop.getNode();
                 fail("Property.getNode() called on a multivalue property " +

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/PathPropertyTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/PathPropertyTest.java?rev=164063&r1=164062&r2=164063&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/PathPropertyTest.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/PathPropertyTest.java
Thu Apr 21 07:06:46 2005
@@ -35,6 +35,7 @@
 
     /**
      * Returns {@link javax.jcr.PropertyType#PATH}.
+     *
      * @return {@link javax.jcr.PropertyType#PATH}.
      */
     protected int getPropertyType() {
@@ -42,12 +43,12 @@
     }
 
     /**
-     * Tests conversion from Path type to String type
-     * and if the resulting string has correct format.
+     * Tests conversion from Path type to String type and if the resulting
+     * string has correct format.
      */
     public void testGetString() throws RepositoryException {
         Value val = PropertyUtil.getValue(prop);
-        assertTrue("Not a valid Path property: "+prop.getName(),
+        assertTrue("Not a valid Path property: " + prop.getName(),
                 PropertyUtil.checkPathFormat(val.getString(), session));
     }
 
@@ -59,7 +60,7 @@
             Value val = PropertyUtil.getValue(prop);
             val.getBoolean();
             fail("Conversion from a Path value to a Boolean value " +
-                        "should throw a ValueFormatException.");
+                    "should throw a ValueFormatException.");
         } catch (ValueFormatException vfe) {
             //ok
         }
@@ -72,8 +73,8 @@
         try {
             Value val = PropertyUtil.getValue(prop);
             val.getDate();
-                fail("Conversion from a Path value to a Date value " +
-                        "should throw a ValueFormatException.");
+            fail("Conversion from a Path value to a Date value " +
+                    "should throw a ValueFormatException.");
         } catch (ValueFormatException vfe) {
             //ok
         }
@@ -86,8 +87,8 @@
         try {
             Value val = PropertyUtil.getValue(prop);
             val.getDouble();
-                   fail("Conversion from a Path value to a Double value " +
-                        "should throw a ValueFormatException.");
+            fail("Conversion from a Path value to a Double value " +
+                    "should throw a ValueFormatException.");
         } catch (ValueFormatException vfe) {
             //ok
         }
@@ -101,23 +102,23 @@
             Value val = PropertyUtil.getValue(prop);
             val.getLong();
             fail("Conversion from a Path value to a Long value " +
-                        "should throw a ValueFormatException.");
+                    "should throw a ValueFormatException.");
         } catch (ValueFormatException vfe) {
             //ok
         }
     }
 
     /**
-     * Tests if Value.getType() returns the same as Property.getType()
-     * and also tests that prop.getDefinition().getRequiredType() returns
-     * the same type in case it is not of Undefined type.
+     * Tests if Value.getType() returns the same as Property.getType() and also
+     * tests that prop.getDefinition().getRequiredType() returns the same type
+     * in case it is not of Undefined type.
      */
     public void testGetType() throws RepositoryException {
         assertTrue("Value.getType() returns wrong type.",
                 PropertyUtil.checkGetType(prop, PropertyType.PATH));
     }
 
-   /**
+    /**
      * Tests failure of conversion from Path type to Reference type.
      */
     public void testAsReference() throws RepositoryException {
@@ -129,8 +130,7 @@
             } catch (ValueFormatException vfe) {
                 //ok
             }
-        }
-        else {
+        } else {
             try {
                 prop.getNode();
                 fail("Property.getNode() called on a multivalue property " +

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/StringPropertyTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/StringPropertyTest.java?rev=164063&r1=164062&r2=164063&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/StringPropertyTest.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/StringPropertyTest.java
Thu Apr 21 07:06:46 2005
@@ -89,9 +89,10 @@
             } catch (ValueFormatException vfe) {
                 // ok
             }
+        } else {
+            assertEquals("Value.getString() and Property.getString() return different values.",
+                    prop.getValue().getString(), prop.getString());
         }
-        assertEquals("Value.getString() and Property.getString() return different values.",
-                prop.getValue().getString(), prop.getString());
     }
 
     /**

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=164063&r1=164062&r2=164063&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 21 07:06:46 2005
@@ -209,7 +209,6 @@
         }
 
         Value value = NodeTypeUtil.getValueAccordingToValueConstraints(propDef, false);
-        System.out.println(value.getString());
         if (value == null) {
             throw new NotExecutableException("No boolean property def with " +
                     "testable value constraints has been found");



Mime
View raw message