/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* 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
* @bug 4467564
* @summary Test the popping of frames in an asynchronous context
* (that is, when suspended by the debugger at random points)
*
* @author Robert Field
*
* @run build TestScaffold VMConnection TargetListener TargetAdapter
* @run compile -g PopAsynchronousTest.java
* @run main PopAsynchronousTest
*/
/********** target program **********/
class PopAsynchronousTarg {
static final int N = 30;
int fibonacci(int n) {
if (n <= 2) {
return 1;
} else {
}
}
}
int n = N;
}
}
/********** test program **********/
boolean harassTarget = true;
super(args);
}
}
/********** event handlers **********/
harassTarget = false;
synchronized(harassLock) {
try {
}
}
}
/********** test assist **********/
public void run() {
int harassCount = 0;
try {
int prev = 0;
int delayTime = 1;
synchronized(harassLock) {
boolean backoff = true;
if (n != prev) {
backoff = false;
/* pop lowest fibonacci frame */
break;
}
}
++harassCount;
prev = n;
} else {
}
} else {
}
if (backoff) {
delayTime *= 2;
} else {
delayTime /= 2;
if (delayTime < harassCount) {
}
}
mainThread.resume();
}
}
}
}
}
/********** test core **********/
/*
* Get to the top of main()
* to determine targetClass and mainThread
*/
/*
* Set event requests
*/
/*
* start popping wildly away
*/
(new HarassThread()).start();
/*
* resume the target listening for events
*/
/*
* check result
*/
int correct = (new PopAsynchronousTarg()).
} else {
", got: " + result);
}
/*
* deal with results of test
* if anything has called failure("foo") testFailed will be true
*/
if (!testFailed) {
println("PopAsynchronousTest: passed");
} else {
throw new Exception("PopAsynchronousTest: failed");
}
}
}