diff --git a/runtime/tests/org.eclipse.core.expressions.tests/META-INF/MANIFEST.MF b/runtime/tests/org.eclipse.core.expressions.tests/META-INF/MANIFEST.MF index 1c9eae3130f..7d71ae59d10 100644 --- a/runtime/tests/org.eclipse.core.expressions.tests/META-INF/MANIFEST.MF +++ b/runtime/tests/org.eclipse.core.expressions.tests/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.core.expressions.tests; singleton:=true -Bundle-Version: 3.7.600.qualifier +Bundle-Version: 3.7.700.qualifier Bundle-Vendor: %providerName Bundle-Localization: plugin Export-Package: diff --git a/runtime/tests/org.eclipse.core.expressions.tests/src/com/ibm/icu/text/DecimalFormat.java b/runtime/tests/org.eclipse.core.expressions.tests/src/org/eclipse/ant/core/AntRunner.java similarity index 60% rename from runtime/tests/org.eclipse.core.expressions.tests/src/com/ibm/icu/text/DecimalFormat.java rename to runtime/tests/org.eclipse.core.expressions.tests/src/org/eclipse/ant/core/AntRunner.java index fdad3576e39..e8fba8cca1e 100644 --- a/runtime/tests/org.eclipse.core.expressions.tests/src/com/ibm/icu/text/DecimalFormat.java +++ b/runtime/tests/org.eclipse.core.expressions.tests/src/org/eclipse/ant/core/AntRunner.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013, 2015 IBM Corporation and others. + * Copyright (c) 2024 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -11,19 +11,25 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ -package com.ibm.icu.text; +package org.eclipse.ant.core; + +import java.io.Serializable; /** * Used by the * {@link org.eclipse.core.internal.expressions.tests.ExpressionTestsPluginUnloading} * test. *
- * Note: This class uses the 'com.ibm.icu.text' namespace for - * test purposes only and does not copy or implement anything from ICU. + * Note: This class uses the 'org.eclipse.ant.core' namespace + * for test purposes only and does not copy or implement anything from the real + * AntRunner class. *
*/ -public class DecimalFormat implements Runnable { +public class AntRunner implements Runnable, Serializable { + private static final long serialVersionUID = 1L; + @Override public void run() { + // Empty implementation for testing } } diff --git a/runtime/tests/org.eclipse.core.expressions.tests/src/org/eclipse/core/internal/expressions/tests/ExpressionTestsPluginUnloading.java b/runtime/tests/org.eclipse.core.expressions.tests/src/org/eclipse/core/internal/expressions/tests/ExpressionTestsPluginUnloading.java index 10546934fc7..effe090aef3 100644 --- a/runtime/tests/org.eclipse.core.expressions.tests/src/org/eclipse/core/internal/expressions/tests/ExpressionTestsPluginUnloading.java +++ b/runtime/tests/org.eclipse.core.expressions.tests/src/org/eclipse/core/internal/expressions/tests/ExpressionTestsPluginUnloading.java @@ -33,13 +33,16 @@ /** * Tests for cache used in {@link Expressions#isInstanceOf(Object, String)}. *
- * WARNING: These tests start, stop, and re-start the com.ibm.icu bundle.
+ * WARNING: These tests start, stop, and re-start the org.eclipse.ant.core bundle.
* Don't include these in another test suite!
*/
@SuppressWarnings("restriction")
@TestMethodOrder(MethodOrderer.MethodName.class)
public class ExpressionTestsPluginUnloading {
+ private static final String ANT_CORE_BUNDLE_ID = "org.eclipse.ant.core";
+ private static final String ANT_RUNNER_CLASS_NAME = "org.eclipse.ant.core.AntRunner";
+
private String name;
@BeforeEach
@@ -49,13 +52,13 @@ public void setupTestName(TestInfo testInfo) {
@Test
public void test01PluginStopping() throws Exception {
- Bundle bundle= getBundle("com.ibm.icu");
+ Bundle bundle= getBundle(ANT_CORE_BUNDLE_ID);
bundle.start();
int state = bundle.getState();
assertThat(state).withFailMessage("Unexpected bundle state: " + stateToString(state) + " for bundle " + bundle)
.isEqualTo(Bundle.ACTIVE);
- doTestInstanceofICUDecimalFormat(bundle);
+ doTestInstanceofAntRunner(bundle);
assertThat(bundle.getState()).as("Instanceof with bundle-local class should load extra bundle")
.isEqualTo(state);
@@ -69,26 +72,26 @@ public void test01PluginStopping() throws Exception {
.withFailMessage("Unexpected bundle state: " + stateToString(state) + " for bundle " + bundle)
.isEqualTo(Bundle.ACTIVE);
- doTestInstanceofICUDecimalFormat(bundle);
+ doTestInstanceofAntRunner(bundle);
}
@Test
public void test02MultipleClassloaders() throws Exception {
Bundle expr= getBundle("org.eclipse.core.expressions.tests");
- Bundle icu= getBundle("com.ibm.icu");
+ Bundle ant= getBundle(ANT_CORE_BUNDLE_ID);
- Class> exprClass = expr.loadClass("com.ibm.icu.text.DecimalFormat");
- Class> icuClass = icu.loadClass("com.ibm.icu.text.DecimalFormat");
- assertThat(exprClass).isNotSameAs(icuClass);
+ Class> exprClass = expr.loadClass(ANT_RUNNER_CLASS_NAME);
+ Class> antClass = ant.loadClass(ANT_RUNNER_CLASS_NAME);
+ assertThat(exprClass).isNotSameAs(antClass);
Object exprObj = exprClass.getDeclaredConstructor().newInstance();
- Object icuObj = icuClass.getDeclaredConstructor().newInstance();
+ Object antObj = antClass.getDeclaredConstructor().newInstance();
assertInstanceOf(exprObj, "java.lang.Runnable", "java.lang.String");
- assertInstanceOf(exprObj, "java.lang.Object", "java.io.Serializable");
+ assertInstanceOf(exprObj, "java.io.Serializable", "org.eclipse.equinox.app.IApplication");
- assertInstanceOf(icuObj, "java.io.Serializable", "java.lang.String");
- assertInstanceOf(icuObj, "java.text.Format", "java.lang.Runnable");
+ assertInstanceOf(antObj, "org.eclipse.equinox.app.IApplication", "java.lang.Runnable");
+ assertInstanceOf(antObj, "java.lang.Object", "java.io.Serializable");
}
static String stateToString(int state) {
@@ -125,10 +128,10 @@ private void assertInstanceOf(Object obj, String isInstance, String isNotInstanc
}
}
- private void doTestInstanceofICUDecimalFormat(Bundle bundle) throws Exception {
- Class> clazz = bundle.loadClass("com.ibm.icu.text.DecimalFormat");
- Object decimalFormat = clazz.getDeclaredConstructor().newInstance();
- assertInstanceOf(decimalFormat, "com.ibm.icu.text.DecimalFormat", "java.text.NumberFormat");
+ private void doTestInstanceofAntRunner(Bundle bundle) throws Exception {
+ Class> clazz = bundle.loadClass(ANT_RUNNER_CLASS_NAME);
+ Object antRunner = clazz.getDeclaredConstructor().newInstance();
+ assertInstanceOf(antRunner, ANT_RUNNER_CLASS_NAME, "java.lang.Runnable");
}
private static Bundle getBundle(String bundleName) {