Java Code Examples for com.sun.jdi.IncompatibleThreadStateException#printStackTrace()

The following examples show how to use com.sun.jdi.IncompatibleThreadStateException#printStackTrace() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractJdiTestCase.java    From java-debug with Eclipse Public License 1.0 5 votes vote down vote up
protected StackFrame getStackFrame() {
    if (this.staticBreakpointEvent == null || !this.staticBreakpointEvent.thread().isAtBreakpoint()) {
        return null;
    }
    try {
        return this.staticBreakpointEvent.thread().frame(0);

    } catch (IncompatibleThreadStateException e) {
        e.printStackTrace();
        return null;
    }
}
 
Example 2
Source File: AbstractJdiTestCase.java    From java-debug with Eclipse Public License 1.0 5 votes vote down vote up
protected StackFrame getSecondLevelStackFrame() {
    if (this.staticBreakpointEvent == null || !this.staticBreakpointEvent.thread().isAtBreakpoint()) {
        return null;
    }
    try {
        return this.staticBreakpointEvent.thread().frame(1);

    } catch (IncompatibleThreadStateException e) {
        e.printStackTrace();
        return null;
    }
}
 
Example 3
Source File: DynamothCollector.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
private void getCurrentTest(ThreadReference threadRef) {
	try {
		List<StackFrame> frames = threadRef.frames();
		for (StackFrame stackFrame : frames) {
			for (String test : tests) {
				String[] splitted = test.split("#");
				test = splitted[0];
				ObjectReference thisObject = stackFrame.thisObject();
				if (thisObject == null) {
					continue;
				}
				String frameClass = thisObject.referenceType().name();
				if (frameClass.equals(test)) {
					String frameMethod = stackFrame.location().method().name();
					if (oracle.containsKey(test + "#" + frameMethod)) {
						if (frameClass.equals(currentTestClass) && frameMethod.equals(currentTestMethod)) {
							this.currentIteration++;
						} else {
							currentTestClass = test;
							currentTestMethod = frameMethod;
							this.currentIteration = 0;
						}
						// logger.info("[test] " + currentTestClass + "#" + currentTestMethod + "
						// iteration "
						// + this.currentIteration);
						return;
					}
				}
			}
		}
	} catch (IncompatibleThreadStateException e) {
		e.printStackTrace();
	}
	throw new RuntimeException("Unable to identify the current test");
}