diff --git a/jdk/make/launcher/Launcher-jdk.hotspot.agent.gmk b/jdk/make/launcher/Launcher-jdk.hotspot.agent.gmk index 6686513e3c2..ce1e3309d94 100644 --- a/jdk/make/launcher/Launcher-jdk.hotspot.agent.gmk +++ b/jdk/make/launcher/Launcher-jdk.hotspot.agent.gmk @@ -27,6 +27,10 @@ include LauncherCommon.gmk $(eval $(call SetupLauncher,jsadebugd, \ -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.jvm.hotspot.jdi.SADebugServer"$(COMMA) }' \ - -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \ + ,,,,,,,,,Info-privileged.plist)) + + +$(eval $(call SetupLauncher,jhsdb, \ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.jvm.hotspot.SALauncher"$(COMMA) }' \ ,,,,,,,,,Info-privileged.plist)) diff --git a/jdk/src/java.base/share/native/libverify/check_code.c b/jdk/src/java.base/share/native/libverify/check_code.c index 4ffbd67eaf2..0391b366437 100644 --- a/jdk/src/java.base/share/native/libverify/check_code.c +++ b/jdk/src/java.base/share/native/libverify/check_code.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -159,11 +159,12 @@ enum { ITEM_InitObject, /* "this" is init method, before call to super() */ ITEM_ReturnAddress, /* Extra info gives instr # of start pc */ - /* The following three are only used within array types. + /* The following four are only used within array types. * Normally, we use ITEM_Integer, instead. */ ITEM_Byte, ITEM_Short, - ITEM_Char + ITEM_Char, + ITEM_Boolean }; @@ -1446,7 +1447,9 @@ verify_opcode_operands(context_type *context, unsigned int inumber, int offset) full_info = MAKE_FULLINFO(ITEM_Float, 1, 0); break; case JVM_T_DOUBLE: full_info = MAKE_FULLINFO(ITEM_Double, 1, 0); break; - case JVM_T_BYTE: case JVM_T_BOOLEAN: + case JVM_T_BOOLEAN: + full_info = MAKE_FULLINFO(ITEM_Boolean, 1, 0); break; + case JVM_T_BYTE: full_info = MAKE_FULLINFO(ITEM_Byte, 1, 0); break; case JVM_T_CHAR: full_info = MAKE_FULLINFO(ITEM_Char, 1, 0); break; @@ -2250,10 +2253,11 @@ pop_stack(context_type *context, unsigned int inumber, stack_info_type *new_stac break; } - case 'B': /* array of bytes */ - if (top_type != MAKE_FULLINFO(ITEM_Byte, 1, 0)) + case 'B': /* array of bytes or booleans */ + if (top_type != MAKE_FULLINFO(ITEM_Byte, 1, 0) && + top_type != MAKE_FULLINFO(ITEM_Boolean, 1, 0)) CCerror(context, - "Expecting to find array of bytes on stack"); + "Expecting to find array of bytes or Booleans on stack"); break; case 'C': /* array of characters */ @@ -2403,7 +2407,6 @@ pop_stack(context_type *context, unsigned int inumber, stack_info_type *new_stac CCerror(context, "Call to wrong initialization method"); } if (this_idata->protected - && context->major_version > LDC_CLASS_MAJOR_VERSION && !isAssignableTo(context, object_type, context->currentclass_info)) { CCerror(context, "Bad access to protected data"); @@ -3728,7 +3731,14 @@ signature_to_fieldtype(context_type *context, result = 0; break; - case JVM_SIGNATURE_BOOLEAN: case JVM_SIGNATURE_BYTE: + case JVM_SIGNATURE_BOOLEAN: + full_info = (array_depth > 0) + ? MAKE_FULLINFO(ITEM_Boolean, 0, 0) + : MAKE_FULLINFO(ITEM_Integer, 0, 0); + result = 'I'; + break; + + case JVM_SIGNATURE_BYTE: full_info = (array_depth > 0) ? MAKE_FULLINFO(ITEM_Byte, 0, 0) : MAKE_FULLINFO(ITEM_Integer, 0, 0); @@ -3831,7 +3841,7 @@ decrement_indirection(fullinfo_type array_info) int indirection = GET_INDIRECTION(array_info) - 1; int extra_info = GET_EXTRA_INFO(array_info); if ( (indirection == 0) - && ((type == ITEM_Short || type == ITEM_Byte || type == ITEM_Char))) + && ((type == ITEM_Short || type == ITEM_Byte || type == ITEM_Boolean || type == ITEM_Char))) type = ITEM_Integer; return MAKE_FULLINFO(type, indirection, extra_info); } @@ -4286,6 +4296,8 @@ print_fullinfo_type(context_type *context, fullinfo_type type, jboolean verbose) jio_fprintf(stdout, "C"); break; case ITEM_Short: jio_fprintf(stdout, "S"); break; + case ITEM_Boolean: + jio_fprintf(stdout, "Z"); break; case ITEM_Byte: jio_fprintf(stdout, "B"); break; case ITEM_NewObject: diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index d12d071a46b..2145e96e28a 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -379,7 +379,4 @@ sun/tools/jinfo/JInfoRunningProcessFlagTest.java generic-all # 8057732 sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java generic-all -# 8064572 8060736 8062938 -sun/jvmstat/monitor/MonitoredVm/CR6672135.java generic-all - ############################################################################ diff --git a/jdk/test/com/sun/jdi/ArrayLengthDumpTest.sh b/jdk/test/com/sun/jdi/ArrayLengthDumpTest.sh index a1f6b7c5a03..8d8df5cfc0e 100644 --- a/jdk/test/com/sun/jdi/ArrayLengthDumpTest.sh +++ b/jdk/test/com/sun/jdi/ArrayLengthDumpTest.sh @@ -30,6 +30,7 @@ # TTY: dump command not implemented. # @author Tim Bell # +# @key intermittent # @run shell ArrayLengthDumpTest.sh # classname=ArrayLengthDumpTarg diff --git a/jdk/test/com/sun/jdi/BreakpointTest.java b/jdk/test/com/sun/jdi/BreakpointTest.java index 55f0b0d2219..1266f0a274b 100644 --- a/jdk/test/com/sun/jdi/BreakpointTest.java +++ b/jdk/test/com/sun/jdi/BreakpointTest.java @@ -28,6 +28,7 @@ * * @author jjh * + * @key intermittent * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g BreakpointTest.java @@ -45,7 +46,7 @@ import java.util.*; // the debuggee, waits a bit, and enables the bkpt again. class BreakpointTarg { - public final static int BKPT_LINE = 55; + public final static int BKPT_LINE = 56; // LINE NUMBER SENSITIVE public static long count; diff --git a/jdk/test/com/sun/jdi/BreakpointWithFullGC.sh b/jdk/test/com/sun/jdi/BreakpointWithFullGC.sh index e358487d3be..f7bcb89e715 100644 --- a/jdk/test/com/sun/jdi/BreakpointWithFullGC.sh +++ b/jdk/test/com/sun/jdi/BreakpointWithFullGC.sh @@ -29,6 +29,7 @@ # @author dcubed (based on the test program posted to the following # Eclipse thread https://bugs.eclipse.org/bugs/show_bug.cgi?id=279137) # +# @key intermittent # @run shell BreakpointWithFullGC.sh compileOptions=-g diff --git a/jdk/test/com/sun/jdi/CatchAllTest.sh b/jdk/test/com/sun/jdi/CatchAllTest.sh index 19b70d99bc8..52d1864384b 100644 --- a/jdk/test/com/sun/jdi/CatchAllTest.sh +++ b/jdk/test/com/sun/jdi/CatchAllTest.sh @@ -29,6 +29,7 @@ # @summary REGRESSION: jdb rejects the syntax catch java.lang.IndexOutOfBoundsException # @author Tim Bell # +# @key intermittent # @run shell CatchAllTest.sh # classname=CatchAllTestTarg diff --git a/jdk/test/com/sun/jdi/CatchCaughtTest.sh b/jdk/test/com/sun/jdi/CatchCaughtTest.sh index e1665283a55..47a0d356e36 100644 --- a/jdk/test/com/sun/jdi/CatchCaughtTest.sh +++ b/jdk/test/com/sun/jdi/CatchCaughtTest.sh @@ -29,6 +29,7 @@ # @summary TTY: 'catch caught' with no class pattern throws NullPointerException # @author Tim Bell # +# @key intermittent # @run shell CatchCaughtTest.sh # classname=CatchCaughtTestTarg diff --git a/jdk/test/com/sun/jdi/CatchPatternTest.sh b/jdk/test/com/sun/jdi/CatchPatternTest.sh index a490760db4e..1164b74b94d 100644 --- a/jdk/test/com/sun/jdi/CatchPatternTest.sh +++ b/jdk/test/com/sun/jdi/CatchPatternTest.sh @@ -28,6 +28,7 @@ # @summary TTY: surprising ExceptionSpec.resolveEventRequest() wildcard results # @author Tim Bell # +# @key intermittent # @run shell CatchPatternTest.sh classname=CatchPatternTestTarg createJavaFile() diff --git a/jdk/test/com/sun/jdi/CommandCommentDelimiter.sh b/jdk/test/com/sun/jdi/CommandCommentDelimiter.sh index 34f0942824b..c5beb904d30 100644 --- a/jdk/test/com/sun/jdi/CommandCommentDelimiter.sh +++ b/jdk/test/com/sun/jdi/CommandCommentDelimiter.sh @@ -28,6 +28,7 @@ # @bug 4507088 # @summary TTY: Add a comment delimiter to the jdb command set # @author Tim Bell +# @key intermittent # @run shell CommandCommentDelimiter.sh # diff --git a/jdk/test/com/sun/jdi/DeoptimizeWalk.sh b/jdk/test/com/sun/jdi/DeoptimizeWalk.sh index c8df10fac0f..e8fc44c4281 100644 --- a/jdk/test/com/sun/jdi/DeoptimizeWalk.sh +++ b/jdk/test/com/sun/jdi/DeoptimizeWalk.sh @@ -27,6 +27,7 @@ # @bug 4525714 # @summary jtreg test PopAsynchronousTest fails in build 85 with -Xcomp # @author Jim Holmlund/Swamy Venkataramanappa +# @key intermittent # @run shell DeoptimizeWalk.sh # This is another test of the same bug. The bug occurs when trying diff --git a/jdk/test/com/sun/jdi/ExceptionEvents.java b/jdk/test/com/sun/jdi/ExceptionEvents.java index 054ad248cc2..8835c4603f6 100644 --- a/jdk/test/com/sun/jdi/ExceptionEvents.java +++ b/jdk/test/com/sun/jdi/ExceptionEvents.java @@ -28,6 +28,7 @@ * * @author Robert Field * + * @key intermittent * @modules jdk.jdi * @run build TestScaffold VMConnection * @run compile -g ExceptionEvents.java diff --git a/jdk/test/com/sun/jdi/JdbExprTest.sh b/jdk/test/com/sun/jdi/JdbExprTest.sh index ecfd9432aed..a3c4ce168f4 100644 --- a/jdk/test/com/sun/jdi/JdbExprTest.sh +++ b/jdk/test/com/sun/jdi/JdbExprTest.sh @@ -26,6 +26,7 @@ # @test # @bug 4660158 # @author Staffan Larsen +# @key intermittent # @run shell JdbExprTest.sh # These are variables that can be set to control execution diff --git a/jdk/test/com/sun/jdi/JdbMissStep.sh b/jdk/test/com/sun/jdi/JdbMissStep.sh index 62c0f3eabf9..42a1108a6c8 100644 --- a/jdk/test/com/sun/jdi/JdbMissStep.sh +++ b/jdk/test/com/sun/jdi/JdbMissStep.sh @@ -28,6 +28,7 @@ # @summary REGRESSION: jdb / jdi not stopping at some breakpoints and steps in j2sdk1.4. # @author Jim Holmlund # +# @key intermittent # @run shell JdbMissStep.sh # These are variables that can be set to control execution diff --git a/jdk/test/com/sun/jdi/JdbVarargsTest.sh b/jdk/test/com/sun/jdi/JdbVarargsTest.sh index 61c3e1c70c3..483c00a5d0a 100644 --- a/jdk/test/com/sun/jdi/JdbVarargsTest.sh +++ b/jdk/test/com/sun/jdi/JdbVarargsTest.sh @@ -29,6 +29,7 @@ # # @author jjh # +# @key intermittent # @run shell JdbVarargsTest.sh classname=JdbVarargsTest diff --git a/jdk/test/com/sun/jdi/MixedSuspendTest.sh b/jdk/test/com/sun/jdi/MixedSuspendTest.sh index c8b64ea36c7..e18b20bd120 100644 --- a/jdk/test/com/sun/jdi/MixedSuspendTest.sh +++ b/jdk/test/com/sun/jdi/MixedSuspendTest.sh @@ -29,6 +29,7 @@ # # @author Jim Holmlund # +# @key intermittent # @modules jdk.jdi # @run build TestScaffold VMConnection TargetListener TargetAdapter # @run shell MixedSuspendTest.sh diff --git a/jdk/test/com/sun/jdi/NotAField.sh b/jdk/test/com/sun/jdi/NotAField.sh index acc627c92ad..d8ae30c7698 100644 --- a/jdk/test/com/sun/jdi/NotAField.sh +++ b/jdk/test/com/sun/jdi/NotAField.sh @@ -29,6 +29,7 @@ # @summary TTY: NullPointerException at # com.sun.tools.jdi.MirrorImpl.validateMirrors # @author Tim Bell +# @key intermittent # @run shell NotAField.sh # diff --git a/jdk/test/com/sun/jdi/RedefineAbstractClass.sh b/jdk/test/com/sun/jdi/RedefineAbstractClass.sh index 9e6e484dc04..9d0a8f9cc10 100644 --- a/jdk/test/com/sun/jdi/RedefineAbstractClass.sh +++ b/jdk/test/com/sun/jdi/RedefineAbstractClass.sh @@ -31,6 +31,7 @@ # methods are called. # @author Daniel D. Daugherty # +# @key intermittent # @run shell RedefineAbstractClass.sh compileOptions=-g diff --git a/jdk/test/com/sun/jdi/RedefineAnnotation.sh b/jdk/test/com/sun/jdi/RedefineAnnotation.sh index 066e3d3eb4b..45e27acbf96 100644 --- a/jdk/test/com/sun/jdi/RedefineAnnotation.sh +++ b/jdk/test/com/sun/jdi/RedefineAnnotation.sh @@ -28,6 +28,7 @@ # @summary Redefine a class that has an annotation and verify that the # new annotation is returned. # +# @key intermittent # @run shell RedefineAnnotation.sh compileOptions=-g diff --git a/jdk/test/com/sun/jdi/RedefineClearBreakpoint.sh b/jdk/test/com/sun/jdi/RedefineClearBreakpoint.sh index 697a3c839cd..59e8bc8ac6c 100644 --- a/jdk/test/com/sun/jdi/RedefineClearBreakpoint.sh +++ b/jdk/test/com/sun/jdi/RedefineClearBreakpoint.sh @@ -27,6 +27,7 @@ # @bug 4705330 # @summary Netbeans Fix and Continue crashes JVM # @author Jim Holmlund/Swamy Venkataramanappa +# @key intermittent # @run shell RedefineClearBreakpoint.sh # The failure occurs after a bkpt is set and then cleared diff --git a/jdk/test/com/sun/jdi/RedefineException.sh b/jdk/test/com/sun/jdi/RedefineException.sh index e1bc0a3b215..c2f0555f79e 100644 --- a/jdk/test/com/sun/jdi/RedefineException.sh +++ b/jdk/test/com/sun/jdi/RedefineException.sh @@ -28,6 +28,7 @@ # @summary The VM crashes when a method in a redefined class throws an exception. # @author Jim Holmlund # +# @key intermittent # @run shell RedefineException.sh # This is another symptomm of 4559100 diff --git a/jdk/test/com/sun/jdi/RedefineFinal.sh b/jdk/test/com/sun/jdi/RedefineFinal.sh index c35a29d7019..0ad4e5f500e 100644 --- a/jdk/test/com/sun/jdi/RedefineFinal.sh +++ b/jdk/test/com/sun/jdi/RedefineFinal.sh @@ -27,6 +27,7 @@ # @bug 4788344 # @summary RedefineClasses is an apparent no-op if instance method is final # +# @key intermittent # @run shell RedefineFinal.sh compileOptions=-g diff --git a/jdk/test/com/sun/jdi/RedefineIntConstantToLong.sh b/jdk/test/com/sun/jdi/RedefineIntConstantToLong.sh index 112c6c3e53d..bd3bb514d52 100644 --- a/jdk/test/com/sun/jdi/RedefineIntConstantToLong.sh +++ b/jdk/test/com/sun/jdi/RedefineIntConstantToLong.sh @@ -27,6 +27,7 @@ # @bug 6394084 # @summary Redefine class can't handle addition of 64 bit constants in JDK1.5.0_05 # +# @key intermittent # @run shell RedefineIntConstantToLong.sh compileOptions=-g diff --git a/jdk/test/com/sun/jdi/RedefinePop.sh b/jdk/test/com/sun/jdi/RedefinePop.sh index c92e83d2f70..7d223e1201e 100644 --- a/jdk/test/com/sun/jdi/RedefinePop.sh +++ b/jdk/test/com/sun/jdi/RedefinePop.sh @@ -30,6 +30,7 @@ # # The failure occurs with debug java when the pop deletes the # line that called the method which is being popped. +# @key intermittent # @run shell RedefinePop.sh diff --git a/jdk/test/com/sun/jdi/RedefineStep.sh b/jdk/test/com/sun/jdi/RedefineStep.sh index d6680ab79ec..0f457f10681 100644 --- a/jdk/test/com/sun/jdi/RedefineStep.sh +++ b/jdk/test/com/sun/jdi/RedefineStep.sh @@ -27,6 +27,7 @@ # @bug 4689395 # @summary "step over" after a class is redefined acts like "step out" # @author Jim Holmlund +# @key intermittent # @run shell RedefineStep.sh # diff --git a/jdk/test/com/sun/jdi/RedefineTTYLineNumber.sh b/jdk/test/com/sun/jdi/RedefineTTYLineNumber.sh index 8bc7a845ef2..ba0c658db4d 100644 --- a/jdk/test/com/sun/jdi/RedefineTTYLineNumber.sh +++ b/jdk/test/com/sun/jdi/RedefineTTYLineNumber.sh @@ -27,6 +27,7 @@ # @bug 4660756 # @summary TTY: Need to clear source cache after doing a redefine class # @author Jim Holmlund +# @key intermittent # @run shell/timeout=240 RedefineTTYLineNumber.sh #set -x diff --git a/jdk/test/com/sun/jdi/SimulResumerTest.java b/jdk/test/com/sun/jdi/SimulResumerTest.java index e05f27eb8d1..7d9fae6c2a9 100644 --- a/jdk/test/com/sun/jdi/SimulResumerTest.java +++ b/jdk/test/com/sun/jdi/SimulResumerTest.java @@ -28,6 +28,7 @@ * * @author jjh * + * @key intermittent * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g SimulResumerTest.java diff --git a/jdk/test/com/sun/jdi/StringConvertTest.sh b/jdk/test/com/sun/jdi/StringConvertTest.sh index 053396c9297..50924cd7f7f 100644 --- a/jdk/test/com/sun/jdi/StringConvertTest.sh +++ b/jdk/test/com/sun/jdi/StringConvertTest.sh @@ -29,6 +29,7 @@ # 2. TTY: run on expression evaluation # @author jim/suvasis mukherjee # +# @key intermittent # @run shell StringConvertTest.sh # Run this script to see the bug. See comments at the end diff --git a/jdk/test/com/sun/jdi/sde/FilterMangleTest.java b/jdk/test/com/sun/jdi/sde/FilterMangleTest.java index e5a6d601177..349a73ffbb1 100644 --- a/jdk/test/com/sun/jdi/sde/FilterMangleTest.java +++ b/jdk/test/com/sun/jdi/sde/FilterMangleTest.java @@ -5,6 +5,7 @@ * * @author Robert Field / Jim Holmlund * + * @key intermittent * @library .. * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE diff --git a/jdk/test/com/sun/tools/attach/BasicTests.java b/jdk/test/com/sun/tools/attach/BasicTests.java index 30e6ed395b3..720ae0004dd 100644 --- a/jdk/test/com/sun/tools/attach/BasicTests.java +++ b/jdk/test/com/sun/tools/attach/BasicTests.java @@ -41,7 +41,7 @@ import com.sun.tools.attach.VirtualMachineDescriptor; * @test * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757 * @summary Basic unit tests for the VM attach mechanism. - * @modules jdk.jartool/sun.tools.jar + * @key intermittent * @library /lib/testlibrary * @modules java.instrument * java.management diff --git a/jdk/test/java/lang/ClassLoader/Assert.java b/jdk/test/java/lang/ClassLoader/Assert.java index fb2376d45d4..57b6febedb2 100644 --- a/jdk/test/java/lang/ClassLoader/Assert.java +++ b/jdk/test/java/lang/ClassLoader/Assert.java @@ -28,7 +28,7 @@ * @run main/othervm Assert * @summary Test the assertion facility * @author Mike McCloskey - * @key randomness + * @key randomness intermittent */ import package1.*; diff --git a/jdk/test/java/lang/instrument/BootClassPath/BootClassPathTest.sh b/jdk/test/java/lang/instrument/BootClassPath/BootClassPathTest.sh index e0a564189fa..ed499e1f59f 100644 --- a/jdk/test/java/lang/instrument/BootClassPath/BootClassPathTest.sh +++ b/jdk/test/java/lang/instrument/BootClassPath/BootClassPathTest.sh @@ -26,6 +26,7 @@ # @summary Test non US-ASCII characters in the value of the Boot-Class-Path # attribute. # +# @key intermittent # @modules java.instrument # @run shell/timeout=240 BootClassPathTest.sh diff --git a/jdk/test/java/lang/instrument/ManifestTest.sh b/jdk/test/java/lang/instrument/ManifestTest.sh index a9466905e80..4196a7de022 100644 --- a/jdk/test/java/lang/instrument/ManifestTest.sh +++ b/jdk/test/java/lang/instrument/ManifestTest.sh @@ -26,6 +26,7 @@ # @summary JLI JAR manifest processing should ignore leading and trailing white space. # @author Daniel D. Daugherty # +# @key intermittent # @modules java.instrument # @run build ManifestTestApp ExampleForBootClassPath # @run shell/timeout=900 ManifestTest.sh diff --git a/jdk/test/java/lang/instrument/PremainClass/InheritAgent0101.java b/jdk/test/java/lang/instrument/PremainClass/InheritAgent0101.java index 32c0dd91dc0..8766c8a57da 100644 --- a/jdk/test/java/lang/instrument/PremainClass/InheritAgent0101.java +++ b/jdk/test/java/lang/instrument/PremainClass/InheritAgent0101.java @@ -27,6 +27,7 @@ * @summary test config (0,1,0,1): inherited 1-arg and declared 1-arg in agent class * @author Daniel D. Daugherty, Sun Microsystems * + * @key intermittent * @run shell ../MakeJAR3.sh InheritAgent0101 * @run main/othervm -javaagent:InheritAgent0101.jar DummyMain */ diff --git a/jdk/test/java/lang/instrument/RedefineBigClass.sh b/jdk/test/java/lang/instrument/RedefineBigClass.sh index 0098bf596da..a2c702e69dd 100644 --- a/jdk/test/java/lang/instrument/RedefineBigClass.sh +++ b/jdk/test/java/lang/instrument/RedefineBigClass.sh @@ -26,6 +26,7 @@ # @summary Redefine a big class. # @author Daniel D. Daugherty # +# @key intermittent # @modules java.instrument # @run shell MakeJAR3.sh RedefineBigClassAgent 'Can-Redefine-Classes: true' # @run build BigClass RedefineBigClassApp NMTHelper diff --git a/jdk/test/java/lang/instrument/RetransformBigClass.sh b/jdk/test/java/lang/instrument/RetransformBigClass.sh index 8f9d992f422..3e65bff87cb 100644 --- a/jdk/test/java/lang/instrument/RetransformBigClass.sh +++ b/jdk/test/java/lang/instrument/RetransformBigClass.sh @@ -26,6 +26,7 @@ # @summary Retransform a big class. # @author Daniel D. Daugherty # +# @key intermittent # @modules java.instrument # @run shell MakeJAR4.sh RetransformBigClassAgent SimpleIdentityTransformer 'Can-Retransform-Classes: true' # @run build BigClass RetransformBigClassApp NMTHelper diff --git a/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java b/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java index 9de573c3851..8bb229e50d1 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java +++ b/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java @@ -27,6 +27,7 @@ * @summary Basic unit test of ThreadMXBean.getAllThreadIds() * @author Alexei Guibadoulline and Mandy Chung * + * @key intermittent * @modules java.management * @run main/othervm AllThreadIds */ diff --git a/jdk/test/javax/management/monitor/ReflectionExceptionTest.java b/jdk/test/javax/management/monitor/ReflectionExceptionTest.java index c3b0b02dc14..a196c0d5a53 100644 --- a/jdk/test/javax/management/monitor/ReflectionExceptionTest.java +++ b/jdk/test/javax/management/monitor/ReflectionExceptionTest.java @@ -27,6 +27,7 @@ * @summary Test that the jmx.monitor.error.runtime monitor notification * is emitted when getAttribute throws ReflectionException. * @author Luis-Miguel Alventosa + * @key intermittent * @modules java.management * @run clean ReflectionExceptionTest MBeanServerBuilderImpl * MBeanServerForwarderInvocationHandler diff --git a/jdk/test/javax/management/monitor/StringMonitorDeadlockTest.java b/jdk/test/javax/management/monitor/StringMonitorDeadlockTest.java index 7f016bb673b..1359ad4aa65 100644 --- a/jdk/test/javax/management/monitor/StringMonitorDeadlockTest.java +++ b/jdk/test/javax/management/monitor/StringMonitorDeadlockTest.java @@ -27,6 +27,7 @@ * @summary Test that no locks are held when a monitor attribute is sampled * or notif delivered. * @author Eamonn McManus + * @key intermittent * @modules java.management * @run clean StringMonitorDeadlockTest * @run build StringMonitorDeadlockTest diff --git a/jdk/test/javax/management/mxbean/GenericArrayTypeTest.java b/jdk/test/javax/management/mxbean/GenericArrayTypeTest.java index 6fa7e56c334..d22a4a1587c 100644 --- a/jdk/test/javax/management/mxbean/GenericArrayTypeTest.java +++ b/jdk/test/javax/management/mxbean/GenericArrayTypeTest.java @@ -26,6 +26,7 @@ * @bug 6292705 * @summary Test support for arrays in parameterized types. * @author Luis-Miguel Alventosa + * @key intermittent * @modules java.management * @run clean GenericArrayTypeTest * @run build GenericArrayTypeTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/BrokenConnectionTest.java b/jdk/test/javax/management/remote/mandatory/connection/BrokenConnectionTest.java index ba230bce611..869c5ed8343 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/BrokenConnectionTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/BrokenConnectionTest.java @@ -26,6 +26,7 @@ * @bug 4940957 8025205 * @summary Tests behaviour when connections break * @author Eamonn McManus + * @key intermittent * @modules java.management * @run clean BrokenConnectionTest * @run build BrokenConnectionTest diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotificationEmissionTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotificationEmissionTest.java index c59d723aa13..7edc956cb93 100644 --- a/jdk/test/javax/management/remote/mandatory/notif/NotificationEmissionTest.java +++ b/jdk/test/javax/management/remote/mandatory/notif/NotificationEmissionTest.java @@ -27,6 +27,7 @@ * @summary Check the emission of notifications when a Security Manager is * installed. Test the property "jmx.remote.x.check.notification.emission". * @author Luis-Miguel Alventosa + * @key intermittent * @modules java.management * @run clean NotificationEmissionTest * @run build NotificationEmissionTest diff --git a/jdk/test/sun/jvmstat/monitor/MonitoredVm/CR6672135.java b/jdk/test/sun/jvmstat/monitor/MonitoredVm/TestPollingInterval.java similarity index 58% rename from jdk/test/sun/jvmstat/monitor/MonitoredVm/CR6672135.java rename to jdk/test/sun/jvmstat/monitor/MonitoredVm/TestPollingInterval.java index 5f069c474e5..abed0385ebe 100644 --- a/jdk/test/sun/jvmstat/monitor/MonitoredVm/CR6672135.java +++ b/jdk/test/sun/jvmstat/monitor/MonitoredVm/TestPollingInterval.java @@ -21,11 +21,18 @@ * questions. */ +import java.io.IOException; import java.net.URISyntaxException; -import java.util.Set; +import java.util.ArrayList; +import java.util.List; + +import jdk.testlibrary.Asserts; +import jdk.testlibrary.Utils; +import jdk.test.lib.apps.LingeredApp; import sun.jvmstat.monitor.MonitorException; import sun.jvmstat.monitor.MonitoredHost; import sun.jvmstat.monitor.MonitoredVm; +import sun.jvmstat.monitor.MonitoredVmUtil; import sun.jvmstat.monitor.VmIdentifier; /** @@ -33,41 +40,41 @@ import sun.jvmstat.monitor.VmIdentifier; * @test * @bug 6672135 * @summary setInterval() for local MonitoredHost and local MonitoredVm - * @author Tomas Hurka * @modules jdk.jvmstat/sun.jvmstat.monitor - * @run main/othervm -XX:+UsePerfData CR6672135 + * @library /lib/testlibrary + * @library /../../test/lib/share/classes + * @build jdk.testlibrary.* + * @build jdk.test.lib.apps.* + * @run main TestPollingInterval */ -public class CR6672135 { +public class TestPollingInterval { private static final int INTERVAL = 2000; - public static void main(String[] args) { - int vmInterval; - int hostInterval; - + public static void main(String[] args) throws IOException, + MonitorException, URISyntaxException { + LingeredApp app = null; try { + List vmArgs = new ArrayList(); + vmArgs.add("-XX:+UsePerfData"); + vmArgs.addAll(Utils.getVmOptions()); + app = LingeredApp.startApp(vmArgs); + MonitoredHost localHost = MonitoredHost.getMonitoredHost("localhost"); - Set vms = localHost.activeVms(); - Integer vmInt = (Integer) vms.iterator().next(); - String uriString = "//" + vmInt + "?mode=r"; // NOI18N + String uriString = "//" + app.getPid() + "?mode=r"; // NOI18N VmIdentifier vmId = new VmIdentifier(uriString); MonitoredVm vm = localHost.getMonitoredVm(vmId); + System.out.println("Monitored vm command line: " + MonitoredVmUtil.commandLine(vm)); vm.setInterval(INTERVAL); localHost.setInterval(INTERVAL); - vmInterval = vm.getInterval(); - hostInterval = localHost.getInterval(); - } catch (Exception ex) { - throw new Error ("Test failed",ex); - } - System.out.println("VM "+vmInterval); - if (vmInterval != INTERVAL) { - throw new Error("Test failed"); - } - System.out.println("Host "+hostInterval); - if (hostInterval != INTERVAL) { - throw new Error("Test failed"); - } - } -} + Asserts.assertEquals(vm.getInterval(), INTERVAL, "Monitored vm interval should be equal the test value"); + Asserts.assertEquals(localHost.getInterval(), INTERVAL, "Monitored host interval should be equal the test value"); + } finally { + LingeredApp.stopApp(app); + } + + } + +} diff --git a/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh b/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh index 7ace853fcad..2e3fac89fb0 100644 --- a/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh +++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh @@ -26,6 +26,7 @@ # @bug 6528083 # @summary Test RMI Bootstrap # +# @key intermittent # @library /lib/testlibrary # @modules java.management/sun.management # java.management/sun.management.jmxremote diff --git a/jdk/test/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java b/jdk/test/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java index 4d1eef69f50..3659bec98c9 100644 --- a/jdk/test/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java +++ b/jdk/test/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java @@ -40,6 +40,7 @@ import jdk.testlibrary.ProcessTools; * @bug 8075926 * @summary Makes sure that the current management agent status is reflected * in the related performance counters. + * @key intermittent * @library /lib/testlibrary * @build jdk.testlibrary.* PortAllocator TestApp ManagementAgentJcmd * @run testng/othervm -XX:+UsePerfData JMXStatusPerfCountersTest diff --git a/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java b/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java new file mode 100644 index 00000000000..4d7a81c152b --- /dev/null +++ b/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary Basic test for jhsdb launcher + * @library /../../test/lib/share/classes + * @library /lib/testlibrary + * @build jdk.testlibrary.* + * @build jdk.test.lib.apps.* + * @run main BasicLauncherTest + */ + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; +import java.util.Arrays; +import jdk.testlibrary.JDKToolLauncher; +import jdk.testlibrary.Utils; +import jdk.testlibrary.OutputAnalyzer; +import jdk.testlibrary.ProcessTools; +import jdk.test.lib.apps.LingeredApp; + +public class BasicLauncherTest { + + private final static String toolName = "jhsdb"; + private static LingeredApp theApp = null; + + /** + * + * @return exit code of tool + */ + public static int launchCLHSDB() + throws IOException { + + System.out.println("Starting LingeredApp"); + try { + theApp = LingeredApp.startApp(); + + System.out.println("Starting clhsdb against " + theApp.getPid()); + JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK(toolName); + launcher.addToolArg("clhsdb"); + launcher.addToolArg("--pid=" + Long.toString(theApp.getPid())); + + ProcessBuilder processBuilder = new ProcessBuilder(launcher.getCommand()); + processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT); + Process toolProcess = processBuilder.start(); + toolProcess.getOutputStream().write("quit\n".getBytes()); + toolProcess.getOutputStream().close(); + + // By default child process output stream redirected to pipe, so we are reading it in foreground. + BufferedReader reader = new BufferedReader(new InputStreamReader(toolProcess.getInputStream())); + + String line; + while ((line = reader.readLine()) != null) { + System.out.println(line.trim()); + } + + toolProcess.waitFor(); + + return toolProcess.exitValue(); + } catch (Exception ex) { + throw new RuntimeException("Test ERROR " + ex, ex); + } finally { + LingeredApp.stopApp(theApp); + } + } + + /** + * + * @param vmArgs - vm and java arguments to launch test app + * @return exit code of tool + */ + public static void launch(String expectedMessage, List toolArgs) + throws IOException { + + System.out.println("Starting LingeredApp"); + try { + theApp = LingeredApp.startApp(); + + System.out.println("Starting " + toolName + " " + toolArgs.get(0) + " against " + theApp.getPid()); + JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK(toolName); + + for (String cmd : toolArgs) { + launcher.addToolArg(cmd); + } + + launcher.addToolArg("--pid=" + Long.toString(theApp.getPid())); + + ProcessBuilder processBuilder = new ProcessBuilder(launcher.getCommand()); + processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT); + OutputAnalyzer output = ProcessTools.executeProcess(processBuilder);; + output.shouldContain(expectedMessage); + output.shouldHaveExitValue(0); + + } catch (Exception ex) { + throw new RuntimeException("Test ERROR " + ex, ex); + } finally { + LingeredApp.stopApp(theApp); + } + } + + public static void launch(String expectedMessage, String... toolArgs) + throws IOException { + + launch(expectedMessage, Arrays.asList(toolArgs)); + } + + public static void main(String[] args) + throws IOException { + + launchCLHSDB(); + + launch("No deadlocks found", "jstack"); + launch("Server compiler detected", "jmap"); + launch("Java System Properties", "jinfo"); + + // The test throws RuntimeException on error. + // IOException is thrown if LingeredApp can't start because of some bad + // environment condition + System.out.println("Test PASSED"); + } +} diff --git a/jdk/test/sun/tools/jhsdb/SAGetoptTest.java b/jdk/test/sun/tools/jhsdb/SAGetoptTest.java new file mode 100644 index 00000000000..60ff9fffc68 --- /dev/null +++ b/jdk/test/sun/tools/jhsdb/SAGetoptTest.java @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + + /* + * @test + * @summary unit test for SAGetopt function + * @compile -XDignore.symbol.file SAGetoptTest.java + * @run main SAGetoptTest + */ + +import sun.jvm.hotspot.SAGetopt; + +public class SAGetoptTest { + + private static boolean a_opt; + private static boolean b_opt; + private static boolean c_opt; + private static boolean e_opt; + private static boolean mixed_opt; + + private static String d_value; + private static String exe_value; + private static String core_value; + + private static void initArgValues() { + a_opt = false; + b_opt = false; + c_opt = false; + e_opt = false; + mixed_opt = false; + + d_value = ""; + exe_value = ""; + core_value = ""; + } + + + private static void optionsTest(String[] args) { + initArgValues(); + + SAGetopt sg = new SAGetopt(args); + + String[] longOpts = {"exe=","core=","mixed"}; + String shortOpts = "abcd:e"; + String s; + + while((s = sg.next(shortOpts, longOpts)) != null) { + if (s.equals("a")) { + a_opt = true; + continue; + } + + if (s.equals("b")) { + b_opt = true; + continue; + } + + if (s.equals("c")) { + c_opt = true; + continue; + } + + if (s.equals("e")) { + e_opt = true; + continue; + } + + if (s.equals("mixed")) { + mixed_opt = true; + continue; + } + + if (s.equals("d")) { + d_value = sg.getOptarg(); + continue; + } + + if (s.equals("exe")) { + exe_value = sg.getOptarg(); + continue; + } + + if (s.equals("core")) { + core_value = sg.getOptarg(); + continue; + } + } + } + + private static void badOptionsTest(int setNumber, String[] args, String expectedMessage) { + String msg = null; + try { + optionsTest(args); + } catch(RuntimeException ex) { + msg = ex.getMessage(); + } + + if (msg == null || !msg.equals(expectedMessage)) { + if (msg != null) { + System.err.println("Unexpected error '" + msg + "'"); + } + throw new RuntimeException("Bad option test " + setNumber + " failed"); + } + } + + public static void main(String[] args) { + String[] optionSet1 = {"-abd", "bla", "-c"}; + optionsTest(optionSet1); + if (!a_opt || !b_opt || !d_value.equals("bla") || !c_opt) { + throw new RuntimeException("Good optionSet 1 failed"); + } + + String[] optionSet2 = {"-e", "--mixed"}; + optionsTest(optionSet2); + if (!e_opt || !mixed_opt) { + throw new RuntimeException("Good optionSet 2 failed"); + } + + String[] optionSet3 = {"--exe=bla", "--core", "bla_core", "--mixed"}; + optionsTest(optionSet3); + if (!exe_value.equals("bla") || !core_value.equals("bla_core") || !mixed_opt) { + throw new RuntimeException("Good optionSet 3 failed"); + } + + // Bad options test + String[] optionSet4 = {"-abd", "-c"}; + badOptionsTest(4, optionSet4, "Argument is expected for 'd'"); + + String[] optionSet5 = {"-exe", "bla", "--core"}; + badOptionsTest(5, optionSet5, "Invalid option 'x'"); + + String[] optionSet6 = {"--exe", "--core", "bla_core"}; + badOptionsTest(6, optionSet6, "Argument is expected for 'exe'"); + } + } diff --git a/jdk/test/sun/tools/jmap/BasicJMapTest.java b/jdk/test/sun/tools/jmap/BasicJMapTest.java index 30bff00b548..f9cb1eafa02 100644 --- a/jdk/test/sun/tools/jmap/BasicJMapTest.java +++ b/jdk/test/sun/tools/jmap/BasicJMapTest.java @@ -36,6 +36,7 @@ import jdk.testlibrary.ProcessTools; * @test * @bug 6321286 * @summary Unit test for jmap utility + * @key intermittent * @library /lib/testlibrary * @library /../../test/lib/share/classes * @modules java.management diff --git a/jdk/test/sun/tools/jstatd/TestJstatdDefaults.java b/jdk/test/sun/tools/jstatd/TestJstatdDefaults.java index 8782b2a896c..1b0011b70f5 100644 --- a/jdk/test/sun/tools/jstatd/TestJstatdDefaults.java +++ b/jdk/test/sun/tools/jstatd/TestJstatdDefaults.java @@ -24,6 +24,7 @@ /* * @test * @bug 4990825 + * @key intermittent * @library /lib/testlibrary * @modules java.management * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser diff --git a/jdk/test/sun/tools/jstatd/TestJstatdExternalRegistry.java b/jdk/test/sun/tools/jstatd/TestJstatdExternalRegistry.java index acefc694f5e..9c9b564349c 100644 --- a/jdk/test/sun/tools/jstatd/TestJstatdExternalRegistry.java +++ b/jdk/test/sun/tools/jstatd/TestJstatdExternalRegistry.java @@ -24,6 +24,7 @@ /* * @test * @bug 4990825 7092186 + * @key intermittent * @library /lib/testlibrary * @modules java.management * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser diff --git a/jdk/test/sun/tools/jstatd/TestJstatdPort.java b/jdk/test/sun/tools/jstatd/TestJstatdPort.java index c011f73653f..8443b3e1bee 100644 --- a/jdk/test/sun/tools/jstatd/TestJstatdPort.java +++ b/jdk/test/sun/tools/jstatd/TestJstatdPort.java @@ -24,6 +24,7 @@ /* * @test * @bug 4990825 + * @key intermittent * @library /lib/testlibrary * @modules java.management * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser diff --git a/jdk/test/sun/tools/jstatd/TestJstatdPortAndServer.java b/jdk/test/sun/tools/jstatd/TestJstatdPortAndServer.java index 06e7a04a88b..9cce98a347d 100644 --- a/jdk/test/sun/tools/jstatd/TestJstatdPortAndServer.java +++ b/jdk/test/sun/tools/jstatd/TestJstatdPortAndServer.java @@ -24,6 +24,7 @@ /* * @test * @bug 4990825 + * @key intermittent * @library /lib/testlibrary * @modules java.management * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser diff --git a/jdk/test/vm/verifier/VerifyProtectedConstructor.java b/jdk/test/vm/verifier/VerifyProtectedConstructor.java index c8b00be7b57..c47057581e9 100644 --- a/jdk/test/vm/verifier/VerifyProtectedConstructor.java +++ b/jdk/test/vm/verifier/VerifyProtectedConstructor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @test * @bug 6490436 - * @summary Verify that protected constructor calls are not allowed for classfile version >= 50 (but that they are allowed for lesser versions). + * @summary Verify that protected constructor calls are not allowed for any classfile versions in either verifier. * @author Keith McGuigan */ @@ -38,9 +38,10 @@ public class VerifyProtectedConstructor extends ClassLoader { try { t.checkClassVersion(49); // should not throw VerifyError + throw new Exception("FAIL: should be a VerifyError for CF version 49"); } catch(VerifyError e) { - throw new Exception("FAIL: should be no VerifyError for CF version 49"); + System.out.println("PASS for CF version 49"); } try {