commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwaldh...@apache.org
Subject cvs commit: jakarta-commons-sandbox/jux/src/java/org/apache/commons/jux ObjectTestCase.java
Date Tue, 18 Feb 2003 12:51:04 GMT
rwaldhoff    2003/02/18 04:51:04

  Modified:    jux      build.xml
               jux/src/java/org/apache/commons/jux ObjectTestCase.java
  Log:
  javadocs
  
  Revision  Changes    Path
  1.6       +2 -2      jakarta-commons-sandbox/jux/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jux/build.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- build.xml	18 Feb 2003 00:00:59 -0000	1.5
  +++ build.xml	18 Feb 2003 12:51:03 -0000	1.6
  @@ -162,7 +162,7 @@
       <javadoc destdir="${dist.home}/docs/api"
                packagenames="org.apache.commons.*"
                author="false"
  -             private="true"
  +             protected="true"
                version="true"
                doctitle="&lt;h1&gt;${component.title} (Version ${component.version})&lt;/h1&gt;"
                windowtitle="${component.title} (Version ${component.version})"
  
  
  
  1.7       +41 -8     jakarta-commons-sandbox/jux/src/java/org/apache/commons/jux/ObjectTestCase.java
  
  Index: ObjectTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jux/src/java/org/apache/commons/jux/ObjectTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ObjectTestCase.java	18 Feb 2003 12:30:00 -0000	1.6
  +++ ObjectTestCase.java	18 Feb 2003 12:51:03 -0000	1.7
  @@ -86,21 +86,22 @@
        * Return some non-<code>null</code> instance of the object
        * to be tested.
        * Repeated invocations of this method should generally 
  -     * return distinct instances, which may or may not be equal,
  -     * but the precise relationship betwen the values returned
  +     * return distinct instances, which may or may not be equal.
  +     * The precise relationship betwen the values returned
        * by repeated invocations of this method is not specified.
        */
       protected abstract Object makeObject() throws Exception;
       
       /** 
        * Return some not-<code>null</code> instance of the object
  -     * to be tested such that value returned by repeated 
  +     * to be tested such that values returned by repeated 
        * invocations of this method will be <code>equal</code>,
        * or <code>null</code> if no such instance can be 
        * provided.  
        * When {@link Serializable} and {@link #isSerializable}
  -     * returns <code>true</code>, the value by
  -     * this method will be compared to the canonical serialized form,
  +     * returns <code>true</code>, the value returned by
  +     * this method will be compared to the 
  +     * {@link #getSerializedCanonicalInstanceStream canonical serialized form},
        * if any.
        * The default implementation invokes {@link #makeObject}. 
        */
  @@ -212,6 +213,10 @@
       // Tests
       // ------------------------------------------------------------------------    
   
  +    /**
  +     * Test the standard {@link Object#equals Object.equals}
  +     * contract for the object returned by {@link #makeObject}.
  +     */
       public final void testObjectEquals() throws Exception {
           Object obj = makeObject();
           assertNotNull("makeObject() should not return null",obj);
  @@ -230,6 +235,15 @@
           }
       }
   
  +    /**
  +     * {@link #isSerializable Optionally} test the serialization and 
  +     * deserialization the object returned by {@link #makeObject},
  +     * and {@link #serializedCloneIsEqual optionally} compare it 
  +     * to the original value.
  +     * 
  +     * @see #isSerializable
  +     * @see #serializedCloneIsEqual
  +     */
       public final void testObjectSerializeDeserializeThenCompare() throws Exception {
           Object obj = makeObject();
           if(isSerializable() && obj instanceof Serializable) {
  @@ -241,6 +255,17 @@
           }
       }
   
  +    /**
  +     * Test that I can still deserialize the 
  +     * {@link #getSerializedCanonicalInstanceStream canonical serialized instance}
  +     * and {@link #serializedCloneIsEqual optionally}
  +     * compare it to the instance returned by 
  +     * {@link #makeCanonicalInstance}.
  +     * 
  +     * @see #skipSerializedCanonicalTests
  +     * @see #getSerializedCanonicalInstanceStream
  +     * @see #serializedCloneIsEqual
  +     */
       public final void testObjectSerializedCanonicalForm() throws Exception {       
           if(!skipSerializedCanonicalTests()) {
               ObjectInputStream oin = null;
  @@ -266,6 +291,14 @@
           }
       }
   
  +    /**
  +     * Assert that <code>{@link #makeObject}.toString()</code> 
  +     * isn't <code>null</code>, and {@link #mustOverrideToString optionally}
  +     * that the returned value is different from what the 
  +     * {@link Object#toString Object.toString} implementation would return.
  +     * 
  +     * @see #mustOverrideToString
  +     */
       public final void testObjectToString() throws Exception {
           Object obj = makeObject();
           assertNotNull("toString should never return null",obj.toString());
  @@ -277,7 +310,7 @@
       }
   
       // protected utils
  -    // ------------------------------------------------------------------------
  +    // ------------------------------------------------------------------------    
       protected void assertObjectsAreEqual(Object a, Object b) {
           assertObjectsAreEqual(null,a,b);
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message