jdk/test/sun/tools/jrunscript/jrunscript-cpTest.sh
changeset 16040 105e9859a548
parent 5506 202f599c92aa
child 41486 95980c6371d6
equal deleted inserted replaced
16039:85372a48f9aa 16040:105e9859a548
    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