comparison test/sun/tools/jrunscript/jrunscript-cpTest.sh @ 13678:3560e0ebe876

Added tag jdk8u232-b06 for changeset 5d57817931e1
author andrew
date Mon, 16 Sep 2019 18:07:13 +0100
parents 00cd9dc3c2b5
children
comparison
equal deleted inserted replaced
3:07f487c5d808 4:9acabf87f1d2
44 44
45 # we check whether classpath setting for app classes 45 # we check whether classpath setting for app classes
46 # work with jrunscript. Script should be able to 46 # work with jrunscript. Script should be able to
47 # access Java class "Hello". 47 # access Java class "Hello".
48 48
49 ${JRUNSCRIPT} -cp . <<EOF 49 ${JRUNSCRIPT} -l nashorn -cp . <<EOF
50 var v; 50 var v;
51 try { v = new Packages.Hello(); } catch (e) { println(e); exit(1) } 51 try { v = new Packages.Hello(); } catch (e) { println(e); exit(1) }
52 if (v.string != 'hello') { println("Unexpected property value"); exit(1); } 52 if (v.string != 'hello') { println("Unexpected property value"); exit(1); }
53 EOF 53 EOF
54 54
56 exit 1 56 exit 1
57 fi 57 fi
58 58
59 # -classpath and -cp are synonyms 59 # -classpath and -cp are synonyms
60 60
61 ${JRUNSCRIPT} -classpath . <<EOF 61 ${JRUNSCRIPT} -l nashorn -classpath . <<EOF
62 var v; 62 var v;
63 try { v = new Packages.Hello(); } catch (e) { println(e); exit(1) } 63 try { v = new Packages.Hello(); } catch (e) { println(e); exit(1) }
64 if (v.string != 'hello') { println("unexpected property value"); exit(1); } 64 if (v.string != 'hello') { println("unexpected property value"); exit(1); }
65 EOF 65 EOF
66 66