From 2a91e817e917248cc11d37df9b45616d511bc9f6 Mon Sep 17 00:00:00 2001 From: Stephan Herrmann Date: Thu, 4 Dec 2025 17:55:59 +0100 Subject: [PATCH] [26] Adjusting some tests: + applets are gone + don't enable preview for 25 --- org.eclipse.jdt.debug.tests/META-INF/MANIFEST.MF | 2 +- org.eclipse.jdt.debug.tests/pom.xml | 2 +- .../eclipse/jdt/debug/tests/AbstractDebugTest.java | 12 +++++++++++- .../launching/LaunchConfigurationManagerTests.java | 9 +++++++++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/org.eclipse.jdt.debug.tests/META-INF/MANIFEST.MF b/org.eclipse.jdt.debug.tests/META-INF/MANIFEST.MF index 11e6c3281a..55a4021ec2 100644 --- a/org.eclipse.jdt.debug.tests/META-INF/MANIFEST.MF +++ b/org.eclipse.jdt.debug.tests/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.jdt.debug.tests; singleton:=true -Bundle-Version: 3.12.800.qualifier +Bundle-Version: 3.12.850.qualifier Bundle-ClassPath: javadebugtests.jar Bundle-Activator: org.eclipse.jdt.debug.testplugin.JavaTestPlugin Bundle-Vendor: %providerName diff --git a/org.eclipse.jdt.debug.tests/pom.xml b/org.eclipse.jdt.debug.tests/pom.xml index f3c02defe1..729cfbbbd4 100644 --- a/org.eclipse.jdt.debug.tests/pom.xml +++ b/org.eclipse.jdt.debug.tests/pom.xml @@ -18,7 +18,7 @@ org.eclipse.jdt org.eclipse.jdt.debug.tests - 3.12.800-SNAPSHOT + 3.12.850-SNAPSHOT eclipse-test-plugin ${project.artifactId} diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java index 26b68454c1..56d02745ff 100644 --- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java +++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java @@ -251,6 +251,7 @@ public abstract class AbstractDebugTest extends TestCase implements IEvaluation private static boolean loadedMulti = false; private static boolean loadedMR; private static boolean welcomeClosed = false; + protected boolean isJRE26plus = false; /** * Constructor @@ -260,6 +261,10 @@ public AbstractDebugTest(String name) { // set error dialog to non-blocking to avoid hanging the UI during test ErrorDialog.AUTOMATED_MODE = true; SafeRunnable.setIgnoreErrors(true); + String javaVersion = System.getProperty("java.version"); + if (javaVersion.startsWith("26")) { + isJRE26plus = true; + } } @Override @@ -356,6 +361,11 @@ synchronized void assert14Project() { handleProjectCreationException(e, ONE_FOUR_PROJECT_CLOSED_NAME, jp); } jp = createProject(ONE_FOUR_PROJECT_NAME, JavaProjectHelper.TEST_SRC_DIR.toString(), JavaProjectHelper.JAVA_SE_1_8_EE_NAME, false); + if (isJRE26plus) { + // these files cannot be compiled against 26+ + jp.getProject().getFile("src/AppletImpl.java").delete(true, null); + jp.getProject().getFile("src/RunnableAppletImpl.java").delete(true, null); + } IPackageFragmentRoot src = jp.findPackageFragmentRoot(new Path(ONE_FOUR_PROJECT_NAME).append(JavaProjectHelper.SRC_DIR).makeAbsolute()); assertNotNull("The 'src' package fragment root should not be null", src); File root = JavaTestPlugin.getDefault().getFileInPlugin(new Path("testjars")); @@ -734,7 +744,7 @@ synchronized void assert25Project() { try { if (!loaded25) { jp = createProject(TWENTYFIVE_PROJECT_NAME, JavaProjectHelper.TEST_25_SRC_DIR.toString(), JavaProjectHelper.JAVA_SE_25_EE_NAME, false); - jp.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED); + jp.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.DISABLED); jp.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_25); jp.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_25); jp.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_25); diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LaunchConfigurationManagerTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LaunchConfigurationManagerTests.java index 9241d6983d..bad937f5d4 100644 --- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LaunchConfigurationManagerTests.java +++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LaunchConfigurationManagerTests.java @@ -110,6 +110,9 @@ public void testGetJavaLaunchShortcutsForSpecificResource() { * tests that the applet shortcut is found for a resource that extends applet */ public void testGetAppletLaunchShortcutsForSpecificResource() { + if (isJRE26plus) { + return; + } assertNotNull("The launch configuration manager cannot be null", fLCM); IResource resource = getResource("AppletImpl.java"); assertNotNull("The resource AppletImpl must exist", resource); @@ -121,6 +124,9 @@ public void testGetAppletLaunchShortcutsForSpecificResource() { * test that the correct shortcuts are returned for a resource which is an applet and has a main method */ public void testGetLaunchShortcutsForSpecificResource() { + if (isJRE26plus) { + return; + } assertNotNull("The launch configuration manager cannot be null", fLCM); IResource resource = getResource("RunnableAppletImpl.java"); assertNotNull("The resource RunnableAppletImpl must exist", resource); @@ -197,6 +203,9 @@ public void testGetDefaultLaunchGroupForDebugMode() { * in this test the applet and local java types should be found */ public void testGetApplicableLaunchConfigurationTypes() { + if (isJRE26plus) { + return; + } assertNotNull("The launch configuration manager cannot be null", fLCM); IResource resource = getResource("RunnableAppletImpl.java"); assertNotNull("The resource RunnableAppletImpl must exist", resource);