Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@ pipeline {
// The following lines use the newest build on master that did not fail a reference
// To not fail master build on failed test maven needs to be started with "-Dmaven.test.failure.ignore=true" it will then only marked unstable.
// To not fail the build also "unstable: true" is used to only mark the build unstable instead of failing when qualityGates are missed
// Also do not record mavenConsole() as failing tests are logged with ERROR duplicating the failure into the "Maven" plugin
// To accept unstable builds (test errors or new warnings introduced by third party changes) as reference using "ignoreQualityGate:true"
// To only show warnings related to the PR on a PR using "publishAllIssues:false"
// The eclipse compiler name is changed because the logfile not only contains ECJ but also API warnings.
// "pattern:" is used to collect warnings in dedicated files avoiding output of junit tests treated as warnings
junit '**/target/surefire-reports/*.xml'
discoverGitReferenceBuild referenceJob: 'eclipse.jdt.debug-github/master'
recordIssues publishAllIssues:false, ignoreQualityGate:true, tool: eclipse(name: 'Compiler and API Tools', pattern: '**/target/compilelogs/*.xml'), qualityGates: [[threshold: 1, type: 'DELTA', unstable: true]]
recordIssues publishAllIssues:false, ignoreQualityGate:true, tool: javaDoc(), qualityGates: [[threshold: 1, type: 'DELTA', unstable: true]]
junit allowEmptyResults: true, testResults: '**/target/surefire-reports/*.xml'
recordIssues publishAllIssues: false, ignoreQualityGate: true, enabledForFailure: true, tools: [
eclipse(name: 'Compiler', pattern: '**/target/compilelogs/*.xml'),
issues(name: 'API Tools', id: 'apitools', pattern: '**/target/apianalysis/*.xml'),
javaDoc(),
], qualityGates: [[threshold: 1, type: 'DELTA', unstable: true]]
recordIssues tools: [mavenConsole()]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,59 @@ public void testLinkNavigationTrueForLinksWithMultiSpaceBeforeSignature() throws
project.getProject().delete(force, new NullProgressMonitor());
}
}

public void testLinkNavigationTrueForLinksWithTimeStamps1() throws Exception {
String projectName = "StackTest";
IJavaProject project = createProject(projectName, "testfiles/AmbiguityTest/", JavaProjectHelper.JAVA_SE_1_8_EE_NAME, false);
waitForBuild();
waitForJobs();
consoleDocumentWithText("250420 12:59:13.999 (SampleGenerics.java:25) Hello");
IHyperlink[] hyperlinks = fConsole.getHyperlinks();
assertEquals("Wrong hyperlinks, listing all links: " + allLinks(), 1, hyperlinks.length);
String expectedText = "System.out.print(\"EXPECTED_GENERICS\");";
try {
for (IHyperlink hyperlink : hyperlinks) {
closeAllEditors();
hyperlink.linkActivated();
IEditorPart editor = waitForEditorOpen();
String[] selectedText = new String[1];
sync(() -> selectedText[0] = getSelectedText(editor));
selectedText[0] = selectedText[0].trim();
assertEquals("Wrong text selected after hyperlink navigation", expectedText, selectedText[0]);

}
} finally {
closeAllEditors();
boolean force = true;
project.getProject().delete(force, new NullProgressMonitor());
}
}
public void testLinkNavigationTrueForLinksWithTimeStamps2() throws Exception {
String projectName = "StackTest";
IJavaProject project = createProject(projectName, "testfiles/AmbiguityTest/", JavaProjectHelper.JAVA_SE_1_8_EE_NAME, false);
waitForBuild();
waitForJobs();
consoleDocumentWithText("2025-04-20 12.01.23 (SampleGenerics.java:25) Hello");
IHyperlink[] hyperlinks = fConsole.getHyperlinks();
assertEquals("Wrong hyperlinks, listing all links: " + allLinks(), 1, hyperlinks.length);
String expectedText = "System.out.print(\"EXPECTED_GENERICS\");";
try {
for (IHyperlink hyperlink : hyperlinks) {
closeAllEditors();
hyperlink.linkActivated();
IEditorPart editor = waitForEditorOpen();
String[] selectedText = new String[1];
sync(() -> selectedText[0] = getSelectedText(editor));
selectedText[0] = selectedText[0].trim();
assertEquals("Wrong text selected after hyperlink navigation", expectedText, selectedText[0]);

}
} finally {
closeAllEditors();
boolean force = true;
project.getProject().delete(force, new NullProgressMonitor());
}
}
private void waitForJobs() throws Exception {
TestUtil.waitForJobs(getName(), 250, 10_000);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.eclipse.jdt.debug.tests.breakpoints.ConditionalBreakpointsWithFileClass;
import org.eclipse.jdt.debug.tests.breakpoints.ConditionalBreakpointsWithGenerics;
import org.eclipse.jdt.debug.tests.breakpoints.DeferredBreakpointTests;
import org.eclipse.jdt.debug.tests.breakpoints.DisableOnHitTest;
import org.eclipse.jdt.debug.tests.breakpoints.ExceptionBreakpointTests;
import org.eclipse.jdt.debug.tests.breakpoints.HitCountBreakpointsTests;
import org.eclipse.jdt.debug.tests.breakpoints.ImportBreakpointsTest;
Expand Down Expand Up @@ -399,6 +400,7 @@ public AutomatedSuite() {
addTest(new TestSuite(JavaThreadEventHandlerTests.class));
addTest(new TestSuite(ConditionalBreakpointsWithFileClass.class));
addTest(new TestSuite(CompareObjectsTest.class));
addTest(new TestSuite(DisableOnHitTest.class));

if (JavaProjectHelper.isJava8Compatible()) {
addTest(new TestSuite(TestToggleBreakpointsTarget8.class));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*******************************************************************************
* Copyright (c) 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.debug.tests.breakpoints;

import org.eclipse.jdt.debug.core.IJavaLineBreakpoint;
import org.eclipse.jdt.debug.core.IJavaThread;
import org.eclipse.jdt.debug.tests.AbstractDebugTest;

/**
* Tests for disable on hit breakpoints.
*/

public class DisableOnHitTest extends AbstractDebugTest {

/**
* Constructor
*
* @param name
* the name of the test
*/
public DisableOnHitTest(String name) {
super(name);
}

public void testBreakpointHitWith() throws Exception {
String typeName = "TriggerPoint_01";
IJavaLineBreakpoint bp1 = createLineBreakpoint(19, typeName);
IJavaLineBreakpoint bp2 = createLineBreakpoint(20, typeName);
bp1.setDisableOnHit(true);
IJavaThread thread = null;
try {
thread = launchToBreakpoint(typeName);
thread.resume();
boolean isBp1Disabled = bp1.isEnabled();
assertFalse("Breakpoint should be disabled after hit", isBp1Disabled);
bp1.delete();
bp2.delete();
} finally {
terminateAndRemove(thread);
removeAllBreakpoints();
}
}

public void testBreakpointHitWithout() throws Exception {
String typeName = "TriggerPoint_01";
IJavaLineBreakpoint bp1 = createLineBreakpoint(19, typeName);
IJavaLineBreakpoint bp2 = createLineBreakpoint(20, typeName);
IJavaThread thread = null;
try {
thread = launchToBreakpoint(typeName);
thread.resume();
boolean isBp1Disabled = bp1.isEnabled();
assertTrue("Breakpoint should be not be disabled after hit", isBp1Disabled);
bp1.delete();
bp2.delete();
} finally {
terminateAndRemove(thread);
removeAllBreakpoints();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
*******************************************************************************/
package org.eclipse.jdt.debug.tests.breakpoints;

import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.core.model.IVariable;
import org.eclipse.jdt.debug.core.IJavaBreakpoint;
import org.eclipse.jdt.debug.core.IJavaDebugTarget;
import org.eclipse.jdt.debug.core.IJavaLineBreakpoint;
import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
import org.eclipse.jdt.debug.core.IJavaStackFrame;
Expand Down Expand Up @@ -135,4 +138,33 @@ public void testTriggerPointBreakpointWithResumeAndConditionAsTrue() throws Exce
removeAllBreakpoints();
}
}

// see bug : https://github.com/eclipse-jdt/eclipse.jdt.debug/issues/546
public void testTriggerPointAutoEnableAfterConditionalBp() throws Exception {
String typeName = "TriggerPoint_01";
IJavaLineBreakpoint bp1 = createLineBreakpoint(20, typeName);
IJavaLineBreakpoint bp2 = createLineBreakpoint(21, typeName);
bp1.setTriggerPoint(true);
bp2.setCondition("true");
bp2.setConditionEnabled(true);
bp2.setConditionSuspendOnTrue(true);
IJavaThread thread = null;
try {
thread = launchToBreakpoint(typeName);
IJavaStackFrame frame = (IJavaStackFrame) thread.getTopStackFrame();
int lineNumber = frame.getLineNumber();
assertEquals("Breakpoint should hit at triggeroint", 20, lineNumber);
IJavaDebugTarget debugTarget = (IJavaDebugTarget) thread.getDebugTarget();
ILaunch launch = debugTarget.getLaunch();
thread.getLaunch().terminate();
Thread.sleep(3000);
IBreakpoint[] bps = getBreakpointManager().getBreakpoints();
boolean enabledStatus = bps[0].isEnabled();
assertTrue("Trigger point should be enabled after termination", enabledStatus);
getLaunchManager().removeLaunch(launch);
} finally {
terminateAndRemove(thread);
removeAllBreakpoints();
}
}
}
1 change: 1 addition & 0 deletions org.eclipse.jdt.debug.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-21
Automatic-Module-Name: org.eclipse.jdt.debug.ui
Require-Capability: eclipse.swt;filter:="(image.format=svg)"
4 changes: 3 additions & 1 deletion org.eclipse.jdt.debug.ui/forceQualifierUpdate.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/13
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1659
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1781
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1923
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1979
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1979
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/2995
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/3006
Loading
Loading