Author: dgolovin
Date: 2008-06-13 15:26:41 -0400 (Fri, 13 Jun 2008)
New Revision: 8765
Modified:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/PlugInLoadTest.java
Log:
fix test errors
Modified:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/PlugInLoadTest.java
===================================================================
---
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/PlugInLoadTest.java 2008-06-13
17:31:42 UTC (rev 8764)
+++
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/PlugInLoadTest.java 2008-06-13
19:26:41 UTC (rev 8765)
@@ -7,7 +7,7 @@
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.tests;
@@ -15,7 +15,14 @@
import org.eclipse.core.runtime.Platform;
import org.osgi.framework.Bundle;
-
+/**
+ *
+ * //TODO try to refactor it to use Eclipse API to get plug-ins list in installed
feature
+ * //
+ *
+ * @author eskimo
+ *
+ */
public class PlugInLoadTest extends TestCase {
public static final String rhdsNS = "org.jboss.tools.";
@@ -23,169 +30,140 @@
private static String hibNS = "org.hibernate.eclipse.";
private static String jbpmNS = "org.jbpm.gd.jpdl";
private static String jbwsNS = "com.eviware.soapui.";
-
- private boolean isPluginResolved (String pluginId)
- {
+
+ private boolean isPluginResolved(String pluginId) {
Bundle bundle = Platform.getBundle(pluginId);
- assertNotNull(pluginId + " failed to load.",bundle);
+ assertNotNull(pluginId + " failed to load.", bundle);
try {
- // In 3.3 when test case is running plug-in.getState always returns STARTING state
- // to move plug-in in ACTIVE state even one class should be loaded from plug-in
+ // In 3.3 when test case is running plug-in.getState always returns
+ // STARTING state
+ // to move plug-in in ACTIVE state at one class should be loaded
+ // from plug-in
bundle.loadClass("fake class");
} catch (Exception e) {
- // It happen always because loaded class is not exists
+ // It happens always because loaded class doesn't not exist
}
- return ((bundle.getState() & Bundle.RESOLVED) > 0) ||
- ((bundle.getState() & Bundle.ACTIVE) > 0);
+ return ((bundle.getState() & Bundle.RESOLVED) > 0)
+ || ((bundle.getState() & Bundle.ACTIVE) > 0);
}
-
- private void assertPluginsResolved (String[] pluginIds)
- {
+
+ private void assertPluginsResolved(String[] pluginIds) {
for (int i = 0; i < pluginIds.length; i++) {
- assertTrue ("plugin '" + pluginIds[i] + "' is not
resolved",isPluginResolved(pluginIds[i]));
+ assertTrue("plugin '" + pluginIds[i] + "' is not
resolved",
+ isPluginResolved(pluginIds[i]));
}
}
-
- public void testCommonPluginsResolved ()
- {
- assertPluginsResolved(new String[] {
- rhdsNS+"common",
- rhdsNS+"common.gef",
- rhdsNS+"common.kb",
- rhdsNS+"common.model",
- rhdsNS+"common.model.ui",
- rhdsNS+"common.projecttemplates",
- rhdsNS+"common.text.ext",
- rhdsNS+"common.text.xml",
- rhdsNS+"common.verification",
- rhdsNS+"common.verification.ui",
- });
+
+ public void testCommonPluginsResolved() {
+ assertPluginsResolved(new String[] {
+ rhdsNS + "common",
+ rhdsNS + "common.gef",
+ rhdsNS + "common.kb",
+ rhdsNS + "common.model",
+ rhdsNS + "common.model.ui",
+ rhdsNS + "common.projecttemplates",
+ rhdsNS + "common.text.ext",
+ rhdsNS + "common.text.xml",
+ rhdsNS + "common.verification",
+ rhdsNS + "common.verification.ui", });
}
-
- public void testJsfPluginsResolved()
- {
- assertPluginsResolved(new String[] {
- rhdsNS+"jsf",
- rhdsNS+"jsf.text.ext",
- rhdsNS+"jsf.text.ext.facelets",
- rhdsNS+"jsf.ui",
- rhdsNS+"jsf.verification",
- rhdsNS+"jsf.vpe.ajax4jsf",
- rhdsNS+"jsf.vpe.facelets",
- rhdsNS+"jsf.vpe.richfaces",
- rhdsNS+"jsf.vpe.seam",
- rhdsNS+"jsf.vpe.tomahawk"
- });
+
+ public void testJsfPluginsResolved() {
+ assertPluginsResolved(new String[] {
+ rhdsNS + "jsf",
+ rhdsNS + "jsf.text.ext",
+ rhdsNS + "jsf.text.ext.facelets",
+ rhdsNS + "jsf.ui",
+ rhdsNS + "jsf.verification",
+ rhdsNS + "jsf.vpe.ajax4jsf",
+ rhdsNS + "jsf.vpe.facelets",
+ rhdsNS + "jsf.vpe.richfaces",
+ rhdsNS + "jsf.vpe.seam",
+ rhdsNS + "jsf.vpe.tomahawk" });
}
-
- public void testJstPluginsResolved ()
- {
- assertPluginsResolved(new String[] {
- rhdsNS+"jst.jsp",
- rhdsNS+"jst.server.jetty",
- rhdsNS+"jst.server.jrun",
- rhdsNS+"jst.server.resin",
- rhdsNS+"jst.web",
- rhdsNS+"jst.web.debug",
- rhdsNS+"jst.web.debug.ui",
- rhdsNS+"jst.web.tiles",
- rhdsNS+"jst.web.tiles.ui",
- rhdsNS+"jst.web.ui",
- rhdsNS+"jst.web.verification"
- });
+
+ public void testJstPluginsResolved() {
+ assertPluginsResolved(new String[] {
+ rhdsNS + "jst.jsp",
+ rhdsNS + "jst.web",
+ rhdsNS + "jst.web.debug",
+ rhdsNS + "jst.web.debug.ui",
+ rhdsNS + "jst.web.tiles",
+ rhdsNS + "jst.web.tiles.ui",
+ rhdsNS + "jst.web.ui",
+ rhdsNS + "jst.web.verification" });
}
- public void testVpePluginsResolved ()
- {
- assertPluginsResolved(new String[] {
- rhdsNS+"vpe",
- rhdsNS+"vpe.ui.palette",
- rhdsNS+"vpe.xulrunner"
- });
- }
-
- public void testStrutsPluginsResolved ()
- {
- assertPluginsResolved(new String[] {
- rhdsNS+"struts",
- rhdsNS+"struts.debug",
- rhdsNS+"struts.text.ext",
- rhdsNS+"struts.ui",
- rhdsNS+"struts.validator.ui",
- rhdsNS+"struts.verification"
- });
+ public void testVpePluginsResolved() {
+ assertPluginsResolved(new String[] {
+ rhdsNS + "vpe",
+ rhdsNS + "vpe.ui.palette",
+ rhdsNS + "vpe.xulrunner" });
}
- public void testCorePluginsResolved ()
- {
- assertPluginsResolved(new String[] {
- jbideNS+"core",
- jbideNS+"jdt.core",
- jbideNS+"jdt.j2ee.core",
- jbideNS+"jdt.j2ee.ui",
- jbideNS+"jdt.j2ee.xml.ui",
- jbideNS+"jdt.ui",
- jbideNS+"archives.core",
- jbideNS+"archives.ui",
- jbideNS+"ui",
- jbideNS+"xdoclet.assist",
- jbideNS+"xdoclet.core",
- jbideNS+"xdoclet.run",
- jbideNS+"xdoclet.ui"
- });
+ public void testStrutsPluginsResolved() {
+ assertPluginsResolved(new String[] {
+ rhdsNS + "struts",
+ rhdsNS + "struts.debug",
+ rhdsNS + "struts.text.ext",
+ rhdsNS + "struts.ui",
+ rhdsNS + "struts.validator.ui",
+ rhdsNS + "struts.verification" });
}
-
- public void testASPluginsResolved ()
- {
- assertPluginsResolved(new String[] {
- jbideNS+"as.core",
- jbideNS+"as.ui",
- jbideNS+"as.ui.mbeans"
- });
+
+ public void testCorePluginsResolved() {
+ assertPluginsResolved(new String[] {
+ jbideNS + "archives.core",
+ jbideNS + "archives.ui",
+ jbideNS + "core",
+ jbideNS + "help",
+ jbideNS + "jdt.core",
+ jbideNS + "jdt.j2ee.xml.ui",
+ jbideNS + "jdt.ui",
+ jbideNS + "ui" });
}
-
- public void testHibernatePluginsResolved ()
- {
- assertPluginsResolved(new String[] {
- "org.hibernate.eclipse",
- hibNS+"console",
- hibNS+"help",
- hibNS+"mapper",
- hibNS+"jdt.ui",
- hibNS+"jdt.apt.ui"
- });
+
+ public void testASPluginsResolved() {
+ assertPluginsResolved(new String[] {
+ jbideNS + "as.core",
+ jbideNS + "as.ui",
+ jbideNS + "as.ui.mbeans" });
}
-
- public void testJbpmPluginsResolved ()
- {
- assertPluginsResolved(new String[] {
- jbpmNS
- });
+
+ public void testHibernatePluginsResolved() {
+ assertPluginsResolved(new String[] {
+ "org.hibernate.eclipse",
+ hibNS + "console",
+ hibNS + "help",
+ hibNS + "mapper",
+ hibNS + "jdt.ui",
+ hibNS + "jdt.apt.ui" });
}
-
- public void testFreemarkerPluginsResolved ()
- {
- assertPluginsResolved(new String[] {
- jbideNS+"freemarker"
- });
+
+ public void testJbpmPluginsResolved() {
+ assertPluginsResolved(new String[] {
+ jbpmNS });
}
-
- public void testDroolsPluginsResolved ()
- {
- // Skipped until drools migartion to 3.3 is finished
- // assertPluginsResolved(new String[] {
- // "org.drools.ide"
- // });
+
+ public void testFreemarkerPluginsResolved() {
+ assertPluginsResolved(new String[] {
+ jbideNS + "freemarker" });
}
-
- public void testJBossWSPluginsResolved ()
- {
- // assertPluginsResolved(new String[] {
- // jbwsNS+"core",
- // jbwsNS+"eclipse.core",
- // jbwsNS+"jbosside.wstools",
- // jbwsNS+"libs"
- // });
+
+ public void testDroolsPluginsResolved() {
+ // Skipped until drools migartion to 3.3 is finished
+ // assertPluginsResolved(new String[] {
+ // "org.drools.ide"
+ // });
}
-
+
+ public void testJBossWSPluginsResolved() {
+ // assertPluginsResolved(new String[] {
+ // jbwsNS+"core",
+ // jbwsNS+"eclipse.core",
+ // jbwsNS+"jbosside.wstools",
+ // jbwsNS+"libs"
+ // });
+ }
+
}