< prev index next >
test/vmTestbase/nsk/jvmti/PopFrame/popframe003.java
Print this page
*** 39,49 ****
public class popframe003 {
public static final int PASSED = 0;
public static final int FAILED = 2;
static final int JCK_STATUS_BASE = 95;
- public static boolean DEBUG_MODE = false;
private popframe003p popFrameClsThr;
static {
try {
System.loadLibrary("popframe003");
--- 39,48 ----
*** 53,65 ****
System.getProperty("java.library.path"));
throw e;
}
}
! native static int doPopFrame(int vrb, popframe003p popFrameClsThr);
! native static int suspThread(int vrb, popframe003p popFrameClsThr);
! native static int resThread(int vrb, popframe003p popFrameClsThr);
public static void main(String[] argv) {
argv = nsk.share.jvmti.JVMTITest.commonInit(argv);
System.exit(run(argv, System.out) + JCK_STATUS_BASE);
--- 52,64 ----
System.getProperty("java.library.path"));
throw e;
}
}
! native static int doPopFrame(popframe003p popFrameClsThr);
! native static int suspThread(popframe003p popFrameClsThr);
! native static int resThread(popframe003p popFrameClsThr);
public static void main(String[] argv) {
argv = nsk.share.jvmti.JVMTITest.commonInit(argv);
System.exit(run(argv, System.out) + JCK_STATUS_BASE);
*** 70,122 ****
}
private int runIt(String argv[], PrintStream out) {
int retValue = 0;
! for (int i = 0; i < argv.length; i++) {
! if (argv[i].equals("-v")) // verbose mode
! DEBUG_MODE = true;
! }
!
! popFrameClsThr = new popframe003p("Tested Thread", out, DEBUG_MODE);
// start the child thread
popFrameClsThr.start();
popFrameClsThr.startingBarrier.waitFor();
// pause until the child thread exits notification-block
synchronized (popFrameClsThr.barrier) {
}
- if (DEBUG_MODE) {
out.println("Going to suspend the thread...");
! retValue = suspThread(1, popFrameClsThr);
! } else
! retValue = suspThread(0, popFrameClsThr);
if (retValue != PASSED) {
out.println("TEST: failed to suspend thread");
return FAILED;
}
// pop the frame
- if (DEBUG_MODE) {
out.println("Going to pop a frame...");
! retValue = doPopFrame(1, popFrameClsThr);
! } else
! retValue = doPopFrame(0, popFrameClsThr);
popFrameClsThr.popFrameHasBeenDone();
if (retValue != PASSED) {
out.println("TEST: failed to pop frame");
! resThread(0, popFrameClsThr);
return FAILED;
}
- if (DEBUG_MODE) {
out.println("Going to resume the thread...");
! retValue = resThread(1, popFrameClsThr);
! } else
! retValue = resThread(0, popFrameClsThr);
if (retValue != PASSED) {
out.println("TEST: failed to resume thread");
return FAILED;
}
--- 69,107 ----
}
private int runIt(String argv[], PrintStream out) {
int retValue = 0;
! popFrameClsThr = new popframe003p("Tested Thread", out);
// start the child thread
popFrameClsThr.start();
popFrameClsThr.startingBarrier.waitFor();
// pause until the child thread exits notification-block
synchronized (popFrameClsThr.barrier) {
}
out.println("Going to suspend the thread...");
! retValue = suspThread(popFrameClsThr);
if (retValue != PASSED) {
out.println("TEST: failed to suspend thread");
return FAILED;
}
// pop the frame
out.println("Going to pop a frame...");
! retValue = doPopFrame(popFrameClsThr);
popFrameClsThr.popFrameHasBeenDone();
if (retValue != PASSED) {
out.println("TEST: failed to pop frame");
! resThread(popFrameClsThr);
return FAILED;
}
out.println("Going to resume the thread...");
! retValue = resThread(popFrameClsThr);
if (retValue != PASSED) {
out.println("TEST: failed to resume thread");
return FAILED;
}
*** 145,157 ****
"\t\tdoublePubStatGlFld=" + popframe003p.doublePubStatGlFld + "\texpected: 7.35\n" +
"\t\tcharPubStatGlFld='" + popframe003p.charPubStatGlFld + "'\texpected: 'b'\n" +
"\t\tbooleanPubStatGlFld=" + popframe003p.booleanPubStatGlFld + "\texpected: true\n" +
"\t\tstrPubStatGlFld=\"" + popframe003p.strPubStatGlFld + "\"\texpected: \"sttc glbl fld\"");
return FAILED;
! }
! else if (DEBUG_MODE)
out.println("Check #6 PASSED: changes for the static fields of a class,\n" +
"\twhich have been made in the popped frame's method, remained\n");
return popframe003p.totRes;
}
}
--- 130,142 ----
"\t\tdoublePubStatGlFld=" + popframe003p.doublePubStatGlFld + "\texpected: 7.35\n" +
"\t\tcharPubStatGlFld='" + popframe003p.charPubStatGlFld + "'\texpected: 'b'\n" +
"\t\tbooleanPubStatGlFld=" + popframe003p.booleanPubStatGlFld + "\texpected: true\n" +
"\t\tstrPubStatGlFld=\"" + popframe003p.strPubStatGlFld + "\"\texpected: \"sttc glbl fld\"");
return FAILED;
! } else {
out.println("Check #6 PASSED: changes for the static fields of a class,\n" +
"\twhich have been made in the popped frame's method, remained\n");
+ }
return popframe003p.totRes;
}
}
< prev index next >