test/java/rmi/MarshalledObject/compare/Compare.java

Print this page
rev 9077 : 8031179: update RMI tests to declare othervm explicitly
Summary: The /othervm declaration should be added to all the RMI tests and the RMI directories removed from the othervm.dirs property
Reviewed-by: smarks
Contributed-by: Eric Wang <yiming.wang@oracle.com>


  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 4096312
  27  * @summary Codebase annotations on classes that are marshalled should not
  28  *          affect the behavior of MarshalledObject.equals.  Only the bytes
  29  *          not involved in location should be compared.
  30  * @author Ken Arnold
  31  *
  32  * @run main Compare 11 annotatedRef
  33  */
  34 
  35 import java.rmi.MarshalledObject;
  36 import java.io.*;
  37 
  38 public class Compare {
  39     static class Node implements Serializable {
  40         int value = nextValue++;
  41         Node next;
  42 
  43         static int nextValue = 1;
  44     };
  45 
  46     private static MarshalledObject made;
  47     private static MarshalledObject read;
  48 
  49     public static void main(String[] args) throws Throwable {
  50         if (args.length == 1)
  51             writeObjToOut(Integer.parseInt(args[0]));
  52         else




  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 4096312
  27  * @summary Codebase annotations on classes that are marshalled should not
  28  *          affect the behavior of MarshalledObject.equals.  Only the bytes
  29  *          not involved in location should be compared.
  30  * @author Ken Arnold
  31  *
  32  * @run main/othervm Compare 11 annotatedRef
  33  */
  34 
  35 import java.rmi.MarshalledObject;
  36 import java.io.*;
  37 
  38 public class Compare {
  39     static class Node implements Serializable {
  40         int value = nextValue++;
  41         Node next;
  42 
  43         static int nextValue = 1;
  44     };
  45 
  46     private static MarshalledObject made;
  47     private static MarshalledObject read;
  48 
  49     public static void main(String[] args) throws Throwable {
  50         if (args.length == 1)
  51             writeObjToOut(Integer.parseInt(args[0]));
  52         else