diff options
author | Christian W. Damus | 2021-08-03 20:54:34 +0000 |
---|---|---|
committer | Patrick Tessier | 2021-09-02 09:31:51 +0000 |
commit | cc0fe4253febdc094325776eec84b5a8db10d0ad (patch) | |
tree | fc5ee5ded2d28b0e37cbee9b819d512d2fea33bd /tests/junit/plugins | |
parent | f7d5202c473b69174dc84344490aa8edb3da30fd (diff) | |
download | org.eclipse.papyrus-cc0fe4253febdc094325776eec84b5a8db10d0ad.tar.gz org.eclipse.papyrus-cc0fe4253febdc094325776eec84b5a8db10d0ad.tar.xz org.eclipse.papyrus-cc0fe4253febdc094325776eec84b5a8db10d0ad.zip |
Bug 569105: [Toolsmiths] The "Remove Reexport" quickfix may create invalid Manifest directives
- do not add a null value for a header attribute/directive that was not present
Change-Id: I36872c7803730655e48a62c4dc72c5383aa2b7c5
Signed-off-by: Christian W. Damus <give.a.damus@gmail.com>
Diffstat (limited to 'tests/junit/plugins')
2 files changed, 58 insertions, 51 deletions
diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.eclipse.project.editors.tests/org.eclipse.papyrus.eclipse.project.editors.tests.launch b/tests/junit/plugins/editor/org.eclipse.papyrus.eclipse.project.editors.tests/org.eclipse.papyrus.eclipse.project.editors.tests.launch index 859cb8ba16b..d4c643b7edf 100644 --- a/tests/junit/plugins/editor/org.eclipse.papyrus.eclipse.project.editors.tests/org.eclipse.papyrus.eclipse.project.editors.tests.launch +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.eclipse.project.editors.tests/org.eclipse.papyrus.eclipse.project.editors.tests.launch @@ -1,47 +1,48 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig"> -<booleanAttribute key="append.args" value="true"/> -<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/> -<booleanAttribute key="askclear" value="false"/> -<booleanAttribute key="automaticAdd" value="true"/> -<booleanAttribute key="automaticValidate" value="false"/> -<stringAttribute key="bootstrap" value=""/> -<stringAttribute key="checked" value="[NONE]"/> -<booleanAttribute key="clearConfig" value="true"/> -<booleanAttribute key="clearws" value="true"/> -<booleanAttribute key="clearwslog" value="false"/> -<listAttribute key="com.mountainminds.eclemma.core.SCOPE_IDS"> -<listEntry value="=org.eclipse.papyrus.eclipse.project.editors/src"/> -</listAttribute> -<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/> -<booleanAttribute key="default" value="true"/> -<booleanAttribute key="includeOptional" value="true"/> -<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> -<listEntry value="/org.eclipse.papyrus.eclipse.project.editors.tests/src/org/eclipse/papyrus/eclipse/project/editors/tests/AllTests.java"/> -</listAttribute> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> -<listEntry value="1"/> -</listAttribute> -<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/> -<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> -<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> -<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> -<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> -<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> -<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.papyrus.eclipse.project.editors.tests.AllTests"/> -<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/> -<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.papyrus.eclipse.project.editors.tests"/> -<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> -<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms1024m -Xmx4086m"/> -<stringAttribute key="pde.version" value="3.3"/> -<stringAttribute key="product" value="org.eclipse.sdk.ide"/> -<booleanAttribute key="run_in_ui_thread" value="true"/> -<booleanAttribute key="show_selected_only" value="false"/> -<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/> -<booleanAttribute key="tracing" value="false"/> -<booleanAttribute key="useCustomFeatures" value="false"/> -<booleanAttribute key="useDefaultConfig" value="true"/> -<booleanAttribute key="useDefaultConfigArea" value="false"/> -<booleanAttribute key="useProduct" value="false"/> + <booleanAttribute key="append.args" value="true"/> + <stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/> + <booleanAttribute key="askclear" value="false"/> + <booleanAttribute key="automaticAdd" value="true"/> + <booleanAttribute key="automaticValidate" value="false"/> + <stringAttribute key="bootstrap" value=""/> + <stringAttribute key="checked" value="[NONE]"/> + <booleanAttribute key="clearConfig" value="true"/> + <booleanAttribute key="clearws" value="true"/> + <booleanAttribute key="clearwslog" value="false"/> + <listAttribute key="com.mountainminds.eclemma.core.SCOPE_IDS"> + <listEntry value="=org.eclipse.papyrus.eclipse.project.editors/src"/> + </listAttribute> + <stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/> + <booleanAttribute key="default" value="true"/> + <booleanAttribute key="includeOptional" value="true"/> + <stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/> + <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> + <listEntry value="/org.eclipse.papyrus.eclipse.project.editors.tests/src/org/eclipse/papyrus/eclipse/project/editors/tests/AllTests.java"/> + </listAttribute> + <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> + <listEntry value="1"/> + </listAttribute> + <stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/> + <booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> + <stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> + <stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> + <booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/> + <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> + <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/> + <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.papyrus.eclipse.project.editors.tests.AllTests"/> + <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/> + <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.papyrus.eclipse.project.editors.tests"/> + <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> + <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms1024m -Xmx4086m"/> + <stringAttribute key="pde.version" value="3.3"/> + <stringAttribute key="product" value="org.eclipse.sdk.ide"/> + <booleanAttribute key="run_in_ui_thread" value="true"/> + <booleanAttribute key="show_selected_only" value="false"/> + <stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/> + <booleanAttribute key="tracing" value="false"/> + <booleanAttribute key="useCustomFeatures" value="false"/> + <booleanAttribute key="useDefaultConfig" value="true"/> + <booleanAttribute key="useDefaultConfigArea" value="false"/> + <booleanAttribute key="useProduct" value="false"/> </launchConfiguration> diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.eclipse.project.editors.tests/src/org/eclipse/papyrus/eclipse/project/editors/tests/ManifestEditorTest.java b/tests/junit/plugins/editor/org.eclipse.papyrus.eclipse.project.editors.tests/src/org/eclipse/papyrus/eclipse/project/editors/tests/ManifestEditorTest.java index 56e952a843a..dba2d5bc9df 100644 --- a/tests/junit/plugins/editor/org.eclipse.papyrus.eclipse.project.editors.tests/src/org/eclipse/papyrus/eclipse/project/editors/tests/ManifestEditorTest.java +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.eclipse.project.editors.tests/src/org/eclipse/papyrus/eclipse/project/editors/tests/ManifestEditorTest.java @@ -1,6 +1,6 @@ /***************************************************************************** - * Copyright (c) 2016 Christian W. Damus and others. - * + * Copyright (c) 2016, 2021 Christian W. Damus, CEA LIST, and others. + * * All rights reserved. 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 @@ -10,7 +10,7 @@ * * Contributors: * Christian W. Damus - Initial API and implementation - * + * *****************************************************************************/ package org.eclipse.papyrus.eclipse.project.editors.tests; @@ -23,7 +23,7 @@ import static org.hamcrest.CoreMatchers.hasItem; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.CoreMatchers.nullValue; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import java.util.Arrays; import java.util.Collections; @@ -422,6 +422,12 @@ public class ManifestEditorTest { fixture.getEditor().save(); assertThat(one(getManifest(), "org.eclipse.papyrus.junit.utils"), not(containsString("visibility:=reexport"))); + + // And try to remove it again! (bug 569105) + fixture.getEditor().setRequiredBundleExported("org.eclipse.papyrus.junit.utils", false); + fixture.getEditor().save(); + + assertThat(one(getManifest(), "org.eclipse.papyrus.junit.utils"), not(containsString("visibility:="))); } @WithResource("manifest_project/META-INF/MANIFEST.MF") @@ -432,9 +438,9 @@ public class ManifestEditorTest { fixture.getEditor().save(); List<String> manifest = getManifest(); - - assertThat(manifest, hasItem("Require-Bundle: org.eclipse.papyrus.junit.utils;bundle-version=\"[1.2.0,2.0.0)\",")); - + + assertThat(manifest, hasItem("Require-Bundle: org.eclipse.papyrus.junit.utils;bundle-version=\"[1.2.0,2.0.0)\",")); + // This is now the last one (no trailing comma) assertThat(manifest, hasItem(" org.eclipse.papyrus.eclipse.project.editors;bundle-version=\"[2.0.0,3.0.0)\"")); } |