author | alanb |
Fri, 11 Jan 2013 20:19:55 +0000 | |
changeset 15254 | 3997a6f357cb |
parent 14786 | a9f61e0cbe61 |
permissions | -rw-r--r-- |
2 | 1 |
#!/bin/sh |
2 |
||
3 |
# |
|
5506 | 4 |
# Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. |
2 | 5 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
6 |
# |
|
7 |
# This code is free software; you can redistribute it and/or modify it |
|
8 |
# under the terms of the GNU General Public License version 2 only, as |
|
9 |
# published by the Free Software Foundation. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
5506 | 21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
2 | 24 |
# |
25 |
||
26 |
||
27 |
# @test |
|
28 |
# @bug 6364894 |
|
29 |
# @run shell FileOpen.sh |
|
30 |
# @summary Test to ensure that opening of hidden Vs non-hidden, |
|
31 |
# read/write Vs read-only files for writing works as expected. |
|
32 |
||
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 |
|
15254
3997a6f357cb
8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents:
14786
diff
changeset
|
49 |
${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \ |
3997a6f357cb
8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents:
14786
diff
changeset
|
50 |
${TESTSRC}\\FileOpenPos.java |
3997a6f357cb
8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents:
14786
diff
changeset
|
51 |
${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \ |
3997a6f357cb
8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents:
14786
diff
changeset
|
52 |
${TESTSRC}\\FileOpenNeg.java |
2 | 53 |
|
54 |
echo "Opening Writable Normal File.." |
|
14786
a9f61e0cbe61
8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents:
5506
diff
changeset
|
55 |
${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenPos ${hfile} |
2 | 56 |
|
57 |
echo "Opening Writable Hidden File.." |
|
58 |
${ATTRIB} +h ${hfile} |
|
14786
a9f61e0cbe61
8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents:
5506
diff
changeset
|
59 |
${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenNeg ${hfile} |
2 | 60 |
|
61 |
echo "Opening Read-Only Normal File.." |
|
62 |
${ATTRIB} -h ${hfile} |
|
63 |
${ATTRIB} +r ${hfile} |
|
14786
a9f61e0cbe61
8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents:
5506
diff
changeset
|
64 |
${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenNeg ${hfile} |
2 | 65 |
|
66 |
echo "Opening Read-Only Hidden File.." |
|
67 |
${ATTRIB} +h ${hfile} |
|
14786
a9f61e0cbe61
8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents:
5506
diff
changeset
|
68 |
${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenNeg ${hfile} |
2 | 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 |