< prev index next >

test/java/io/FileOutputStream/FileOpen.sh

Print this page
rev 1541 : 8003890: corelibs test scripts should pass TESTVMOPTS
Reviewed-by: chegar, alanb
Contributed-by: Mark Sheppard <mark.sheppard@oracle.com>


  33 
  34 # We use a TMP directory on a local disk because this test
  35 # requires that the file to be tested be present on the local disk,
  36 # not on a samba mounted drive or on a drive that is mapped.
  37 # The cmd 'attrib' works only on the local files.
  38 TMP="C:\TEMP"
  39 hfile=${TMP}"\random_file1.txt"
  40 ATTRIB=${SystemRoot}"\system32\attrib.exe"
  41 
  42 OS=`uname -s`
  43 case "$OS" in
  44     Windows_* )
  45         if [ ! -d ${TMP} ] ; then 
  46            echo "Could not find the directory-" ${TMP} "- passing test"
  47            exit 0;
  48         fi
  49         ${TESTJAVA}/bin/javac -d . ${TESTSRC}\\FileOpenPos.java
  50         ${TESTJAVA}/bin/javac -d . ${TESTSRC}\\FileOpenNeg.java
  51 
  52         echo "Opening Writable Normal File.."
  53         ${TESTJAVA}/bin/java FileOpenPos ${hfile}
  54 
  55         echo "Opening Writable Hidden File.."
  56         ${ATTRIB} +h ${hfile}
  57         ${TESTJAVA}/bin/java FileOpenNeg ${hfile}
  58 
  59         echo "Opening Read-Only Normal File.."
  60         ${ATTRIB} -h ${hfile}
  61         ${ATTRIB} +r ${hfile}
  62         ${TESTJAVA}/bin/java FileOpenNeg ${hfile}
  63 
  64         echo "Opening Read-Only Hidden File.." 
  65         ${ATTRIB} +h ${hfile}
  66         ${TESTJAVA}/bin/java FileOpenNeg ${hfile}
  67 
  68         rm -f ${hfile}
  69         exit
  70         ;;
  71 
  72     * )
  73         echo "This test is not intended for this OS - passing test"
  74         exit 0
  75         ;;
  76 esac


  33 
  34 # We use a TMP directory on a local disk because this test
  35 # requires that the file to be tested be present on the local disk,
  36 # not on a samba mounted drive or on a drive that is mapped.
  37 # The cmd 'attrib' works only on the local files.
  38 TMP="C:\TEMP"
  39 hfile=${TMP}"\random_file1.txt"
  40 ATTRIB=${SystemRoot}"\system32\attrib.exe"
  41 
  42 OS=`uname -s`
  43 case "$OS" in
  44     Windows_* )
  45         if [ ! -d ${TMP} ] ; then 
  46            echo "Could not find the directory-" ${TMP} "- passing test"
  47            exit 0;
  48         fi
  49         ${TESTJAVA}/bin/javac -d . ${TESTSRC}\\FileOpenPos.java
  50         ${TESTJAVA}/bin/javac -d . ${TESTSRC}\\FileOpenNeg.java
  51 
  52         echo "Opening Writable Normal File.."
  53         ${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenPos ${hfile}
  54 
  55         echo "Opening Writable Hidden File.."
  56         ${ATTRIB} +h ${hfile}
  57         ${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenNeg ${hfile}
  58 
  59         echo "Opening Read-Only Normal File.."
  60         ${ATTRIB} -h ${hfile}
  61         ${ATTRIB} +r ${hfile}
  62         ${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenNeg ${hfile}
  63 
  64         echo "Opening Read-Only Hidden File.." 
  65         ${ATTRIB} +h ${hfile}
  66         ${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenNeg ${hfile}
  67 
  68         rm -f ${hfile}
  69         exit
  70         ;;
  71 
  72     * )
  73         echo "This test is not intended for this OS - passing test"
  74         exit 0
  75         ;;
  76 esac
< prev index next >