Skip to content

Commit fc76020

Browse files
authored
Re-Enable Conditional breakpoint for file class test (#784)
This commit fixes issues of ConditionalBreakpointsWithFileClass test for Java 25 and re-enables the test for all java versions fixes : #695
1 parent 32a314c commit fc76020

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AutomatedSuite.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,7 @@ public AutomatedSuite() {
398398
addTest(new TestSuite(TestToggleBreakpointsTarget.class));
399399
addTest(new TestSuite(TriggerPointBreakpointsTests.class));
400400
addTest(new TestSuite(JavaThreadEventHandlerTests.class));
401-
if (!JavaProjectHelper.isJava25_Compatible()) { // Disabling since consistent failure on Java 25
402-
addTest(new TestSuite(ConditionalBreakpointsWithFileClass.class));
403-
}
401+
addTest(new TestSuite(ConditionalBreakpointsWithFileClass.class));
404402
addTest(new TestSuite(CompareObjectsTest.class));
405403
addTest(new TestSuite(DisableOnHitTest.class));
406404

org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/ConditionalBreakpointsWithFileClass.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.eclipse.jdt.core.IJavaProject;
1717
import org.eclipse.jdt.debug.core.IJavaLineBreakpoint;
1818
import org.eclipse.jdt.debug.core.IJavaThread;
19+
import org.eclipse.jdt.debug.testplugin.JavaProjectHelper;
1920
import org.eclipse.jdt.debug.tests.AbstractDebugTest;
2021

2122
public class ConditionalBreakpointsWithFileClass extends AbstractDebugTest {
@@ -54,19 +55,30 @@ public void testFileConditionalBreakpointforFalse() throws Exception {
5455
public void testFileConditionalBreakpointforTrue() throws Exception {
5556
String typeName = "FileConditionSnippet2";
5657
IJavaLineBreakpoint bp3 = createLineBreakpoint(20, typeName);
58+
IJavaLineBreakpoint bp2;
5759
IJavaThread mainThread = null;
5860

5961
try {
6062
Thread.sleep(10);
6163
mainThread = launchToBreakpoint(typeName);
6264
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+
6472
int hitLine = 0;
6573
mainThread.resume();
6674
Thread.sleep(1000);
6775
assertTrue("Thread should be suspended", mainThread.isSuspended());
6876
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+
}
7082

7183
bp2.delete();
7284
bp3.delete();

0 commit comments

Comments
 (0)