summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Liebig2008-03-11 09:53:05 (EDT)
committerStefan Liebig2008-03-11 09:53:05 (EDT)
commit33b16ab44efae338e91f1f6c220189244d57b05e (patch)
tree42aa0c4cd706a1a598b3ade0ce5c1362d07317b5
parentd92b080167de1fba947b0e1627b53966561cd5af (diff)
downloadorg.eclipse.riena-33b16ab44efae338e91f1f6c220189244d57b05e.zip
org.eclipse.riena-33b16ab44efae338e91f1f6c220189244d57b05e.tar.gz
org.eclipse.riena-33b16ab44efae338e91f1f6c220189244d57b05e.tar.bz2
added removeExtensionPoint
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/tests/RienaTestCase.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/tests/RienaTestCase.java b/org.eclipse.riena.tests/src/org/eclipse/riena/tests/RienaTestCase.java
index 24ca9ce..d3ce292 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/tests/RienaTestCase.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/tests/RienaTestCase.java
@@ -18,10 +18,12 @@ import java.util.regex.Pattern;
import junit.framework.TestCase;
import org.eclipse.core.internal.registry.ExtensionRegistry;
+import org.eclipse.core.runtime.ContributorFactoryOSGi;
+import org.eclipse.core.runtime.IContributor;
import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.RegistryFactory;
-import org.eclipse.core.runtime.spi.RegistryContributor;
import org.eclipse.riena.internal.tests.Activator;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -87,7 +89,7 @@ public abstract class RienaTestCase extends TestCase {
protected void addPluginXml(Class<?> forLoad, String pluginResource) {
IExtensionRegistry registry = RegistryFactory.getRegistry();
InputStream inputStream = forLoad.getResourceAsStream(pluginResource);
- RegistryContributor contributor = new RegistryContributor("4711", "org.eclipse.riena.tests", null, null);
+ IContributor contributor = ContributorFactoryOSGi.createContributor(Activator.getDefault().getBundle());
assertTrue(registry.addContribution(inputStream, contributor, false, null, null, ((ExtensionRegistry) registry)
.getTemporaryUserToken()));
}
@@ -105,6 +107,19 @@ public abstract class RienaTestCase extends TestCase {
}
/**
+ * Remove the given extension from the extension registry.
+ *
+ * @param extensionPointId
+ */
+ protected void removeExtensionPoint(String extensionPointId) {
+ IExtensionRegistry registry = RegistryFactory.getRegistry();
+ IExtensionPoint extensionPoint = registry.getExtensionPoint(extensionPointId);
+ assertNotNull(extensionPoint);
+ assertTrue(registry
+ .removeExtensionPoint(extensionPoint, ((ExtensionRegistry) registry).getTemporaryUserToken()));
+ }
+
+ /**
* Get the service for the specified <code>serviceClass</code>.
*
* @param <T>