Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2012-05-11 09:18:14 +0000
committervlorenzo2012-05-11 09:18:14 +0000
commit645b6ba55157fb901883d6278339f8129eba5636 (patch)
treef48e76f749a5d2c7c41906cd8ab078a285c3b12a /tests/junit/plugins/developer
parent43dc1f235524454c77d6d0574b73ac16a0a06ca1 (diff)
downloadorg.eclipse.papyrus-645b6ba55157fb901883d6278339f8129eba5636.tar.gz
org.eclipse.papyrus-645b6ba55157fb901883d6278339f8129eba5636.tar.xz
org.eclipse.papyrus-645b6ba55157fb901883d6278339f8129eba5636.zip
378990: [Tests] Add JUnit tests to test informations of builded plugins and features
https://bugs.eclipse.org/bugs/show_bug.cgi?id=378990 Add a test for the JavaVersion (1.5)
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/BundleTestsUtils.java12
-rw-r--r--tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundlesTests.java19
2 files changed, 21 insertions, 10 deletions
diff --git a/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundleTestsUtils.java b/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundleTestsUtils.java
index 4ce8b42440c..b405db80eaf 100644
--- a/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundleTestsUtils.java
+++ b/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundleTestsUtils.java
@@ -8,7 +8,6 @@ import org.eclipse.osgi.launch.EquinoxFactory;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
-
public class BundleTestsUtils {
// This version number should be changed at each release
@@ -23,17 +22,20 @@ public class BundleTestsUtils {
public static final String BUNDLE_VENDOR = "Bundle-Vendor"; //$NON-NLS-1$
public static final String BUNDLE_VERSION = "Bundle-Version"; //$NON-NLS-1$
-
+
public static final String PAPYRUS_PREFIX = "org.eclipse.papyrus."; //$NON-NLS-1$
+ public static final String BUNDLE_REQUIREDEXECUTIONENVIRONMENT = "Bundle-RequiredExecutionEnvironment"; //$NON-NLS-1$
+
+ public static final String JAVA_VERSION_5 = "J2SE-1.5";//$NON-NLS-1$
+
private BundleTestsUtils() {
- //to prevent instanciation
+ // to prevent instanciation
}
/**
*
- * @return
- * the Bundle with a name beginning by {@link #PAPYRUS_PREFIX}
+ * @return the Bundle with a name beginning by {@link #PAPYRUS_PREFIX}
*/
public static List<Bundle> getPapyrusBundles() {
final List<Bundle> papyrusBundle = new ArrayList<Bundle>();
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 68028e37720..8bdae123471 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
@@ -25,7 +25,7 @@ public class BundlesTests {
* Tests that all Papyrus Bundle name are finished by {@link #INCUBATION}
*/
@Test
- public void incubationTests() {
+ public void incubationTest() {
testManifestProperty(BundleTestsUtils.BUNDLE_NAME, ".*\\(Incubation\\)"); //$NON-NLS-1$
}
@@ -37,22 +37,31 @@ public class BundlesTests {
testManifestProperty(BundleTestsUtils.BUNDLE_VENDOR, BundleTestsUtils.VENDOR_NAME);
}
-
/**
* Tests that each papyrus plugins have the correct version
*/
@Test
- public void versionTests() {
+ public void versionTest() {
testManifestProperty(BundleTestsUtils.BUNDLE_VERSION, "0\\.9\\.0\\..*"); //$NON-NLS-1$
}
-
+ /**
+ * Tests if the file about.html is included to the plugin
+ */
@Test
public void aboutTest() {
fileTest("/about.html"); //$NON-NLS-1$
}
/**
+ * Tests the java version
+ */
+ @Test
+ public void javaVersionTest() {
+ testManifestProperty(BundleTestsUtils.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, BundleTestsUtils.JAVA_VERSION_5); //$NON-NLS-1$
+ }
+
+ /**
* Tests if a the value of a property in the Manifest is correct
*
* @param property
@@ -65,7 +74,7 @@ public class BundlesTests {
int nb = 0;
for(Bundle current : BundleTestsUtils.getPapyrusBundles()) {
final String value = (String)current.getHeaders().get(property);
- boolean result = false;
+ boolean result = false;
if(value != null) {
result = value.matches(regex);
}

Back to the top