test/java/io/FileOutputStream/FileOpen.sh

Print this page




  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         ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
  50             ${TESTSRC}\\FileOpenPos.java
  51         ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
  52             ${TESTSRC}\\FileOpenNeg.java
  53 
  54         echo "Opening Writable Normal File.."
  55         ${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenPos ${hfile}
  56 
  57         echo "Opening Writable Hidden File.."
  58         ${ATTRIB} +h ${hfile}
  59         ${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenNeg ${hfile}
  60 
  61         echo "Opening Read-Only Normal File.."
  62         ${ATTRIB} -h ${hfile}
  63         ${ATTRIB} +r ${hfile}
  64         ${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenNeg ${hfile}
  65 
  66         echo "Opening Read-Only Hidden File.." 
  67         ${ATTRIB} +h ${hfile}
  68         ${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenNeg ${hfile}
  69 
  70         rm -f ${hfile}
  71         exit
  72         ;;
  73 
  74     * )
  75         echo "This test is not intended for this OS - passing test"
  76         exit 0
  77         ;;
  78 esac


  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         ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
  50             ${TESTSRC}\\FileOpenPos.java
  51         ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
  52             ${TESTSRC}\\FileOpenNeg.java
  53 
  54         echo "Opening Writable Normal File.."
  55         ${TESTJAVA}/bin/java ${TESTVMOPTS} ${TESTJAVAOPTS} FileOpenPos ${hfile}
  56 
  57         echo "Opening Writable Hidden File.."
  58         ${ATTRIB} +h ${hfile}
  59         ${TESTJAVA}/bin/java ${TESTVMOPTS} ${TESTJAVAOPTS} FileOpenNeg ${hfile}
  60 
  61         echo "Opening Read-Only Normal File.."
  62         ${ATTRIB} -h ${hfile}
  63         ${ATTRIB} +r ${hfile}
  64         ${TESTJAVA}/bin/java ${TESTVMOPTS} ${TESTJAVAOPTS} FileOpenNeg ${hfile}
  65 
  66         echo "Opening Read-Only Hidden File.." 
  67         ${ATTRIB} +h ${hfile}
  68         ${TESTJAVA}/bin/java ${TESTVMOPTS} ${TESTJAVAOPTS} FileOpenNeg ${hfile}
  69 
  70         rm -f ${hfile}
  71         exit
  72         ;;
  73 
  74     * )
  75         echo "This test is not intended for this OS - passing test"
  76         exit 0
  77         ;;
  78 esac