From e012f5238ea8dc84f07603cb21d1f5c5bbe64e3d Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Sun, 26 Apr 2026 13:07:16 +0200 Subject: [PATCH] Migrate test fixtures to non-deprecated contentTypes extension point The org.eclipse.core.runtime.contentTypes extension point was deprecated in 2018 and is being removed. Replace with its canonical successor org.eclipse.core.contenttype.contentTypes in the four test fixture plugin.xml files. The child element schema is identical, so this is a mechanical id swap with no behavioral change. These fixtures provide negative-case coverage (missing names, invalid describers, empty file-extensions, missing alias targets) for the content-type registry tests in org.eclipse.core.tests.resources. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../Plugin_Testing/content/bundle01/plugin.xml | 2 +- .../Plugin_Testing/content/bundle02/plugin.xml | 2 +- .../Plugin_Testing/content/bundle03/plugin.xml | 2 +- .../Plugin_Testing/content/bundle04/plugin.xml | 2 +- .../resources/content/IContentTypeManagerTest.java | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/resources/tests/org.eclipse.core.tests.resources/Plugin_Testing/content/bundle01/plugin.xml b/resources/tests/org.eclipse.core.tests.resources/Plugin_Testing/content/bundle01/plugin.xml index f13334a6711..58c01fd4fb9 100644 --- a/resources/tests/org.eclipse.core.tests.resources/Plugin_Testing/content/bundle01/plugin.xml +++ b/resources/tests/org.eclipse.core.tests.resources/Plugin_Testing/content/bundle01/plugin.xml @@ -1,7 +1,7 @@ - + diff --git a/resources/tests/org.eclipse.core.tests.resources/Plugin_Testing/content/bundle02/plugin.xml b/resources/tests/org.eclipse.core.tests.resources/Plugin_Testing/content/bundle02/plugin.xml index 2212d65fe2f..4b1273746a7 100644 --- a/resources/tests/org.eclipse.core.tests.resources/Plugin_Testing/content/bundle02/plugin.xml +++ b/resources/tests/org.eclipse.core.tests.resources/Plugin_Testing/content/bundle02/plugin.xml @@ -1,7 +1,7 @@ - + diff --git a/resources/tests/org.eclipse.core.tests.resources/Plugin_Testing/content/bundle03/plugin.xml b/resources/tests/org.eclipse.core.tests.resources/Plugin_Testing/content/bundle03/plugin.xml index 7b18f4212db..2463d8a3ed1 100644 --- a/resources/tests/org.eclipse.core.tests.resources/Plugin_Testing/content/bundle03/plugin.xml +++ b/resources/tests/org.eclipse.core.tests.resources/Plugin_Testing/content/bundle03/plugin.xml @@ -1,7 +1,7 @@ - + - + diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/content/IContentTypeManagerTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/content/IContentTypeManagerTest.java index aa1222a93bb..fefc3870a51 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/content/IContentTypeManagerTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/content/IContentTypeManagerTest.java @@ -204,7 +204,7 @@ public void testAlias() throws Exception { assertThat(selected).containsExactly(alias, derived); // test late addition of content type - TestRegistryChangeListener listener = new TestRegistryChangeListener(Platform.PI_RUNTIME, + TestRegistryChangeListener listener = new TestRegistryChangeListener(IContentConstants.CONTENT_NAME, ContentTypeBuilder.PT_CONTENTTYPES, null, null); BundleTestingHelper.runWithBundles(() -> { IContentType alias1 = contentTypeManager.getContentType(PI_RESOURCES_TESTS + ".alias"); @@ -761,7 +761,7 @@ public void testDynamicChanges() throws Exception { assertEquals(text[0], text[1]); assertEquals(text[0], text[1]); // make arbitrary dynamic changes to the contentTypes extension point - TestRegistryChangeListener listener = new TestRegistryChangeListener(Platform.PI_RUNTIME, + TestRegistryChangeListener listener = new TestRegistryChangeListener(IContentConstants.CONTENT_NAME, ContentTypeBuilder.PT_CONTENTTYPES, null, null); BundleTestingHelper.runWithBundles(() -> { IContentType missing = manager.getContentType("org.eclipse.bundle01.missing"); @@ -1031,7 +1031,7 @@ public void testInvalidMarkup() throws Exception { assertThat(finder.findContentTypesFor("invalid.missing.identifier")).isEmpty(); assertThat(finder.findContentTypesFor("invalid.missing.name")).isEmpty(); assertNull(contentTypeManager.getContentType(PI_RESOURCES_TESTS + '.' + "invalid-missing-name")); - TestRegistryChangeListener listener = new TestRegistryChangeListener(Platform.PI_RUNTIME, + TestRegistryChangeListener listener = new TestRegistryChangeListener(IContentConstants.CONTENT_NAME, ContentTypeBuilder.PT_CONTENTTYPES, null, null); BundleTestingHelper.runWithBundles(() -> { // ensure the invalid content types are not available @@ -1173,7 +1173,7 @@ public void testNoExtensionAssociation() throws Exception { IContentType[] selected = manager.findContentTypesFor("file_with_no_extension"); assertThat(selected).isEmpty(); - TestRegistryChangeListener listener = new TestRegistryChangeListener(Platform.PI_RUNTIME, + TestRegistryChangeListener listener = new TestRegistryChangeListener(IContentConstants.CONTENT_NAME, ContentTypeBuilder.PT_CONTENTTYPES, null, null); BundleTestingHelper.runWithBundles(() -> { final String namespace = "org.eclipse.bundle04"; @@ -1240,7 +1240,7 @@ public void testOrphanContentType() throws Exception { assertThat(contentTypeManager.findContentTypesFor("foo.orphan2")).isEmpty(); // test late addition of content type - orphan2 should become visible - TestRegistryChangeListener listener = new TestRegistryChangeListener(Platform.PI_RUNTIME, + TestRegistryChangeListener listener = new TestRegistryChangeListener(IContentConstants.CONTENT_NAME, ContentTypeBuilder.PT_CONTENTTYPES, null, null); BundleTestingHelper.runWithBundles(() -> {