test/java/io/Serializable/evolution/RenamePackage/run.sh

Print this page




  26 # @summary Enable resolveClass() to accommodate package renaming.
  27 # This fix enables one to implement a resolveClass method that maps a
  28 # Serialiazable class within a serialization stream to the same class
  29 # in a different package within the JVM runtime. See run shell script
  30 # for instructions on how to run this test.
  31 
  32 
  33 if [ "${TESTJAVA}" = "" ]
  34 then
  35   echo "TESTJAVA not set.  Test cannot execute.  Failed."
  36   exit 1
  37 fi
  38 
  39 
  40 OS=`uname -s`
  41 # Need to determine the classpath separator and filepath separator based on the
  42 # operating system.
  43 case "$OS" in
  44 SunOS | Linux )
  45   PS=":"  ;;
  46 Windows* )
  47   PS=";"  ;;
  48 * )
  49   echo "Unrecognized system!"
  50   exit 1  ;;
  51 esac
  52 
  53 JAVA=${TESTJAVA}/bin/java
  54 JAVAC=${TESTJAVA}/bin/javac
  55 MKDIR=mkdir
  56 RDEL="rm -r"
  57 
  58 if [ -d ${TESTCLASSES}/oclasses ] 
  59 then
  60    ${RDEL} ${TESTCLASSES}/oclasses 
  61 fi
  62 if [ -d ${TESTCLASSES}/nclasses ] 
  63 then
  64    ${RDEL} ${TESTCLASSES}/nclasses 
  65 fi
  66 if [ -d ${TESTCLASSES}/share ] 


  68    ${RDEL} ${TESTCLASSES}/share 
  69 fi
  70 if [ -f ${TESTCLASSES}/stream.ser ] 
  71 then
  72    ${RDEL} ${TESTCLASSES}/stream.ser
  73 fi
  74 
  75 mkdir ${TESTCLASSES}/oclasses
  76 mkdir ${TESTCLASSES}/share
  77 mkdir ${TESTCLASSES}/nclasses
  78 
  79 # Build sources
  80 set -e 
  81 ${JAVAC} -d ${TESTCLASSES}/share ${TESTSRC}/extension/ExtendedObjectInputStream.java
  82 CLASSPATH=${TESTCLASSES}/share; export CLASSPATH;
  83 ${JAVAC} -d ${TESTCLASSES}/oclasses ${TESTSRC}/test/SerialDriver.java
  84 CLASSPATH=${TESTCLASSES}/share; export CLASSPATH;
  85 ${JAVAC} -d ${TESTCLASSES}/nclasses ${TESTSRC}/install/SerialDriver.java
  86 
  87 # Run Case 1. Map test.SerialDriver within stream to install.SerialDriver.
  88 CLASSPATH=${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share; export CLASSPATH;
  89 ${JAVA} test.SerialDriver -s
  90 CLASSPATH=${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share; export CLASSPATH;
  91 ${JAVA} install.SerialDriver -d
  92 rm stream.ser
  93 
  94 # Run Case 2. Map install.SerialDriver within stream to test.SerialDriver.
  95 CLASSPATH=${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share; export CLASSPATH;
  96 ${JAVA} install.SerialDriver -s
  97 CLASSPATH=${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share; export CLASSPATH;
  98 ${JAVA} test.SerialDriver -d


  26 # @summary Enable resolveClass() to accommodate package renaming.
  27 # This fix enables one to implement a resolveClass method that maps a
  28 # Serialiazable class within a serialization stream to the same class
  29 # in a different package within the JVM runtime. See run shell script
  30 # for instructions on how to run this test.
  31 
  32 
  33 if [ "${TESTJAVA}" = "" ]
  34 then
  35   echo "TESTJAVA not set.  Test cannot execute.  Failed."
  36   exit 1
  37 fi
  38 
  39 
  40 OS=`uname -s`
  41 # Need to determine the classpath separator and filepath separator based on the
  42 # operating system.
  43 case "$OS" in
  44 SunOS | Linux )
  45   PS=":"  ;;
  46 Windows* | CYGWIN* )
  47   PS=";"  ;;
  48 * )
  49   echo "Unrecognized system!"
  50   exit 1  ;;
  51 esac
  52 
  53 JAVA=${TESTJAVA}/bin/java
  54 JAVAC=${TESTJAVA}/bin/javac
  55 MKDIR=mkdir
  56 RDEL="rm -r"
  57 
  58 if [ -d ${TESTCLASSES}/oclasses ] 
  59 then
  60    ${RDEL} ${TESTCLASSES}/oclasses 
  61 fi
  62 if [ -d ${TESTCLASSES}/nclasses ] 
  63 then
  64    ${RDEL} ${TESTCLASSES}/nclasses 
  65 fi
  66 if [ -d ${TESTCLASSES}/share ] 


  68    ${RDEL} ${TESTCLASSES}/share 
  69 fi
  70 if [ -f ${TESTCLASSES}/stream.ser ] 
  71 then
  72    ${RDEL} ${TESTCLASSES}/stream.ser
  73 fi
  74 
  75 mkdir ${TESTCLASSES}/oclasses
  76 mkdir ${TESTCLASSES}/share
  77 mkdir ${TESTCLASSES}/nclasses
  78 
  79 # Build sources
  80 set -e 
  81 ${JAVAC} -d ${TESTCLASSES}/share ${TESTSRC}/extension/ExtendedObjectInputStream.java
  82 CLASSPATH=${TESTCLASSES}/share; export CLASSPATH;
  83 ${JAVAC} -d ${TESTCLASSES}/oclasses ${TESTSRC}/test/SerialDriver.java
  84 CLASSPATH=${TESTCLASSES}/share; export CLASSPATH;
  85 ${JAVAC} -d ${TESTCLASSES}/nclasses ${TESTSRC}/install/SerialDriver.java
  86 
  87 # Run Case 1. Map test.SerialDriver within stream to install.SerialDriver.
  88 CLASSPATH="${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
  89 ${JAVA} test.SerialDriver -s
  90 CLASSPATH="${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
  91 ${JAVA} install.SerialDriver -d
  92 rm stream.ser
  93 
  94 # Run Case 2. Map install.SerialDriver within stream to test.SerialDriver.
  95 CLASSPATH="${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
  96 ${JAVA} install.SerialDriver -s
  97 CLASSPATH="${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
  98 ${JAVA} test.SerialDriver -d