savara SVN: r213 - in tools/eclipse/trunk/plugins: org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions and 1 other directory.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-03-25 19:06:56 -0400 (Thu, 25 Mar 2010)
New Revision: 213
Modified:
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java
Log:
SAVARA-63 - allow multiple schema files to be specified.
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java 2010-03-25 22:07:38 UTC (rev 212)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java 2010-03-25 23:06:56 UTC (rev 213)
@@ -322,27 +322,32 @@
if (ns.getSchemaLocation() != null &&
ns.getSchemaLocation().trim().length() > 0) {
- IFile file=cdmResource.getParent().getFile(new Path(ns.getSchemaLocation()));
- javax.wsdl.Import imp=defns.get(0).createImport();
+ java.util.StringTokenizer st=new java.util.StringTokenizer(ns.getSchemaLocation());
- imp.setDefinition(defn);
- imp.setNamespaceURI(ns.getURI());
- imp.setLocationURI(file.getName());
-
- defns.get(0).addImport(imp);
-
- IPath artifactPath=wsdlFolderPath.append(file.getName());
-
- IFile artifactFile=cdmResource.getProject().getWorkspace().getRoot().getFile(artifactPath);
-
- if (artifactFile.exists() == false) {
- artifactFile.create(null, true,
- new org.eclipse.core.runtime.NullProgressMonitor());
+ while (st.hasMoreTokens()) {
+ IFile file=cdmResource.getParent().getFile(new Path(st.nextToken()));
+
+ javax.wsdl.Import imp=defns.get(0).createImport();
+
+ imp.setDefinition(defn);
+ imp.setNamespaceURI(ns.getURI());
+ imp.setLocationURI(file.getName());
+
+ defns.get(0).addImport(imp);
+
+ IPath artifactPath=wsdlFolderPath.append(file.getName());
+
+ IFile artifactFile=cdmResource.getProject().getWorkspace().getRoot().getFile(artifactPath);
+
+ if (artifactFile.exists() == false) {
+ artifactFile.create(null, true,
+ new org.eclipse.core.runtime.NullProgressMonitor());
+ }
+
+ artifactFile.setContents(file.getContents(), true, false,
+ new org.eclipse.core.runtime.NullProgressMonitor());
}
-
- artifactFile.setContents(file.getContents(), true, false,
- new org.eclipse.core.runtime.NullProgressMonitor());
}
}
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java 2010-03-25 22:07:38 UTC (rev 212)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java 2010-03-25 23:06:56 UTC (rev 213)
@@ -183,34 +183,32 @@
if (ns.getSchemaLocation() != null &&
ns.getSchemaLocation().trim().length() > 0) {
- IFile file=cdmResource.getParent().getFile(new Path(ns.getSchemaLocation()));
-
- javax.wsdl.Import imp=defns.get(0).createImport();
-
- imp.setDefinition(defn);
- imp.setNamespaceURI(ns.getURI());
- imp.setLocationURI(file.getName());
-
- defns.get(0).addImport(imp);
-
- IPath artifactPath=wsdlFolderPath.append(file.getName());
-
- IFile artifactFile=cdmResource.getProject().getWorkspace().getRoot().getFile(artifactPath);
- if (artifactFile.exists() == false) {
- artifactFile.create(null, true,
- new org.eclipse.core.runtime.NullProgressMonitor());
- }
+ java.util.StringTokenizer st=new java.util.StringTokenizer(ns.getSchemaLocation());
- try {
+ while (st.hasMoreTokens()) {
+ IFile file=cdmResource.getParent().getFile(new Path(st.nextToken()));
+
+ javax.wsdl.Import imp=defns.get(0).createImport();
+
+ imp.setDefinition(defn);
+ imp.setNamespaceURI(ns.getURI());
+ imp.setLocationURI(file.getName());
+
+ defns.get(0).addImport(imp);
+
+ IPath artifactPath=wsdlFolderPath.append(file.getName());
+
+ IFile artifactFile=cdmResource.getProject().getWorkspace().getRoot().getFile(artifactPath);
+
+ if (artifactFile.exists() == false) {
+ artifactFile.create(null, true,
+ new org.eclipse.core.runtime.NullProgressMonitor());
+ }
+
artifactFile.setContents(file.getContents(), true, false,
- new org.eclipse.core.runtime.NullProgressMonitor());
- } catch(Exception e) {
- org.jboss.savara.tools.wsdl.osgi.Activator.logError(
- "Failed to generate WSDL for choreography '"+
- cdmResource+"' to file: "+artifactFile.getName(), e);
+ new org.eclipse.core.runtime.NullProgressMonitor());
}
-
}
}
}
14 years
savara SVN: r212 - tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-03-25 18:07:38 -0400 (Thu, 25 Mar 2010)
New Revision: 212
Modified:
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java
Log:
Fix WSDL generation problem.
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java 2010-03-25 21:56:52 UTC (rev 211)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java 2010-03-25 22:07:38 UTC (rev 212)
@@ -320,7 +320,8 @@
// Generate imports for specified message schema
for (Namespace ns : contract.getNamespaces()) {
- if (ns.getSchemaLocation() != null) {
+ if (ns.getSchemaLocation() != null &&
+ ns.getSchemaLocation().trim().length() > 0) {
IFile file=cdmResource.getParent().getFile(new Path(ns.getSchemaLocation()));
javax.wsdl.Import imp=defns.get(0).createImport();
14 years
savara SVN: r211 - in tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl: generator and 1 other directory.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-03-25 17:56:52 -0400 (Thu, 25 Mar 2010)
New Revision: 211
Modified:
tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/WSDLGenerator.java
Log:
Fix WSDL generation problem.
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java 2010-03-23 22:01:18 UTC (rev 210)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java 2010-03-25 21:56:52 UTC (rev 211)
@@ -121,7 +121,7 @@
try {
generateWSDL(conversationModel, mref, res);
} catch(Exception e) {
- logger.error("Failed to generate WSDL for '"+res+"'", e);
+ org.jboss.savara.tools.wsdl.osgi.Activator.logError("Failed to generate WSDL for '"+res+"'", e);
}
}
}
@@ -181,7 +181,8 @@
// Generate imports for specified message schema
for (Namespace ns : contract.getNamespaces()) {
- if (ns.getSchemaLocation() != null) {
+ if (ns.getSchemaLocation() != null &&
+ ns.getSchemaLocation().trim().length() > 0) {
IFile file=cdmResource.getParent().getFile(new Path(ns.getSchemaLocation()));
javax.wsdl.Import imp=defns.get(0).createImport();
@@ -201,8 +202,15 @@
new org.eclipse.core.runtime.NullProgressMonitor());
}
- artifactFile.setContents(file.getContents(), true, false,
+ try {
+ artifactFile.setContents(file.getContents(), true, false,
new org.eclipse.core.runtime.NullProgressMonitor());
+ } catch(Exception e) {
+ org.jboss.savara.tools.wsdl.osgi.Activator.logError(
+ "Failed to generate WSDL for choreography '"+
+ cdmResource+"' to file: "+artifactFile.getName(), e);
+ }
+
}
}
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/WSDLGenerator.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/WSDLGenerator.java 2010-03-23 22:01:18 UTC (rev 210)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/WSDLGenerator.java 2010-03-25 21:56:52 UTC (rev 211)
@@ -460,7 +460,7 @@
throw new UnsupportedOperationException("Currently only supports single type reference");
}
- if (qname != null &&
+ if (defn != null && qname != null &&
(ret = defn.getMessage(qname)) == null) {
ret = defn.createMessage();
ret.setUndefined(false);
14 years
savara SVN: r210 - in tools/eclipse/trunk/plugins: org.jboss.savara.tools.wsdl and 2 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-03-23 18:01:18 -0400 (Tue, 23 Mar 2010)
New Revision: 210
Modified:
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/build.properties
tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/META-INF/MANIFEST.MF
tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/build.properties
tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/osgi/Activator.java
Log:
Fix distribution issue not making the wsdl plugin available.
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/build.properties
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/build.properties 2010-03-22 20:34:38 UTC (rev 209)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/build.properties 2010-03-23 22:01:18 UTC (rev 210)
@@ -2,4 +2,12 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
- plugin.xml
+ plugin.xml,\
+ Copyright.txt
+src.includes = src/,\
+ plugin.xml,\
+ build.properties,\
+ META-INF/,\
+ Copyright.txt,\
+ .project,\
+ .classpath
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/META-INF/MANIFEST.MF
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/META-INF/MANIFEST.MF 2010-03-22 20:34:38 UTC (rev 209)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/META-INF/MANIFEST.MF 2010-03-23 22:01:18 UTC (rev 210)
@@ -4,13 +4,12 @@
Bundle-SymbolicName: org.jboss.savara.tools.wsdl;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.jboss.savara.tools.wsdl.osgi.Activator
-Import-Package: org.osgi.framework;version="1.3.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: www.jboss.org
-Require-Bundle: javax.wsdl;bundle-version="1.5.1";visibility:=reexport,
- org.scribble.contract.model;bundle-version="0.1.0",
- org.apache.commons.logging;bundle-version="1.0.4",
- org.scribble.core;bundle-version="0.1.0",
+Require-Bundle: javax.wsdl;visibility:=reexport,
+ org.scribble.contract.model,
+ org.apache.commons.logging,
+ org.scribble.core,
org.eclipse.core.resources,
org.eclipse.jface,
org.eclipse.ui,
@@ -19,3 +18,4 @@
org.scribble.conversation.model
Export-Package: org.jboss.savara.tools.wsdl.generator,
org.jboss.savara.tools.wsdl.generator.soap
+Bundle-ActivationPolicy: lazy
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/build.properties
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/build.properties 2010-03-22 20:34:38 UTC (rev 209)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/build.properties 2010-03-23 22:01:18 UTC (rev 210)
@@ -1,4 +1,14 @@
source.. = src/java/
output.. = classes/
bin.includes = META-INF/,\
- .
+ .,\
+ plugin.xml,\
+ build.properties,\
+ Copyright.txt
+src.includes = .classpath,\
+ .project,\
+ Copyright.txt,\
+ META-INF/,\
+ build.properties,\
+ plugin.xml,\
+ src/
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/osgi/Activator.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/osgi/Activator.java 2010-03-22 20:34:38 UTC (rev 209)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/osgi/Activator.java 2010-03-23 22:01:18 UTC (rev 210)
@@ -1,39 +1,73 @@
-/*
- * 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.savara.tools.wsdl.osgi;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class Activator implements BundleActivator {
-
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- }
-
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- }
-
-}
+package org.jboss.savara.tools.wsdl.osgi;
+
+import org.apache.commons.logging.*;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.savara.tools.wsdl";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * This method logs an error against the plugin.
+ *
+ * @param mesg The error message
+ * @param t The optional exception
+ */
+ public static void logError(String mesg, Throwable t) {
+
+ if (getDefault() != null) {
+ Status status=new Status(IStatus.ERROR,
+ PLUGIN_ID, 0, mesg, t);
+
+ getDefault().getLog().log(status);
+ }
+
+ logger.error("LOG ERROR: "+mesg+
+ (t == null ? "" : ": "+t), t);
+ }
+
+ private static Log logger = LogFactory.getLog(Activator.class);
+}
14 years
savara SVN: r209 - in tools/eclipse/trunk/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model: actions and 1 other directory.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-03-22 16:34:38 -0400 (Mon, 22 Mar 2010)
New Revision: 209
Modified:
tools/eclipse/trunk/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/DefaultESBService.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/AbstractESBAction.java
Log:
RIFTSAW-53 - focus on text - but currently does not automatically focus on the form.
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/DefaultESBService.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/DefaultESBService.java 2010-03-21 21:11:23 UTC (rev 208)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/DefaultESBService.java 2010-03-22 20:34:38 UTC (rev 209)
@@ -142,6 +142,7 @@
loggedEndPosition = str.indexOf('>', startPosition);
endPosition = str.indexOf("</service>", startPosition);
+ endPosition += 10;
if (servCount > 0) {
startPosition=str.indexOf("<service ", endPosition);
@@ -152,7 +153,8 @@
endPosition = str.indexOf("</service>", startPosition);
getSource().setStartPosition(startPosition);
- getSource().setEndPosition(loggedEndPosition);
+ //getSource().setEndPosition(loggedEndPosition);
+ getSource().setEndPosition(endPosition);
getSource().getProperties().put("path",
ESBModelUtil.getPath(m_service));
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/AbstractESBAction.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/AbstractESBAction.java 2010-03-21 21:11:23 UTC (rev 208)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/AbstractESBAction.java 2010-03-22 20:34:38 UTC (rev 209)
@@ -139,6 +139,7 @@
loggedEndPosition = str.indexOf('>', startPosition);
endPosition = str.indexOf("</action>", startPosition);
+ endPosition += 9;
if (actionCount > 0) {
startPosition=str.indexOf("<action", endPosition);
@@ -155,7 +156,8 @@
}
getSource().setStartPosition(startPosition);
- getSource().setEndPosition(loggedEndPosition);
+ //getSource().setEndPosition(loggedEndPosition);
+ getSource().setEndPosition(endPosition);
getSource().getProperties().put("path",
ESBModelUtil.getPath(m_action));
14 years, 1 month
savara SVN: r208 - in tools/eclipse/trunk/plugins: org.jboss.savara.tools.jbossesb/META-INF and 1 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-03-21 17:11:23 -0400 (Sun, 21 Mar 2010)
New Revision: 208
Modified:
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.jbossesb/META-INF/MANIFEST.MF
tools/eclipse/trunk/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/editor/JBossESBConfigEditorManager.java
Log:
Looking initially at SAVARA-53 - but need to find out how the marker uri is recorded to enable focus on the relevant node in the ESB editor.
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java 2010-03-21 19:57:23 UTC (rev 207)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java 2010-03-21 21:11:23 UTC (rev 208)
@@ -99,21 +99,5 @@
String uri=issue.getModelObject().getSource().getComponentURI();
issue.getProperties().put("address.model", uri);
-
- /*
- if (issue.getModelObject() instanceof BPELElement) {
- String uri=((BPELElement)issue.getModelObject()).getURI();
-
- if (uri != null) {
- issue.getProperties().put("address.model", uri);
- }
- }
- */
-
- // Set the EMF URI attribute
- //issue.getProperties().put(EValidator.URI_ATTRIBUTE, "//@activity/(a)activities.0");
- //issue.getProperties().put("address.model", "//@activity/(a)activities.0");
- // issue.getModelObject().getSource().getComponentURI());
-
}
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.jbossesb/META-INF/MANIFEST.MF
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.jbossesb/META-INF/MANIFEST.MF 2010-03-21 19:57:23 UTC (rev 207)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.jbossesb/META-INF/MANIFEST.MF 2010-03-21 21:11:23 UTC (rev 208)
@@ -20,7 +20,8 @@
org.eclipse.ui.ide,
org.eclipse.ui.editors,
org.scribble.conversation.parser,
- org.junit
+ org.junit,
+ org.eclipse.emf.ecore
Scribble-Extensions: org.jboss.savara.tools.jbossesb.parser.JBossESBTokenizer,
org.jboss.savara.tools.jbossesb.parser.JBossESBModelParserRule,
org.jboss.savara.tools.jbossesb.model.JBossESBNotation,
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/editor/JBossESBConfigEditorManager.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/editor/JBossESBConfigEditorManager.java 2010-03-21 19:57:23 UTC (rev 207)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/editor/JBossESBConfigEditorManager.java 2010-03-21 21:11:23 UTC (rev 208)
@@ -22,9 +22,11 @@
import org.scribble.extensions.RegistryInfo;
import org.scribble.model.ModelReference;
import org.scribble.model.SourceRef;
+import org.scribble.model.admin.ModelIssue;
import org.scribble.editor.AbstractEditorManager;
import org.scribble.editor.EditorManager;
import org.jboss.savara.tools.jbossesb.model.*;
+import org.eclipse.emf.ecore.EValidator;
/**
* This is the JBossESB config implementation of the EditorManager
@@ -92,4 +94,16 @@
}
}
+ /**
+ * This method enriches the set of properties required
+ * by the editor, using the properties associated with
+ * the model issue.
+ *
+ * @param issue The model issue
+ */
+ public void enrich(ModelIssue issue) {
+ String uri="//@services/@service.1/@actions/(a)action.0"; //issue.getModelObject().getSource().getComponentURI();
+
+ issue.getProperties().put(EValidator.URI_ATTRIBUTE, uri);
+ }
}
14 years, 1 month
savara SVN: r207 - tools/eclipse/trunk/samples/purchasing.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-03-21 15:57:23 -0400 (Sun, 21 Mar 2010)
New Revision: 207
Modified:
tools/eclipse/trunk/samples/purchasing/PurchaseGoods.cdm
Log:
Add schema location for the store and creditAgency xsd files.
Modified: tools/eclipse/trunk/samples/purchasing/PurchaseGoods.cdm
===================================================================
--- tools/eclipse/trunk/samples/purchasing/PurchaseGoods.cdm 2010-03-21 19:04:30 UTC (rev 206)
+++ tools/eclipse/trunk/samples/purchasing/PurchaseGoods.cdm 2010-03-21 19:57:23 UTC (rev 207)
@@ -4,8 +4,8 @@
<nameSpaces description="Target Namespace for PurchaseGoods" prefix="tns" uRI="http://www.jboss.org/savara/examples"/>
<nameSpaces description="XML Schema Namespace" prefix="xsd" uRI="http://www.w3.org/2001/XMLSchema"/>
<nameSpaces prefix="pur" uRI="http://www.jboss.org/examples/purchasing"/>
- <nameSpaces prefix="sto" uRI="http://www.jboss.org/examples/store"/>
- <nameSpaces prefix="ca" uRI="http://www.jboss.org/examples/creditAgency"/>
+ <nameSpaces prefix="sto" uRI="http://www.jboss.org/examples/store" schemaLocation="store.xsd"/>
+ <nameSpaces prefix="ca" uRI="http://www.jboss.org/examples/creditAgency" schemaLocation="creditAgency.xsd"/>
<informationTypes description="This is the information type BuyConfirmed" name="BuyConfirmed" typeName="sto:BuyConfirmed" elementName=""/>
<informationTypes description="This is the information type BuyFailed" name="BuyFailed" typeName="sto:BuyFailed" elementName=""/>
<informationTypes description="This is the information type BuyRequest" name="BuyRequest" typeName="sto:BuyRequest" elementName=""/>
14 years, 1 month
savara SVN: r206 - in tools/eclipse/trunk/plugins: org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator and 2 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-03-21 15:04:30 -0400 (Sun, 21 Mar 2010)
New Revision: 206
Modified:
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/dialogs/GenerateDialog.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/GeneratorUtil.java
Log:
Added import of message schema files and copied them into the same folder as the generated WSDL files (SAVARA-54).
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/dialogs/GenerateDialog.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/dialogs/GenerateDialog.java 2010-03-21 16:53:15 UTC (rev 205)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/dialogs/GenerateDialog.java 2010-03-21 19:04:30 UTC (rev 206)
@@ -336,7 +336,7 @@
if (m_roleButtons.get(i).getSelection()) {
generator.generateRole(m_localModelRefs.get(i),
- m_projectNames.get(i).getText());
+ m_projectNames.get(i).getText(), m_file);
}
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java 2010-03-21 16:53:15 UTC (rev 205)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java 2010-03-21 19:04:30 UTC (rev 206)
@@ -24,15 +24,18 @@
import org.apache.commons.logging.*;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.jboss.savara.tools.bpel.generator.BuildSystem;
import org.jboss.savara.tools.bpel.model.*;
import org.jboss.savara.tools.bpel.model.component.PartnerLink;
import org.jboss.savara.tools.bpel.util.XMLUtils;
+import org.jboss.savara.tools.wsdl.generator.GeneratorUtil;
import org.jboss.savara.tools.wsdl.generator.soap.*;
import org.scribble.contract.model.Contract;
import org.scribble.contract.model.Interface;
+import org.scribble.contract.model.Namespace;
import org.scribble.conversation.model.*;
import org.scribble.extensions.RegistryFactory;
import org.scribble.model.*;
@@ -155,9 +158,10 @@
*
* @param localModelRef The local model reference
* @param projectName The project name
+ * @param cdmResource The original choreography file
* @throws Exception Failed to generate role
*/
- public void generateRole(ModelReference localModelRef, String projectName)
+ public void generateRole(ModelReference localModelRef, String projectName, IFile cdmResource)
throws Exception {
if (logger.isDebugEnabled()) {
@@ -207,7 +211,7 @@
lcm);
generateRoleProject(projectName, role,
- target.getBPELProcess(), lcm, target);
+ target.getBPELProcess(), lcm, target, cdmResource);
} else {
logger.error("Unable to find model generator");
}
@@ -217,7 +221,7 @@
protected void generateRoleProject(String projectName, Role role,
org.jboss.savara.tools.bpel.model.component.Process bpelProcess, ConversationModel localcm,
- BPELLanguageModel model) throws Exception {
+ BPELLanguageModel model, IFile cdmResource) throws Exception {
final IProject proj=createProject(projectName);
@@ -230,7 +234,8 @@
localcm.getModelName().getRole().getName()+".bpel");
IFile bpelFile=proj.getProject().getWorkspace().getRoot().getFile(bpelPath);
- GeneratorUtil.createParentFolder(bpelFile);
+ GeneratorUtil.createFolder(bpelFile);
+
bpelFile.create(null, true,
new org.eclipse.core.runtime.NullProgressMonitor());
@@ -243,12 +248,12 @@
}
// Write the WSDL files
- generateWSDL(role, proj, localcm);
+ generateWSDL(role, proj, localcm, cdmResource);
java.util.List<Role> roles=localcm.getConversation().getRoles();
for (int i=0; i < roles.size(); i++) {
- generateWSDL(roles.get(i), proj, localcm);
+ generateWSDL(roles.get(i), proj, localcm, cdmResource);
}
// Generate WSDL with partner link types
@@ -259,8 +264,8 @@
}
}
- protected void generateWSDL(Role role, IProject proj, ConversationModel localcm)
- throws Exception {
+ protected void generateWSDL(Role role, IProject proj, ConversationModel localcm,
+ IFile cdmResource) throws Exception {
if (role.getAnnotations().containsKey(Contract.class.getName())) {
javax.wsdl.xml.WSDLWriter writer=
@@ -269,6 +274,15 @@
new org.jboss.savara.tools.wsdl.generator.WSDLGenerator();
Contract contract=(Contract)role.getAnnotations().get(Contract.class.getName());
+ // Generate WSDL folder
+ IPath wsdlFolderPath=proj.getFullPath().append(
+ new Path(getBuildSystem().getBPELFilePath()));
+
+ IFolder wsdlFolder=proj.getProject().getWorkspace().getRoot().getFolder(wsdlFolderPath);
+
+ GeneratorUtil.createFolder(wsdlFolder);
+
+ // Generate definition
java.util.List<javax.wsdl.Definition> defns=generator.generateDefinitions(contract,
new SOAPDocLitWSDLBinding());
@@ -301,6 +315,35 @@
imp.setLocationURI(filename);
defns.get(0).addImport(imp);
+ } else {
+
+ // Generate imports for specified message schema
+ for (Namespace ns : contract.getNamespaces()) {
+
+ if (ns.getSchemaLocation() != null) {
+ IFile file=cdmResource.getParent().getFile(new Path(ns.getSchemaLocation()));
+
+ javax.wsdl.Import imp=defns.get(0).createImport();
+
+ imp.setDefinition(defn);
+ imp.setNamespaceURI(ns.getURI());
+ imp.setLocationURI(file.getName());
+
+ defns.get(0).addImport(imp);
+
+ IPath artifactPath=wsdlFolderPath.append(file.getName());
+
+ IFile artifactFile=cdmResource.getProject().getWorkspace().getRoot().getFile(artifactPath);
+
+ if (artifactFile.exists() == false) {
+ artifactFile.create(null, true,
+ new org.eclipse.core.runtime.NullProgressMonitor());
+ }
+
+ artifactFile.setContents(file.getContents(), true, false,
+ new org.eclipse.core.runtime.NullProgressMonitor());
+ }
+ }
}
java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream();
@@ -311,15 +354,17 @@
baos.close();
- IPath wsdlPath=proj.getFullPath().append(
- new Path(getBuildSystem().getBPELFilePath())).
- append(filename);
+ IPath wsdlPath=wsdlFolderPath.append(filename);
IFile wsdlFile=proj.getProject().getWorkspace().getRoot().getFile(wsdlPath);
- GeneratorUtil.createParentFolder(wsdlFile);
- wsdlFile.create(null, true,
- new org.eclipse.core.runtime.NullProgressMonitor());
+ GeneratorUtil.createFolder(wsdlFile);
+
+ if (wsdlFile.exists() == false) {
+ wsdlFile.create(null, true,
+ new org.eclipse.core.runtime.NullProgressMonitor());
+ }
+
wsdlFile.setContents(new java.io.ByteArrayInputStream(b), true, false,
new org.eclipse.core.runtime.NullProgressMonitor());
}
@@ -431,7 +476,9 @@
append(filename);
IFile wsdlFile=proj.getProject().getWorkspace().getRoot().getFile(wsdlPath);
- GeneratorUtil.createParentFolder(wsdlFile);
+
+ GeneratorUtil.createFolder(wsdlFile);
+
wsdlFile.create(null, true,
new org.eclipse.core.runtime.NullProgressMonitor());
@@ -535,7 +582,9 @@
append(BPEL_DEPLOY_DESCRIPTOR_FILENAME);
IFile wsdlFile=proj.getProject().getWorkspace().getRoot().getFile(wsdlPath);
- GeneratorUtil.createParentFolder(wsdlFile);
+
+ GeneratorUtil.createFolder(wsdlFile);
+
wsdlFile.create(null, true,
new org.eclipse.core.runtime.NullProgressMonitor());
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java 2010-03-21 16:53:15 UTC (rev 205)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java 2010-03-21 19:04:30 UTC (rev 206)
@@ -19,6 +19,7 @@
import org.apache.commons.logging.*;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
@@ -34,6 +35,7 @@
import org.scribble.contract.model.Contract;
import org.scribble.contract.model.Interface;
+import org.scribble.contract.model.Namespace;
import org.scribble.conversation.model.ConversationModel;
import org.scribble.eclipse.util.*;
import org.scribble.extensions.RegistryFactory;
@@ -134,6 +136,14 @@
new org.jboss.savara.tools.wsdl.generator.WSDLGenerator();
Contract contract=(Contract)ref.getAnnotations().get(Contract.class.getName());
+ // Generate WSDL folder
+ IPath wsdlFolderPath=cdmResource.getParent().getFullPath().append(new Path("wsdl"));
+
+ IFolder wsdlFolder=cdmResource.getProject().getWorkspace().getRoot().getFolder(wsdlFolderPath);
+
+ GeneratorUtil.createFolder(wsdlFolder);
+
+ // Generate definition
java.util.List<javax.wsdl.Definition> defns=generator.generateDefinitions(contract,
new SOAPDocLitWSDLBinding());
@@ -166,6 +176,35 @@
imp.setLocationURI(filename);
defns.get(0).addImport(imp);
+ } else {
+
+ // Generate imports for specified message schema
+ for (Namespace ns : contract.getNamespaces()) {
+
+ if (ns.getSchemaLocation() != null) {
+ IFile file=cdmResource.getParent().getFile(new Path(ns.getSchemaLocation()));
+
+ javax.wsdl.Import imp=defns.get(0).createImport();
+
+ imp.setDefinition(defn);
+ imp.setNamespaceURI(ns.getURI());
+ imp.setLocationURI(file.getName());
+
+ defns.get(0).addImport(imp);
+
+ IPath artifactPath=wsdlFolderPath.append(file.getName());
+
+ IFile artifactFile=cdmResource.getProject().getWorkspace().getRoot().getFile(artifactPath);
+
+ if (artifactFile.exists() == false) {
+ artifactFile.create(null, true,
+ new org.eclipse.core.runtime.NullProgressMonitor());
+ }
+
+ artifactFile.setContents(file.getContents(), true, false,
+ new org.eclipse.core.runtime.NullProgressMonitor());
+ }
+ }
}
java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream();
@@ -176,11 +215,10 @@
baos.close();
- IPath wsdlPath=cdmResource.getParent().getFullPath().append(
- new Path("wsdl")).append(filename);
+ IPath wsdlPath=wsdlFolderPath.append(filename);
IFile wsdlFile=cdmResource.getProject().getWorkspace().getRoot().getFile(wsdlPath);
- GeneratorUtil.createParentFolder(wsdlFile);
+
wsdlFile.create(null, true,
new org.eclipse.core.runtime.NullProgressMonitor());
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/GeneratorUtil.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/GeneratorUtil.java 2010-03-21 16:53:15 UTC (rev 205)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/GeneratorUtil.java 2010-03-21 19:04:30 UTC (rev 206)
@@ -27,26 +27,27 @@
public class GeneratorUtil {
/**
- * This method checks whether the parent folder exists,
+ * This method checks whether the folder exists,
* and if not attempts to create it.
*
* @param res The current resource
*/
- public static void createParentFolder(IResource res) {
-
- if (res.getParent() instanceof IFolder) {
- IFolder parent=(IFolder)res.getParent();
+ public static void createFolder(IResource res) {
+ if (res instanceof IFolder) {
+ IFolder folder=(IFolder)res;
- if (parent.exists() == false) {
- createParentFolder(parent);
+ if (folder.exists() == false) {
+ createFolder(folder.getParent());
try {
- parent.create(true, true,
+ folder.create(true, true,
new org.eclipse.core.runtime.NullProgressMonitor());
} catch(Exception e) {
e.printStackTrace();
}
}
+ } else if (res.getParent() != null) {
+ createFolder(res.getParent());
}
}
14 years, 1 month
savara SVN: r205 - in tools/eclipse/trunk/plugins: org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions and 2 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-03-21 12:53:15 -0400 (Sun, 21 Mar 2010)
New Revision: 205
Added:
tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/soap/SOAPDocLitWSDLBinding.java
Modified:
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/WSDLBinding.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/WSDLGenerator.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/soap/SOAPRPCWSDLBinding.java
Log:
SAVARA-54 - set doclit as default mode for WSDL generation. Need to make this configurable eventually.
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java 2010-03-21 14:53:57 UTC (rev 204)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java 2010-03-21 16:53:15 UTC (rev 205)
@@ -30,7 +30,7 @@
import org.jboss.savara.tools.bpel.model.*;
import org.jboss.savara.tools.bpel.model.component.PartnerLink;
import org.jboss.savara.tools.bpel.util.XMLUtils;
-import org.jboss.savara.tools.wsdl.generator.soap.SOAPRPCWSDLBinding;
+import org.jboss.savara.tools.wsdl.generator.soap.*;
import org.scribble.contract.model.Contract;
import org.scribble.contract.model.Interface;
import org.scribble.conversation.model.*;
@@ -270,7 +270,7 @@
Contract contract=(Contract)role.getAnnotations().get(Contract.class.getName());
java.util.List<javax.wsdl.Definition> defns=generator.generateDefinitions(contract,
- new SOAPRPCWSDLBinding());
+ new SOAPDocLitWSDLBinding());
// Check if contract has atleast one message exchange pattern
boolean f_hasMEP=false;
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java 2010-03-21 14:53:57 UTC (rev 204)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java 2010-03-21 16:53:15 UTC (rev 205)
@@ -30,7 +30,7 @@
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
import org.jboss.savara.tools.wsdl.generator.GeneratorUtil;
-import org.jboss.savara.tools.wsdl.generator.soap.SOAPRPCWSDLBinding;
+import org.jboss.savara.tools.wsdl.generator.soap.*;
import org.scribble.contract.model.Contract;
import org.scribble.contract.model.Interface;
@@ -135,7 +135,7 @@
Contract contract=(Contract)ref.getAnnotations().get(Contract.class.getName());
java.util.List<javax.wsdl.Definition> defns=generator.generateDefinitions(contract,
- new SOAPRPCWSDLBinding());
+ new SOAPDocLitWSDLBinding());
// Check if contract has atleast one message exchange pattern
boolean f_hasMEP=false;
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/WSDLBinding.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/WSDLBinding.java 2010-03-21 14:53:57 UTC (rev 204)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/WSDLBinding.java 2010-03-21 16:53:15 UTC (rev 205)
@@ -50,9 +50,12 @@
* This method adds WSDL binding information to the operation.
*
* @param defn The definition
+ * @param mep The message exchange pattern
* @param operation The operation
*/
- public void updateOperation(javax.wsdl.Definition defn, javax.wsdl.BindingOperation operation);
+ public void updateOperation(javax.wsdl.Definition defn,
+ org.scribble.contract.model.MessageExchangePattern mep,
+ javax.wsdl.BindingOperation operation);
/**
* This method adds WSDL binding information to the input.
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/WSDLGenerator.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/WSDLGenerator.java 2010-03-21 14:53:57 UTC (rev 204)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/WSDLGenerator.java 2010-03-21 16:53:15 UTC (rev 205)
@@ -364,7 +364,7 @@
// Check if WSDL operation details
if (wsdlBinding != null) {
- wsdlBinding.updateOperation(defn, ret);
+ wsdlBinding.updateOperation(defn, mep, ret);
}
ret.setName(mep.getOperation());
Added: tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/soap/SOAPDocLitWSDLBinding.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/soap/SOAPDocLitWSDLBinding.java (rev 0)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/soap/SOAPDocLitWSDLBinding.java 2010-03-21 16:53:15 UTC (rev 205)
@@ -0,0 +1,165 @@
+/*
+ * 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.savara.tools.wsdl.generator.soap;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.savara.tools.wsdl.generator.WSDLBinding;
+
+/**
+ * This interface is used to establish binding information on a
+ * WSDL definition.
+ *
+ */
+public class SOAPDocLitWSDLBinding implements WSDLBinding {
+ private static Log logger = LogFactory.getLog(SOAPDocLitWSDLBinding.class);
+
+ /**
+ * This method returns the name of the WSDL binding implementation.
+ *
+ * @return The WSDL binding
+ */
+ public String getName() {
+ return("SOAP DocLit");
+ }
+
+ /**
+ * This method initializes the WSDL definition for the binding.
+ *
+ * @param defn The definition
+ */
+ public void initDefinition(javax.wsdl.Definition defn) {
+ defn.addNamespace("soap", "http://schemas.xmlsoap.org/wsdl/soap/");
+ }
+
+ /**
+ * This method adds WSDL binding information to the port binding.
+ *
+ * @param defn The definition
+ * @param binding The port type
+ */
+ public void updateBinding(javax.wsdl.Definition defn, javax.wsdl.Binding binding) {
+ try {
+ javax.wsdl.extensions.soap.SOAPBinding sb=(javax.wsdl.extensions.soap.SOAPBinding)
+ defn.getExtensionRegistry().createExtension(javax.wsdl.Binding.class,
+ new javax.xml.namespace.QName("http://schemas.xmlsoap.org/wsdl/soap/", "binding"));
+ sb.setStyle("document");
+ sb.setTransportURI("http://schemas.xmlsoap.org/soap/http");
+ binding.addExtensibilityElement(sb);
+ } catch(Exception e) {
+ logger.error("Failed to add SOAP binding", e);
+ }
+ }
+
+ /**
+ * This method adds WSDL binding information to the operation.
+ *
+ * @param defn The definition
+ * @param mep The message exchange pattern
+ * @param operation The operation
+ */
+ public void updateOperation(javax.wsdl.Definition defn,
+ org.scribble.contract.model.MessageExchangePattern mep,
+ javax.wsdl.BindingOperation operation) {
+ try {
+ javax.wsdl.extensions.soap.SOAPOperation soap=(javax.wsdl.extensions.soap.SOAPOperation)
+ defn.getExtensionRegistry().createExtension(javax.wsdl.BindingOperation.class,
+ new javax.xml.namespace.QName("http://schemas.xmlsoap.org/wsdl/soap/", "operation"));
+ soap.setSoapActionURI(defn.getTargetNamespace()+"/"+mep.getOperation());
+ operation.addExtensibilityElement(soap);
+ } catch(Exception e) {
+ logger.error("Failed to add SOAP operation", e);
+ }
+ }
+
+ /**
+ * This method adds WSDL binding information to the input.
+ *
+ * @param defn The definition
+ * @param input The input
+ */
+ public void updateInput(javax.wsdl.Definition defn, javax.wsdl.BindingInput input) {
+ try {
+ javax.wsdl.extensions.soap.SOAPBody soap=(javax.wsdl.extensions.soap.SOAPBody)
+ defn.getExtensionRegistry().createExtension(javax.wsdl.BindingInput.class,
+ new javax.xml.namespace.QName("http://schemas.xmlsoap.org/wsdl/soap/", "body"));
+ soap.setUse("literal");
+ input.addExtensibilityElement(soap);
+ } catch(Exception e) {
+ logger.error("Failed to add SOAP body to input", e);
+ }
+ }
+
+ /**
+ * This method adds WSDL binding information to the output.
+ *
+ * @param defn The definition
+ * @param output The output
+ */
+ public void updateOutput(javax.wsdl.Definition defn, javax.wsdl.BindingOutput output) {
+ try {
+ javax.wsdl.extensions.soap.SOAPBody soap=(javax.wsdl.extensions.soap.SOAPBody)
+ defn.getExtensionRegistry().createExtension(javax.wsdl.BindingOutput.class,
+ new javax.xml.namespace.QName("http://schemas.xmlsoap.org/wsdl/soap/", "body"));
+ soap.setUse("literal");
+ output.addExtensibilityElement(soap);
+ } catch(Exception e) {
+ logger.error("Failed to add SOAP body to output", e);
+ }
+ }
+
+ /**
+ * This method adds WSDL binding information to the fault.
+ *
+ * @param defn The definition
+ * @param fault The fault
+ */
+ public void updateFault(javax.wsdl.Definition defn, javax.wsdl.BindingFault fault) {
+ try {
+ javax.wsdl.extensions.soap.SOAPFault soap=(javax.wsdl.extensions.soap.SOAPFault)
+ defn.getExtensionRegistry().createExtension(javax.wsdl.BindingFault.class,
+ new javax.xml.namespace.QName("http://schemas.xmlsoap.org/wsdl/soap/", "fault"));
+ soap.setUse("literal");
+ soap.setName(fault.getName());
+
+ fault.addExtensibilityElement(soap);
+ } catch(Exception e) {
+ logger.error("Failed to add SOAP body to fault", e);
+ }
+ }
+
+ /**
+ * This method adds WSDL binding information to the fault.
+ *
+ * @param defn The definition
+ * @param port The port
+ */
+ public void updatePort(javax.wsdl.Definition defn, javax.wsdl.Port port) {
+ try {
+ javax.wsdl.extensions.soap.SOAPAddress soap=(javax.wsdl.extensions.soap.SOAPAddress)
+ defn.getExtensionRegistry().createExtension(javax.wsdl.Port.class,
+ new javax.xml.namespace.QName("http://schemas.xmlsoap.org/wsdl/soap/", "address"));
+ soap.setLocationURI("http://localhost:8080/"+defn.getQName().getLocalPart()+"Service");
+
+ port.addExtensibilityElement(soap);
+ } catch(Exception e) {
+ logger.error("Failed to add SOAP address to port", e);
+ }
+ }
+
+}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/soap/SOAPRPCWSDLBinding.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/soap/SOAPRPCWSDLBinding.java 2010-03-21 14:53:57 UTC (rev 204)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/soap/SOAPRPCWSDLBinding.java 2010-03-21 16:53:15 UTC (rev 205)
@@ -70,9 +70,12 @@
* This method adds WSDL binding information to the operation.
*
* @param defn The definition
+ * @param mep The message exchange pattern
* @param operation The operation
*/
- public void updateOperation(javax.wsdl.Definition defn, javax.wsdl.BindingOperation operation) {
+ public void updateOperation(javax.wsdl.Definition defn,
+ org.scribble.contract.model.MessageExchangePattern mep,
+ javax.wsdl.BindingOperation operation) {
try {
javax.wsdl.extensions.soap.SOAPOperation soap=(javax.wsdl.extensions.soap.SOAPOperation)
defn.getExtensionRegistry().createExtension(javax.wsdl.BindingOperation.class,
14 years, 1 month
savara SVN: r204 - in tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src: test/org/jboss/savara/tools/bpel/model/component and 1 other directory.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-03-21 10:53:57 -0400 (Sun, 21 Mar 2010)
New Revision: 204
Modified:
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Catch.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/OnAlarm.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/OnMessage.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Pick.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/RepeatUntil.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/While.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/EventHandlersTest.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/OnAlarmTest.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/PickTest.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/RepeatUntilTest.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/WhileTest.java
Log:
SAVARA-11 - added remaining unit tests for deriving the URI that will focus on the graphical BPEL component when a marker is created.
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Catch.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Catch.java 2010-03-21 13:22:30 UTC (rev 203)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Catch.java 2010-03-21 14:53:57 UTC (rev 204)
@@ -177,7 +177,7 @@
String ret="";
if (elem instanceof BPELActivity) {
- ret += "@activity";
+ ret = "@activity";
}
return(ret);
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/OnAlarm.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/OnAlarm.java 2010-03-21 13:22:30 UTC (rev 203)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/OnAlarm.java 2010-03-21 14:53:57 UTC (rev 204)
@@ -42,16 +42,7 @@
org.w3c.dom.Element activity) {
super(model, activity);
- //m_activity = findChildActivity();
-
- BPELElement elem=findChildActivity();
-
- java.util.List<BPELElement> elems=findChildElements(BPELActivity.class);
-
- if (elem instanceof Scope) {
- m_scope = (Scope)elem;
- }
-
+ m_activity = findChildActivity();
}
/**
@@ -77,8 +68,8 @@
public void setUntil(Until cond) {
org.w3c.dom.Element insertBefore=null;
- if (m_scope != null) {
- insertBefore = m_scope.getDOMElement();
+ if (m_activity != null) {
+ insertBefore = m_activity.getDOMElement();
}
setChildElement(findChildElement(Until.UNTIL),
@@ -114,8 +105,8 @@
public void setFor(For cond) {
org.w3c.dom.Element insertBefore=null;
- if (m_scope != null) {
- insertBefore = m_scope.getDOMElement();
+ if (m_activity != null) {
+ insertBefore = m_activity.getDOMElement();
}
setChildElement(findChildElement(For.FOR),
@@ -144,13 +135,13 @@
}
/**
- * This method sets the scope associated with
- * the 'onEvent' construct.
+ * This method sets the activity associated with
+ * the 'else' construct.
*
- * @param scope The scope
+ * @param act The activity
*/
- public void setScope(Scope scope) {
- m_scope = scope;
+ public void setActivity(BPELElement act) {
+ m_activity = act;
BPELElement existing=findChildActivity();
org.w3c.dom.Element existingElem=null;
@@ -161,30 +152,31 @@
org.w3c.dom.Element insertBefore=null;
- setChildElement(existingElem, scope,
+ setChildElement(existingElem, act,
insertBefore);
}
/**
- * This method returns the scope associated with
- * the 'onEvent' construct.
+ * This method returns the activity associated with
+ * the 'else' construct.
*
- * @return The scope
+ * @return The activity
*/
- public Scope getScope() {
- return(m_scope);
+ public BPELElement getActivity() {
+ return(m_activity);
}
-
+
protected String getLocalURIPart(BPELElement elem) {
String ret="";
if (elem instanceof Scope) {
- ret += "@scope";
+ ret = "@scope";
+ } else {
+ ret = "@activity";
}
return(ret);
}
- private Scope m_scope;
- //private BPELElement m_activity;
+ private BPELElement m_activity;
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/OnMessage.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/OnMessage.java 2010-03-21 13:22:30 UTC (rev 203)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/OnMessage.java 2010-03-21 14:53:57 UTC (rev 204)
@@ -223,5 +223,15 @@
}
}
+ protected String getLocalURIPart(BPELElement elem) {
+ String ret="";
+
+ if (elem instanceof BPELActivity) {
+ ret = "@activity";
+ }
+
+ return(ret);
+ }
+
private BPELElement m_activity;
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Pick.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Pick.java 2010-03-21 13:22:30 UTC (rev 203)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Pick.java 2010-03-21 14:53:57 UTC (rev 204)
@@ -265,6 +265,18 @@
activities.add(elem);
}
+ protected String getLocalURIPart(BPELElement elem) {
+ String ret="";
+
+ if (elem instanceof OnMessage) {
+ ret += "@onMessage."+getOnMessages().indexOf(elem);
+ } else if (elem instanceof OnAlarm) {
+ ret += "@onAlarm."+getOnAlarms().indexOf(elem);
+ }
+
+ return(ret);
+ }
+
private java.util.List<OnMessage> m_onMessages=
new java.util.Vector<OnMessage>();
private java.util.List<OnAlarm> m_onAlarms=
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/RepeatUntil.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/RepeatUntil.java 2010-03-21 13:22:30 UTC (rev 203)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/RepeatUntil.java 2010-03-21 14:53:57 UTC (rev 204)
@@ -145,6 +145,16 @@
return(m_activity);
}
+ protected String getLocalURIPart(BPELElement elem) {
+ String ret="";
+
+ if (elem instanceof BPELActivity) {
+ ret = "@activity";
+ }
+
+ return(ret);
+ }
+
private Condition m_condition=null;
private BPELElement m_activity=null;
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/While.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/While.java 2010-03-21 13:22:30 UTC (rev 203)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/While.java 2010-03-21 14:53:57 UTC (rev 204)
@@ -158,6 +158,16 @@
return(m_activity);
}
+ protected String getLocalURIPart(BPELElement elem) {
+ String ret="";
+
+ if (elem instanceof BPELActivity) {
+ ret = "@activity";
+ }
+
+ return(ret);
+ }
+
private Condition m_condition=null;
private BPELElement m_activity=null;
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/EventHandlersTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/EventHandlersTest.java 2010-03-21 13:22:30 UTC (rev 203)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/EventHandlersTest.java 2010-03-21 14:53:57 UTC (rev 204)
@@ -371,8 +371,12 @@
OnAlarm one=scope.getEventHandlers().getOnAlarms().get(0);
- Scope innerScope=one.getScope();
+ if ((one.getActivity() instanceof Scope) == false) {
+ fail("Activity is not Scope");
+ }
+ Scope innerScope=(Scope)one.getActivity();
+
if (innerScope == null) {
fail("Inner scope not set");
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/OnAlarmTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/OnAlarmTest.java 2010-03-21 13:22:30 UTC (rev 203)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/OnAlarmTest.java 2010-03-21 14:53:57 UTC (rev 204)
@@ -87,8 +87,8 @@
expr1+"' but got '"+result+"'");
}
- if (component.getScope() == null) {
- fail("No scope");
+ if (component.getActivity() == null) {
+ fail("No activity");
}
}
@@ -144,7 +144,7 @@
expr1+"' but got '"+result+"'");
}
- if (component.getScope() == null) {
+ if (component.getActivity() == null) {
fail("No activity");
}
}
@@ -681,10 +681,10 @@
}
Scope sub=new Scope(model);
- component.setScope(sub);
+ component.setActivity(sub);
- if (component.getScope() == null) {
- fail("No scope");
+ if (component.getActivity() == null) {
+ fail("No activity");
}
if (component.getDOMElement().getChildNodes().item(1).
@@ -747,10 +747,10 @@
}
Scope sub=new Scope(model);
- component.setScope(sub);
+ component.setActivity(sub);
- if (component.getScope() == null) {
- fail("No Scope");
+ if (component.getActivity() == null) {
+ fail("No activity");
}
if (component.getDOMElement().getChildNodes().item(1).
@@ -801,8 +801,8 @@
fail("Until condition should not be set");
}
- if (component.getScope() == null) {
- fail("No Scope");
+ if (component.getActivity() == null) {
+ fail("No activity");
}
For cond=new For(model);
@@ -876,8 +876,8 @@
fail("Until condition should not be set");
}
- if (component.getScope() == null) {
- fail("No Scope");
+ if (component.getActivity() == null) {
+ fail("No activity");
}
Until cond=new Until(model);
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/PickTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/PickTest.java 2010-03-21 13:22:30 UTC (rev 203)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/PickTest.java 2010-03-21 14:53:57 UTC (rev 204)
@@ -216,4 +216,202 @@
getLocalName());
}
}
+
+ public void testGetURIOnAlarm() {
+ BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+ String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+ "<sequence>"+
+ "<pick>"+
+ "<onAlarm>"+
+ "<scope>"+
+ "<sequence>"+
+ "<receive/>"+
+ "</sequence>"+
+ "</scope>"+
+ "</onAlarm>"+
+ "</pick>"+
+ "</sequence>"+
+ "</process>";
+
+ org.w3c.dom.Element elem=null;
+
+ try {
+ javax.xml.parsers.DocumentBuilderFactory factory=
+ javax.xml.parsers.DocumentBuilderFactory.newInstance();
+
+ factory.setNamespaceAware(true);
+
+ javax.xml.parsers.DocumentBuilder builder=
+ factory.newDocumentBuilder();
+
+ java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+
+ org.w3c.dom.Document doc=builder.parse(is);
+ elem = doc.getDocumentElement();
+
+ is.close();
+ } catch(Exception e) {
+ e.printStackTrace();
+ fail("Failed to convert to doc");
+ }
+
+ Process component=new Process(model, elem);
+
+ BPELActivity topact=component.getActivity();
+
+ if ((topact instanceof Sequence) == false) {
+ fail("Top level activity is not Sequence");
+ }
+
+ Sequence topseq=(Sequence)topact;
+
+ if (topseq.getActivities().size() != 1) {
+ fail("Top sequence should have 1 activity");
+ }
+
+ if ((topseq.getActivities().get(0) instanceof Pick) == false) {
+ fail("Activity is not Pick");
+ }
+
+ Pick pick=(Pick)topseq.getActivities().get(0);
+
+ OnAlarm one=pick.getOnAlarms().get(0);
+
+ if ((one.getActivity() instanceof Scope) == false) {
+ fail("Activity is not scope");
+ }
+
+ Scope innerScope=(Scope)one.getActivity();
+
+ if (innerScope == null) {
+ fail("Inner scope not set");
+ }
+
+ if ((innerScope.getActivity() instanceof Sequence) == false) {
+ fail("Inner scope activity is not a sequence");
+ }
+
+ Sequence seq=(Sequence)innerScope.getActivity();
+
+ if (seq.getActivities().size() != 1) {
+ fail("Expecting 1 child activities: "+
+ seq.getActivities().size());
+ }
+
+ if ((seq.getActivities().get(0) instanceof Receive) == false) {
+ fail("First activity should be receive");
+ }
+
+ Receive recv=(Receive)seq.getActivities().get(0);
+
+ String uri=recv.getURI();
+
+ if (uri == null) {
+ fail("URI is null");
+ }
+
+ if (uri.equals("//@activity/@activities.0/@onAlarm.0/@scope/@activity/(a)activities.0") == false) {
+ fail("URI is invalid: "+uri);
+ }
+ }
+
+ public void testGetURIOnMessage() {
+ BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+ String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+ "<sequence>"+
+ "<pick>"+
+ "<onMessage>"+
+ "<scope>"+
+ "<sequence>"+
+ "<receive/>"+
+ "</sequence>"+
+ "</scope>"+
+ "</onMessage>"+
+ "</pick>"+
+ "</sequence>"+
+ "</process>";
+
+ org.w3c.dom.Element elem=null;
+
+ try {
+ javax.xml.parsers.DocumentBuilderFactory factory=
+ javax.xml.parsers.DocumentBuilderFactory.newInstance();
+
+ factory.setNamespaceAware(true);
+
+ javax.xml.parsers.DocumentBuilder builder=
+ factory.newDocumentBuilder();
+
+ java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+
+ org.w3c.dom.Document doc=builder.parse(is);
+ elem = doc.getDocumentElement();
+
+ is.close();
+ } catch(Exception e) {
+ e.printStackTrace();
+ fail("Failed to convert to doc");
+ }
+
+ Process component=new Process(model, elem);
+
+ BPELActivity topact=component.getActivity();
+
+ if ((topact instanceof Sequence) == false) {
+ fail("Top level activity is not Sequence");
+ }
+
+ Sequence topseq=(Sequence)topact;
+
+ if (topseq.getActivities().size() != 1) {
+ fail("Top sequence should have 1 activity");
+ }
+
+ if ((topseq.getActivities().get(0) instanceof Pick) == false) {
+ fail("Activity is not Pick");
+ }
+
+ Pick pick=(Pick)topseq.getActivities().get(0);
+
+ OnMessage one=pick.getOnMessages().get(0);
+
+ if ((one.getActivity() instanceof Scope) == false) {
+ fail("Activity is not scope");
+ }
+
+ Scope innerScope=(Scope)one.getActivity();
+
+ if (innerScope == null) {
+ fail("Inner scope not set");
+ }
+
+ if ((innerScope.getActivity() instanceof Sequence) == false) {
+ fail("Inner scope activity is not a sequence");
+ }
+
+ Sequence seq=(Sequence)innerScope.getActivity();
+
+ if (seq.getActivities().size() != 1) {
+ fail("Expecting 1 child activities: "+
+ seq.getActivities().size());
+ }
+
+ if ((seq.getActivities().get(0) instanceof Receive) == false) {
+ fail("First activity should be receive");
+ }
+
+ Receive recv=(Receive)seq.getActivities().get(0);
+
+ String uri=recv.getURI();
+
+ if (uri == null) {
+ fail("URI is null");
+ }
+
+ if (uri.equals("//@activity/@activities.0/@onMessage.0/@activity/@activity/(a)activities.0") == false) {
+ fail("URI is invalid: "+uri);
+ }
+ }
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/RepeatUntilTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/RepeatUntilTest.java 2010-03-21 13:22:30 UTC (rev 203)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/RepeatUntilTest.java 2010-03-21 14:53:57 UTC (rev 204)
@@ -400,4 +400,78 @@
getLocalName());
}
}
+
+ public void testGetURI() {
+ BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+ String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+ "<repeatUntil xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+ "<sequence>"+
+ "<receive/>"+
+ "</sequence>"+
+ "</repeatUntil>"+
+ "</process>";
+
+ org.w3c.dom.Element elem=null;
+
+ try {
+ javax.xml.parsers.DocumentBuilderFactory factory=
+ javax.xml.parsers.DocumentBuilderFactory.newInstance();
+
+ factory.setNamespaceAware(true);
+
+ javax.xml.parsers.DocumentBuilder builder=
+ factory.newDocumentBuilder();
+
+ java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+
+ org.w3c.dom.Document doc=builder.parse(is);
+ elem = doc.getDocumentElement();
+
+ is.close();
+ } catch(Exception e) {
+ e.printStackTrace();
+ fail("Failed to convert to doc");
+ }
+
+ Process component=new Process(model, elem);
+
+ BPELActivity topact=component.getActivity();
+
+ if ((topact instanceof RepeatUntil) == false) {
+ fail("Top level activity is not RepeatUntil");
+ }
+
+ RepeatUntil top=(RepeatUntil)topact;
+
+ if (top.getActivity() == null) {
+ fail("While activity is null");
+ }
+
+ if ((top.getActivity() instanceof Sequence) == false) {
+ fail("While activity is not sequence");
+ }
+
+ Sequence seq=(Sequence)top.getActivity();
+
+ if (seq.getActivities().size() != 1) {
+ fail("Should have 1 activity: "+seq.getActivities().size());
+ }
+
+ if ((seq.getActivities().get(0) instanceof Receive) == false) {
+ fail("Activty should be Receive");
+ }
+
+ Receive recv=(Receive)seq.getActivities().get(0);
+
+ String uri=recv.getURI();
+
+ if (uri == null) {
+ fail("URI is null");
+ }
+
+ if (uri.equals("//@activity/@activity/(a)activities.0") == false) {
+ fail("URI is invalid: "+uri);
+ }
+ }
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/WhileTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/WhileTest.java 2010-03-21 13:22:30 UTC (rev 203)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/WhileTest.java 2010-03-21 14:53:57 UTC (rev 204)
@@ -398,4 +398,78 @@
getLocalName());
}
}
+
+ public void testGetURI() {
+ BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+ String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+ "<while xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+ "<sequence>"+
+ "<receive/>"+
+ "</sequence>"+
+ "</while>"+
+ "</process>";
+
+ org.w3c.dom.Element elem=null;
+
+ try {
+ javax.xml.parsers.DocumentBuilderFactory factory=
+ javax.xml.parsers.DocumentBuilderFactory.newInstance();
+
+ factory.setNamespaceAware(true);
+
+ javax.xml.parsers.DocumentBuilder builder=
+ factory.newDocumentBuilder();
+
+ java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+
+ org.w3c.dom.Document doc=builder.parse(is);
+ elem = doc.getDocumentElement();
+
+ is.close();
+ } catch(Exception e) {
+ e.printStackTrace();
+ fail("Failed to convert to doc");
+ }
+
+ Process component=new Process(model, elem);
+
+ BPELActivity topact=component.getActivity();
+
+ if ((topact instanceof While) == false) {
+ fail("Top level activity is not While");
+ }
+
+ While top=(While)topact;
+
+ if (top.getActivity() == null) {
+ fail("While activity is null");
+ }
+
+ if ((top.getActivity() instanceof Sequence) == false) {
+ fail("While activity is not sequence");
+ }
+
+ Sequence seq=(Sequence)top.getActivity();
+
+ if (seq.getActivities().size() != 1) {
+ fail("Should have 1 activity: "+seq.getActivities().size());
+ }
+
+ if ((seq.getActivities().get(0) instanceof Receive) == false) {
+ fail("Activty should be Receive");
+ }
+
+ Receive recv=(Receive)seq.getActivities().get(0);
+
+ String uri=recv.getURI();
+
+ if (uri == null) {
+ fail("URI is null");
+ }
+
+ if (uri.equals("//@activity/@activity/(a)activities.0") == false) {
+ fail("URI is invalid: "+uri);
+ }
+ }
}
14 years, 1 month