Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2021-03-30 17:47:39 +0000
committerPatrick Tessier2021-04-28 15:32:13 +0000
commitfa66dbad196b27abfb3e4f14e4323c09870232cb (patch)
tree1f6a28d3ff0ae65ce6512eaedb2fade0d8156808 /tests/junit/plugins/toolsmiths
parent06916a28a86bf04b9fc15e35f29cb9b7fc8d2834 (diff)
downloadorg.eclipse.papyrus-fa66dbad196b27abfb3e4f14e4323c09870232cb.tar.gz
org.eclipse.papyrus-fa66dbad196b27abfb3e4f14e4323c09870232cb.tar.xz
org.eclipse.papyrus-fa66dbad196b27abfb3e4f14e4323c09870232cb.zip
Bug 571125: [Toolsmith] Improve icon validation for toolsmith validation
- unify validation of icons referenced by model elements - covers opaque resources of all kinds, not just icons: e.g., creation/conversion command classes in Architecture models - covers resources referenced from model files and from plugin.xml - add calculation of required bundle dependencies from command-class features that are constrained to implement some interface, the bundle providing that interface type being a required dependency. This helps to diagnose problems in resolving commands when the JDT classpath of the architecture bundle does not include the required interface Change-Id: I70db66a448d13cd989da3aeb51b54d2995d273b6 Signed-off-by: Christian W. Damus <give.a.damus@gmail.com>
Diffstat (limited to 'tests/junit/plugins/toolsmiths')
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.profile.tests/src/org/eclipse/papyrus/toolsmiths/validation/profile/tests/ProfilePluginValidationTest.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.profile.tests/src/org/eclipse/papyrus/toolsmiths/validation/profile/tests/ProfilePluginValidationTest.java b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.profile.tests/src/org/eclipse/papyrus/toolsmiths/validation/profile/tests/ProfilePluginValidationTest.java
index 2a86284b9a9..63378aab03f 100644
--- a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.profile.tests/src/org/eclipse/papyrus/toolsmiths/validation/profile/tests/ProfilePluginValidationTest.java
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.profile.tests/src/org/eclipse/papyrus/toolsmiths/validation/profile/tests/ProfilePluginValidationTest.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2019 CEA LIST, and others.
+ * Copyright (c) 2019, 2021 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,10 +10,14 @@
*
* Contributors:
* Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Initial API and implementation
+ * Christian W. Damus - bug 571125
*
*****************************************************************************/
package org.eclipse.papyrus.toolsmiths.validation.profile.tests;
+import static org.eclipse.papyrus.junit.matchers.MoreMatchers.greaterThan;
+import static org.eclipse.papyrus.junit.matchers.MoreMatchers.greaterThanOrEqual;
+
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
@@ -26,6 +30,7 @@ import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusT
import org.eclipse.papyrus.junit.utils.rules.ProjectFixture;
import org.eclipse.papyrus.toolsmiths.validation.profile.checkers.ProfilePluginCheckerService;
import org.eclipse.papyrus.toolsmiths.validation.profile.constants.ProfilePluginValidationConstants;
+import org.hamcrest.MatcherAssert;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
@@ -83,7 +88,7 @@ public class ProfilePluginValidationTest extends AbstractPapyrusTest {
// Now check the markers
Assert.assertNotNull("The markers have to be found", markers); //$NON-NLS-1$
- Assert.assertEquals("The number of markers is not correct", 6, markers.size()); //$NON-NLS-1$
+ MatcherAssert.assertThat("The number of markers is not correct", markers.size(), greaterThanOrEqual(6)); //$NON-NLS-1$
// Check the profile.uml markers
final List<IMarker> profileFileMarkers = markers.stream().filter(marker -> marker.getResource().getFullPath().toString().endsWith("bookstore.profile.uml")).collect(Collectors.toList()); //$NON-NLS-1$
@@ -96,10 +101,10 @@ public class ProfilePluginValidationTest extends AbstractPapyrusTest {
Assert.assertEquals("The number of markers for dependencies is not correct", 4, manifestMarkers.size()); //$NON-NLS-1$
Assert.assertTrue("The severity of profile marker is not correct", isMarkerSeverity(manifestMarkers.get(0), IMarker.SEVERITY_WARNING)); //$NON-NLS-1$
- // Check the build markers
+ // Check the build markers. The profile and genmodel need to be included in the binary build
final List<IMarker> buildMarkers = markers.stream().filter(marker -> marker.getResource().getFullPath().toString().endsWith("build.properties")).collect(Collectors.toList()); //$NON-NLS-1$
Assert.assertNotNull("Build markers are not found", buildMarkers); //$NON-NLS-1$
- Assert.assertEquals("The number of markers for build is not correct", 0, buildMarkers.size()); //$NON-NLS-1$
+ MatcherAssert.assertThat("The number of markers for build is not correct", buildMarkers.size(), greaterThan(0)); //$NON-NLS-1$
// Check the extensions markers
final List<IMarker> extensionsMarkers = markers.stream().filter(marker -> marker.getResource().getFullPath().toString().endsWith("plugin.xml")).collect(Collectors.toList()); //$NON-NLS-1$
@@ -130,4 +135,4 @@ public class ProfilePluginValidationTest extends AbstractPapyrusTest {
}
}
-} \ No newline at end of file
+}

Back to the top