Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2013-05-07 12:23:21 +0000
committercletavernie2013-05-07 12:23:21 +0000
commit101b349f456dd22f7c90683b1e20d6e8ee634235 (patch)
treefe58f0e4cb16a7addb9d576743824b2a65325aeb /tests/junit/plugins/developer
parente4de1d44e940071e51268bf360604410f6d238e9 (diff)
downloadorg.eclipse.papyrus-101b349f456dd22f7c90683b1e20d6e8ee634235.tar.gz
org.eclipse.papyrus-101b349f456dd22f7c90683b1e20d6e8ee634235.tar.xz
org.eclipse.papyrus-101b349f456dd22f7c90683b1e20d6e8ee634235.zip
378990: [Tests] Add JUnit tests to test informations of built plugins and features
Improve the test for PLUGIN_ID
Diffstat (limited to 'tests/junit/plugins/developer')
-rw-r--r--tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundlesTests.java34
1 files changed, 15 insertions, 19 deletions
diff --git a/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundlesTests.java b/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundlesTests.java
index 9e371e21f40..6b7bf2d3c6c 100644
--- a/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundlesTests.java
+++ b/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundlesTests.java
@@ -20,23 +20,17 @@ import java.util.Collection;
import java.util.Enumeration;
import java.util.List;
-import org.eclipse.core.internal.runtime.InternalPlatform;
-import org.eclipse.core.runtime.IBundleGroup;
-import org.eclipse.core.runtime.IBundleGroupProvider;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.osgi.framework.internal.core.BundleFragment;
import org.eclipse.osgi.util.NLS;
import org.eclipse.pde.internal.core.feature.Feature;
import org.junit.Assert;
import org.junit.Test;
import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.eclipse.update.internal.configurator.FeatureEntry;
public class BundlesTests {
private static final String REGEX_VERSION_NUMBER = "0\\.10\\.0\\..*";
-
+
private static final String REGEX_INCUBATION = ".*\\(Incubation\\)";
@Test
@@ -45,16 +39,16 @@ public class BundlesTests {
int nbProblem = 0;
final List<Feature> features = BundleTestsUtils.getPapyrusFeature();
for(final Feature feature : features) {
- String version = feature.getVersion();
- if(!version.matches(REGEX_VERSION_NUMBER)) {
- if(message == null) {
- message = "Wrong version number for the features:";
- }
- message += "\n" + feature.getId();
- nbProblem++;
+ String version = feature.getVersion();
+ if(!version.matches(REGEX_VERSION_NUMBER)) {
+ if(message == null) {
+ message = "Wrong version number for the features:";
}
+ message += "\n" + feature.getId();
+ nbProblem++;
}
- Assert.assertNull(nbProblem + "problems!\n"+message, message);
+ }
+ Assert.assertNull(nbProblem + "problems!\n" + message, message);
}
/**
@@ -78,7 +72,7 @@ public class BundlesTests {
*/
@Test
public void versionTest() {
- testManifestProperty(BundleTestsUtils.BUNDLE_VERSION, REGEX_VERSION_NUMBER, false, false); //$NON-NLS-1$
+ testManifestProperty(BundleTestsUtils.BUNDLE_VERSION, REGEX_VERSION_NUMBER, false, false);
}
/**
@@ -277,7 +271,7 @@ public class BundlesTests {
* verify that the field PLUGIN_ID is equals to the plugin name
*/
@Test
- public void PLUGIN_ID_Test() {
+ public void pluginIDTest() {
String errorMessage = ""; //$NON-NLS-1$.
String warningMessage = "";//$NON-NLS-1$
final Collection<String> possibleIds = new ArrayList<String>();
@@ -318,8 +312,10 @@ public class BundlesTests {
}
}
- Assert.assertTrue(nbError + " problems! " + errorMessage, nbError == 0); //$NON-NLS-1$
- Assert.assertTrue(nbWarning + "warning!" + warningMessage, nbWarning == 0);//$NON-NLS-1$
+ Assert.assertTrue(nbError + " problems! " + errorMessage, nbError == 0); //$NON-NLS-1$
+
+ //Do not fail on warnings
+ //Assert.assertTrue(nbWarning + "warning!" + warningMessage, nbWarning == 0);//$NON-NLS-1$
}

Back to the top