|
16 | 16 | import org.eclipse.jdt.core.IJavaProject; |
17 | 17 | import org.eclipse.jdt.debug.core.IJavaLineBreakpoint; |
18 | 18 | import org.eclipse.jdt.debug.core.IJavaThread; |
| 19 | +import org.eclipse.jdt.debug.testplugin.JavaProjectHelper; |
19 | 20 | import org.eclipse.jdt.debug.tests.AbstractDebugTest; |
20 | 21 |
|
21 | 22 | public class ConditionalBreakpointsWithFileClass extends AbstractDebugTest { |
@@ -54,19 +55,30 @@ public void testFileConditionalBreakpointforFalse() throws Exception { |
54 | 55 | public void testFileConditionalBreakpointforTrue() throws Exception { |
55 | 56 | String typeName = "FileConditionSnippet2"; |
56 | 57 | IJavaLineBreakpoint bp3 = createLineBreakpoint(20, typeName); |
| 58 | + IJavaLineBreakpoint bp2; |
57 | 59 | IJavaThread mainThread = null; |
58 | 60 |
|
59 | 61 | try { |
60 | 62 | Thread.sleep(10); |
61 | 63 | mainThread = launchToBreakpoint(typeName); |
62 | 64 | mainThread.getTopStackFrame().stepInto(); |
63 | | - IJavaLineBreakpoint bp2 = createConditionalLineBreakpoint(364, "java.io.File", "true", true); |
| 65 | + |
| 66 | + if (JavaProjectHelper.isJava25_Compatible()) { |
| 67 | + bp2 = createConditionalLineBreakpoint(369, "java.io.File", "true", true); |
| 68 | + } else { |
| 69 | + bp2 = createConditionalLineBreakpoint(364, "java.io.File", "true", true); |
| 70 | + } |
| 71 | + |
64 | 72 | int hitLine = 0; |
65 | 73 | mainThread.resume(); |
66 | 74 | Thread.sleep(1000); |
67 | 75 | assertTrue("Thread should be suspended", mainThread.isSuspended()); |
68 | 76 | hitLine = mainThread.getStackFrames()[0].getLineNumber(); |
69 | | - assertEquals("Didn't suspend at the expected line", 364, hitLine); |
| 77 | + if (JavaProjectHelper.isJava25_Compatible()) { |
| 78 | + assertEquals("Didn't suspend at the expected line", 369, hitLine); |
| 79 | + } else { |
| 80 | + assertEquals("Didn't suspend at the expected line", 364, hitLine); |
| 81 | + } |
70 | 82 |
|
71 | 83 | bp2.delete(); |
72 | 84 | bp3.delete(); |
|
0 commit comments