Author: objectiser
Date: 2009-02-17 06:57:55 -0500 (Tue, 17 Feb 2009)
New Revision: 505
Removed:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/test/org/jboss/tools/overlord/cdl/bpel/generator/MANIFEST.MF
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/test/org/jboss/tools/overlord/cdl/bpel/generator/ManifestRegistryUtil.java
Modified:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/test/org/jboss/tools/overlord/cdl/bpel/generator/GeneratorTest.java
Log:
Test needs to be run as a Plug-in unit test, so that it correctly initializes the other
scribble plugins. Using the ClasspathRegistry approach inside Eclipse works fine when the
BPEL plugin is the only plugin in the workspace, but if the other plugins are loaded into
the workspace, then the classloader fails to find the Manifest, as only the classes folder
is on the classpath.
Modified:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/test/org/jboss/tools/overlord/cdl/bpel/generator/GeneratorTest.java
===================================================================
---
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/test/org/jboss/tools/overlord/cdl/bpel/generator/GeneratorTest.java 2009-02-16
21:13:18 UTC (rev 504)
+++
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/test/org/jboss/tools/overlord/cdl/bpel/generator/GeneratorTest.java 2009-02-17
11:57:55 UTC (rev 505)
@@ -27,32 +27,7 @@
public class GeneratorTest extends TestCase {
- protected void setUp() {
-
- // Uses a locally defined manifest to register
- // the extra extension 'rules'
- java.io.InputStream
is=ManifestRegistryUtil.class.getResourceAsStream("MANIFEST.MF");
-
- try {
- org.scribble.extensions.ClasspathRegistry reg=
- new org.scribble.extensions.ClasspathRegistry();
-
- reg.initialize();
-
- ManifestRegistryUtil.registerScribbleExtensions(reg, new java.util.jar.Manifest(is));
-
- RegistryFactory.setRegistry(reg);
-
- } catch(Exception e) {
- e.printStackTrace();
- }
- }
-
public void testGenerate() {
-
- // TODO: Write a 'Manifest' utility for registering rules
- // into the registry - when working move into scribble core,
- // but so that it is accessible to other plugins
ConversationModel model=new ConversationModel();
Role role=new Role();
@@ -104,8 +79,6 @@
ModelReference targetRef=
new ModelReference(BPELNotation.NOTATION_CODE);
- System.out.println("REG="+RegistryFactory.getRegistry());
-
DefaultBPELLanguageModel target=
new DefaultBPELLanguageModel(targetRef);
Deleted:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/test/org/jboss/tools/overlord/cdl/bpel/generator/MANIFEST.MF
===================================================================
---
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/test/org/jboss/tools/overlord/cdl/bpel/generator/MANIFEST.MF 2009-02-16
21:13:18 UTC (rev 504)
+++
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/test/org/jboss/tools/overlord/cdl/bpel/generator/MANIFEST.MF 2009-02-17
11:57:55 UTC (rev 505)
@@ -1,28 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Overlord CDL BPEL Plug-in
-Bundle-SymbolicName: org.jboss.tools.overlord.cdl.bpel;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.jboss.tools.overlord.cdl.bpel.eclipse.Activator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.scribble.conversation.model,
- org.scribble.core,
- org.scribble.lang.model,
- org.eclipse.core.resources,
- org.scribble.osgi,
- org.eclipse.jdt.core,
- org.junit
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Vendor:
www.jboss.org
-Scribble-Extensions: org.jboss.tools.overlord.cdl.bpel.parser.BPELParser,
- org.jboss.tools.overlord.cdl.bpel.parser.BPELNotation,
- org.jboss.tools.overlord.cdl.bpel.model.change.LanguageToConversationModelChangeRule,
- org.jboss.tools.overlord.cdl.bpel.model.change.ConversationModelChangeRule,
- org.jboss.tools.overlord.cdl.bpel.model.change.WhileModelChangeRule,
- org.jboss.tools.overlord.cdl.bpel.model.change.WhenModelChangeRule,
- org.jboss.tools.overlord.cdl.bpel.model.change.IfModelChangeRule,
- org.jboss.tools.overlord.cdl.bpel.model.change.RunModelChangeRule,
- org.jboss.tools.overlord.cdl.bpel.model.change.SpawnModelChangeRule,
- org.jboss.tools.overlord.cdl.bpel.model.change.ConversationInteractionModelChangeRule
Deleted:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/test/org/jboss/tools/overlord/cdl/bpel/generator/ManifestRegistryUtil.java
===================================================================
---
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/test/org/jboss/tools/overlord/cdl/bpel/generator/ManifestRegistryUtil.java 2009-02-16
21:13:18 UTC (rev 504)
+++
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/test/org/jboss/tools/overlord/cdl/bpel/generator/ManifestRegistryUtil.java 2009-02-17
11:57:55 UTC (rev 505)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.jboss.tools.overlord.cdl.bpel.generator;
-
-public class ManifestRegistryUtil {
-
- public static void registerScribbleExtensions(org.scribble.extensions.AbstractRegistry
registry,
- java.util.jar.Manifest manifest) {
-
- String str=manifest.getMainAttributes().getValue("Scribble-Extensions");
-
- java.util.StringTokenizer st=new java.util.StringTokenizer(str, ", ");
-
- while (st.hasMoreTokens()) {
- String clsName=st.nextToken();
-
- try {
- Class<?> cls=Class.forName(clsName);
- registry.addExtension(cls);
- } catch(Exception e) {
- e.printStackTrace();
- }
- }
- }
-}