Overlord SVN: r544 - in cdl/trunk/samples/jbossesb/brokerage: broker/stateless and 28 other directories.
by overlord-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2009-03-18 12:43:08 -0400 (Wed, 18 Mar 2009)
New Revision: 544
Added:
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/pom.xml
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/Quote.java
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetCreditCheckRequestMessageAction.java
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetOrderConfirmRequestAction.java
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetOrderRejectMessageAction.java
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetQuotesListAction.java
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetRequestQuoteMessageAction.java
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/resources/
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/resources/META-INF/
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/resources/META-INF/deployment.xml
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/resources/META-INF/jboss-esb.xml
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/resources/jbmq-queue-service.xml
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/resources/log4j.xml
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/test/
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/test/java/
cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/test/resources/
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/pom.xml
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/java/
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/java/org/
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/java/org/jboss/
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/java/org/jboss/soa/
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/java/org/jboss/soa/overlord/
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/java/org/jboss/soa/overlord/samples/
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/supplier/
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/supplier/SetOrderConfirmResponseAction.java
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/supplier/SetQuoteMessageAction.java
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/resources/
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/resources/META-INF/
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/resources/META-INF/deployment.xml
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/resources/META-INF/jboss-esb.xml
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/resources/jbmq-queue-service.xml
cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/resources/log4j.xml
Log:
[SOAG-93] add stateless broker example, not fully working yet.
Added: cdl/trunk/samples/jbossesb/brokerage/broker/stateless/pom.xml
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/broker/stateless/pom.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/brokerage/broker/stateless/pom.xml 2009-03-18 16:43:08 UTC (rev 544)
@@ -0,0 +1,60 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.soa.overlord.cdl.samples</groupId>
+ <artifactId>jbossesb-stateless-broker</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jboss-esb</packaging>
+ <name>Overlord::CDL::Samples::Stateless::Broker</name>
+ <url>http://www.jboss.org/overlord</url>
+
+ <parent>
+ <groupId>org.jboss.soa.overlord.cdl</groupId>
+ <artifactId>samples</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${log4j.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.soa.overlord.cdl.runtime</groupId>
+ <artifactId>cdl-runtime-jbossesb</artifactId>
+ <version>${cdl.jbossesb.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>broker-stateless</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <!--Deploy esb artifact to JBoss AS/ESB -->
+ <execution>
+ <id>deploy</id>
+ <phase>install</phase>
+ <configuration>
+ <tasks>
+ <!--copy file="target/broker-stateless.esb" todir="${deploy.dir}" overwrite="true" /-->
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
+
Added: cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/Quote.java
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/Quote.java (rev 0)
+++ cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/Quote.java 2009-03-18 16:43:08 UTC (rev 544)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., 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.
+ *
+ * (C) 2008,
+ */
+package org.jboss.soa.overlord.samples.jbossesb.loan.broker;
+
+import java.io.Serializable;
+
+
+
+public class Quote implements Serializable {
+
+ private static final long serialVersionUID = 3234324947672128469L;
+
+ private String value;
+
+ private String serviceDescription;
+
+ public String getServiceDescription() {
+ return serviceDescription;
+ }
+
+ public void setServiceDescription(String serviceDescription) {
+ this.serviceDescription = serviceDescription;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+}
Added: cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetCreditCheckRequestMessageAction.java
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetCreditCheckRequestMessageAction.java (rev 0)
+++ cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetCreditCheckRequestMessageAction.java 2009-03-18 16:43:08 UTC (rev 544)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., 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.
+ *
+ * (C) 2008,
+ */
+package org.jboss.soa.overlord.samples.jbossesb.loan.broker;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.overlord.jbossesb.XMLUtils;
+import org.w3c.dom.Node;
+
+public class SetCreditCheckRequestMessageAction extends AbstractActionLifecycle {
+
+ private static Logger logger = Logger.getLogger(SetCreditCheckRequestMessageAction.class);
+
+ private ConfigTree config;
+
+ public SetCreditCheckRequestMessageAction(ConfigTree config) {
+ this.config = config;
+ }
+
+ public Message process(Message message) throws Exception{
+
+ Node node = XMLUtils.getNode((String)message.getBody().get());
+ String idValue = node.getAttributes().getNamedItem("id").getNodeValue();
+ message.getBody().add("<CreditCheckRequest id=\"" + idValue +"\"></CreditCheckRequest>");
+
+ logger.info("Updated credit check request message: "+message.getBody().get());
+
+ return(message);
+ }
+
+}
\ No newline at end of file
Added: cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetOrderConfirmRequestAction.java
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetOrderConfirmRequestAction.java (rev 0)
+++ cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetOrderConfirmRequestAction.java 2009-03-18 16:43:08 UTC (rev 544)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., 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.
+ *
+ * (C) 2008,
+ */
+package org.jboss.soa.overlord.samples.jbossesb.loan.broker;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.overlord.jbossesb.XMLUtils;
+import org.w3c.dom.Node;
+
+/**
+ * @author jeffyu
+ *
+ */
+public class SetOrderConfirmRequestAction extends AbstractActionLifecycle {
+
+ public static Logger logger = Logger.getLogger(SetOrderConfirmRequestAction.class);
+
+ private ConfigTree config;
+
+ public SetOrderConfirmRequestAction(ConfigTree config){
+ this.config = config;
+ }
+
+ public Message process(Message message) throws Exception {
+ Node node = XMLUtils.getNode((String)message.getBody().get());
+ String idValue = node.getAttributes().getNamedItem("id").getNodeValue();
+ String supplier = (String) message.getProperties().getProperty("supplierDesc");
+ String quoteValue = (String)message.getProperties().getProperty("quoteValue");
+
+ message.getBody().add("<orderConfirmed id=\"" + idValue +"\" supplierDesc=\""
+ + supplier+"\" quoteValue=\"" + quoteValue + "\"></orderConfirmed>");
+
+ logger.info(message.getBody().get());
+
+ return message;
+ }
+
+}
Added: cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetOrderRejectMessageAction.java
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetOrderRejectMessageAction.java (rev 0)
+++ cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetOrderRejectMessageAction.java 2009-03-18 16:43:08 UTC (rev 544)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., 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.
+ *
+ * (C) 2008,
+ */
+package org.jboss.soa.overlord.samples.jbossesb.loan.broker;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.overlord.jbossesb.XMLUtils;
+import org.w3c.dom.Node;
+
+/**
+ * @author jeffyu
+ *
+ */
+public class SetOrderRejectMessageAction extends AbstractActionLifecycle {
+
+ public static Logger logger = Logger.getLogger(SetOrderRejectMessageAction.class);
+
+ private ConfigTree config;
+
+ public SetOrderRejectMessageAction(ConfigTree config){
+ this.config = config;
+ }
+
+ public Message process(Message message) throws Exception {
+ Node node = XMLUtils.getNode((String)message.getBody().get());
+ String idValue = node.getAttributes().getNamedItem("id").getNodeValue();
+
+ message.getBody().add("<orderRejected id=\"" + idValue + "\">Credit Card is invalid!</orderRejected>");
+
+ logger.info(message.getBody().get());
+
+ return message;
+ }
+
+}
Added: cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetQuotesListAction.java
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetQuotesListAction.java (rev 0)
+++ cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetQuotesListAction.java 2009-03-18 16:43:08 UTC (rev 544)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., 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.
+ *
+ * (C) 2008,
+ */
+package org.jboss.soa.overlord.samples.jbossesb.loan.broker;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.overlord.jbossesb.XMLUtils;
+import org.w3c.dom.Node;
+
+/**
+ * @author jeffyu
+ *
+ */
+public class SetQuotesListAction extends AbstractActionLifecycle {
+
+ private Logger logger = Logger.getLogger(SetQuotesListAction.class);
+
+ private ConfigTree config;
+
+ public SetQuotesListAction(ConfigTree config) {
+ this.config = config;
+ }
+
+ public Message process(Message message) throws Exception {
+
+ List<Quote> quotes = (List<Quote>)message.getProperties().getProperty("quotes");
+
+ Node node = XMLUtils.getNode((String)message.getBody().get());
+ String idValue = node.getAttributes().getNamedItem("id").getNodeValue();
+
+ StringBuffer sbuffer = new StringBuffer();
+ sbuffer.append("<quoteList id=\"" + idValue + "\">");
+
+ for(Quote quote : quotes) {
+ sbuffer.append("<quote supplierDesc=\"" + quote.getServiceDescription() + "\">");
+ sbuffer.append(quote.getValue());
+ sbuffer.append("</quote>");
+ }
+
+ sbuffer.append("</quoteList>");
+
+ message.getBody().add(sbuffer.toString());
+
+ logger.info("set quote list message :[" + sbuffer.toString() + "]");
+
+ return message;
+ }
+
+}
Added: cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetRequestQuoteMessageAction.java
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetRequestQuoteMessageAction.java (rev 0)
+++ cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/SetRequestQuoteMessageAction.java 2009-03-18 16:43:08 UTC (rev 544)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., 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.
+ *
+ * (C) 2008,
+ */
+package org.jboss.soa.overlord.samples.jbossesb.loan.broker;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.overlord.jbossesb.XMLUtils;
+import org.w3c.dom.Node;
+
+/**
+ * @author jeffyu
+ *
+ */
+public class SetRequestQuoteMessageAction extends AbstractActionLifecycle {
+
+ public static Logger logger = Logger.getLogger(SetRequestQuoteMessageAction.class);
+
+ private ConfigTree config;
+
+ public SetRequestQuoteMessageAction(ConfigTree config){
+ this.config = config;
+ }
+
+ public Message process(Message message) throws Exception {
+ Node node = XMLUtils.getNode((String)message.getBody().get());
+ String idValue = node.getAttributes().getNamedItem("id").getNodeValue();
+
+ String serviceDescription = (String)message.getProperties().getProperty("serviceDescriptionName");
+
+ message.getBody().add("<requestForQuote id=\"" + idValue +"\" supplierDesc=\"" + serviceDescription+ "\" ></requestForQuote>");
+
+ logger.info("Set 'requestForQuote' : "+message);
+
+ return message;
+ }
+
+}
Added: cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/resources/META-INF/deployment.xml
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/resources/META-INF/deployment.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/resources/META-INF/deployment.xml 2009-03-18 16:43:08 UTC (rev 544)
@@ -0,0 +1,16 @@
+<jbossesb-deployment>
+ <depends>org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__2</depends>
+ <depends>org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__1</depends>
+ <depends>org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__12</depends>
+ <depends>org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_checkCredit</depends>
+ <depends>org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__11</depends>
+ <depends>org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__10</depends>
+ <depends>org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__9</depends>
+ <depends>org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__8</depends>
+ <depends>org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker</depends>
+ <depends>org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__7</depends>
+ <depends>org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__6</depends>
+ <depends>org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__5</depends>
+ <depends>org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__4</depends>
+ <depends>org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__3</depends>
+</jbossesb-deployment>
Added: cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/resources/META-INF/jboss-esb.xml
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/resources/META-INF/jboss-esb.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/resources/META-INF/jboss-esb.xml 2009-03-18 16:43:08 UTC (rev 544)
@@ -0,0 +1,261 @@
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml..." parameterReloadSecs="5000">
+ <providers>
+ <jms-provider connection-factory="ConnectionFactory" jndi-URL="localhost" jndi-context-factory="org.jnp.interfaces.NamingContextFactory" name="JBossMQ">
+ <jms-bus busid="busId1">
+ <jms-message-filter dest-name="queue/org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId2">
+ <jms-message-filter dest-name="queue/org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__1" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId3">
+ <jms-message-filter dest-name="queue/org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__2" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId4">
+ <jms-message-filter dest-name="queue/org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__3" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId5">
+ <jms-message-filter dest-name="queue/org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__4" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId6">
+ <jms-message-filter dest-name="queue/org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__5" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId7">
+ <jms-message-filter dest-name="queue/org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__6" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId8">
+ <jms-message-filter dest-name="queue/org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__7" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId9">
+ <jms-message-filter dest-name="queue/org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__8" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId10">
+ <jms-message-filter dest-name="queue/org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__9" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId11">
+ <jms-message-filter dest-name="queue/org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__10" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId12">
+ <jms-message-filter dest-name="queue/org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__11" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId13">
+ <jms-message-filter dest-name="queue/org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__12" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId14">
+ <jms-message-filter dest-name="queue/org_pi4soa_esbbroker_esbbroker_checkCredit" dest-type="QUEUE"/>
+ </jms-bus>
+ </jms-provider>
+ </providers>
+ <services>
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker">
+ <listeners>
+ <jms-listener busidref="busId1" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SwitchAction" name="ESBBrokerProcess_Broker_action_1" process="process">
+ <property name="serviceDescriptionName" value="{org.pi4soa.esbbroker.esbbroker}ESBBrokerProcess-Broker"/>
+ <property name="conversationType" value="overlord.cdl.samples.LoanBroker@Broker"/>
+ <property name="paths">
+ <case service-category="org.pi4soa.esbbroker.esbbroker" service-name="ESBBrokerProcess_Broker__1">
+ <message type="enquiry"/>
+ </case>
+ <case service-category="org.pi4soa.esbbroker.esbbroker" service-name="ESBBrokerProcess_Broker__7">
+ <event description="Event trigger to send quoteList message type(s)"/>
+ </case>
+ <case service-category="org.pi4soa.esbbroker.esbbroker" service-name="ESBBrokerProcess_Broker__8">
+ <message type="buy"/>
+ </case>
+ <case service-category="org.pi4soa.esbbroker.esbbroker" service-name="ESBBrokerProcess_Broker__12">
+ <message type="cancel"/>
+ </case>
+ </property>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__1">
+ <listeners>
+ <jms-listener busidref="busId2" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__1"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.ReceiveMessageAction" name="ESBBrokerProcess_Broker__1_action_1" process="process">
+ <property name="operation" value="makeEnquiry"/>
+ <property name="messageType" value="enquiry"/>
+ </action>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.IfAction" name="ESBBrokerProcess_Broker__1_action_2" process="process">
+ <property name="paths">
+ <if service-category="org.pi4soa.esbbroker.esbbroker" service-name="ESBBrokerProcess_Broker__2"/>
+ <else service-category="org.pi4soa.esbbroker.esbbroker" service-name="ESBBrokerProcess_Broker__3"/>
+ </property>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__2">
+ <listeners>
+ <jms-listener busidref="busId3" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__2"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction" name="ESBBrokerProcess_Broker__2_action_1" process="process">
+ <property name="operation" value="getQuote"/>
+ <property name="messageType" value="requestForQuote"/>
+ <property name="serviceCategory" value="org.pi4soa.esbbroker.esbbroker"/>
+ <property name="serviceName" value="ESBBrokerProcess_SupplierQuoteEngine"/>
+ <property name="responseServiceCategory" value="org.pi4soa.esbbroker.esbbroker"/>
+ <property name="responseServiceName" value="getQuote"/>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__3">
+ <listeners>
+ <jms-listener busidref="busId4" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__3"/>
+ </listeners>
+ <actions/>
+ </service>
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="getQuote">
+ <listeners>
+ <jms-listener busidref="busId5" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__4"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.ReceiveMessageAction" name="ESBBrokerProcess_Broker__4_action_1" process="process">
+ <property name="operation" value="getQuote"/>
+ <property name="messageType" value="quote"/>
+ </action>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.IfAction" name="ESBBrokerProcess_Broker__4_action_2" process="process">
+ <property name="paths">
+ <if service-category="org.pi4soa.esbbroker.esbbroker" service-name="ESBBrokerProcess_Broker__5"/>
+ <else service-category="org.pi4soa.esbbroker.esbbroker" service-name="ESBBrokerProcess_Broker__6"/>
+ </property>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__5">
+ <listeners>
+ <jms-listener busidref="busId6" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__5"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction" name="ESBBrokerProcess_Broker__5_action_1" process="process">
+ <property name="operation" value="getQuote"/>
+ <property name="messageType" value="requestForQuote"/>
+ <property name="serviceCategory" value="org.pi4soa.esbbroker.esbbroker"/>
+ <property name="serviceName" value="ESBBrokerProcess_SupplierQuoteEngine"/>
+ <property name="responseServiceCategory" value="org.pi4soa.esbbroker.esbbroker"/>
+ <property name="responseServiceName" value="getQuote"/>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__6">
+ <listeners>
+ <jms-listener busidref="busId7" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__6"/>
+ </listeners>
+ <actions/>
+ </service>
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__7">
+ <listeners>
+ <jms-listener busidref="busId8" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__7"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction" name="ESBBrokerProcess_Broker__7_action_1" process="process">
+ <property name="operation" value="makeEnquiry"/>
+ <property name="messageType" value="quoteList"/>
+ <property name="clientRole" value="Buyer"/>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__8">
+ <listeners>
+ <jms-listener busidref="busId9" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__8"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.ReceiveMessageAction" name="ESBBrokerProcess_Broker__8_action_1" process="process">
+ <property name="operation" value="buy"/>
+ <property name="messageType" value="buy"/>
+ </action>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction" name="ESBBrokerProcess_Broker__8_action_2" process="process">
+ <property name="operation" value="checkCredit"/>
+ <property name="messageType" value="CreditCheckRequest"/>
+ <property name="serviceCategory" value="org.pi4soa.purchase.purchasegoods"/>
+ <property name="serviceName" value="PurchaseGoodsProcess_CreditAgency"/>
+ <property name="responseServiceCategory" value="org.pi4soa.esbbroker.esbbroker"/>
+ <property name="responseServiceName" value="checkCredit"/>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__9">
+ <listeners>
+ <jms-listener busidref="busId10" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__9"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.ReceiveMessageAction" name="ESBBrokerProcess_Broker__9_action_1" process="process">
+ <property name="operation" value="checkCredit"/>
+ <property name="messageType" value="CreditCheckOk"/>
+ </action>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction" name="ESBBrokerProcess_Broker__9_action_2" process="process">
+ <property name="operation" value="confirm"/>
+ <property name="messageType" value="orderConfirmed"/>
+ <property name="serviceCategory" value="org.pi4soa.esbbroker.esbbroker"/>
+ <property name="serviceName" value="ESBBrokerProcess_SupplierTxnProcessor"/>
+ <property name="responseServiceCategory" value="org.pi4soa.esbbroker.esbbroker"/>
+ <property name="responseServiceName" value="confirm"/>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="confirm">
+ <listeners>
+ <jms-listener busidref="busId11" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__10"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.ReceiveMessageAction" name="ESBBrokerProcess_Broker__10_action_1" process="process">
+ <property name="operation" value="confirm"/>
+ <property name="messageType" value="bookingReference"/>
+ </action>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction" name="ESBBrokerProcess_Broker__10_action_2" process="process">
+ <property name="operation" value="buy"/>
+ <property name="messageType" value="bookingReference"/>
+ <property name="clientRole" value="Buyer"/>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__11">
+ <listeners>
+ <jms-listener busidref="busId12" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__11"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.ReceiveMessageAction" name="ESBBrokerProcess_Broker__11_action_1" process="process">
+ <property name="operation" value="checkCredit"/>
+ <property name="messageType" value="CreditCheckInvalid"/>
+ </action>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction" name="ESBBrokerProcess_Broker__11_action_2" process="process">
+ <property name="operation" value="buy"/>
+ <property name="messageType" value="orderRejected"/>
+ <property name="clientRole" value="Buyer"/>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__12">
+ <listeners>
+ <jms-listener busidref="busId13" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__12"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.ReceiveMessageAction" name="ESBBrokerProcess_Broker__12_action_1" process="process">
+ <property name="operation" value="cancel"/>
+ <property name="messageType" value="cancel"/>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="checkCredit">
+ <listeners>
+ <jms-listener busidref="busId14" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-checkCredit"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SwitchAction" name="checkCredit_action_1" process="process">
+ <property name="paths">
+ <case service-category="org.pi4soa.esbbroker.esbbroker" service-name="ESBBrokerProcess_Broker__9">
+ <message type="CreditCheckOk"/>
+ </case>
+ <case service-category="org.pi4soa.esbbroker.esbbroker" service-name="ESBBrokerProcess_Broker__11">
+ <message type="CreditCheckInvalid"/>
+ </case>
+ </property>
+ </action>
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Added: cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/resources/jbmq-queue-service.xml
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/resources/jbmq-queue-service.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/resources/jbmq-queue-service.xml 2009-03-18 16:43:08 UTC (rev 544)
@@ -0,0 +1,86 @@
+<server>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__2">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__1">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__12">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_checkCredit">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__11">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__10">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__9">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__8">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__7">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__6">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__5">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__4">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_Broker__3">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+</server>
Added: cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/resources/log4j.xml
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/resources/log4j.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/brokerage/broker/stateless/src/main/resources/log4j.xml 2009-03-18 16:43:08 UTC (rev 544)
@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.10 2006/04/21 17:29:20 csuconic Exp $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A time/date based rolling appender -->
+ <appender name="FILE" class="org.apache.log4j.FileAppender">
+ <!--errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/-->
+ <param name="File" value="./broker.log"/>
+ <param name="Append" value="false"/>
+
+ <!-- Rollover at midnight each day -->
+ <param name="DatePattern" value="'.'yyyy-MM-dd"/>
+
+ <!-- Rollover at the top of each hour
+ <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
+ -->
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+
+ <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
+ <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
+ -->
+ </layout>
+ </appender>
+
+ <!-- A size based file rolling appender
+ <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="${jboss.server.log.dir}/server.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <!--errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/-->
+ <param name="Target" value="System.out"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ====================== -->
+ <!-- More Appender examples -->
+ <!-- ====================== -->
+
+ <!-- Buffer events and log them asynchronously
+ <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <appender-ref ref="FILE"/>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="SMTP"/>
+ </appender>
+ -->
+
+ <!-- EMail events to an administrator
+ <appender name="SMTP" class="org.apache.log4j.net.SMTPAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Threshold" value="ERROR"/>
+ <param name="To" value="admin(a)myhost.domain.com"/>
+ <param name="From" value="nobody(a)myhost.domain.com"/>
+ <param name="Subject" value="JBoss Sever Errors"/>
+ <param name="SMTPHost" value="localhost"/>
+ <param name="BufferSize" value="10"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- Syslog events
+ <appender name="SYSLOG" class="org.apache.log4j.net.SyslogAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Facility" value="LOCAL7"/>
+ <param name="FacilityPrinting" value="true"/>
+ <param name="SyslogHost" value="localhost"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- Log events to JMS (requires a topic to be created)
+ <appender name="JMS" class="org.apache.log4j.net.JMSAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Threshold" value="ERROR"/>
+ <param name="TopicConnectionFactoryBindingName" value="java:/ConnectionFactory"/>
+ <param name="TopicBindingName" value="topic/MyErrorsTopic"/>
+ </appender>
+ -->
+
+ <!-- Log events through SNMP
+ <appender name="TRAP_LOG" class="org.apache.log4j.ext.SNMPTrapAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="ImplementationClassName" value="org.apache.log4j.ext.JoeSNMPTrapSender"/>
+ <param name="ManagementHost" value="127.0.0.1"/>
+ <param name="ManagementHostTrapListenPort" value="162"/>
+ <param name="EnterpriseOID" value="1.3.6.1.4.1.24.0"/>
+ <param name="LocalIPAddress" value="127.0.0.1"/>
+ <param name="LocalTrapSendPort" value="161"/>
+ <param name="GenericTrapType" value="6"/>
+ <param name="SpecificTrapType" value="12345678"/>
+ <param name="CommunityString" value="public"/>
+ <param name="ForwardStackTraceWithTrap" value="true"/>
+ <param name="Threshold" value="DEBUG"/>
+ <param name="ApplicationTrapOID" value="1.3.6.1.4.1.24.12.10.22.64"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d,%p,[%t],[%c],%m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- Emit events as JMX notifications
+ <appender name="JMX" class="org.jboss.monitor.services.JMXNotificationAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+
+ <param name="Threshold" value="WARN"/>
+ <param name="ObjectName" value="jboss.system:service=Logging,type=JMXNotificationAppender"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%c] %m"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
+ <category name="org.apache">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit the org.jboss.serial (jboss-serialization) to INFO as its DEBUG is verbose -->
+ <category name="org.jboss.serial">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit the org.jgroups category to WARN as its INFO is verbose -->
+ <category name="org.jgroups">
+ <priority value="WARN"/>
+ </category>
+
+ <!-- Limit the jacorb category to WARN as its INFO is verbose -->
+ <category name="jacorb">
+ <priority value="WARN"/>
+ </category>
+
+
+ <!-- Limit the JSR77 categories -->
+ <category name="org.jboss.management">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit Axis based webservice category -->
+ <category name="org.jboss.webservice">
+ <priority value="DEBUG"/>
+ </category>
+ <category name="org.jboss.axis">
+ <priority value="INFO"/>
+ </category>
+
+ <category name="org.milyn">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.milyn.delivery.SmooksXML">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.milyn.delivery.serialize.Serializer">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.milyn.cdr.XMLConfigDigester">
+ <priority value="INFO"/>
+ </category>
+
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <priority value="INFO" />
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+ <!-- Clustering logging -->
+ <!-- Uncomment the following to redirect the org.jgroups and
+ org.jboss.ha categories to a cluster.log file.
+
+ <appender name="CLUSTER" class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="${jboss.server.log.dir}/cluster.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+ </layout>
+ </appender>
+ <category name="org.jgroups">
+ <priority value="DEBUG" />
+ <appender-ref ref="CLUSTER"/>
+ </category>
+ <category name="org.jboss.ha">
+ <priority value="DEBUG" />
+ <appender-ref ref="CLUSTER"/>
+ </category>
+ -->
+
+</log4j:configuration>
Added: cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/pom.xml
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/pom.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/pom.xml 2009-03-18 16:43:08 UTC (rev 544)
@@ -0,0 +1,60 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.soa.overlord.cdl.samples</groupId>
+ <artifactId>jbossesb-stateless-supplier</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jboss-esb</packaging>
+ <name>Overlord::CDL::Samples::Stateless::Supplier</name>
+ <url>http://www.jboss.org/overlord</url>
+
+ <parent>
+ <groupId>org.jboss.soa.overlord.cdl</groupId>
+ <artifactId>samples</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${log4j.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.soa.overlord.cdl.runtime</groupId>
+ <artifactId>cdl-runtime-jbossesb</artifactId>
+ <version>${cdl.jbossesb.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>supplier-stateless</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <!--Deploy esb artifact to JBoss AS/ESB -->
+ <execution>
+ <id>deploy</id>
+ <phase>install</phase>
+ <configuration>
+ <tasks>
+ <!--copy file="target/supplier-stateless.esb" todir="${deploy.dir}" overwrite="true" /-->
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
+
Added: cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/supplier/SetOrderConfirmResponseAction.java
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/supplier/SetOrderConfirmResponseAction.java (rev 0)
+++ cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/supplier/SetOrderConfirmResponseAction.java 2009-03-18 16:43:08 UTC (rev 544)
@@ -0,0 +1,43 @@
+package org.jboss.soa.overlord.samples.jbossesb.supplier;
+
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.overlord.jbossesb.XMLUtils;
+import org.w3c.dom.Node;
+
+/**
+ * @author jeffyu
+ *
+ */
+public class SetOrderConfirmResponseAction extends AbstractActionLifecycle {
+
+ private Logger logger = Logger.getLogger(SetOrderConfirmResponseAction.class);
+
+ private ConfigTree config;
+
+ public SetOrderConfirmResponseAction(ConfigTree config) {
+ this.config = config;
+ }
+
+ public Message process(Message message) throws Exception {
+ Node node = XMLUtils.getNode((String)message.getBody().get());
+
+ String idValue = node.getAttributes().getNamedItem("id").getNodeValue();
+ String quoteValue = node.getAttributes().getNamedItem("quoteValue").getNodeValue();
+
+ String supplierDesc = "{http://www.jboss.org/overlord/loanBroker}Supplier1";
+ String confirmation = "The quote of " + quoteValue + " has been confirmed.";
+
+ String body = "<bookingReference id=\"" + idValue + "\" supplierDesc = \""
+ + supplierDesc+ "\">"+confirmation +"</bookingReference>";
+
+ message.getBody().add(body);
+
+ logger.info("set 'bookingReference' of [" + body + "]");
+ return message;
+ }
+
+}
Added: cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/supplier/SetQuoteMessageAction.java
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/supplier/SetQuoteMessageAction.java (rev 0)
+++ cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/java/org/jboss/soa/overlord/samples/jbossesb/supplier/SetQuoteMessageAction.java 2009-03-18 16:43:08 UTC (rev 544)
@@ -0,0 +1,40 @@
+package org.jboss.soa.overlord.samples.jbossesb.supplier;
+
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.overlord.jbossesb.XMLUtils;
+import org.w3c.dom.Node;
+
+/**
+ * @author jeffyu
+ *
+ */
+public class SetQuoteMessageAction extends AbstractActionLifecycle {
+
+ private Logger logger = Logger.getLogger(SetQuoteMessageAction.class);
+
+ private ConfigTree config;
+
+ public SetQuoteMessageAction(ConfigTree config) {
+ this.config = config;
+ }
+
+ public Message process(Message message) throws Exception {
+ Node node = XMLUtils.getNode((String)message.getBody().get());
+
+ String idValue = node.getAttributes().getNamedItem("id").getNodeValue();
+ String supplierDesc = "{http://www.jboss.org/overlord/loanBroker}Supplier1";
+
+ String body = "<quote id=\"" + idValue + "\" supplierDesc = \""
+ + supplierDesc+ "\">10</quote>";
+
+ message.getBody().add(body);
+
+ logger.info("set 'quote' of [" + body + "]");
+ return message;
+ }
+
+}
Added: cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/resources/META-INF/deployment.xml
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/resources/META-INF/deployment.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/resources/META-INF/deployment.xml 2009-03-18 16:43:08 UTC (rev 544)
@@ -0,0 +1,6 @@
+<jbossesb-deployment>
+ <depends>org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_SupplierTxnProcessor</depends>
+ <depends>org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_SupplierTxnProcessor__1</depends>
+ <depends>org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_SupplierQuoteEngine</depends>
+ <depends>org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_SupplierQuoteEngine__1</depends>
+</jbossesb-deployment>
Added: cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/resources/META-INF/jboss-esb.xml
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/resources/META-INF/jboss-esb.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/resources/META-INF/jboss-esb.xml 2009-03-18 16:43:08 UTC (rev 544)
@@ -0,0 +1,89 @@
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml..." parameterReloadSecs="5000">
+ <providers>
+ <jms-provider connection-factory="ConnectionFactory" jndi-URL="localhost" jndi-context-factory="org.jnp.interfaces.NamingContextFactory" name="JBossMQ">
+ <jms-bus busid="busId1">
+ <jms-message-filter dest-name="queue/org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_SupplierTxnProcessor" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId2">
+ <jms-message-filter dest-name="queue/org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_SupplierTxnProcessor__1" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId3">
+ <jms-message-filter dest-name="queue/org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_SupplierQuoteEngine" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId4">
+ <jms-message-filter dest-name="queue/org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_SupplierQuoteEngine__1" dest-type="QUEUE"/>
+ </jms-bus>
+ </jms-provider>
+ </jms-provider>
+ </providers>
+ <services>
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_SupplierTxnProcessor">
+ <listeners>
+ <jms-listener busidref="busId1" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_SupplierTxnProcessor"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SwitchAction" name="ESBBrokerProcess_SupplierTxnProcessor_action_1" process="process">
+ <property name="serviceDescriptionName" value="{org.pi4soa.esbbroker.esbbroker}ESBBrokerProcess-SupplierTxnProcessor"/>
+ <property name="conversationType" value="overlord.cdl.samples.LoanBroker@SupplierTxnProcessor"/>
+ <property name="paths">
+ <case service-category="org.pi4soa.esbbroker.esbbroker" service-name="ESBBrokerProcess_SupplierTxnProcessor__1">
+ <message type="orderConfirmed"/>
+ </case>
+ </property>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_SupplierTxnProcessor__1">
+ <listeners>
+ <jms-listener busidref="busId2" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_SupplierTxnProcessor__1"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.ReceiveMessageAction" name="ESBBrokerProcess_SupplierTxnProcessor__1_action_1" process="process">
+ <property name="operation" value="confirm"/>
+ <property name="messageType" value="orderConfirmed"/>
+ </action>
+ <action class="org.jboss.soa.overlord.samples.jbossesb.supplier.SetOrderConfirmResponseAction" name="su-1">
+ </action>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction" name="ESBBrokerProcess_SupplierTxnProcessor__1_action_2" process="process">
+ <property name="operation" value="confirm"/>
+ <property name="messageType" value="bookingReference"/>
+ <property name="clientRole" value="Broker"/>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_SupplierQuoteEngine">
+ <listeners>
+ <jms-listener busidref="busId3" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_SupplierQuoteEngine"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SwitchAction" name="ESBBrokerProcess_SupplierQuoteEngine_action_1" process="process">
+ <property name="serviceDescriptionName" value="{org.pi4soa.esbbroker.esbbroker}ESBBrokerProcess-SupplierQuoteEngine"/>
+ <property name="conversationType" value="overlord.cdl.samples.LoanBroker@SupplierQuoteEngine"/>
+ <property name="paths">
+ <case service-category="org.pi4soa.esbbroker.esbbroker" service-name="ESBBrokerProcess_SupplierQuoteEngine__1">
+ <message type="requestForQuote"/>
+ </case>
+ </property>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_SupplierQuoteEngine__1">
+ <listeners>
+ <jms-listener busidref="busId4" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_SupplierQuoteEngine__1"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.ReceiveMessageAction" name="ESBBrokerProcess_SupplierQuoteEngine__1_action_1" process="process">
+ <property name="operation" value="getQuote"/>
+ <property name="messageType" value="requestForQuote"/>
+ </action>
+ <action class="org.jboss.soa.overlord.samples.jbossesb.supplier.SetQuoteMessageAction" name="su1-2">
+ </action>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction" name="ESBBrokerProcess_SupplierQuoteEngine__1_action_2" process="process">
+ <property name="operation" value="getQuote"/>
+ <property name="messageType" value="quote"/>
+ <property name="clientRole" value="Broker"/>
+ </action>
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Added: cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/resources/jbmq-queue-service.xml
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/resources/jbmq-queue-service.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/resources/jbmq-queue-service.xml 2009-03-18 16:43:08 UTC (rev 544)
@@ -0,0 +1,26 @@
+<server>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_SupplierTxnProcessor">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_SupplierTxnProcessor__1">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_SupplierQuoteEngine">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.esbbroker.esbbroker.destination:service=Queue,name=org_pi4soa_esbbroker_esbbroker_ESBBrokerProcess_SupplierQuoteEngine__1">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+</server>
Added: cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/resources/log4j.xml
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/resources/log4j.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/brokerage/supplier/stateless/src/main/resources/log4j.xml 2009-03-18 16:43:08 UTC (rev 544)
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A time/date based rolling appender -->
+ <appender name="FILE" class="org.apache.log4j.FileAppender">
+ <!--errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/-->
+ <param name="File" value="./supplier.log"/>
+ <param name="Append" value="false"/>
+
+ <!-- Rollover at midnight each day -->
+ <param name="DatePattern" value="'.'yyyy-MM-dd"/>
+
+ <!-- Rollover at the top of each hour
+ <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
+ -->
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+
+ <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
+ <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
+ -->
+ </layout>
+ </appender>
+
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <!--errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/-->
+ <param name="Target" value="System.out"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
+ <category name="org.apache">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit the org.jboss.serial (jboss-serialization) to INFO as its DEBUG is verbose -->
+ <category name="org.jboss.serial">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit the org.jgroups category to WARN as its INFO is verbose -->
+ <category name="org.jgroups">
+ <priority value="WARN"/>
+ </category>
+
+ <!-- Limit the jacorb category to WARN as its INFO is verbose -->
+ <category name="jacorb">
+ <priority value="WARN"/>
+ </category>
+
+
+ <!-- Limit the JSR77 categories -->
+ <category name="org.jboss.management">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit Axis based webservice category -->
+ <category name="org.jboss.webservice">
+ <priority value="DEBUG"/>
+ </category>
+ <category name="org.jboss.axis">
+ <priority value="INFO"/>
+ </category>
+
+ <category name="org.milyn">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.milyn.delivery.SmooksXML">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.milyn.delivery.serialize.Serializer">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.milyn.cdr.XMLConfigDigester">
+ <priority value="INFO"/>
+ </category>
+
+ <category name="org.jboss.soa.overlord">
+ <priority value="DEBUG" />
+ </category>
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <priority value="INFO" />
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+
+</log4j:configuration>
17 years, 4 months
Overlord SVN: r543 - cdl/trunk/distribution/validator/jbossesb/pi4soa.sar.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2009-03-18 07:24:11 -0400 (Wed, 18 Mar 2009)
New Revision: 543
Added:
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.cdl_2.0.0.200903181050.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.common_2.0.0.200903181050.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.j2ee_2.0.0.200903181050.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jboss_2.0.0.200903181050.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jbossesb_2.0.0.200903181050.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.service_2.0.0.200903181050.jar
Removed:
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.cdl_2.0.0.200903061741.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.common_2.0.0.200903061741.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.j2ee_2.0.0.200903061741.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jboss_2.0.0.200903061741.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jbossesb_2.0.0.200903061741.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.service_2.0.0.200903061741.jar
Log:
Update pi4soa jars
Deleted: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.cdl_2.0.0.200903061741.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.cdl_2.0.0.200903181050.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.cdl_2.0.0.200903181050.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.common_2.0.0.200903061741.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.common_2.0.0.200903181050.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.common_2.0.0.200903181050.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.j2ee_2.0.0.200903061741.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.j2ee_2.0.0.200903181050.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.j2ee_2.0.0.200903181050.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jboss_2.0.0.200903061741.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jboss_2.0.0.200903181050.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jboss_2.0.0.200903181050.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jbossesb_2.0.0.200903061741.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jbossesb_2.0.0.200903181050.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jbossesb_2.0.0.200903181050.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.service_2.0.0.200903061741.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.service_2.0.0.200903181050.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.service_2.0.0.200903181050.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 4 months
Overlord SVN: r542 - cdl/trunk/samples/jbossesb/brokerage/models.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2009-03-17 05:48:33 -0400 (Tue, 17 Mar 2009)
New Revision: 542
Modified:
cdl/trunk/samples/jbossesb/brokerage/models/ESBBroker.cdm
Log:
Temporary update to model - changed perform to sync.
Modified: cdl/trunk/samples/jbossesb/brokerage/models/ESBBroker.cdm
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/models/ESBBroker.cdm 2009-03-16 09:00:27 UTC (rev 541)
+++ cdl/trunk/samples/jbossesb/brokerage/models/ESBBroker.cdm 2009-03-17 09:48:33 UTC (rev 542)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="Cp1252"?>
-<org.pi4soa.cdl:Package xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:org.pi4soa.cdl="http:///org/pi4soa/cdl.ecore" description="The choreography description for ESBBroker" name="ESBBroker" author="gary" version="0.2" targetNamespace="http://www.pi4soa.org/ESBBroker">
+<org.pi4soa.cdl:Package xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:org.pi4soa.cdl="http:///org/pi4soa/cdl.ecore" description="The choreography description for ESBBroker" name="ESBBroker" author="gary" version="0.3" targetNamespace="http://www.pi4soa.org/ESBBroker">
<typeDefinitions>
<nameSpaces description="Target Namespace for ESBBroker" prefix="tns" uRI="http://www.pi4soa.org/ESBBroker"/>
<nameSpaces description="XML Schema Namespace" prefix="xsd" uRI="http://www.w3.org/2001/XMLSchema"/>
@@ -109,7 +109,7 @@
</activities>
<activities xsi:type="org.pi4soa.cdl:Choice">
<activities xsi:type="org.pi4soa.cdl:Sequence">
- <activities xsi:type="org.pi4soa.cdl:Perform" choreography="//@choreographies.0/(a)enclosedChoreographies.0" waitForCompletion="false">
+ <activities xsi:type="org.pi4soa.cdl:Perform" choreography="//@choreographies.0/(a)enclosedChoreographies.0">
<bindDetails name="BindBrokerChannel" thisVariable="//@choreographies.0/(a)variableDefinitions.0" thisRole="//@typeDefinitions/(a)roleTypes.1" freeVariable="//@choreographies.0/@enclosedChoreographies.0/(a)variableDefinitions.0" freeRole="//@typeDefinitions/(a)roleTypes.1"/>
<bindDetails name="BindBrokerChannel" thisVariable="//@choreographies.0/(a)variableDefinitions.0" thisRole="//@typeDefinitions/(a)roleTypes.0" freeVariable="//@choreographies.0/@enclosedChoreographies.0/(a)variableDefinitions.0" freeRole="//@typeDefinitions/(a)roleTypes.0"/>
</activities>
17 years, 4 months
Overlord SVN: r541 - in cdl/trunk/distribution/eclipse: features and 1 other directories.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2009-03-16 05:00:27 -0400 (Mon, 16 Mar 2009)
New Revision: 541
Added:
cdl/trunk/distribution/eclipse/features/org.jboss.tools.overlord.cdl.jbossesb.feature_1.0.0.200903160851.jar
cdl/trunk/distribution/eclipse/features/org.scribble.conversation.feature_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/features/org.scribble.experimental.feature_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/features/org.scribble.feature_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/features/org.scribble.java.feature_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/features/org.scribble.protocol.feature_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb_1.0.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.jboss.tools.overlord.cdl.validator.jbossesb_1.0.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.conformance_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.comparator_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.export.text_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.model_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.parser_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.projector_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.validation_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.core_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.designer_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.expression.xpath_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.lang.comparator_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.lang.java.parser_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.lang.model_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.osgi_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.comparator_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.export.text_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.model_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.parser_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.projector_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.validation_0.1.0.200903160851.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.type.java_0.1.0.200903160851.jar
Removed:
cdl/trunk/distribution/eclipse/features/org.jboss.tools.overlord.cdl.jbossesb.feature_1.0.0.200902182341.jar
cdl/trunk/distribution/eclipse/features/org.scribble.conversation.feature_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/features/org.scribble.experimental.feature_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/features/org.scribble.feature_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/features/org.scribble.java.feature_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/features/org.scribble.protocol.feature_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb_1.0.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.jboss.tools.overlord.cdl.validator.jbossesb_1.0.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.conformance_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.comparator_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.export.text_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.model_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.parser_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.projector_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.validation_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.core_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.designer_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.expression.xpath_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.lang.comparator_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.lang.java.parser_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.lang.model_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.osgi_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.comparator_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.export.text_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.model_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.parser_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.projector_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.validation_0.1.0.200902182341.jar
cdl/trunk/distribution/eclipse/plugins/org.scribble.type.java_0.1.0.200902182341.jar
Modified:
cdl/trunk/distribution/eclipse/site.xml
Log:
Updated plugin update site with fix from SOAG-94.
Deleted: cdl/trunk/distribution/eclipse/features/org.jboss.tools.overlord.cdl.jbossesb.feature_1.0.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/features/org.jboss.tools.overlord.cdl.jbossesb.feature_1.0.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/features/org.jboss.tools.overlord.cdl.jbossesb.feature_1.0.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/features/org.scribble.conversation.feature_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/features/org.scribble.conversation.feature_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/features/org.scribble.conversation.feature_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/features/org.scribble.experimental.feature_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/features/org.scribble.experimental.feature_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/features/org.scribble.experimental.feature_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/features/org.scribble.feature_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/features/org.scribble.feature_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/features/org.scribble.feature_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/features/org.scribble.java.feature_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/features/org.scribble.java.feature_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/features/org.scribble.java.feature_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/features/org.scribble.protocol.feature_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/features/org.scribble.protocol.feature_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/features/org.scribble.protocol.feature_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb_1.0.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb_1.0.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb_1.0.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.jboss.tools.overlord.cdl.validator.jbossesb_1.0.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.jboss.tools.overlord.cdl.validator.jbossesb_1.0.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.jboss.tools.overlord.cdl.validator.jbossesb_1.0.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.conformance_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.conformance_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.conformance_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.comparator_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.comparator_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.comparator_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.export.text_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.export.text_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.export.text_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.model_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.model_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.model_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.parser_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.parser_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.parser_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.projector_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.projector_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.projector_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.validation_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.validation_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.conversation.validation_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.core_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.core_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.core_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.designer_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.designer_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.designer_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.expression.xpath_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.expression.xpath_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.expression.xpath_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.lang.comparator_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.lang.comparator_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.lang.comparator_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.lang.java.parser_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.lang.java.parser_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.lang.java.parser_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.lang.model_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.lang.model_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.lang.model_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.osgi_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.osgi_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.osgi_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.comparator_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.comparator_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.comparator_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.export.text_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.export.text_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.export.text_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.model_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.model_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.model_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.parser_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.parser_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.parser_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.projector_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.projector_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.projector_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.validation_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.validation_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.protocol.validation_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/eclipse/plugins/org.scribble.type.java_0.1.0.200902182341.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/eclipse/plugins/org.scribble.type.java_0.1.0.200903160851.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/eclipse/plugins/org.scribble.type.java_0.1.0.200903160851.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: cdl/trunk/distribution/eclipse/site.xml
===================================================================
--- cdl/trunk/distribution/eclipse/site.xml 2009-03-16 07:49:15 UTC (rev 540)
+++ cdl/trunk/distribution/eclipse/site.xml 2009-03-16 09:00:27 UTC (rev 541)
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
- <feature url="features/org.scribble.conversation.feature_0.1.0.200902182341.jar" id="org.scribble.conversation.feature" version="0.1.0.200902182341">
+ <feature url="features/org.scribble.conversation.feature_0.1.0.200903160851.jar" id="org.scribble.conversation.feature" version="0.1.0.200903160851">
<category name="Common"/>
</feature>
- <feature url="features/org.scribble.experimental.feature_0.1.0.200902182341.jar" id="org.scribble.experimental.feature" version="0.1.0.200902182341">
+ <feature url="features/org.scribble.experimental.feature_0.1.0.200903160851.jar" id="org.scribble.experimental.feature" version="0.1.0.200903160851">
<category name="Common"/>
</feature>
- <feature url="features/org.scribble.feature_0.1.0.200902182341.jar" id="org.scribble.feature" version="0.1.0.200902182341">
+ <feature url="features/org.scribble.feature_0.1.0.200903160851.jar" id="org.scribble.feature" version="0.1.0.200903160851">
<category name="Common"/>
</feature>
- <feature url="features/org.scribble.java.feature_0.1.0.200902182341.jar" id="org.scribble.java.feature" version="0.1.0.200902182341">
+ <feature url="features/org.scribble.java.feature_0.1.0.200903160851.jar" id="org.scribble.java.feature" version="0.1.0.200903160851">
<category name="Common"/>
</feature>
- <feature url="features/org.scribble.protocol.feature_0.1.0.200902182341.jar" id="org.scribble.protocol.feature" version="0.1.0.200902182341">
+ <feature url="features/org.scribble.protocol.feature_0.1.0.200903160851.jar" id="org.scribble.protocol.feature" version="0.1.0.200903160851">
<category name="Common"/>
</feature>
- <feature url="features/org.jboss.tools.overlord.cdl.jbossesb.feature_1.0.0.200902182341.jar" id="org.jboss.tools.overlord.cdl.jbossesb.feature" version="1.0.0.200902182341">
+ <feature url="features/org.jboss.tools.overlord.cdl.jbossesb.feature_1.0.0.200903160851.jar" id="org.jboss.tools.overlord.cdl.jbossesb.feature" version="1.0.0.200903160851">
<category name="JBossESB"/>
</feature>
<category-def name="JBossESB" label="JBossESB">
17 years, 4 months
Overlord SVN: r540 - in cdl/trunk/samples/jbossesb: client/src and 5 other directories.
by overlord-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2009-03-16 03:49:15 -0400 (Mon, 16 Mar 2009)
New Revision: 540
Modified:
cdl/trunk/samples/jbossesb/client/lib/jbossesb-rosetta.jar
cdl/trunk/samples/jbossesb/client/src/com/acme/services/buyer/BuyerClient.java
cdl/trunk/samples/jbossesb/client/src/jbossesb-properties.xml
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/META-INF/jboss-esb.xml
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/jbmq-queue-service.xml
cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/META-INF/jboss-esb.xml
cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/jbmq-queue-service.xml
Log:
[SOAG-92] Finish the purchasing example.
Modified: cdl/trunk/samples/jbossesb/client/lib/jbossesb-rosetta.jar
===================================================================
(Binary files differ)
Modified: cdl/trunk/samples/jbossesb/client/src/com/acme/services/buyer/BuyerClient.java
===================================================================
--- cdl/trunk/samples/jbossesb/client/src/com/acme/services/buyer/BuyerClient.java 2009-03-15 16:13:48 UTC (rev 539)
+++ cdl/trunk/samples/jbossesb/client/src/com/acme/services/buyer/BuyerClient.java 2009-03-16 07:49:15 UTC (rev 540)
@@ -41,7 +41,7 @@
System.setProperty("javax.xml.registry.ConnectionFactoryClass", regClass);
try {
- storeInvoker = new ServiceInvoker("PurchaseGoods.Store", "Store.main");
+ storeInvoker = new ServiceInvoker("org.pi4soa.purchase.purchasegoods", "PurchaseGoodsProcess_Store");
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("Failed to create ServiceInvoker", e);
Modified: cdl/trunk/samples/jbossesb/client/src/jbossesb-properties.xml
===================================================================
--- cdl/trunk/samples/jbossesb/client/src/jbossesb-properties.xml 2009-03-15 16:13:48 UTC (rev 539)
+++ cdl/trunk/samples/jbossesb/client/src/jbossesb-properties.xml 2009-03-16 07:49:15 UTC (rev 540)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
JBoss, Home of Professional Open Source
- Copyright 2008, JBoss Inc., and others contributors as indicated
+ Copyright 2006, JBoss Inc., 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.
@@ -16,7 +16,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
- (C) 2008,
+ (C) 2005-2006,
@author JBoss Inc.
-->
<!-- $Id: jbossesb-unittest-properties.xml $ -->
@@ -34,6 +34,7 @@
<property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
<property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
<property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/META-INF/jboss-esb.xml
===================================================================
--- cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/META-INF/jboss-esb.xml 2009-03-15 16:13:48 UTC (rev 539)
+++ cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/META-INF/jboss-esb.xml 2009-03-16 07:49:15 UTC (rev 540)
@@ -16,12 +16,12 @@
</jms-provider>
</providers>
<services>
- <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_CreditAgency">
+ <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_CreditAgency" description="">
<listeners>
<jms-listener busidref="busId1" maxThreads="1" name="esb-stateless-creditAgency"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SwitchAction">
+ <action name="c1" process="process" class="org.jboss.soa.overlord.jbossesb.stateless.actions.SwitchAction">
<property name="serviceDescriptionName" value="{org.pi4soa.purchase.purchasegoods}PurchaseGoodsProcess-CreditAgency"/>
<property name="conversationType" value="overlord.cdl.samples.Common@CreditAgency"/>
<property name="paths">
@@ -32,16 +32,16 @@
</action>
</actions>
</service>
- <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_CreditAgency__1">
+ <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_CreditAgency__1" description="">
<listeners>
<jms-listener busidref="busId2" maxThreads="1" name="esb-stateless-creditAgency1"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.ReceiveMessageAction">
+ <action name="c2" process="process" class="org.jboss.soa.overlord.jbossesb.stateless.actions.ReceiveMessageAction">
<property name="operation" value="checkCredit"/>
<property name="messageType" value="CreditCheckRequest"/>
</action>
- <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.IfAction">
+ <action name="c3" process="process" class="org.jboss.soa.overlord.jbossesb.stateless.actions.IfAction">
<property name="paths">
<if service-category="org.pi4soa.purchase.purchasegoods" service-name="PurchaseGoodsProcess_CreditAgency__2" decision-class="com.acme.services.creditAgency.CreditAgencyDecision"/>
<else service-category="org.pi4soa.purchase.purchasegoods" service-name="PurchaseGoodsProcess_CreditAgency__3"/>
@@ -49,24 +49,24 @@
</action>
</actions>
</service>
- <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_CreditAgency__2">
+ <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_CreditAgency__2" description="">
<listeners>
<jms-listener busidref="busId3" maxThreads="1" name="esb-stateless-creditAgency2"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction">
+ <action name="c4" process="process" class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction">
<property name="operation" value="checkCredit"/>
<property name="messageType" value="CreditCheckOk"/>
<property name="clientRole" value="Store"/>
</action>
</actions>
</service>
- <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_CreditAgency__3">
+ <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_CreditAgency__3" description="">
<listeners>
<jms-listener busidref="busId4" maxThreads="1" name="esb-stateless-creditAgency3"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction">
+ <action name="c5" process="process" class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction">
<property name="operation" value="checkCredit"/>
<property name="messageType" value="CreditCheckInvalid"/>
<property name="clientRole" value="Store"/>
Modified: cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/jbmq-queue-service.xml
===================================================================
--- cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/jbmq-queue-service.xml 2009-03-15 16:13:48 UTC (rev 539)
+++ cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/jbmq-queue-service.xml 2009-03-16 07:49:15 UTC (rev 540)
@@ -7,6 +7,12 @@
</depends>
</mbean>
<mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.gen.destination:service=Queue,name=esb-stateless-creditAgency_reply">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+</mbean>
+<mbean code="org.jboss.mq.server.jmx.Queue"
name="jboss.esb.gen.destination:service=Queue,name=esb-stateless-creditAgency1">
<depends optional-attribute-name="DestinationManager">
jboss.mq:service=DestinationManager
Modified: cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/META-INF/jboss-esb.xml
===================================================================
--- cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/META-INF/jboss-esb.xml 2009-03-15 16:13:48 UTC (rev 539)
+++ cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/META-INF/jboss-esb.xml 2009-03-16 07:49:15 UTC (rev 540)
@@ -19,12 +19,12 @@
</jms-provider>
</providers>
<services>
- <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_Store">
+ <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_Store" description="">
<listeners>
<jms-listener busidref="busId1" maxThreads="1" name="org.pi4soa.purchase.purchasegoods-PurchaseGoodsProcess_Store"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SwitchAction">
+ <action name="s1" process="process" class="org.jboss.soa.overlord.jbossesb.stateless.actions.SwitchAction">
<property name="serviceDescriptionName" value="{org.pi4soa.purchase.purchasegoods}PurchaseGoodsProcess-Store"/>
<property name="conversationType" value="overlord.cdl.samples.Purchasing@Store"/>
<property name="paths">
@@ -35,16 +35,16 @@
</action>
</actions>
</service>
- <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_Store__1">
+ <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_Store__1" description="">
<listeners>
<jms-listener busidref="busId2" maxThreads="1" name="org.pi4soa.purchase.purchasegoods-PurchaseGoodsProcess_Store__1"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.ReceiveMessageAction">
+ <action name="s2" process="process" class="org.jboss.soa.overlord.jbossesb.stateless.actions.ReceiveMessageAction">
<property name="operation" value="buy"/>
<property name="messageType" value="BuyRequest"/>
</action>
- <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction">
+ <action name="s3" process="process" class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction">
<property name="operation" value="checkCredit"/>
<property name="messageType" value="CreditCheckRequest"/>
<property name="serviceCategory" value="org.pi4soa.purchase.purchasegoods"/>
@@ -54,44 +54,44 @@
</action>
</actions>
</service>
- <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_Store__2">
+ <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_Store__2" description="">
<listeners>
<jms-listener busidref="busId3" maxThreads="1" name="org.pi4soa.purchase.purchasegoods-PurchaseGoodsProcess_Store__2"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.ReceiveMessageAction">
+ <action name="s4" process="process" class="org.jboss.soa.overlord.jbossesb.stateless.actions.ReceiveMessageAction">
<property name="operation" value="checkCredit"/>
<property name="messageType" value="CreditCheckOk"/>
</action>
- <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction">
+ <action name="s5" process="process" class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction">
<property name="operation" value="buy"/>
<property name="messageType" value="BuyConfirmed"/>
<property name="clientRole" value="Buyer"/>
</action>
</actions>
</service>
- <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_Store__3">
+ <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_Store__3" description="">
<listeners>
<jms-listener busidref="busId4" maxThreads="1" name="org.pi4soa.purchase.purchasegoods-PurchaseGoodsProcess_Store__3"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.ReceiveMessageAction">
+ <action name="s6" process="process" class="org.jboss.soa.overlord.jbossesb.stateless.actions.ReceiveMessageAction">
<property name="operation" value="checkCredit"/>
<property name="messageType" value="CreditCheckInvalid"/>
</action>
- <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction">
+ <action name="s7" process="process" class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction">
<property name="operation" value="buy"/>
<property name="messageType" value="BuyFailed"/>
<property name="clientRole" value="Buyer"/>
</action>
</actions>
</service>
- <service category="org.pi4soa.purchase.purchasegoods" name="checkCredit">
+ <service category="org.pi4soa.purchase.purchasegoods" name="checkCredit" description="">
<listeners>
<jms-listener busidref="busId5" maxThreads="1" name="org.pi4soa.purchase.purchasegoods-checkCredit"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SwitchAction">
+ <action name="s8" process="process" class="org.jboss.soa.overlord.jbossesb.stateless.actions.SwitchAction">
<property name="paths">
<case service-category="org.pi4soa.purchase.purchasegoods" service-name="PurchaseGoodsProcess_Store__2">
<message type="CreditCheckOk"/>
Modified: cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/jbmq-queue-service.xml
===================================================================
--- cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/jbmq-queue-service.xml 2009-03-15 16:13:48 UTC (rev 539)
+++ cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/jbmq-queue-service.xml 2009-03-16 07:49:15 UTC (rev 540)
@@ -24,6 +24,12 @@
</depends>
</mbean>
<mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.purchase.purchasegoods.destination:service=Queue,name=org_pi4soa_purchase_purchasegoods_PurchaseGoodsProcess_Store_reply">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
name="org.pi4soa.purchase.purchasegoods.destination:service=Queue,name=org_pi4soa_purchase_purchasegoods_checkCredit">
<depends optional-attribute-name="DestinationManager">
jboss.mq:service=DestinationManager
17 years, 4 months
Overlord SVN: r539 - in cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb: src and 16 other directories.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2009-03-15 12:13:48 -0400 (Sun, 15 Mar 2009)
New Revision: 539
Added:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/GeneratorTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/TypeMapperTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/results/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/testmodels/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/CreateSessionActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/IfActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/MessageRouterActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ParallelActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/PerformActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ReceiveMessageActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/RetrieveSessionActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ScheduleStateActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SendMessageActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetMessageActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetStateActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SwitchActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhenActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhileActionTest.java
Removed:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/GeneratorTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/TypeMapperTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/results/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/testmodels/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/CreateSessionActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/IfActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/MessageRouterActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ParallelActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/PerformActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ReceiveMessageActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/RetrieveSessionActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ScheduleStateActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SendMessageActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetMessageActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetStateActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SwitchActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhenActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhileActionTest.java
Modified:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/.classpath
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBService.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractESBAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/results/ESBBrokerProcess(a)Broker.jboss-esb.xml
Log:
SOAG-94 - fixed issue with missing attributes on the service and action elements. Also moved some of the unit tests - some were specific to stateful actions, so moved into a 'stateful' sub-packages, and others require a plugin test to be launched, so need to be separate out.
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/.classpath
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/.classpath 2009-03-13 07:34:38 UTC (rev 538)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/.classpath 2009-03-15 16:13:48 UTC (rev 539)
@@ -2,6 +2,7 @@
<classpath>
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="src" path="src/test"/>
+ <classpathentry kind="src" path="src/plugintest"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBService.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBService.java 2009-03-13 07:34:38 UTC (rev 538)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBService.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -33,11 +33,14 @@
*/
public class DefaultESBService extends ModelObject implements ESBService {
+ private static final long serialVersionUID = 1266018368857224091L;
+
public static final String LISTENERS_ELEMENT = "listeners";
public static final String BUSIDREF_ATTR = "busidref";
public static final String JMS_LISTENER_ELEMENT = "jms-listener";
public static final String MAX_THREADS_ATTR = "maxThreads";
public static final String NAME_ATTR = "name";
+ public static final String DESCRIPTION_ATTR = "description";
public static final String CATEGORY_ATTR = "category";
public static final String ROOT_PROPERTY = "root";
public static final String BUSINESS_OBJECT_TYPE_PROPERTY = "session";
@@ -90,6 +93,7 @@
m_service.setAttribute(CATEGORY_ATTR, category);
m_service.setAttribute(NAME_ATTR, name);
+ m_service.setAttribute(DESCRIPTION_ATTR, "");
m_actionsElem = m_model.getESBConfiguration().
getOwnerDocument().createElement(ACTIONS_ELEMENT);
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractESBAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractESBAction.java 2009-03-13 07:34:38 UTC (rev 538)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractESBAction.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -40,7 +40,8 @@
public static final String VALUE_ATTR = "value";
public static final String NAME_ATTR = "name";
public static final String PROPERTY_ELEMENT = "property";
- public static final String CLASS_PROPERTY = "class";
+ public static final String CLASS_ATTR = "class";
+ public static final String PROCESS_ATTR = "process";
/**
* The constructor for initializing the action based on
@@ -73,8 +74,13 @@
m_action = service.getService().
getOwnerDocument().createElement(ACTION_ELEMENT);
- m_action.setAttribute(CLASS_PROPERTY, actionClass);
+ m_action.setAttribute(CLASS_ATTR, actionClass);
+ m_action.setAttribute(PROCESS_ATTR, "process");
+
+ m_action.setAttribute(NAME_ATTR, service.getName()+"_action_"+
+ (service.getActions().size()+1));
+
getSource().setObject(this);
}
@@ -322,7 +328,7 @@
String ret=null;
if (m_action != null) {
- ret = m_action.getAttribute(CLASS_PROPERTY);
+ ret = m_action.getAttribute(CLASS_ATTR);
}
return(ret);
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/GeneratorTest.java (from rev 531, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/GeneratorTest.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/GeneratorTest.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/GeneratorTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -0,0 +1,348 @@
+/*
+ * 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.runtime.jbossesb.generator;
+
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.scribble.conversation.model.*;
+import org.scribble.extensions.RegistryFactory;
+import org.scribble.model.ModelReference;
+import org.scribble.model.change.ModelGenerator;
+import org.w3c.dom.Node;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+
+import junit.framework.*;
+
+public class GeneratorTest extends TestCase {
+
+ public static TestSuite suite() {
+ TestSuite suite = new TestSuite("Conversation->jboss-esb.xml Generator Tests");
+ suite.addTest(new ConversationToJBossESBTest("ESBBrokerProcess@Broker"));
+ return suite;
+ }
+
+ /**
+ * The test case for running the conversation to jboss-esb.xml test.
+ */
+ protected static class ConversationToJBossESBTest extends TestCase {
+
+ /**
+ * This constructor is initialized with the test
+ * name.
+ *
+ * @param name The test name
+ */
+ public ConversationToJBossESBTest(String name) {
+ super(name);
+ m_name = name;
+ }
+
+ /**
+ * This method runs the test.
+ *
+ * @param result The test result
+ */
+ public void run(TestResult result) {
+ result.startTest(this);
+
+ String filename="testmodels/"+m_name+".scv";
+
+ java.io.InputStream is=
+ GeneratorTest.class.getResourceAsStream(filename);
+
+ if (is == null) {
+ result.addError(this,
+ new Throwable("Unable to locate resource: "+filename));
+ } else {
+ org.scribble.parser.Parser p=new org.scribble.conversation.parser.ConversationParser();
+ org.scribble.model.ModelReference ref=
+ new org.scribble.model.ModelReference(ConversationNotation.NOTATION_CODE);
+ org.scribble.model.admin.DefaultModelListener l=
+ new org.scribble.model.admin.DefaultModelListener();
+
+ org.scribble.model.Model model=p.parse(ref, is, l);
+
+ if (model == null) {
+ result.addError(this, new Throwable("Model is null"));
+
+ } else if ((model instanceof ConversationModel) == false) {
+ result.addError(this, new Throwable("Model is null"));
+
+ } else if (l.getErrors().size() != 0) {
+ result.addError(this, new Throwable("Failed to parse Conversation Model"));
+
+ for (int i=0; i < l.getErrors().size(); i++) {
+ System.err.println("ModelIssue: "+
+ l.getErrors().get(i).getMessage());
+ }
+ } else {
+ ConversationModel cm=(ConversationModel)model;
+
+ ModelGenerator generator=(ModelGenerator)
+ RegistryFactory.getRegistry().getExtension(
+ ModelGenerator.class, null);
+
+ if (generator != null) {
+ ModelReference targetRef=
+ new ModelReference(JBossESBNotation.NOTATION_CODE);
+
+ DefaultESBLanguageModel target=
+ new DefaultESBLanguageModel(targetRef,
+ cm.getConversation().isStateless());
+
+ generator.generate(targetRef,
+ model.getModelName().getLocatedRole(),
+ target, model);
+
+ if (target.getESBConfiguration() != null) {
+ try {
+ String text=getText(target.getESBConfiguration(), true);
+
+ checkResults(result, text);
+ } catch(Exception e) {
+ result.addError(this, e);
+ }
+ } else {
+ result.addError(this,
+ new Throwable("No jboss-esb.xml generated"));
+ }
+
+ } else {
+ result.addError(this,
+ new Throwable("Unable to find Model Generator"));
+ }
+ }
+ }
+
+ result.endTest(this);
+ }
+
+ /**
+ * This method checks the generated jboss-esb.xml against a
+ * previously stored correct version.
+ *
+ * @param result The test result
+ * @param esbconfig The ESB configuration
+ */
+ protected void checkResults(TestResult result, String esbconfig) {
+
+ String filename="results/"+m_name+".jboss-esb.xml";
+
+ java.io.InputStream is=
+ GeneratorTest.class.getResourceAsStream(filename);
+
+ if (is != null) {
+
+ try {
+ byte[] b=new byte[is.available()];
+
+ is.read(b);
+
+ is.close();
+
+ String orig=new String(b);
+
+ if (orig.equals(esbconfig) == false) {
+ result.addError(this,
+ new Throwable("Generated ESB configuration does not match stored version"));
+
+ System.out.println("COMPARED GENERATED:");
+ System.out.println(esbconfig);
+ System.out.println("WITH ORIGINAL:");
+ System.out.println(orig);
+ }
+ } catch(Exception e) {
+ result.addError(this, e);
+ }
+ } else {
+ result.addError(this,
+ new Throwable("Resulting ESB configuration '"+filename+
+ "' not found for comparison"));
+ }
+ }
+
+ /**
+ * This class converts a DOM representation node to
+ * text with appropriate presentation formatting.
+ *
+ * @param node The DOM node
+ * @param pretty Whether to format the text for presentation
+ * @return The text
+ * @throws Exception Failed to convert
+ */
+ public static String getText(Node node, boolean pretty) throws Exception {
+ String ret=getText(node);
+
+ if (pretty) {
+ ret = reformat(ret);
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method reformats the XML text for presentation.
+ *
+ * @param xmltext The original XML text
+ * @return The reformatted text
+ */
+ protected static String reformat(String xmltext) {
+ String ret=xmltext;
+ int pos=0;
+ int prevpos=0;
+ StringBuffer buf=new StringBuffer();
+ int level=0;
+
+ while ((pos=ret.indexOf('<', prevpos)) != -1) {
+
+ if (prevpos < pos &&
+ ret.substring(prevpos, pos).trim().length() > 0 &&
+ ret.charAt(prevpos-1) != '?') {
+
+ if (ret.charAt(prevpos) == '\r' &&
+ ret.charAt(prevpos+1) == '\n') {
+ prevpos += 2;
+ }
+ for (int i=0; i < level; i++) {
+ buf.append(" ");
+ }
+
+ buf.append(ret.substring(prevpos, pos).trim());
+ buf.append("\r\n");
+ }
+
+ int endpos=ret.indexOf('>', pos);
+
+ if (endpos > 0) {
+ boolean noreturn=false;
+
+ if (pos > 0 && ret.charAt(pos+1) == '/') {
+ level--;
+ }
+
+ for (int i=0; i < level; i++) {
+ buf.append(" ");
+ }
+ buf.append(ret.substring(pos, endpos+1));
+
+ if (ret.charAt(endpos-1)== '?') {
+ //noreturn = true;
+
+ } else if (ret.charAt(endpos-1) == '/') {
+ // Ignore
+ } else if (pos > 0 && ret.charAt(pos+1) == '/') {
+ // Ignore
+
+ } else if (pos > 0 && ret.charAt(pos+1) == '!') {
+ // Ignore
+
+ } else {
+ level++;
+ }
+
+ if (noreturn == false) {
+ buf.append("\r\n");
+ }
+
+ pos = endpos+1;
+ }
+
+ prevpos = pos;
+ }
+
+ if (prevpos != -1 &&
+ ret.substring(prevpos).trim().length() > 0) {
+ buf.append(ret.substring(prevpos));
+ }
+
+ ret = buf.toString();
+
+ return(ret);
+ }
+
+ /**
+ * This class converts a DOM representation node to
+ * text.
+ *
+ * @param node The DOM node
+ * @return The text
+ * @throws Exception Failed to convert
+ */
+ public static String getText(Node node) throws Exception {
+ String ret=null;
+
+ try {
+ // Transform the DOM represent to text
+ java.io.ByteArrayOutputStream xmlstr=
+ new java.io.ByteArrayOutputStream();
+
+ DOMSource source=new DOMSource();
+ source.setNode(node);
+
+ StreamResult result=new StreamResult(xmlstr);
+
+ Transformer trans=
+ TransformerFactory.newInstance().newTransformer();
+ trans.transform(source, result);
+
+ xmlstr.close();
+
+ ret = new String(xmlstr.toByteArray());
+
+ if ((node instanceof org.w3c.dom.Document) == false) {
+
+ // Strip off any <?xml> header
+ int index=ret.indexOf("<?xml");
+ if (index != -1) {
+ index = ret.indexOf("<", 1);
+
+ if (index != -1) {
+ ret = ret.substring(index);
+ } else {
+ index = ret.indexOf("?>");
+
+ if (index != -1) {
+ index += 2;
+
+ // Remove any trailing whitespaces
+ // after XML header
+ while (index < ret.length() &&
+ Character.isWhitespace(ret.charAt(index))) {
+ index++;
+ }
+
+ ret = ret.substring(index);
+ }
+ }
+ }
+ }
+
+ } catch(Exception e) {
+ throw new Exception("Failed to transform " +
+ "DOM representation into text", e);
+ }
+
+ return(ret);
+ }
+
+ private String m_name=null;
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/GeneratorTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/TypeMapperTest.java (from rev 531, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/TypeMapperTest.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/TypeMapperTest.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/TypeMapperTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -0,0 +1,122 @@
+/*
+ * 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.runtime.jbossesb.generator;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.generator.TypeMapper;
+
+import junit.framework.TestCase;
+
+public class TypeMapperTest extends TestCase {
+
+ public void testGetJavaTypeCustomClass() {
+ String pack="org.acme.service";
+ String namespace=TypeMapper.JAVA_PREFIX+pack;
+ String localpart="Message";
+ String clsName=pack+"."+localpart;
+
+ String type=TypeMapper.getJavaType(namespace, localpart);
+
+ if (type == null) {
+ fail("Type not returned");
+ }
+
+ if (type.equals(clsName) == false) {
+ fail("Expecting '"+clsName+"', but got: "+type);
+ }
+ }
+
+ public void testGetJavaTypeDOMElement() {
+ String namespace="http://www.jboss.org/example";
+ String localpart="Message";
+ String clsName=org.w3c.dom.Element.class.getName();
+
+ String type=TypeMapper.getJavaType(namespace, localpart);
+
+ if (type == null) {
+ fail("Type not returned");
+ }
+
+ if (type.equals(clsName) == false) {
+ fail("Expecting '"+clsName+"', but got: "+type);
+ }
+ }
+
+ public void testGetJavaTypeXSDString() {
+ String namespace=TypeMapper.XSD_NAMESPACE;
+ String localpart="string";
+ String clsName=String.class.getName();
+
+ String type=TypeMapper.getJavaType(namespace, localpart);
+
+ if (type == null) {
+ fail("Type not returned");
+ }
+
+ if (type.equals(clsName) == false) {
+ fail("Expecting '"+clsName+"', but got: "+type);
+ }
+ }
+
+ public void testGetJavaTypeXSDBoolean() {
+ String namespace=TypeMapper.XSD_NAMESPACE;
+ String localpart="boolean";
+ String clsName="boolean";
+
+ String type=TypeMapper.getJavaType(namespace, localpart);
+
+ if (type == null) {
+ fail("Type not returned");
+ }
+
+ if (type.equals(clsName) == false) {
+ fail("Expecting '"+clsName+"', but got: "+type);
+ }
+ }
+
+ public void testGetJavaTypeXSDDecimal() {
+ String namespace=TypeMapper.XSD_NAMESPACE;
+ String localpart="decimal";
+ String clsName="int";
+
+ String type=TypeMapper.getJavaType(namespace, localpart);
+
+ if (type == null) {
+ fail("Type not returned");
+ }
+
+ if (type.equals(clsName) == false) {
+ fail("Expecting '"+clsName+"', but got: "+type);
+ }
+ }
+
+ public void testGetJavaTypeXSDInteger() {
+ String namespace=TypeMapper.XSD_NAMESPACE;
+ String localpart="integer";
+ String clsName="int";
+
+ String type=TypeMapper.getJavaType(namespace, localpart);
+
+ if (type == null) {
+ fail("Type not returned");
+ }
+
+ if (type.equals(clsName) == false) {
+ fail("Expecting '"+clsName+"', but got: "+type);
+ }
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/TypeMapperTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/results (from rev 531, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/results)
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/results
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/results/ESBBrokerProcess(a)Broker.jboss-esb.xml
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/results/ESBBrokerProcess(a)Broker.jboss-esb.xml 2009-03-02 14:05:59 UTC (rev 531)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/results/ESBBrokerProcess(a)Broker.jboss-esb.xml 2009-03-15 16:13:48 UTC (rev 539)
@@ -46,12 +46,12 @@
</jms-provider>
</providers>
<services>
- <service category="org.pi4soa.esbbroker.esbbroker" name="ESBBrokerProcess_Broker">
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker">
<listeners>
<jms-listener busidref="busId1" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SwitchAction">
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SwitchAction" name="ESBBrokerProcess_Broker_action_1" process="process">
<property name="serviceDescriptionName" value="{org.pi4soa.esbbroker.esbbroker}ESBBrokerProcess-Broker"/>
<property name="conversationType" value="overlord.cdl.samples.LoanBroker@Broker"/>
<property name="paths">
@@ -71,16 +71,16 @@
</action>
</actions>
</service>
- <service category="org.pi4soa.esbbroker.esbbroker" name="ESBBrokerProcess_Broker__1">
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__1">
<listeners>
<jms-listener busidref="busId2" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__1"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.ReceiveMessageAction">
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.ReceiveMessageAction" name="ESBBrokerProcess_Broker__1_action_1" process="process">
<property name="operation" value="makeEnquiry"/>
<property name="messageType" value="enquiry"/>
</action>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.IfAction">
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.IfAction" name="ESBBrokerProcess_Broker__1_action_2" process="process">
<property name="paths">
<if service-category="org.pi4soa.esbbroker.esbbroker" service-name="ESBBrokerProcess_Broker__2"/>
<else service-category="org.pi4soa.esbbroker.esbbroker" service-name="ESBBrokerProcess_Broker__3"/>
@@ -88,12 +88,12 @@
</action>
</actions>
</service>
- <service category="org.pi4soa.esbbroker.esbbroker" name="ESBBrokerProcess_Broker__2">
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__2">
<listeners>
<jms-listener busidref="busId3" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__2"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SendMessageAction">
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SendMessageAction" name="ESBBrokerProcess_Broker__2_action_1" process="process">
<property name="operation" value="getQuote"/>
<property name="messageType" value="requestForQuote"/>
<property name="serviceCategory" value=""/>
@@ -103,22 +103,22 @@
</action>
</actions>
</service>
- <service category="org.pi4soa.esbbroker.esbbroker" name="ESBBrokerProcess_Broker__3">
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__3">
<listeners>
<jms-listener busidref="busId4" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__3"/>
</listeners>
<actions/>
</service>
- <service category="org.pi4soa.esbbroker.esbbroker" name="getQuote">
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="getQuote">
<listeners>
<jms-listener busidref="busId5" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__4"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.ReceiveMessageAction">
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.ReceiveMessageAction" name="ESBBrokerProcess_Broker__4_action_1" process="process">
<property name="operation" value="getQuote"/>
<property name="messageType" value="quote"/>
</action>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.IfAction">
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.IfAction" name="ESBBrokerProcess_Broker__4_action_2" process="process">
<property name="paths">
<if service-category="org.pi4soa.esbbroker.esbbroker" service-name="ESBBrokerProcess_Broker__5"/>
<else service-category="org.pi4soa.esbbroker.esbbroker" service-name="ESBBrokerProcess_Broker__6"/>
@@ -126,12 +126,12 @@
</action>
</actions>
</service>
- <service category="org.pi4soa.esbbroker.esbbroker" name="ESBBrokerProcess_Broker__5">
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__5">
<listeners>
<jms-listener busidref="busId6" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__5"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SendMessageAction">
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SendMessageAction" name="ESBBrokerProcess_Broker__5_action_1" process="process">
<property name="operation" value="getQuote"/>
<property name="messageType" value="requestForQuote"/>
<property name="serviceCategory" value=""/>
@@ -141,34 +141,34 @@
</action>
</actions>
</service>
- <service category="org.pi4soa.esbbroker.esbbroker" name="ESBBrokerProcess_Broker__6">
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__6">
<listeners>
<jms-listener busidref="busId7" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__6"/>
</listeners>
<actions/>
</service>
- <service category="org.pi4soa.esbbroker.esbbroker" name="ESBBrokerProcess_Broker__7">
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__7">
<listeners>
<jms-listener busidref="busId8" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__7"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SendMessageAction">
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SendMessageAction" name="ESBBrokerProcess_Broker__7_action_1" process="process">
<property name="operation" value="makeEnquiry"/>
<property name="messageType" value="quoteList"/>
<property name="clientRole" value="Buyer"/>
</action>
</actions>
</service>
- <service category="org.pi4soa.esbbroker.esbbroker" name="ESBBrokerProcess_Broker__8">
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__8">
<listeners>
<jms-listener busidref="busId9" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__8"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.ReceiveMessageAction">
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.ReceiveMessageAction" name="ESBBrokerProcess_Broker__8_action_1" process="process">
<property name="operation" value="buy"/>
<property name="messageType" value="buy"/>
</action>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SendMessageAction">
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SendMessageAction" name="ESBBrokerProcess_Broker__8_action_2" process="process">
<property name="operation" value="checkCredit"/>
<property name="messageType" value="CreditCheckRequest"/>
<property name="serviceCategory" value=""/>
@@ -178,16 +178,16 @@
</action>
</actions>
</service>
- <service category="org.pi4soa.esbbroker.esbbroker" name="ESBBrokerProcess_Broker__9">
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__9">
<listeners>
<jms-listener busidref="busId10" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__9"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.ReceiveMessageAction">
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.ReceiveMessageAction" name="ESBBrokerProcess_Broker__9_action_1" process="process">
<property name="operation" value="checkCredit"/>
<property name="messageType" value="CreditCheckOk"/>
</action>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SendMessageAction">
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SendMessageAction" name="ESBBrokerProcess_Broker__9_action_2" process="process">
<property name="operation" value="confirm"/>
<property name="messageType" value="orderConfirmed"/>
<property name="serviceCategory" value=""/>
@@ -197,55 +197,55 @@
</action>
</actions>
</service>
- <service category="org.pi4soa.esbbroker.esbbroker" name="confirm">
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="confirm">
<listeners>
<jms-listener busidref="busId11" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__10"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.ReceiveMessageAction">
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.ReceiveMessageAction" name="ESBBrokerProcess_Broker__10_action_1" process="process">
<property name="operation" value="confirm"/>
<property name="messageType" value="bookingReference"/>
</action>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SendMessageAction">
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SendMessageAction" name="ESBBrokerProcess_Broker__10_action_2" process="process">
<property name="operation" value="buy"/>
<property name="messageType" value="bookingReference"/>
<property name="clientRole" value="Buyer"/>
</action>
</actions>
</service>
- <service category="org.pi4soa.esbbroker.esbbroker" name="ESBBrokerProcess_Broker__11">
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__11">
<listeners>
<jms-listener busidref="busId12" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__11"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.ReceiveMessageAction">
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.ReceiveMessageAction" name="ESBBrokerProcess_Broker__11_action_1" process="process">
<property name="operation" value="checkCredit"/>
<property name="messageType" value="CreditCheckInvalid"/>
</action>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SendMessageAction">
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SendMessageAction" name="ESBBrokerProcess_Broker__11_action_2" process="process">
<property name="operation" value="buy"/>
<property name="messageType" value="orderRejected"/>
<property name="clientRole" value="Buyer"/>
</action>
</actions>
</service>
- <service category="org.pi4soa.esbbroker.esbbroker" name="ESBBrokerProcess_Broker__12">
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="ESBBrokerProcess_Broker__12">
<listeners>
<jms-listener busidref="busId13" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-ESBBrokerProcess_Broker__12"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.ReceiveMessageAction">
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.ReceiveMessageAction" name="ESBBrokerProcess_Broker__12_action_1" process="process">
<property name="operation" value="cancel"/>
<property name="messageType" value="cancel"/>
</action>
</actions>
</service>
- <service category="org.pi4soa.esbbroker.esbbroker" name="checkCredit">
+ <service category="org.pi4soa.esbbroker.esbbroker" description="" name="checkCredit">
<listeners>
<jms-listener busidref="busId14" maxThreads="1" name="org.pi4soa.esbbroker.esbbroker-checkCredit"/>
</listeners>
<actions>
- <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SwitchAction">
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SwitchAction" name="checkCredit_action_1" process="process">
<property name="paths">
<case service-category="org.pi4soa.esbbroker.esbbroker" service-name="ESBBrokerProcess_Broker__9">
<message type="CreditCheckOk"/>
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/testmodels (from rev 531, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/testmodels)
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/plugintest/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/testmodels
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/GeneratorTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/GeneratorTest.java 2009-03-13 07:34:38 UTC (rev 538)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/GeneratorTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -1,348 +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.runtime.jbossesb.generator;
-
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.scribble.conversation.model.*;
-import org.scribble.extensions.RegistryFactory;
-import org.scribble.model.ModelReference;
-import org.scribble.model.change.ModelGenerator;
-import org.w3c.dom.Node;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-
-import junit.framework.*;
-
-public class GeneratorTest extends TestCase {
-
- public static TestSuite suite() {
- TestSuite suite = new TestSuite("Conversation->jboss-esb.xml Generator Tests");
- suite.addTest(new ConversationToJBossESBTest("ESBBrokerProcess@Broker"));
- return suite;
- }
-
- /**
- * The test case for running the conversation to jboss-esb.xml test.
- */
- protected static class ConversationToJBossESBTest extends TestCase {
-
- /**
- * This constructor is initialized with the test
- * name.
- *
- * @param name The test name
- */
- public ConversationToJBossESBTest(String name) {
- super(name);
- m_name = name;
- }
-
- /**
- * This method runs the test.
- *
- * @param result The test result
- */
- public void run(TestResult result) {
- result.startTest(this);
-
- String filename="testmodels/"+m_name+".scv";
-
- java.io.InputStream is=
- GeneratorTest.class.getResourceAsStream(filename);
-
- if (is == null) {
- result.addError(this,
- new Throwable("Unable to locate resource: "+filename));
- } else {
- org.scribble.parser.Parser p=new org.scribble.conversation.parser.ConversationParser();
- org.scribble.model.ModelReference ref=
- new org.scribble.model.ModelReference(ConversationNotation.NOTATION_CODE);
- org.scribble.model.admin.DefaultModelListener l=
- new org.scribble.model.admin.DefaultModelListener();
-
- org.scribble.model.Model model=p.parse(ref, is, l);
-
- if (model == null) {
- result.addError(this, new Throwable("Model is null"));
-
- } else if ((model instanceof ConversationModel) == false) {
- result.addError(this, new Throwable("Model is null"));
-
- } else if (l.getErrors().size() != 0) {
- result.addError(this, new Throwable("Failed to parse Conversation Model"));
-
- for (int i=0; i < l.getErrors().size(); i++) {
- System.err.println("ModelIssue: "+
- l.getErrors().get(i).getMessage());
- }
- } else {
- ConversationModel cm=(ConversationModel)model;
-
- ModelGenerator generator=(ModelGenerator)
- RegistryFactory.getRegistry().getExtension(
- ModelGenerator.class, null);
-
- if (generator != null) {
- ModelReference targetRef=
- new ModelReference(JBossESBNotation.NOTATION_CODE);
-
- DefaultESBLanguageModel target=
- new DefaultESBLanguageModel(targetRef,
- cm.getConversation().isStateless());
-
- generator.generate(targetRef,
- model.getModelName().getLocatedRole(),
- target, model);
-
- if (target.getESBConfiguration() != null) {
- try {
- String text=getText(target.getESBConfiguration(), true);
-
- checkResults(result, text);
- } catch(Exception e) {
- result.addError(this, e);
- }
- } else {
- result.addError(this,
- new Throwable("No jboss-esb.xml generated"));
- }
-
- } else {
- result.addError(this,
- new Throwable("Unable to find Model Generator"));
- }
- }
- }
-
- result.endTest(this);
- }
-
- /**
- * This method checks the generated jboss-esb.xml against a
- * previously stored correct version.
- *
- * @param result The test result
- * @param esbconfig The ESB configuration
- */
- protected void checkResults(TestResult result, String esbconfig) {
-
- String filename="results/"+m_name+".jboss-esb.xml";
-
- java.io.InputStream is=
- GeneratorTest.class.getResourceAsStream(filename);
-
- if (is != null) {
-
- try {
- byte[] b=new byte[is.available()];
-
- is.read(b);
-
- is.close();
-
- String orig=new String(b);
-
- if (orig.equals(esbconfig) == false) {
- result.addError(this,
- new Throwable("Generated ESB configuration does not match stored version"));
-
- System.out.println("COMPARED GENERATED:");
- System.out.println(esbconfig);
- System.out.println("WITH ORIGINAL:");
- System.out.println(orig);
- }
- } catch(Exception e) {
- result.addError(this, e);
- }
- } else {
- result.addError(this,
- new Throwable("Resulting ESB configuration '"+filename+
- "' not found for comparison"));
- }
- }
-
- /**
- * This class converts a DOM representation node to
- * text with appropriate presentation formatting.
- *
- * @param node The DOM node
- * @param pretty Whether to format the text for presentation
- * @return The text
- * @throws Exception Failed to convert
- */
- public static String getText(Node node, boolean pretty) throws Exception {
- String ret=getText(node);
-
- if (pretty) {
- ret = reformat(ret);
- }
-
- return(ret);
- }
-
- /**
- * This method reformats the XML text for presentation.
- *
- * @param xmltext The original XML text
- * @return The reformatted text
- */
- protected static String reformat(String xmltext) {
- String ret=xmltext;
- int pos=0;
- int prevpos=0;
- StringBuffer buf=new StringBuffer();
- int level=0;
-
- while ((pos=ret.indexOf('<', prevpos)) != -1) {
-
- if (prevpos < pos &&
- ret.substring(prevpos, pos).trim().length() > 0 &&
- ret.charAt(prevpos-1) != '?') {
-
- if (ret.charAt(prevpos) == '\r' &&
- ret.charAt(prevpos+1) == '\n') {
- prevpos += 2;
- }
- for (int i=0; i < level; i++) {
- buf.append(" ");
- }
-
- buf.append(ret.substring(prevpos, pos).trim());
- buf.append("\r\n");
- }
-
- int endpos=ret.indexOf('>', pos);
-
- if (endpos > 0) {
- boolean noreturn=false;
-
- if (pos > 0 && ret.charAt(pos+1) == '/') {
- level--;
- }
-
- for (int i=0; i < level; i++) {
- buf.append(" ");
- }
- buf.append(ret.substring(pos, endpos+1));
-
- if (ret.charAt(endpos-1)== '?') {
- //noreturn = true;
-
- } else if (ret.charAt(endpos-1) == '/') {
- // Ignore
- } else if (pos > 0 && ret.charAt(pos+1) == '/') {
- // Ignore
-
- } else if (pos > 0 && ret.charAt(pos+1) == '!') {
- // Ignore
-
- } else {
- level++;
- }
-
- if (noreturn == false) {
- buf.append("\r\n");
- }
-
- pos = endpos+1;
- }
-
- prevpos = pos;
- }
-
- if (prevpos != -1 &&
- ret.substring(prevpos).trim().length() > 0) {
- buf.append(ret.substring(prevpos));
- }
-
- ret = buf.toString();
-
- return(ret);
- }
-
- /**
- * This class converts a DOM representation node to
- * text.
- *
- * @param node The DOM node
- * @return The text
- * @throws Exception Failed to convert
- */
- public static String getText(Node node) throws Exception {
- String ret=null;
-
- try {
- // Transform the DOM represent to text
- java.io.ByteArrayOutputStream xmlstr=
- new java.io.ByteArrayOutputStream();
-
- DOMSource source=new DOMSource();
- source.setNode(node);
-
- StreamResult result=new StreamResult(xmlstr);
-
- Transformer trans=
- TransformerFactory.newInstance().newTransformer();
- trans.transform(source, result);
-
- xmlstr.close();
-
- ret = new String(xmlstr.toByteArray());
-
- if ((node instanceof org.w3c.dom.Document) == false) {
-
- // Strip off any <?xml> header
- int index=ret.indexOf("<?xml");
- if (index != -1) {
- index = ret.indexOf("<", 1);
-
- if (index != -1) {
- ret = ret.substring(index);
- } else {
- index = ret.indexOf("?>");
-
- if (index != -1) {
- index += 2;
-
- // Remove any trailing whitespaces
- // after XML header
- while (index < ret.length() &&
- Character.isWhitespace(ret.charAt(index))) {
- index++;
- }
-
- ret = ret.substring(index);
- }
- }
- }
- }
-
- } catch(Exception e) {
- throw new Exception("Failed to transform " +
- "DOM representation into text", e);
- }
-
- return(ret);
- }
-
- private String m_name=null;
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/TypeMapperTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/TypeMapperTest.java 2009-03-13 07:34:38 UTC (rev 538)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/generator/TypeMapperTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -1,122 +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.runtime.jbossesb.generator;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.generator.TypeMapper;
-
-import junit.framework.TestCase;
-
-public class TypeMapperTest extends TestCase {
-
- public void testGetJavaTypeCustomClass() {
- String pack="org.acme.service";
- String namespace=TypeMapper.JAVA_PREFIX+pack;
- String localpart="Message";
- String clsName=pack+"."+localpart;
-
- String type=TypeMapper.getJavaType(namespace, localpart);
-
- if (type == null) {
- fail("Type not returned");
- }
-
- if (type.equals(clsName) == false) {
- fail("Expecting '"+clsName+"', but got: "+type);
- }
- }
-
- public void testGetJavaTypeDOMElement() {
- String namespace="http://www.jboss.org/example";
- String localpart="Message";
- String clsName=org.w3c.dom.Element.class.getName();
-
- String type=TypeMapper.getJavaType(namespace, localpart);
-
- if (type == null) {
- fail("Type not returned");
- }
-
- if (type.equals(clsName) == false) {
- fail("Expecting '"+clsName+"', but got: "+type);
- }
- }
-
- public void testGetJavaTypeXSDString() {
- String namespace=TypeMapper.XSD_NAMESPACE;
- String localpart="string";
- String clsName=String.class.getName();
-
- String type=TypeMapper.getJavaType(namespace, localpart);
-
- if (type == null) {
- fail("Type not returned");
- }
-
- if (type.equals(clsName) == false) {
- fail("Expecting '"+clsName+"', but got: "+type);
- }
- }
-
- public void testGetJavaTypeXSDBoolean() {
- String namespace=TypeMapper.XSD_NAMESPACE;
- String localpart="boolean";
- String clsName="boolean";
-
- String type=TypeMapper.getJavaType(namespace, localpart);
-
- if (type == null) {
- fail("Type not returned");
- }
-
- if (type.equals(clsName) == false) {
- fail("Expecting '"+clsName+"', but got: "+type);
- }
- }
-
- public void testGetJavaTypeXSDDecimal() {
- String namespace=TypeMapper.XSD_NAMESPACE;
- String localpart="decimal";
- String clsName="int";
-
- String type=TypeMapper.getJavaType(namespace, localpart);
-
- if (type == null) {
- fail("Type not returned");
- }
-
- if (type.equals(clsName) == false) {
- fail("Expecting '"+clsName+"', but got: "+type);
- }
- }
-
- public void testGetJavaTypeXSDInteger() {
- String namespace=TypeMapper.XSD_NAMESPACE;
- String localpart="integer";
- String clsName="int";
-
- String type=TypeMapper.getJavaType(namespace, localpart);
-
- if (type == null) {
- fail("Type not returned");
- }
-
- if (type.equals(clsName) == false) {
- fail("Expecting '"+clsName+"', but got: "+type);
- }
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/CreateSessionActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/CreateSessionActionTest.java 2009-03-13 07:34:38 UTC (rev 538)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/CreateSessionActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -1,189 +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.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.CreateSessionAction;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.UnsupportedAction;
-
-import junit.framework.TestCase;
-
-public class CreateSessionActionTest extends TestCase {
-
- public void testValidateFirstAction() {
- TestESBService service=new TestESBService();
-
- UnsupportedAction unsupported=new UnsupportedAction(service, null);
-
- CreateSessionAction action=new CreateSessionAction(service, null);
-
- service.getActions().add(action);
- service.getActions().add(unsupported);
-
- TestModelListener l=new TestModelListener();
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateNotFirstAction() {
- TestESBService service=new TestESBService();
-
- UnsupportedAction unsupported=new UnsupportedAction(service, null);
-
- CreateSessionAction action=new CreateSessionAction(service, null);
-
- service.getActions().add(unsupported);
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_MUST_BE_FIRST_ACTION",
- new String[]{"CreateSession"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateRootNoConversationType() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- CreateSessionAction action=new CreateSessionAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_CONVERSATION_TYPE",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateRootWithConversationType() {
- String convType="test.Type@MyRole";
-
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(service);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("conversationType", convType);
-
- service.setConversationType(convType);
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- CreateSessionAction action=new CreateSessionAction(service, elem);
-
- service.getActions().add(action);
-
- service.setModel(model);
-
- TestModelListener l=new TestModelListener();
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
-
- public void testValidateRootWithConversationTypeNoRole() {
- String convType="test.Type";
-
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(service);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("conversationType", convType);
-
- service.setConversationType(convType);
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- CreateSessionAction action=new CreateSessionAction(service, elem);
-
- service.getActions().add(action);
-
- service.setModel(model);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_CONVERSATION_TYPE_ROLE",
- new String[]{convType}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testIsCreateSession() {
- TestESBService service=new TestESBService();
-
- CreateSessionAction action=new CreateSessionAction(service, null);
-
- if (action.isSessionType() == false) {
- fail("Action is not flagged as a 'CreateSession'");
- }
- }
-
- public void testIsSessionBased() {
- TestESBService service=new TestESBService();
-
- CreateSessionAction action=new CreateSessionAction(service, null);
-
- if (action.isSessionBased() == false) {
- fail("Action is not flagged as a 'SessionBased'");
- }
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/IfActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/IfActionTest.java 2009-03-13 07:34:38 UTC (rev 538)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/IfActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -1,630 +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.runtime.jbossesb.model.actions;
-
-import junit.framework.TestCase;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.IfAction;
-import org.scribble.model.*;
-import org.scribble.conversation.model.*;
-
-public class IfActionTest extends TestCase {
-
- public void testValidatePathsSpecified() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- IfAction action=new IfAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{"paths"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateServiceNotFound() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><if service-category=\"cat1\" " +
- "service-name=\"name1\" /><elseif service-category=\"cat2\" " +
- "service-name=\"name2\" /><else service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(service);
-
- service.setModel(model);
-
- IfAction action=new IfAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{"cat1","name1"}));
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{"cat2","name2"}));
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{"cat3","name3"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateNoPathsContent() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat3");
- other2.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(service);
-
- service.setModel(model);
-
- IfAction action=new IfAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_IF_ORDER_WRONG",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateOnlyOneIf() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><if service-category=\"cat1\" " +
- "service-name=\"name1\" /><elseif service-category=\"cat2\" " +
- "service-name=\"name2\" /><if service-category=\"cat3\" " +
- "service-name=\"name3\" /><else service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- IfAction action=new IfAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_IF_ORDER_WRONG",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateOutOfOrderElse() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><if service-category=\"cat1\" " +
- "service-name=\"name1\" /><else service-category=\"cat3\" " +
- "service-name=\"name3\" /><elseif service-category=\"cat2\" " +
- "service-name=\"name2\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- IfAction action=new IfAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_IF_ORDER_WRONG",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateMissingServiceDetails() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><if service-category=\"cat1\" " +
- "service-name=\"name1\" /><elseif " +
- "service-name=\"name2\" /><else service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- IfAction action=new IfAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_PATH_SERVICE_DETAILS_MISSING",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateImmediateIf() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><if service-category=\"cat1\" " +
- "service-name=\"name1\" immediate=\"fred\" /><elseif service-category=\"cat2\" " +
- "service-name=\"name2\" /><else service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- IfAction action=new IfAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_BOOLEAN",
- new String[]{IfAction.IMMEDIATE}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateImmediateElseIf() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><if service-category=\"cat1\" " +
- "service-name=\"name1\" /><elseif service-category=\"cat2\" " +
- "service-name=\"name2\" immediate=\"fred\" /><else service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- IfAction action=new IfAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_BOOLEAN",
- new String[]{IfAction.IMMEDIATE}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateImmediateElse() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><if service-category=\"cat1\" " +
- "service-name=\"name1\" /><elseif service-category=\"cat2\" " +
- "service-name=\"name2\" /><else service-category=\"cat3\" " +
- "service-name=\"name3\" immediate=\"fred\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- IfAction action=new IfAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_BOOLEAN",
- new String[]{IfAction.IMMEDIATE}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testConvert() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><if service-category=\"cat1\" " +
- "service-name=\"name1\" /><elseif service-category=\"cat2\" " +
- "service-name=\"name2\" /><else service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestActivity act1=new TestActivity();
- other1.getContents().add(act1);
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestActivity act2=new TestActivity();
- other2.getContents().add(act2);
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestActivity act3=new TestActivity();
- other3.getContents().add(act3);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- IfAction action=new IfAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, null);
-
- if (activities.size() != 1) {
- fail("Expecting one activity, but got: "+activities.size());
- }
-
- Activity act=activities.get(0);
-
- if ((act instanceof If) == false) {
- fail("Expecting an 'If' activity");
- }
-
- If ifAction=(If)act;
-
- if (ifAction.getConditionalBlocks().size() != 2) {
- fail("Expecting two conditional blocks: "+ifAction.getConditionalBlocks().size());
- }
-
- if (ifAction.getConditionalBlocks().get(0).getContents().size() != 1 ||
- ifAction.getConditionalBlocks().get(0).getContents().get(0) != act1) {
- fail("First conditional block should have 1 activity = act1");
- }
-
- if (ifAction.getConditionalBlocks().get(1).getContents().size() != 1 ||
- ifAction.getConditionalBlocks().get(1).getContents().get(0) != act2) {
- fail("Second conditional block should have 1 activity = act2");
- }
-
- if (ifAction.getElseBlock() == null) {
- fail("Else block not defined");
- }
-
- if (ifAction.getElseBlock().getContents().size() != 1 ||
- ifAction.getElseBlock().getContents().get(0) != act3) {
- fail("Else block should have 1 activity = act3");
- }
- }
-
- public void testConvertNotExcludingEmptyPaths() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><if service-category=\"cat1\" " +
- "service-name=\"name1\" /><elseif service-category=\"cat2\" " +
- "service-name=\"name2\" /><else service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- IfAction action=new IfAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, null);
-
- if (activities.size() != 1) {
- fail("Expecting one activity, but got: "+activities.size());
- }
-
- Activity act=activities.get(0);
-
- if ((act instanceof If) == false) {
- fail("Expecting an 'If' activity");
- }
-
- If ifAction=(If)act;
-
- if (ifAction.getConditionalBlocks().size() != 2) {
- fail("Expecting two conditional blocks: "+ifAction.getConditionalBlocks().size());
- }
-
- if (ifAction.getConditionalBlocks().get(0).getContents().size() != 0) {
- fail("First conditional block should be empty");
- }
-
- if (ifAction.getConditionalBlocks().get(1).getContents().size() != 0) {
- fail("Second conditional block should be empty");
- }
-
- if (ifAction.getElseBlock() == null) {
- fail("Else block not defined");
- }
-
- if (ifAction.getElseBlock().getContents().size() != 0) {
- fail("Else block should have be empty");
- }
- }
-
- public void testIsCreateSession() {
- TestESBService service=new TestESBService();
-
- IfAction action=new IfAction(service, null);
-
- if (action.isSessionType() == true) {
- fail("Action is flagged as a 'CreateSession'");
- }
- }
-
- public void testIsSessionBased() {
- TestESBService service=new TestESBService();
-
- IfAction action=new IfAction(service, null);
-
- if (action.isSessionBased() == false) {
- fail("Action is not flagged as a 'SessionBased'");
- }
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/MessageRouterActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/MessageRouterActionTest.java 2009-03-13 07:34:38 UTC (rev 538)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/MessageRouterActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -1,272 +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.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.MessageRouterAction;
-
-import junit.framework.TestCase;
-
-public class MessageRouterActionTest extends TestCase {
-
- public void testValidatePathsSpecified() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- MessageRouterAction action=new MessageRouterAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{"paths"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateSessionBasedService() {
- TestESBService service=new TestESBService();
- service.setSessionBased(true);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><route service-category=\"cat1\" " +
- "service-name=\"name1\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- MessageRouterAction action=new MessageRouterAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_CANNOT_SESSION_BASED_ACTIONS_WITH_ROUTER",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateServiceNotFound() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><route service-category=\"cat1\" " +
- "service-name=\"name1\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(service);
-
- service.setModel(model);
-
- MessageRouterAction action=new MessageRouterAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{"cat1","name1"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateInitiateServiceNotRoot() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><route service-category=\"cat1\" " +
- "service-name=\"name1\" initiate=\"true\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other=new TestESBService();
- other.setCategory("cat1");
- other.setName("name1");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other);
- model.addService(service);
-
- service.setModel(model);
-
- MessageRouterAction action=new MessageRouterAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_CANNOT_INITIATE_NON_ROOT",
- new String[]{other.getCategory(),
- other.getName()}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateNotInitiateRootService() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><route service-category=\"cat1\" " +
- "service-name=\"name1\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other=new TestESBService();
- other.setCategory("cat1");
- other.setName("name1");
- other.setRoot(true);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other);
- model.addService(service);
-
- service.setModel(model);
-
- MessageRouterAction action=new MessageRouterAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_MUST_INITIATE_ROOT",
- new String[]{other.getCategory(),
- other.getName()}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateNoRoutes() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- MessageRouterAction action=new MessageRouterAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_ROUTER_ONE_OR_MORE_PATHS",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateServiceDetailsMissing() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><route service-category=\"cat1\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- MessageRouterAction action=new MessageRouterAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_PATH_SERVICE_DETAILS_MISSING",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testIsCreateSession() {
- TestESBService service=new TestESBService();
-
- MessageRouterAction action=new MessageRouterAction(service, null);
-
- if (action.isSessionType() == true) {
- fail("Action is flagged as a 'CreateSession'");
- }
- }
-
- public void testIsSessionBased() {
- TestESBService service=new TestESBService();
-
- MessageRouterAction action=new MessageRouterAction(service, null);
-
- if (action.isSessionBased() == true) {
- fail("Action is flagged as a 'SessionBased'");
- }
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ParallelActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ParallelActionTest.java 2009-03-13 07:34:38 UTC (rev 538)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ParallelActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -1,526 +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.runtime.jbossesb.model.actions;
-
-import org.scribble.conversation.model.*;
-import org.scribble.model.Activity;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.ParallelAction;
-
-import junit.framework.TestCase;
-
-public class ParallelActionTest extends TestCase {
-
- public void testValidatePathsSpecified() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- ParallelAction action=new ParallelAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{"paths"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateServiceNotFound() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><path service-category=\"cat1\" " +
- "service-name=\"name1\" /><path service-category=\"cat2\" " +
- "service-name=\"name2\" /><join service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(service);
-
- service.setModel(model);
-
- ParallelAction action=new ParallelAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{"cat1","name1"}));
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{"cat2","name2"}));
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{"cat3","name3"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateLessThanTwoPaths() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><path service-category=\"cat1\" " +
- "service-name=\"name1\" /><join service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat3");
- other2.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(service);
-
- service.setModel(model);
-
- ParallelAction action=new ParallelAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_PARALLEL_MORE_THAN_TWO_PATHS",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateOnlyOneJoin() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><path service-category=\"cat1\" " +
- "service-name=\"name1\" /><path service-category=\"cat2\" " +
- "service-name=\"name2\" /><join service-category=\"cat3\" " +
- "service-name=\"name3\" /><join service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- ParallelAction action=new ParallelAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_MULTIPLE_JOINS",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateOutOfOrderJoin() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><path service-category=\"cat1\" " +
- "service-name=\"name1\" /><join service-category=\"cat3\" " +
- "service-name=\"name3\" /><path service-category=\"cat2\" " +
- "service-name=\"name2\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- ParallelAction action=new ParallelAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_PARALLEL_PATH_AFTER_JOIN",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateMissingServiceDetails() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><path service-category=\"cat1\" " +
- "service-name=\"name1\" /><path " +
- "service-name=\"name2\" /><join service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- ParallelAction action=new ParallelAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_PATH_SERVICE_DETAILS_MISSING",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateImmediate() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><path service-category=\"cat1\" " +
- "service-name=\"name1\" /><path service-category=\"cat2\" " +
- "service-name=\"name2\" immediate=\"fred\" /><join service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- ParallelAction action=new ParallelAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_BOOLEAN",
- new String[]{ParallelAction.IMMEDIATE}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testConvert() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><path service-category=\"cat1\" " +
- "service-name=\"name1\" /><path service-category=\"cat2\" " +
- "service-name=\"name2\" /><join service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestActivity act1=new TestActivity();
- other1.getContents().add(act1);
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestActivity act2=new TestActivity();
- other2.getContents().add(act2);
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestActivity act3=new TestActivity();
- other3.getContents().add(act3);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- ParallelAction action=new ParallelAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, new DefaultConversionContext(null));
-
- if (activities.size() != 2) {
- fail("Expecting two activities, but got: "+activities.size());
- }
-
- Activity act=activities.get(0);
-
- if ((act instanceof Parallel) == false) {
- fail("Expecting an 'Parallel' activity");
- }
-
- Parallel parallelAction=(Parallel)act;
-
- if (parallelAction.getBlocks().size() != 2) {
- fail("Expecting two blocks: "+parallelAction.getBlocks().size());
- }
-
- if (parallelAction.getBlocks().get(0).getContents().size() != 1 ||
- parallelAction.getBlocks().get(0).getContents().get(0) != act1) {
- fail("First conditional block should have 1 activity = act1");
- }
-
- if (parallelAction.getBlocks().get(1).getContents().size() != 1 ||
- parallelAction.getBlocks().get(1).getContents().get(0) != act2) {
- fail("Second conditional block should have 1 activity = act2");
- }
-
- if (activities.get(1) != act3) {
- fail("Activity after parallel should be act3");
- }
- }
-
- public void testConvertNotExcludingEmptyPaths() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><path service-category=\"cat1\" " +
- "service-name=\"name1\" /><path service-category=\"cat2\" " +
- "service-name=\"name2\" /><join service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestActivity act1=new TestActivity();
- other1.getContents().add(act1);
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestActivity act3=new TestActivity();
- other3.getContents().add(act3);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- ParallelAction action=new ParallelAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, new DefaultConversionContext(null));
-
- if (activities.size() != 2) {
- fail("Expecting two activities, but got: "+activities.size());
- }
-
- Activity act=activities.get(0);
-
- if ((act instanceof Parallel) == false) {
- fail("Expecting an 'Parallel' activity");
- }
-
- Parallel parallelAction=(Parallel)act;
-
- if (parallelAction.getBlocks().size() != 2) {
- fail("Expecting two blocks: "+parallelAction.getBlocks().size());
- }
-
- if (parallelAction.getBlocks().get(0).getContents().size() != 1 ||
- parallelAction.getBlocks().get(0).getContents().get(0) != act1) {
- fail("First conditional block should have 1 activity = act1");
- }
-
- if (parallelAction.getBlocks().get(1).getContents().size() != 0) {
- fail("Second conditional block should be empty");
- }
-
- if (activities.get(1) != act3) {
- fail("Activity after parallel should be act3");
- }
- }
-
- public void testIsCreateSession() {
- TestESBService service=new TestESBService();
-
- ParallelAction action=new ParallelAction(service, null);
-
- if (action.isSessionType() == true) {
- fail("Action is flagged as a 'CreateSession'");
- }
- }
-
- public void testIsSessionBased() {
- TestESBService service=new TestESBService();
-
- ParallelAction action=new ParallelAction(service, null);
-
- if (action.isSessionBased() == false) {
- fail("Action is not flagged as a 'SessionBased'");
- }
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/PerformActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/PerformActionTest.java 2009-03-13 07:34:38 UTC (rev 538)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/PerformActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -1,779 +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.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.PerformAction;
-import org.scribble.conversation.model.*;
-import org.scribble.model.Activity;
-
-import junit.framework.TestCase;
-
-public class PerformActionTest extends TestCase {
-
- public void testValidateNoServiceCategory() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(PerformAction.SERVICE_NAME, "");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- PerformAction action=new PerformAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{"serviceCategory"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateNoServiceName() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(PerformAction.SERVICE_CATEGORY, "");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- PerformAction action=new PerformAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{"serviceName"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateService() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(PerformAction.SERVICE_CATEGORY, "cat1");
- props.put(PerformAction.SERVICE_NAME, "name1");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(service);
-
- service.setModel(model);
-
- PerformAction action=new PerformAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{"cat1", "name1"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateReturnService() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(PerformAction.SERVICE_CATEGORY, "cat1");
- props.put(PerformAction.SERVICE_NAME, "name1");
- props.put(PerformAction.RETURN_SERVICE_CATEGORY, "cat2");
- props.put(PerformAction.RETURN_SERVICE_NAME, "name2");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
- other1.setCreateSession(true);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(service);
-
- service.setModel(model);
-
- PerformAction action=new PerformAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{"cat2", "name2"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateServiceCreatesSession() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(PerformAction.SERVICE_CATEGORY, "cat1");
- props.put(PerformAction.SERVICE_NAME, "name1");
- props.put(PerformAction.RETURN_SERVICE_CATEGORY, "cat2");
- props.put(PerformAction.RETURN_SERVICE_NAME, "name2");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
- other1.setCreateSession(false);
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(service);
-
- service.setModel(model);
-
- PerformAction action=new PerformAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_FOUND_PERFORM_CREATE_SESSION",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateParentReferenceNotFound() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(PerformAction.SERVICE_CATEGORY, "cat1");
- props.put(PerformAction.SERVICE_NAME, "name1");
- props.put(PerformAction.PARENT_REFERENCE, "fred");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
- other1.setCreateSession(true);
- other1.setSessionClass(Object.class);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(service);
-
- service.setModel(model);
-
- PerformAction action=new PerformAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_FOUND_VARIABLE",
- new String[]{"fred", Object.class.getName()}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateParentReferenceNotWritable() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(PerformAction.SERVICE_CATEGORY, "cat1");
- props.put(PerformAction.SERVICE_NAME, "name1");
- props.put(PerformAction.PARENT_REFERENCE, "class");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
- other1.setCreateSession(true);
- other1.setSessionClass(Object.class);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(service);
-
- service.setModel(model);
-
- PerformAction action=new PerformAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_WRITABLE_PROPERTY",
- new String[]{"class", Object.class.getName()}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateParentReferenceIncorrectType() {
- TestESBService service=new TestESBService();
- service.setSessionClass(ParentPojo.class);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(PerformAction.SERVICE_CATEGORY, "cat1");
- props.put(PerformAction.SERVICE_NAME, "name1");
- props.put(PerformAction.PARENT_REFERENCE, "invalidParent");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
- other1.setCreateSession(true);
- other1.setSessionClass(ChildPojo.class);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(service);
-
- service.setModel(model);
-
- PerformAction action=new PerformAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_INVALID_PROPERTY_TYPE",
- new String[]{"invalidParent",
- ChildPojo.class.getName(),
- ParentPojo.class.getName()}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateParentReferenceCorrectType() {
- TestESBService service=new TestESBService();
- service.setSessionClass(ParentPojo.class);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(PerformAction.SERVICE_CATEGORY, "cat1");
- props.put(PerformAction.SERVICE_NAME, "name1");
- props.put(PerformAction.PARENT_REFERENCE, "validParent");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
- other1.setCreateSession(true);
- other1.setSessionClass(ChildPojo.class);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(service);
-
- service.setModel(model);
-
- PerformAction action=new PerformAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateParentReferenceCorrectType2() {
- TestESBService service=new TestESBService();
- service.setSessionClass(ParentPojo.class);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(PerformAction.SERVICE_CATEGORY, "cat1");
- props.put(PerformAction.SERVICE_NAME, "name1");
- props.put(PerformAction.PARENT_REFERENCE, "validParentView");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
- other1.setCreateSession(true);
- other1.setSessionClass(ChildPojo.class);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(service);
-
- service.setModel(model);
-
- PerformAction action=new PerformAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateBindDetailsNotFound() {
- TestESBService service=new TestESBService();
-
- String varName="fred";
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(PerformAction.SERVICE_CATEGORY, "cat1");
- props.put(PerformAction.SERVICE_NAME, "name1");
-
- java.util.Map<String,String> customProps=new java.util.Hashtable<String,String>();
- customProps.put(PerformAction.BIND_DETAILS,
- "<root><bind to-variable=\""+varName+"\" /></root>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, customProps);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
- other1.setCreateSession(true);
- other1.setSessionClass(Object.class);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(service);
-
- service.setModel(model);
-
- PerformAction action=new PerformAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_FOUND_VARIABLE",
- new String[]{varName, Object.class.getName()}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateBindDetailsNotWritable() {
- TestESBService service=new TestESBService();
-
- String varName="class";
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(PerformAction.SERVICE_CATEGORY, "cat1");
- props.put(PerformAction.SERVICE_NAME, "name1");
-
- java.util.Map<String,String> customProps=new java.util.Hashtable<String,String>();
- customProps.put(PerformAction.BIND_DETAILS,
- "<root><bind to-variable=\""+varName+"\" /></root>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, customProps);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
- other1.setCreateSession(true);
- other1.setSessionClass(Object.class);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(service);
-
- service.setModel(model);
-
- PerformAction action=new PerformAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_WRITABLE_PROPERTY",
- new String[]{varName, Object.class.getName()}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateBindDetailsCorrect() {
- TestESBService service=new TestESBService();
-
- String varName="validParent";
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(PerformAction.SERVICE_CATEGORY, "cat1");
- props.put(PerformAction.SERVICE_NAME, "name1");
-
- java.util.Map<String,String> customProps=new java.util.Hashtable<String,String>();
- customProps.put(PerformAction.BIND_DETAILS,
- "<root><bind to-variable=\""+varName+"\" /></root>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, customProps);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
- other1.setCreateSession(true);
- other1.setSessionClass(ChildPojo.class);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(service);
-
- service.setModel(model);
-
- PerformAction action=new PerformAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testConvertRun() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(PerformAction.SERVICE_CATEGORY, "cat1");
- props.put(PerformAction.SERVICE_NAME, "name1");
- props.put(PerformAction.RETURN_SERVICE_CATEGORY, "cat2");
- props.put(PerformAction.RETURN_SERVICE_NAME, "name2");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestActivity act1=new TestActivity();
- other1.getContents().add(act1);
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestActivity act2=new TestActivity();
- other2.getContents().add(act2);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(service);
-
- service.setModel(model);
-
- PerformAction action=new PerformAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, null);
-
- if (activities.size() != 2) {
- fail("Expecting two activities, but got: "+activities.size());
- }
-
- Activity act=activities.get(0);
-
- if ((act instanceof Run) == false) {
- fail("Expecting an 'Run' activity");
- }
-
- Run runAction=(Run)act;
-
- if (runAction.getDefinition() == null) {
- fail("Run definition was null");
- }
-
- if (runAction.getDefinition().getBlock().getContents().size() != 1) {
- fail("Expecting one ran block activity: "+runAction.getDefinition().getBlock().getContents().size());
- }
-
- if (runAction.getDefinition().getBlock().getContents().get(0) != act1) {
- fail("Run model block should have 1 activity = act1");
- }
-
- if (activities.get(1) != act2) {
- fail("Subsequent activity after run was not act2");
- }
- }
-
- public void testConvertSpawn() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(PerformAction.SERVICE_CATEGORY, "cat1");
- props.put(PerformAction.SERVICE_NAME, "name1");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestActivity act1=new TestActivity();
- other1.getContents().add(act1);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(service);
-
- service.setModel(model);
-
- PerformAction action=new PerformAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, null);
-
- if (activities.size() != 1) {
- fail("Expecting 1 activity, but got: "+activities.size());
- }
-
- Activity act=activities.get(0);
-
- if ((act instanceof Spawn) == false) {
- fail("Expecting a 'Spawn' activity");
- }
-
- Spawn spawnAction=(Spawn)act;
-
- if (spawnAction.getDefinition() == null) {
- fail("Run definition was null");
- }
-
- if (spawnAction.getDefinition().getBlock().getContents().size() != 1) {
- fail("Expecting one block activity: "+spawnAction.getDefinition().getBlock().getContents().size());
- }
-
- if (spawnAction.getDefinition().getBlock().getContents().get(0) != act1) {
- fail("Spawn model block should have 1 activity = act1");
- }
- }
-
- public void testConvertNotExcludingEmptyPath() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(PerformAction.SERVICE_CATEGORY, "cat1");
- props.put(PerformAction.SERVICE_NAME, "name1");
- props.put(PerformAction.RETURN_SERVICE_CATEGORY, "cat2");
- props.put(PerformAction.RETURN_SERVICE_NAME, "name2");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestActivity act2=new TestActivity();
- other2.getContents().add(act2);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(service);
-
- service.setModel(model);
-
- PerformAction action=new PerformAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, null);
-
- if (activities.size() != 2) {
- fail("Expecting two activities, but got: "+activities.size());
- }
-
- Activity act=activities.get(0);
-
- if ((act instanceof Run) == false) {
- fail("Expecting an 'Run' activity");
- }
-
- Run runAction=(Run)act;
-
- if (runAction.getDefinition() == null) {
- fail("Run definition was null");
- }
-
- if (runAction.getDefinition().getBlock().getContents().size() != 0) {
- fail("Expecting zero ran block activities: "+runAction.getDefinition().getBlock().getContents().size());
- }
-
- if (activities.get(1) != act2) {
- fail("Subsequent activity after run was not act2");
- }
- }
-
- public void testIsCreateSession() {
- TestESBService service=new TestESBService();
-
- PerformAction action=new PerformAction(service, null);
-
- if (action.isSessionType() == true) {
- fail("Action is flagged as a 'CreateSession'");
- }
- }
-
- public void testIsSessionBased() {
- TestESBService service=new TestESBService();
-
- PerformAction action=new PerformAction(service, null);
-
- if (action.isSessionBased() == false) {
- fail("Action is not flagged as a 'SessionBased'");
- }
- }
-
- public interface ParentView {
-
- }
-
- public class ParentPojo implements ParentView {
-
- }
-
- public class ChildPojo {
-
- public void setValidParent(ParentPojo p) {
- }
-
- public void setValidParentView(ParentView p) {
- }
-
- public void setInvalidParent(String p) {
- }
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ReceiveMessageActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ReceiveMessageActionTest.java 2009-03-13 07:34:38 UTC (rev 538)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ReceiveMessageActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -1,287 +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.runtime.jbossesb.model.actions;
-
-import org.scribble.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.ReceiveMessageAction;
-
-import junit.framework.TestCase;
-
-public class ReceiveMessageActionTest extends TestCase {
-
- public void testValidateNoMessageType() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("identities", "");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- ReceiveMessageAction action=new ReceiveMessageAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{"messageType"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateNoIdentities() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("messageType", "");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- ReceiveMessageAction action=new ReceiveMessageAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{"identities"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testConvertRoles() {
- TestESBService service=new TestESBService();
-
- String ns="MessageTypeNS";
- String lp="MessageType";
- String role="Buyer";
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("messageType", "{"+ns+"}"+lp);
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(service);
-
- service.setModel(model);
-
- ReceiveMessageAction action=new ReceiveMessageAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, new DefaultConversionContext(role));
-
- if (activities.size() != 1) {
- fail("Expecting one activity, but got: "+activities.size());
- }
-
- Activity act=activities.get(0);
-
- if ((act instanceof Interaction) == false) {
- fail("Expecting an 'Interaction' activity");
- }
-
- Interaction interaction=(Interaction)act;
-
- if (interaction.getToRole() == null) {
- fail("'To' role is null");
- }
-
- if (interaction.getToRole().getName().equals(role) == false) {
- fail("'To' role should be '"+role+"', but found: "+interaction.getToRole().getName());
- }
-
- if (interaction.getFromRole() != null) {
- fail("'From' role should be null");
- }
- }
-
- public void testConvertMessageBased() {
- TestESBService service=new TestESBService();
-
- String ns="MessageTypeNS";
- String lp="MessageType";
- String role="Buyer";
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("messageType", "{"+ns+"}"+lp);
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(service);
-
- service.setModel(model);
-
- ReceiveMessageAction action=new ReceiveMessageAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, new DefaultConversionContext(role));
-
- if (activities.size() != 1) {
- fail("Expecting one activity, but got: "+activities.size());
- }
-
- Activity act=activities.get(0);
-
- if ((act instanceof Interaction) == false) {
- fail("Expecting an 'Interaction' activity");
- }
-
- Interaction interaction=(Interaction)act;
-
- if (interaction.getMessageSignature() == null) {
- fail("Message signature is null");
- }
-
- if (interaction.getMessageSignature().getOperation() != null) {
- fail("Operation should be null");
- }
-
- if (interaction.getMessageSignature().getTypes().size() != 1) {
- fail("Only one type expected, but got: "+interaction.getMessageSignature().getTypes().size());
- }
-
- TypeReference ref=interaction.getMessageSignature().getTypes().get(0);
-
- if (ref.getNamespace() == null ||
- ref.getNamespace().equals(ns) == false) {
- fail("Namespace should be '"+ns+"', but found: "+ref.getNamespace());
- }
-
- if (ref.getLocalpart() == null ||
- ref.getLocalpart().equals(lp) == false) {
- fail("Local type should be '"+lp+"', but found: "+ref.getLocalpart());
- }
- }
-
- public void testConvertRPCBased() {
- TestESBService service=new TestESBService();
-
- String ns="MessageTypeNS";
- String lp="MessageType";
- String opname="op";
- String role="Buyer";
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("operation", opname);
- props.put("messageType", "{"+ns+"}"+lp);
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(service);
-
- service.setModel(model);
-
- ReceiveMessageAction action=new ReceiveMessageAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, new DefaultConversionContext(role));
-
- if (activities.size() != 1) {
- fail("Expecting one activity, but got: "+activities.size());
- }
-
- Activity act=activities.get(0);
-
- if ((act instanceof Interaction) == false) {
- fail("Expecting an 'Interaction' activity");
- }
-
- Interaction interaction=(Interaction)act;
-
- if (interaction.getMessageSignature() == null) {
- fail("Message signature is null");
- }
-
- if (interaction.getMessageSignature().getOperation() == null) {
- fail("Operation should not be null");
- }
-
- if (interaction.getMessageSignature().getOperation().equals(opname) == false) {
- fail("Operation expected '"+opname+"', but got: "+
- interaction.getMessageSignature().getOperation());
- }
-
- if (interaction.getMessageSignature().getTypes().size() != 1) {
- fail("Only one type expected, but got: "+interaction.getMessageSignature().getTypes().size());
- }
-
- TypeReference ref=interaction.getMessageSignature().getTypes().get(0);
-
- if (ref.getNamespace() == null ||
- ref.getNamespace().equals(ns) == false) {
- fail("Namespace should be '"+ns+"', but found: "+ref.getNamespace());
- }
-
- if (ref.getLocalpart() == null ||
- ref.getLocalpart().equals(lp) == false) {
- fail("Local type should be '"+lp+"', but found: "+ref.getLocalpart());
- }
- }
-
- public void testIsCreateSession() {
- TestESBService service=new TestESBService();
-
- ReceiveMessageAction action=new ReceiveMessageAction(service, null);
-
- if (action.isSessionType() == true) {
- fail("Action is flagged as a 'CreateSession'");
- }
- }
-
- public void testIsSessionBased() {
- TestESBService service=new TestESBService();
-
- ReceiveMessageAction action=new ReceiveMessageAction(service, null);
-
- if (action.isSessionBased() == false) {
- fail("Action is not flagged as a 'SessionBased'");
- }
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/RetrieveSessionActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/RetrieveSessionActionTest.java 2009-03-13 07:34:38 UTC (rev 538)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/RetrieveSessionActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -1,128 +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.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.RetrieveSessionAction;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.UnsupportedAction;
-
-import junit.framework.TestCase;
-
-public class RetrieveSessionActionTest extends TestCase {
-
- public void testValidateFirstAction() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("identities", "");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- UnsupportedAction unsupported=new UnsupportedAction(service, null);
-
- RetrieveSessionAction action=new RetrieveSessionAction(service, elem);
-
- service.getActions().add(action);
- service.getActions().add(unsupported);
-
- TestModelListener l=new TestModelListener();
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateNotFirstAction() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("identities", "");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- UnsupportedAction unsupported=new UnsupportedAction(service, null);
-
- RetrieveSessionAction action=new RetrieveSessionAction(service, elem);
-
- service.getActions().add(unsupported);
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_MUST_BE_FIRST_ACTION",
- new String[]{"RetrieveSession"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateNoIdentities() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- RetrieveSessionAction action=new RetrieveSessionAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{"identities"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testIsCreateSession() {
- TestESBService service=new TestESBService();
-
- RetrieveSessionAction action=new RetrieveSessionAction(service, null);
-
- if (action.isSessionType() == true) {
- fail("Action is flagged as a 'CreateSession'");
- }
- }
-
- public void testIsSessionBased() {
- TestESBService service=new TestESBService();
-
- RetrieveSessionAction action=new RetrieveSessionAction(service, null);
-
- if (action.isSessionBased() == false) {
- fail("Action is not flagged as a 'SessionBased'");
- }
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ScheduleStateActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ScheduleStateActionTest.java 2009-03-13 07:34:38 UTC (rev 538)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ScheduleStateActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -1,257 +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.runtime.jbossesb.model.actions;
-
-import org.scribble.model.Activity;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.ScheduleStateAction;
-
-import junit.framework.TestCase;
-
-public class ScheduleStateActionTest extends TestCase {
-
- public void testValidateNoServiceCategory() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("serviceName", "");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- ScheduleStateAction action=new ScheduleStateAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{"serviceCategory"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateNoServiceName() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("serviceCategory", "");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- ScheduleStateAction action=new ScheduleStateAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{"serviceName"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateService() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("serviceCategory", "cat1");
- props.put("serviceName", "name1");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(service);
-
- service.setModel(model);
-
- ScheduleStateAction action=new ScheduleStateAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{"cat1", "name1"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testConvert() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("serviceCategory", "cat1");
- props.put("serviceName", "name1");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestActivity act1=new TestActivity();
- other1.getContents().add(act1);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(service);
-
- service.setModel(model);
-
- ScheduleStateAction action=new ScheduleStateAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, new DefaultConversionContext(null));
-
- if (activities.size() != 1) {
- fail("Expecting one activity, but got: "+activities.size());
- }
-
- if (activities.get(0) != act1) {
- fail("Activity was not act1");
- }
- }
-
- public void testConvertBackToWhileLoop() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("serviceCategory", "cat1");
- props.put("serviceName", "name1");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
- other1.setLoop(true);
-
- TestActivity act1=new TestActivity();
- other1.getContents().add(act1);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(service);
-
- service.setModel(model);
-
- ScheduleStateAction action=new ScheduleStateAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- DefaultConversionContext context=new DefaultConversionContext(null);
- context.push(other1);
-
- action.convert(activities, context);
-
- if (activities.size() != 0) {
- fail("Should be no activities, but found: "+activities.size());
- }
- }
-
- public void testConvertBackToJoinState() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("serviceCategory", "cat1");
- props.put("serviceName", "name1");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestActivity act1=new TestActivity();
- other1.getContents().add(act1);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(service);
-
- service.setModel(model);
-
- ScheduleStateAction action=new ScheduleStateAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- DefaultConversionContext context=new DefaultConversionContext(null);
- context.markJoin(other1);
-
- action.convert(activities, context);
-
- if (activities.size() != 0) {
- fail("Should be no activities, but found: "+activities.size());
- }
- }
-
- public void testIsCreateSession() {
- TestESBService service=new TestESBService();
-
- ScheduleStateAction action=new ScheduleStateAction(service, null);
-
- if (action.isSessionType() == true) {
- fail("Action is flagged as a 'CreateSession'");
- }
- }
-
- public void testIsSessionBased() {
- TestESBService service=new TestESBService();
-
- ScheduleStateAction action=new ScheduleStateAction(service, null);
-
- if (action.isSessionBased() == false) {
- fail("Action is not flagged as a 'SessionBased'");
- }
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SendMessageActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SendMessageActionTest.java 2009-03-13 07:34:38 UTC (rev 538)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SendMessageActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -1,363 +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.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.DefaultConversionContext;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.SendMessageAction;
-import org.scribble.model.Activity;
-import org.scribble.model.Interaction;
-import org.scribble.model.TypeReference;
-
-import junit.framework.TestCase;
-
-public class SendMessageActionTest extends TestCase {
-
- public void testValidateNoMessageType() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("identities", "");
- props.put("serviceCategory", "");
- props.put("serviceName", "");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- SendMessageAction action=new SendMessageAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{"messageType"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateNoIdentities() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("messageType", "");
- props.put("clientRole", "");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- SendMessageAction action=new SendMessageAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{"identities"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateNoDestination() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("messageType", "");
- props.put("identities", "");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- SendMessageAction action=new SendMessageAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_REQ_RESP_EPR",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateResponseService() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("messageType", "");
- props.put("identities", "");
- props.put("serviceCategory", "cat1");
- props.put("serviceName", "name1");
- props.put("responseServiceCategory", "cat2");
- props.put("responseServiceName", "name2");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(service);
-
- service.setModel(model);
-
- SendMessageAction action=new SendMessageAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{"cat2", "name2"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testConvertRoles() {
- TestESBService service=new TestESBService();
-
- String ns="MessageTypeNS";
- String lp="MessageType";
- String role="Buyer";
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("messageType", "{"+ns+"}"+lp);
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(service);
-
- service.setModel(model);
-
- SendMessageAction action=new SendMessageAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, new DefaultConversionContext(role));
-
- if (activities.size() != 1) {
- fail("Expecting one activity, but got: "+activities.size());
- }
-
- Activity act=activities.get(0);
-
- if ((act instanceof Interaction) == false) {
- fail("Expecting an 'Interaction' activity");
- }
-
- Interaction interaction=(Interaction)act;
-
- if (interaction.getFromRole() == null) {
- fail("'From' role is null");
- }
-
- if (interaction.getFromRole().getName().equals(role) == false) {
- fail("'From' role should be '"+role+"', but found: "+interaction.getFromRole().getName());
- }
-
- if (interaction.getToRole() != null) {
- fail("'To' role should be null");
- }
- }
-
- public void testConvertMessageBased() {
- TestESBService service=new TestESBService();
-
- String ns="MessageTypeNS";
- String lp="MessageType";
- String role="Buyer";
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("messageType", "{"+ns+"}"+lp);
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(service);
-
- service.setModel(model);
-
- SendMessageAction action=new SendMessageAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, new DefaultConversionContext(role));
-
- if (activities.size() != 1) {
- fail("Expecting one activity, but got: "+activities.size());
- }
-
- Activity act=activities.get(0);
-
- if ((act instanceof Interaction) == false) {
- fail("Expecting an 'Interaction' activity");
- }
-
- Interaction interaction=(Interaction)act;
-
- if (interaction.getMessageSignature() == null) {
- fail("Message signature is null");
- }
-
- if (interaction.getMessageSignature().getOperation() != null) {
- fail("Operation should be null");
- }
-
- if (interaction.getMessageSignature().getTypes().size() != 1) {
- fail("Only one type expected, but got: "+interaction.getMessageSignature().getTypes().size());
- }
-
- TypeReference ref=interaction.getMessageSignature().getTypes().get(0);
-
- if (ref.getNamespace() == null ||
- ref.getNamespace().equals(ns) == false) {
- fail("Namespace should be '"+ns+"', but found: "+ref.getNamespace());
- }
-
- if (ref.getLocalpart() == null ||
- ref.getLocalpart().equals(lp) == false) {
- fail("Local type should be '"+lp+"', but found: "+ref.getLocalpart());
- }
- }
-
- public void testConvertRPCBased() {
- TestESBService service=new TestESBService();
-
- String ns="MessageTypeNS";
- String lp="MessageType";
- String opname="op";
- String role="Buyer";
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("operation", opname);
- props.put("messageType", "{"+ns+"}"+lp);
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(service);
-
- service.setModel(model);
-
- SendMessageAction action=new SendMessageAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, new DefaultConversionContext(role));
-
- if (activities.size() != 1) {
- fail("Expecting one activity, but got: "+activities.size());
- }
-
- Activity act=activities.get(0);
-
- if ((act instanceof Interaction) == false) {
- fail("Expecting an 'Interaction' activity");
- }
-
- Interaction interaction=(Interaction)act;
-
- if (interaction.getMessageSignature() == null) {
- fail("Message signature is null");
- }
-
- if (interaction.getMessageSignature().getOperation() == null) {
- fail("Operation should not be null");
- }
-
- if (interaction.getMessageSignature().getOperation().equals(opname) == false) {
- fail("Operation expected '"+opname+"', but got: "+
- interaction.getMessageSignature().getOperation());
- }
-
- if (interaction.getMessageSignature().getTypes().size() != 1) {
- fail("Only one type expected, but got: "+interaction.getMessageSignature().getTypes().size());
- }
-
- TypeReference ref=interaction.getMessageSignature().getTypes().get(0);
-
- if (ref.getNamespace() == null ||
- ref.getNamespace().equals(ns) == false) {
- fail("Namespace should be '"+ns+"', but found: "+ref.getNamespace());
- }
-
- if (ref.getLocalpart() == null ||
- ref.getLocalpart().equals(lp) == false) {
- fail("Local type should be '"+lp+"', but found: "+ref.getLocalpart());
- }
- }
-
- public void testIsCreateSession() {
- TestESBService service=new TestESBService();
-
- SendMessageAction action=new SendMessageAction(service, null);
-
- if (action.isSessionType() == true) {
- fail("Action is flagged as a 'CreateSession'");
- }
- }
-
- public void testIsSessionBased() {
- TestESBService service=new TestESBService();
-
- SendMessageAction action=new SendMessageAction(service, null);
-
- if (action.isSessionBased() == false) {
- fail("Action is not flagged as a 'SessionBased'");
- }
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetMessageActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetMessageActionTest.java 2009-03-13 07:34:38 UTC (rev 538)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetMessageActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -1,74 +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.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.SetMessageAction;
-
-import junit.framework.TestCase;
-
-public class SetMessageActionTest extends TestCase {
-
- public void testValidateNoExpression() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- SetMessageAction action=new SetMessageAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{SetMessageAction.STATE_EXPRESSION}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testIsCreateSession() {
- TestESBService service=new TestESBService();
-
- SetMessageAction action=new SetMessageAction(service, null);
-
- if (action.isSessionType() == true) {
- fail("Action is flagged as a 'CreateSession'");
- }
- }
-
- public void testIsSessionBased() {
- TestESBService service=new TestESBService();
-
- SetMessageAction action=new SetMessageAction(service, null);
-
- if (action.isSessionBased() == false) {
- fail("Action is not flagged as a 'SessionBased'");
- }
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetStateActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetStateActionTest.java 2009-03-13 07:34:38 UTC (rev 538)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetStateActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -1,358 +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.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.SetStateAction;
-
-import junit.framework.TestCase;
-
-public class SetStateActionTest extends TestCase {
-
- public void testValidateNoVariable() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(SetStateAction.STATE_EXPRESSION, "");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- SetStateAction action=new SetStateAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{SetStateAction.VARIABLE}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateVariableNotClassProperty() {
- String varName="classX";
- Class<?> cls=java.lang.Object.class;
-
- TestESBService service=new TestESBService();
- service.setRoot(true);
- service.setSessionClass(cls);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(SetStateAction.VARIABLE, varName);
- props.put(SetStateAction.STATE_EXPRESSION, "");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null,
- props, null);
-
- SetStateAction action=new SetStateAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_FOUND_VARIABLE",
- new String[]{varName, cls.getName()}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateVariableIsClassProperty() {
- String varName="writableProperty";
- Class<?> cls=TestClass2.class;
-
- TestESBService service=new TestESBService();
- service.setRoot(true);
- service.setSessionClass(cls);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(SetStateAction.VARIABLE, varName);
- props.put(SetStateAction.STATE_EXPRESSION, "");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null,
- props, null);
-
- SetStateAction action=new SetStateAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateMultiPartVariableIsClassWritableProperty() {
- String varName="testClass2.writableProperty";
- Class<?> cls=TestClass1.class;
-
- TestESBService service=new TestESBService();
- service.setRoot(true);
- service.setSessionClass(cls);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(SetStateAction.VARIABLE, varName);
- props.put(SetStateAction.STATE_EXPRESSION, "");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null,
- props, null);
-
- SetStateAction action=new SetStateAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateMultiPartVariableIsClassNotWritableProperty() {
- String varName="testClass2.readableProperty";
- Class<?> cls=TestClass1.class;
-
- TestESBService service=new TestESBService();
- service.setRoot(true);
- service.setSessionClass(cls);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(SetStateAction.VARIABLE, varName);
- props.put(SetStateAction.STATE_EXPRESSION, "");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null,
- props, null);
-
- SetStateAction action=new SetStateAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_WRITABLE_PROPERTY",
- new String[]{"readableProperty", TestClass2.class.getName()}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateMultiPartVariableIsClassNotReadableProperty() {
- String varName="testClass2.writableProperty";
- Class<?> cls=TestClass3.class;
-
- TestESBService service=new TestESBService();
- service.setRoot(true);
- service.setSessionClass(cls);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(SetStateAction.VARIABLE, varName);
- props.put(SetStateAction.STATE_EXPRESSION, "");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null,
- props, null);
-
- SetStateAction action=new SetStateAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_READABLE_PROPERTY",
- new String[]{"testClass2", TestClass3.class.getName()}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateMissingExpression() {
- String varName="writableProperty";
- Class<?> cls=TestClass2.class;
-
- TestESBService service=new TestESBService();
- service.setRoot(true);
- service.setSessionClass(cls);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(SetStateAction.VARIABLE, varName);
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null,
- props, null);
-
- SetStateAction action=new SetStateAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_MUST_SPECIFY_STATE_OR_MESSAGE_EXPRESSION",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateBothExpressions() {
- String varName="writableProperty";
- Class<?> cls=TestClass2.class;
-
- TestESBService service=new TestESBService();
- service.setRoot(true);
- service.setSessionClass(cls);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(SetStateAction.VARIABLE, varName);
- props.put(SetStateAction.MESSAGE_EXPRESSION, "mesg");
- props.put(SetStateAction.STATE_EXPRESSION, "state");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null,
- props, null);
-
- SetStateAction action=new SetStateAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_MUST_SPECIFY_STATE_OR_MESSAGE_EXPRESSION",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateMessageExpression() {
- String varName="writableProperty";
- Class<?> cls=TestClass2.class;
-
- TestESBService service=new TestESBService();
- service.setRoot(true);
- service.setSessionClass(cls);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put(SetStateAction.VARIABLE, varName);
- props.put(SetStateAction.MESSAGE_EXPRESSION, "mesg");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null,
- props, null);
-
- SetStateAction action=new SetStateAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testIsCreateSession() {
- TestESBService service=new TestESBService();
-
- SetStateAction action=new SetStateAction(service, null);
-
- if (action.isSessionType() == true) {
- fail("Action is flagged as a 'CreateSession'");
- }
- }
-
- public void testIsSessionBased() {
- TestESBService service=new TestESBService();
-
- SetStateAction action=new SetStateAction(service, null);
-
- if (action.isSessionBased() == false) {
- fail("Action is not flagged as a 'SessionBased'");
- }
- }
-
- public class TestClass1 {
- public TestClass1() {
- }
-
- public TestClass2 getTestClass2() {
- return(null);
- }
- }
-
- public class TestClass2 {
- public TestClass2() {
- }
-
- public String getReadableProperty() {
- return(null);
- }
-
- public void setWritableProperty(String str) {
- }
- }
-
- public class TestClass3 {
- public TestClass3() {
- }
-
- public void setTestClass2(TestClass2 tc2) {
- }
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SwitchActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SwitchActionTest.java 2009-03-13 07:34:38 UTC (rev 538)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SwitchActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -1,382 +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.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.SwitchAction;
-import org.scribble.conversation.model.If;
-import org.scribble.model.Activity;
-
-import junit.framework.TestCase;
-
-public class SwitchActionTest extends TestCase {
-
- public void testValidatePathsSpecified() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- SwitchAction action=new SwitchAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{"paths"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateServiceNotFound() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><case service-category=\"cat1\" " +
- "service-name=\"name1\" /><case service-category=\"cat2\" " +
- "service-name=\"name2\" /><case service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(service);
-
- service.setModel(model);
-
- SwitchAction action=new SwitchAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{"cat1","name1"}));
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{"cat2","name2"}));
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{"cat3","name3"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateLessThanOnePath() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat3");
- other2.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(service);
-
- service.setModel(model);
-
- SwitchAction action=new SwitchAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_SWITCH_ONE_OR_MORE_PATHS",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateMissingServiceDetails() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><case service-category=\"cat1\" " +
- "service-name=\"name1\" /><case " +
- "service-name=\"name2\" /><case service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- SwitchAction action=new SwitchAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_PATH_SERVICE_DETAILS_MISSING",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testConvert() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><case service-category=\"cat1\" " +
- "service-name=\"name1\" /><case service-category=\"cat2\" " +
- "service-name=\"name2\" /><case service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestActivity act1=new TestActivity();
- other1.getContents().add(act1);
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestActivity act2=new TestActivity();
- other2.getContents().add(act2);
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestActivity act3=new TestActivity();
- other3.getContents().add(act3);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- SwitchAction action=new SwitchAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, null);
-
- if (activities.size() != 1) {
- fail("Expecting one activity, but got: "+activities.size());
- }
-
- Activity act=activities.get(0);
-
- if ((act instanceof If) == false) {
- fail("Expecting an 'If' activity");
- }
-
- If ifAction=(If)act;
-
- if (ifAction.getConditionalBlocks().size() != 3) {
- fail("Expecting three conditional blocks: "+ifAction.getConditionalBlocks().size());
- }
-
- if (ifAction.getConditionalBlocks().get(0).getContents().size() != 1 ||
- ifAction.getConditionalBlocks().get(0).getContents().get(0) != act1) {
- fail("First conditional block should have 1 activity = act1");
- }
-
- if (ifAction.getConditionalBlocks().get(1).getContents().size() != 1 ||
- ifAction.getConditionalBlocks().get(1).getContents().get(0) != act2) {
- fail("Second conditional block should have 1 activity = act2");
- }
-
- if (ifAction.getConditionalBlocks().get(2).getContents().size() != 1 ||
- ifAction.getConditionalBlocks().get(2).getContents().get(0) != act3) {
- fail("Third conditional block should have 1 activity = act3");
- }
-
- if (ifAction.getElseBlock() != null) {
- fail("Else block should not be defined");
- }
- }
-
- public void testConvertNotExcludingEmptyPaths() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><case service-category=\"cat1\" " +
- "service-name=\"name1\" /><case service-category=\"cat2\" " +
- "service-name=\"name2\" /><case service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestActivity act1=new TestActivity();
- other1.getContents().add(act1);
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestActivity act3=new TestActivity();
- other3.getContents().add(act3);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- SwitchAction action=new SwitchAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, null);
-
- if (activities.size() != 1) {
- fail("Expecting one activity, but got: "+activities.size());
- }
-
- Activity act=activities.get(0);
-
- if ((act instanceof If) == false) {
- fail("Expecting an 'If' activity");
- }
-
- If ifAction=(If)act;
-
- if (ifAction.getConditionalBlocks().size() != 3) {
- fail("Expecting three conditional blocks: "+ifAction.getConditionalBlocks().size());
- }
-
- if (ifAction.getConditionalBlocks().get(0).getContents().size() != 1 ||
- ifAction.getConditionalBlocks().get(0).getContents().get(0) != act1) {
- fail("First conditional block should have 1 activity = act1");
- }
-
- if (ifAction.getConditionalBlocks().get(1).getContents().size() != 0) {
- fail("Second conditional block should be empty");
- }
-
- if (ifAction.getConditionalBlocks().get(2).getContents().size() != 1 ||
- ifAction.getConditionalBlocks().get(2).getContents().get(0) != act3) {
- fail("Third conditional block should have 1 activity = act3");
- }
-
- if (ifAction.getElseBlock() != null) {
- fail("Else block should not be defined");
- }
- }
-
- public void testIsCreateSession() {
- TestESBService service=new TestESBService();
-
- SwitchAction action=new SwitchAction(service, null);
-
- if (action.isSessionType() == true) {
- fail("Action is flagged as a 'CreateSession'");
- }
- }
-
- public void testIsSessionBased() {
- TestESBService service=new TestESBService();
-
- SwitchAction action=new SwitchAction(service, null);
-
- if (action.isSessionBased() == false) {
- fail("Action is not flagged as a 'SessionBased'");
- }
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhenActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhenActionTest.java 2009-03-13 07:34:38 UTC (rev 538)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhenActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -1,374 +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.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.WhenAction;
-import org.scribble.conversation.model.*;
-import org.scribble.model.*;
-
-import junit.framework.TestCase;
-
-public class WhenActionTest extends TestCase {
-
- public void testValidatePathsSpecified() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- WhenAction action=new WhenAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{"paths"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateServiceNotFound() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><when service-category=\"cat1\" " +
- "service-name=\"name1\" /><when service-category=\"cat2\" " +
- "service-name=\"name2\" /><when service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(service);
-
- service.setModel(model);
-
- WhenAction action=new WhenAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{"cat1","name1"}));
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{"cat2","name2"}));
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{"cat3","name3"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateLessThanOnePath() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat3");
- other2.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(service);
-
- service.setModel(model);
-
- WhenAction action=new WhenAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_WHEN_ONE_OR_MORE_PATHS",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateMissingServiceDetails() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><when service-category=\"cat1\" " +
- "service-name=\"name1\" /><when " +
- "service-name=\"name2\" /><when service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- WhenAction action=new WhenAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_PATH_SERVICE_DETAILS_MISSING",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testConvert() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><when service-category=\"cat1\" " +
- "service-name=\"name1\" /><when service-category=\"cat2\" " +
- "service-name=\"name2\" /><when service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestActivity act1=new TestActivity();
- other1.getContents().add(act1);
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestActivity act2=new TestActivity();
- other2.getContents().add(act2);
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestActivity act3=new TestActivity();
- other3.getContents().add(act3);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- WhenAction action=new WhenAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, null);
-
- if (activities.size() != 1) {
- fail("Expecting one activity, but got: "+activities.size());
- }
-
- Activity act=activities.get(0);
-
- if ((act instanceof When) == false) {
- fail("Expecting an 'When' activity");
- }
-
- When whenAction=(When)act;
-
- if (whenAction.getConditionalBlocks().size() != 3) {
- fail("Expecting three conditional blocks: "+whenAction.getConditionalBlocks().size());
- }
-
- if (whenAction.getConditionalBlocks().get(0).getContents().size() != 1 ||
- whenAction.getConditionalBlocks().get(0).getContents().get(0) != act1) {
- fail("First conditional block should have 1 activity = act1");
- }
-
- if (whenAction.getConditionalBlocks().get(1).getContents().size() != 1 ||
- whenAction.getConditionalBlocks().get(1).getContents().get(0) != act2) {
- fail("Second conditional block should have 1 activity = act2");
- }
-
- if (whenAction.getConditionalBlocks().get(2).getContents().size() != 1 ||
- whenAction.getConditionalBlocks().get(2).getContents().get(0) != act3) {
- fail("Second conditional block should have 1 activity = act3");
- }
- }
-
- public void testConvertNotExcludingEmptyPath() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><when service-category=\"cat1\" " +
- "service-name=\"name1\" /><when service-category=\"cat2\" " +
- "service-name=\"name2\" /><when service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestActivity act1=new TestActivity();
- other1.getContents().add(act1);
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestActivity act3=new TestActivity();
- other3.getContents().add(act3);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- WhenAction action=new WhenAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, null);
-
- if (activities.size() != 1) {
- fail("Expecting one activity, but got: "+activities.size());
- }
-
- Activity act=activities.get(0);
-
- if ((act instanceof When) == false) {
- fail("Expecting an 'When' activity");
- }
-
- When whenAction=(When)act;
-
- if (whenAction.getConditionalBlocks().size() != 3) {
- fail("Expecting three conditional blocks: "+whenAction.getConditionalBlocks().size());
- }
-
- if (whenAction.getConditionalBlocks().get(0).getContents().size() != 1 ||
- whenAction.getConditionalBlocks().get(0).getContents().get(0) != act1) {
- fail("First conditional block should have 1 activity = act1");
- }
-
- if (whenAction.getConditionalBlocks().get(1).getContents().size() != 0) {
- fail("Second conditional block should be empty");
- }
-
- if (whenAction.getConditionalBlocks().get(2).getContents().size() != 1 ||
- whenAction.getConditionalBlocks().get(2).getContents().get(0) != act3) {
- fail("Third conditional block should have 1 activity = act3");
- }
- }
-
- public void testIsCreateSession() {
- TestESBService service=new TestESBService();
-
- WhenAction action=new WhenAction(service, null);
-
- if (action.isSessionType() == true) {
- fail("Action is flagged as a 'CreateSession'");
- }
- }
-
- public void testIsSessionBased() {
- TestESBService service=new TestESBService();
-
- WhenAction action=new WhenAction(service, null);
-
- if (action.isSessionBased() == false) {
- fail("Action is not flagged as a 'SessionBased'");
- }
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhileActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhileActionTest.java 2009-03-13 07:34:38 UTC (rev 538)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhileActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -1,565 +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.runtime.jbossesb.model.actions;
-
-import org.scribble.conversation.model.*;
-import org.scribble.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.WhileAction;
-
-import junit.framework.TestCase;
-
-public class WhileActionTest extends TestCase {
-
- public void testValidatePathsSpecified() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- WhileAction action=new WhileAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{"paths"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateServiceNotFound() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><while service-category=\"cat1\" " +
- "service-name=\"name1\" /><exit service-category=\"cat2\" " +
- "service-name=\"name2\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(service);
-
- service.setModel(model);
-
- WhileAction action=new WhileAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{"cat1","name1"}));
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{"cat2","name2"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateOneWhilePath() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><while service-category=\"cat1\" " +
- "service-name=\"name1\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat3");
- other2.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(service);
-
- service.setModel(model);
-
- WhileAction action=new WhileAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_MUST_DEFINE_SINGLE_WHILE_EXIT",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateOneWhileExit() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><exit service-category=\"cat2\" " +
- "service-name=\"name2\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(service);
-
- service.setModel(model);
-
- WhileAction action=new WhileAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_MUST_DEFINE_SINGLE_WHILE_PATH",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateMissingServiceDetails1() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><while " +
- "service-name=\"name2\" /><exit service-category=\"cat3\" " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- WhileAction action=new WhileAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_PATH_SERVICE_DETAILS_MISSING",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateMissingServiceDetails2() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><while service-category=\"cat2\" " +
- "service-name=\"name2\" /><exit " +
- "service-name=\"name3\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- WhileAction action=new WhileAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_PATH_SERVICE_DETAILS_MISSING",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateOutOfOrderExit() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><exit service-category=\"cat1\" " +
- "service-name=\"name1\" /><while service-category=\"cat2\" " +
- "service-name=\"name2\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBService other3=new TestESBService();
- other3.setCategory("cat3");
- other3.setName("name3");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(other3);
- model.addService(service);
-
- service.setModel(model);
-
- WhileAction action=new WhileAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_WHILE_PATH_AFTER_EXIT",
- new String[]{}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateImmediateWhile() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><while service-category=\"cat1\" " +
- "service-name=\"name1\" immediate=\"fred\" /><exit service-category=\"cat2\" " +
- "service-name=\"name2\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(service);
-
- service.setModel(model);
-
- WhileAction action=new WhileAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_BOOLEAN",
- new String[]{WhileAction.IMMEDIATE}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateImmediateExit() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><while service-category=\"cat1\" " +
- "service-name=\"name1\" /><exit service-category=\"cat2\" " +
- "service-name=\"name2\" immediate=\"fred\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(service);
-
- service.setModel(model);
-
- WhileAction action=new WhileAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
- "_BOOLEAN",
- new String[]{WhileAction.IMMEDIATE}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testConvert() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><while service-category=\"cat1\" " +
- "service-name=\"name1\" /><exit service-category=\"cat2\" " +
- "service-name=\"name2\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestActivity act1=new TestActivity();
- other1.getContents().add(act1);
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestActivity act2=new TestActivity();
- other2.getContents().add(act2);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(service);
-
- service.setModel(model);
-
- WhileAction action=new WhileAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, new DefaultConversionContext(null));
-
- if (activities.size() != 2) {
- fail("Expecting two activities, but got: "+activities.size());
- }
-
- Activity act=activities.get(0);
-
- if ((act instanceof While) == false) {
- fail("Expecting an 'While' activity");
- }
-
- While whileAction=(While)act;
-
- if (whileAction.getBlock().getContents().size() != 1) {
- fail("Expecting one entry in while block: "+whileAction.getBlock().getContents().size());
- }
-
- if (whileAction.getBlock().getContents().get(0) != act1) {
- fail("While block should have 1 activity = act1");
- }
-
- if (activities.get(1) != act2) {
- fail("Activity following while should be act2");
- }
- }
-
- public void testConvertNotExcludingEmptyBody() {
- TestESBService service=new TestESBService();
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("paths", "<property><while service-category=\"cat1\" " +
- "service-name=\"name1\" /><exit service-category=\"cat2\" " +
- "service-name=\"name2\" /></property>");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
-
- TestESBService other1=new TestESBService();
- other1.setCategory("cat1");
- other1.setName("name1");
-
- TestESBService other2=new TestESBService();
- other2.setCategory("cat2");
- other2.setName("name2");
-
- TestActivity act2=new TestActivity();
- other2.getContents().add(act2);
-
- TestESBLanguageModel model=new TestESBLanguageModel();
- model.addService(other1);
- model.addService(other2);
- model.addService(service);
-
- service.setModel(model);
-
- WhileAction action=new WhileAction(service, elem);
- action.initializeLinks();
-
- service.getActions().add(action);
-
- java.util.List<Activity> activities=new java.util.Vector<Activity>();
-
- action.convert(activities, new DefaultConversionContext(null));
-
- if (activities.size() != 2) {
- fail("Expecting two activities, but got: "+activities.size());
- }
-
- Activity act=activities.get(0);
-
- if ((act instanceof While) == false) {
- fail("Expecting an 'While' activity");
- }
-
- While whileAction=(While)act;
-
- if (whileAction.getBlock().getContents().size() != 0) {
- fail("Expecting zero entries in while block: "+whileAction.getBlock().getContents().size());
- }
-
- if (activities.get(1) != act2) {
- fail("Activity following while should be act2");
- }
- }
-
- public void testIsCreateSession() {
- TestESBService service=new TestESBService();
-
- WhileAction action=new WhileAction(service, null);
-
- if (action.isSessionType() == true) {
- fail("Action is flagged as a 'CreateSession'");
- }
- }
-
- public void testIsSessionBased() {
- TestESBService service=new TestESBService();
-
- WhileAction action=new WhileAction(service, null);
-
- if (action.isSessionBased() == false) {
- fail("Action is not flagged as a 'SessionBased'");
- }
- }
-}
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/CreateSessionActionTest.java (from rev 531, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/CreateSessionActionTest.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/CreateSessionActionTest.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/CreateSessionActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -0,0 +1,190 @@
+/*
+ * 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.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.ESBActionTestUtil;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.CreateSessionAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.UnsupportedAction;
+
+import junit.framework.TestCase;
+
+public class CreateSessionActionTest extends TestCase {
+
+ public void testValidateFirstAction() {
+ TestESBService service=new TestESBService();
+
+ UnsupportedAction unsupported=new UnsupportedAction(service, null);
+
+ CreateSessionAction action=new CreateSessionAction(service, null);
+
+ service.getActions().add(action);
+ service.getActions().add(unsupported);
+
+ TestModelListener l=new TestModelListener();
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateNotFirstAction() {
+ TestESBService service=new TestESBService();
+
+ UnsupportedAction unsupported=new UnsupportedAction(service, null);
+
+ CreateSessionAction action=new CreateSessionAction(service, null);
+
+ service.getActions().add(unsupported);
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_MUST_BE_FIRST_ACTION",
+ new String[]{"CreateSession"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateRootNoConversationType() {
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ CreateSessionAction action=new CreateSessionAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_CONVERSATION_TYPE",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateRootWithConversationType() {
+ String convType="test.Type@MyRole";
+
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(service);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("conversationType", convType);
+
+ service.setConversationType(convType);
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ CreateSessionAction action=new CreateSessionAction(service, elem);
+
+ service.getActions().add(action);
+
+ service.setModel(model);
+
+ TestModelListener l=new TestModelListener();
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+
+ public void testValidateRootWithConversationTypeNoRole() {
+ String convType="test.Type";
+
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(service);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("conversationType", convType);
+
+ service.setConversationType(convType);
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ CreateSessionAction action=new CreateSessionAction(service, elem);
+
+ service.getActions().add(action);
+
+ service.setModel(model);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_CONVERSATION_TYPE_ROLE",
+ new String[]{convType}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testIsCreateSession() {
+ TestESBService service=new TestESBService();
+
+ CreateSessionAction action=new CreateSessionAction(service, null);
+
+ if (action.isSessionType() == false) {
+ fail("Action is not flagged as a 'CreateSession'");
+ }
+ }
+
+ public void testIsSessionBased() {
+ TestESBService service=new TestESBService();
+
+ CreateSessionAction action=new CreateSessionAction(service, null);
+
+ if (action.isSessionBased() == false) {
+ fail("Action is not flagged as a 'SessionBased'");
+ }
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/CreateSessionActionTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/IfActionTest.java (from rev 531, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/IfActionTest.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/IfActionTest.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/IfActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -0,0 +1,632 @@
+/*
+ * 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.runtime.jbossesb.model.actions.stateful;
+
+import junit.framework.TestCase;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.ESBActionTestUtil;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.TestActivity;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.IfAction;
+import org.scribble.model.*;
+import org.scribble.conversation.model.*;
+
+public class IfActionTest extends TestCase {
+
+ public void testValidatePathsSpecified() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ IfAction action=new IfAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_PROPERTY",
+ new String[]{"paths"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateServiceNotFound() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><if service-category=\"cat1\" " +
+ "service-name=\"name1\" /><elseif service-category=\"cat2\" " +
+ "service-name=\"name2\" /><else service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(service);
+
+ service.setModel(model);
+
+ IfAction action=new IfAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{"cat1","name1"}));
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{"cat2","name2"}));
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{"cat3","name3"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateNoPathsContent() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat3");
+ other2.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(service);
+
+ service.setModel(model);
+
+ IfAction action=new IfAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_IF_ORDER_WRONG",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateOnlyOneIf() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><if service-category=\"cat1\" " +
+ "service-name=\"name1\" /><elseif service-category=\"cat2\" " +
+ "service-name=\"name2\" /><if service-category=\"cat3\" " +
+ "service-name=\"name3\" /><else service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ IfAction action=new IfAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_IF_ORDER_WRONG",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateOutOfOrderElse() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><if service-category=\"cat1\" " +
+ "service-name=\"name1\" /><else service-category=\"cat3\" " +
+ "service-name=\"name3\" /><elseif service-category=\"cat2\" " +
+ "service-name=\"name2\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ IfAction action=new IfAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_IF_ORDER_WRONG",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateMissingServiceDetails() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><if service-category=\"cat1\" " +
+ "service-name=\"name1\" /><elseif " +
+ "service-name=\"name2\" /><else service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ IfAction action=new IfAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PATH_SERVICE_DETAILS_MISSING",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateImmediateIf() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><if service-category=\"cat1\" " +
+ "service-name=\"name1\" immediate=\"fred\" /><elseif service-category=\"cat2\" " +
+ "service-name=\"name2\" /><else service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ IfAction action=new IfAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_BOOLEAN",
+ new String[]{IfAction.IMMEDIATE}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateImmediateElseIf() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><if service-category=\"cat1\" " +
+ "service-name=\"name1\" /><elseif service-category=\"cat2\" " +
+ "service-name=\"name2\" immediate=\"fred\" /><else service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ IfAction action=new IfAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_BOOLEAN",
+ new String[]{IfAction.IMMEDIATE}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateImmediateElse() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><if service-category=\"cat1\" " +
+ "service-name=\"name1\" /><elseif service-category=\"cat2\" " +
+ "service-name=\"name2\" /><else service-category=\"cat3\" " +
+ "service-name=\"name3\" immediate=\"fred\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ IfAction action=new IfAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_BOOLEAN",
+ new String[]{IfAction.IMMEDIATE}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testConvert() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><if service-category=\"cat1\" " +
+ "service-name=\"name1\" /><elseif service-category=\"cat2\" " +
+ "service-name=\"name2\" /><else service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestActivity act1=new TestActivity();
+ other1.getContents().add(act1);
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestActivity act2=new TestActivity();
+ other2.getContents().add(act2);
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestActivity act3=new TestActivity();
+ other3.getContents().add(act3);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ IfAction action=new IfAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, null);
+
+ if (activities.size() != 1) {
+ fail("Expecting one activity, but got: "+activities.size());
+ }
+
+ Activity act=activities.get(0);
+
+ if ((act instanceof If) == false) {
+ fail("Expecting an 'If' activity");
+ }
+
+ If ifAction=(If)act;
+
+ if (ifAction.getConditionalBlocks().size() != 2) {
+ fail("Expecting two conditional blocks: "+ifAction.getConditionalBlocks().size());
+ }
+
+ if (ifAction.getConditionalBlocks().get(0).getContents().size() != 1 ||
+ ifAction.getConditionalBlocks().get(0).getContents().get(0) != act1) {
+ fail("First conditional block should have 1 activity = act1");
+ }
+
+ if (ifAction.getConditionalBlocks().get(1).getContents().size() != 1 ||
+ ifAction.getConditionalBlocks().get(1).getContents().get(0) != act2) {
+ fail("Second conditional block should have 1 activity = act2");
+ }
+
+ if (ifAction.getElseBlock() == null) {
+ fail("Else block not defined");
+ }
+
+ if (ifAction.getElseBlock().getContents().size() != 1 ||
+ ifAction.getElseBlock().getContents().get(0) != act3) {
+ fail("Else block should have 1 activity = act3");
+ }
+ }
+
+ public void testConvertNotExcludingEmptyPaths() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><if service-category=\"cat1\" " +
+ "service-name=\"name1\" /><elseif service-category=\"cat2\" " +
+ "service-name=\"name2\" /><else service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ IfAction action=new IfAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, null);
+
+ if (activities.size() != 1) {
+ fail("Expecting one activity, but got: "+activities.size());
+ }
+
+ Activity act=activities.get(0);
+
+ if ((act instanceof If) == false) {
+ fail("Expecting an 'If' activity");
+ }
+
+ If ifAction=(If)act;
+
+ if (ifAction.getConditionalBlocks().size() != 2) {
+ fail("Expecting two conditional blocks: "+ifAction.getConditionalBlocks().size());
+ }
+
+ if (ifAction.getConditionalBlocks().get(0).getContents().size() != 0) {
+ fail("First conditional block should be empty");
+ }
+
+ if (ifAction.getConditionalBlocks().get(1).getContents().size() != 0) {
+ fail("Second conditional block should be empty");
+ }
+
+ if (ifAction.getElseBlock() == null) {
+ fail("Else block not defined");
+ }
+
+ if (ifAction.getElseBlock().getContents().size() != 0) {
+ fail("Else block should have be empty");
+ }
+ }
+
+ public void testIsCreateSession() {
+ TestESBService service=new TestESBService();
+
+ IfAction action=new IfAction(service, null);
+
+ if (action.isSessionType() == true) {
+ fail("Action is flagged as a 'CreateSession'");
+ }
+ }
+
+ public void testIsSessionBased() {
+ TestESBService service=new TestESBService();
+
+ IfAction action=new IfAction(service, null);
+
+ if (action.isSessionBased() == false) {
+ fail("Action is not flagged as a 'SessionBased'");
+ }
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/IfActionTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/MessageRouterActionTest.java (from rev 531, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/MessageRouterActionTest.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/MessageRouterActionTest.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/MessageRouterActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -0,0 +1,273 @@
+/*
+ * 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.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.ESBActionTestUtil;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.MessageRouterAction;
+
+import junit.framework.TestCase;
+
+public class MessageRouterActionTest extends TestCase {
+
+ public void testValidatePathsSpecified() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ MessageRouterAction action=new MessageRouterAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_PROPERTY",
+ new String[]{"paths"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateSessionBasedService() {
+ TestESBService service=new TestESBService();
+ service.setSessionBased(true);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><route service-category=\"cat1\" " +
+ "service-name=\"name1\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ MessageRouterAction action=new MessageRouterAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_CANNOT_SESSION_BASED_ACTIONS_WITH_ROUTER",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateServiceNotFound() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><route service-category=\"cat1\" " +
+ "service-name=\"name1\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(service);
+
+ service.setModel(model);
+
+ MessageRouterAction action=new MessageRouterAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{"cat1","name1"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateInitiateServiceNotRoot() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><route service-category=\"cat1\" " +
+ "service-name=\"name1\" initiate=\"true\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other=new TestESBService();
+ other.setCategory("cat1");
+ other.setName("name1");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other);
+ model.addService(service);
+
+ service.setModel(model);
+
+ MessageRouterAction action=new MessageRouterAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_CANNOT_INITIATE_NON_ROOT",
+ new String[]{other.getCategory(),
+ other.getName()}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateNotInitiateRootService() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><route service-category=\"cat1\" " +
+ "service-name=\"name1\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other=new TestESBService();
+ other.setCategory("cat1");
+ other.setName("name1");
+ other.setRoot(true);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other);
+ model.addService(service);
+
+ service.setModel(model);
+
+ MessageRouterAction action=new MessageRouterAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_MUST_INITIATE_ROOT",
+ new String[]{other.getCategory(),
+ other.getName()}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateNoRoutes() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ MessageRouterAction action=new MessageRouterAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_ROUTER_ONE_OR_MORE_PATHS",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateServiceDetailsMissing() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><route service-category=\"cat1\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ MessageRouterAction action=new MessageRouterAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PATH_SERVICE_DETAILS_MISSING",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testIsCreateSession() {
+ TestESBService service=new TestESBService();
+
+ MessageRouterAction action=new MessageRouterAction(service, null);
+
+ if (action.isSessionType() == true) {
+ fail("Action is flagged as a 'CreateSession'");
+ }
+ }
+
+ public void testIsSessionBased() {
+ TestESBService service=new TestESBService();
+
+ MessageRouterAction action=new MessageRouterAction(service, null);
+
+ if (action.isSessionBased() == true) {
+ fail("Action is flagged as a 'SessionBased'");
+ }
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/MessageRouterActionTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ParallelActionTest.java (from rev 531, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ParallelActionTest.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ParallelActionTest.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ParallelActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -0,0 +1,528 @@
+/*
+ * 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.runtime.jbossesb.model.actions.stateful;
+
+import org.scribble.conversation.model.*;
+import org.scribble.model.Activity;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.ESBActionTestUtil;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.TestActivity;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.ParallelAction;
+
+import junit.framework.TestCase;
+
+public class ParallelActionTest extends TestCase {
+
+ public void testValidatePathsSpecified() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ ParallelAction action=new ParallelAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_PROPERTY",
+ new String[]{"paths"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateServiceNotFound() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><path service-category=\"cat1\" " +
+ "service-name=\"name1\" /><path service-category=\"cat2\" " +
+ "service-name=\"name2\" /><join service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(service);
+
+ service.setModel(model);
+
+ ParallelAction action=new ParallelAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{"cat1","name1"}));
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{"cat2","name2"}));
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{"cat3","name3"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateLessThanTwoPaths() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><path service-category=\"cat1\" " +
+ "service-name=\"name1\" /><join service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat3");
+ other2.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(service);
+
+ service.setModel(model);
+
+ ParallelAction action=new ParallelAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PARALLEL_MORE_THAN_TWO_PATHS",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateOnlyOneJoin() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><path service-category=\"cat1\" " +
+ "service-name=\"name1\" /><path service-category=\"cat2\" " +
+ "service-name=\"name2\" /><join service-category=\"cat3\" " +
+ "service-name=\"name3\" /><join service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ ParallelAction action=new ParallelAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_MULTIPLE_JOINS",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateOutOfOrderJoin() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><path service-category=\"cat1\" " +
+ "service-name=\"name1\" /><join service-category=\"cat3\" " +
+ "service-name=\"name3\" /><path service-category=\"cat2\" " +
+ "service-name=\"name2\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ ParallelAction action=new ParallelAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PARALLEL_PATH_AFTER_JOIN",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateMissingServiceDetails() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><path service-category=\"cat1\" " +
+ "service-name=\"name1\" /><path " +
+ "service-name=\"name2\" /><join service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ ParallelAction action=new ParallelAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PATH_SERVICE_DETAILS_MISSING",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateImmediate() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><path service-category=\"cat1\" " +
+ "service-name=\"name1\" /><path service-category=\"cat2\" " +
+ "service-name=\"name2\" immediate=\"fred\" /><join service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ ParallelAction action=new ParallelAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_BOOLEAN",
+ new String[]{ParallelAction.IMMEDIATE}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testConvert() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><path service-category=\"cat1\" " +
+ "service-name=\"name1\" /><path service-category=\"cat2\" " +
+ "service-name=\"name2\" /><join service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestActivity act1=new TestActivity();
+ other1.getContents().add(act1);
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestActivity act2=new TestActivity();
+ other2.getContents().add(act2);
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestActivity act3=new TestActivity();
+ other3.getContents().add(act3);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ ParallelAction action=new ParallelAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, new DefaultConversionContext(null));
+
+ if (activities.size() != 2) {
+ fail("Expecting two activities, but got: "+activities.size());
+ }
+
+ Activity act=activities.get(0);
+
+ if ((act instanceof Parallel) == false) {
+ fail("Expecting an 'Parallel' activity");
+ }
+
+ Parallel parallelAction=(Parallel)act;
+
+ if (parallelAction.getBlocks().size() != 2) {
+ fail("Expecting two blocks: "+parallelAction.getBlocks().size());
+ }
+
+ if (parallelAction.getBlocks().get(0).getContents().size() != 1 ||
+ parallelAction.getBlocks().get(0).getContents().get(0) != act1) {
+ fail("First conditional block should have 1 activity = act1");
+ }
+
+ if (parallelAction.getBlocks().get(1).getContents().size() != 1 ||
+ parallelAction.getBlocks().get(1).getContents().get(0) != act2) {
+ fail("Second conditional block should have 1 activity = act2");
+ }
+
+ if (activities.get(1) != act3) {
+ fail("Activity after parallel should be act3");
+ }
+ }
+
+ public void testConvertNotExcludingEmptyPaths() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><path service-category=\"cat1\" " +
+ "service-name=\"name1\" /><path service-category=\"cat2\" " +
+ "service-name=\"name2\" /><join service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestActivity act1=new TestActivity();
+ other1.getContents().add(act1);
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestActivity act3=new TestActivity();
+ other3.getContents().add(act3);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ ParallelAction action=new ParallelAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, new DefaultConversionContext(null));
+
+ if (activities.size() != 2) {
+ fail("Expecting two activities, but got: "+activities.size());
+ }
+
+ Activity act=activities.get(0);
+
+ if ((act instanceof Parallel) == false) {
+ fail("Expecting an 'Parallel' activity");
+ }
+
+ Parallel parallelAction=(Parallel)act;
+
+ if (parallelAction.getBlocks().size() != 2) {
+ fail("Expecting two blocks: "+parallelAction.getBlocks().size());
+ }
+
+ if (parallelAction.getBlocks().get(0).getContents().size() != 1 ||
+ parallelAction.getBlocks().get(0).getContents().get(0) != act1) {
+ fail("First conditional block should have 1 activity = act1");
+ }
+
+ if (parallelAction.getBlocks().get(1).getContents().size() != 0) {
+ fail("Second conditional block should be empty");
+ }
+
+ if (activities.get(1) != act3) {
+ fail("Activity after parallel should be act3");
+ }
+ }
+
+ public void testIsCreateSession() {
+ TestESBService service=new TestESBService();
+
+ ParallelAction action=new ParallelAction(service, null);
+
+ if (action.isSessionType() == true) {
+ fail("Action is flagged as a 'CreateSession'");
+ }
+ }
+
+ public void testIsSessionBased() {
+ TestESBService service=new TestESBService();
+
+ ParallelAction action=new ParallelAction(service, null);
+
+ if (action.isSessionBased() == false) {
+ fail("Action is not flagged as a 'SessionBased'");
+ }
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ParallelActionTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/PerformActionTest.java (from rev 531, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/PerformActionTest.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/PerformActionTest.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/PerformActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -0,0 +1,781 @@
+/*
+ * 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.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.ESBActionTestUtil;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.TestActivity;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.PerformAction;
+import org.scribble.conversation.model.*;
+import org.scribble.model.Activity;
+
+import junit.framework.TestCase;
+
+public class PerformActionTest extends TestCase {
+
+ public void testValidateNoServiceCategory() {
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(PerformAction.SERVICE_NAME, "");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ PerformAction action=new PerformAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_PROPERTY",
+ new String[]{"serviceCategory"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateNoServiceName() {
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(PerformAction.SERVICE_CATEGORY, "");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ PerformAction action=new PerformAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_PROPERTY",
+ new String[]{"serviceName"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateService() {
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(PerformAction.SERVICE_CATEGORY, "cat1");
+ props.put(PerformAction.SERVICE_NAME, "name1");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(service);
+
+ service.setModel(model);
+
+ PerformAction action=new PerformAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{"cat1", "name1"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateReturnService() {
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(PerformAction.SERVICE_CATEGORY, "cat1");
+ props.put(PerformAction.SERVICE_NAME, "name1");
+ props.put(PerformAction.RETURN_SERVICE_CATEGORY, "cat2");
+ props.put(PerformAction.RETURN_SERVICE_NAME, "name2");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+ other1.setCreateSession(true);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(service);
+
+ service.setModel(model);
+
+ PerformAction action=new PerformAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{"cat2", "name2"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateServiceCreatesSession() {
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(PerformAction.SERVICE_CATEGORY, "cat1");
+ props.put(PerformAction.SERVICE_NAME, "name1");
+ props.put(PerformAction.RETURN_SERVICE_CATEGORY, "cat2");
+ props.put(PerformAction.RETURN_SERVICE_NAME, "name2");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+ other1.setCreateSession(false);
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(service);
+
+ service.setModel(model);
+
+ PerformAction action=new PerformAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_FOUND_PERFORM_CREATE_SESSION",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateParentReferenceNotFound() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(PerformAction.SERVICE_CATEGORY, "cat1");
+ props.put(PerformAction.SERVICE_NAME, "name1");
+ props.put(PerformAction.PARENT_REFERENCE, "fred");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+ other1.setCreateSession(true);
+ other1.setSessionClass(Object.class);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(service);
+
+ service.setModel(model);
+
+ PerformAction action=new PerformAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_FOUND_VARIABLE",
+ new String[]{"fred", Object.class.getName()}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateParentReferenceNotWritable() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(PerformAction.SERVICE_CATEGORY, "cat1");
+ props.put(PerformAction.SERVICE_NAME, "name1");
+ props.put(PerformAction.PARENT_REFERENCE, "class");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+ other1.setCreateSession(true);
+ other1.setSessionClass(Object.class);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(service);
+
+ service.setModel(model);
+
+ PerformAction action=new PerformAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_WRITABLE_PROPERTY",
+ new String[]{"class", Object.class.getName()}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateParentReferenceIncorrectType() {
+ TestESBService service=new TestESBService();
+ service.setSessionClass(ParentPojo.class);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(PerformAction.SERVICE_CATEGORY, "cat1");
+ props.put(PerformAction.SERVICE_NAME, "name1");
+ props.put(PerformAction.PARENT_REFERENCE, "invalidParent");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+ other1.setCreateSession(true);
+ other1.setSessionClass(ChildPojo.class);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(service);
+
+ service.setModel(model);
+
+ PerformAction action=new PerformAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_INVALID_PROPERTY_TYPE",
+ new String[]{"invalidParent",
+ ChildPojo.class.getName(),
+ ParentPojo.class.getName()}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateParentReferenceCorrectType() {
+ TestESBService service=new TestESBService();
+ service.setSessionClass(ParentPojo.class);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(PerformAction.SERVICE_CATEGORY, "cat1");
+ props.put(PerformAction.SERVICE_NAME, "name1");
+ props.put(PerformAction.PARENT_REFERENCE, "validParent");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+ other1.setCreateSession(true);
+ other1.setSessionClass(ChildPojo.class);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(service);
+
+ service.setModel(model);
+
+ PerformAction action=new PerformAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateParentReferenceCorrectType2() {
+ TestESBService service=new TestESBService();
+ service.setSessionClass(ParentPojo.class);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(PerformAction.SERVICE_CATEGORY, "cat1");
+ props.put(PerformAction.SERVICE_NAME, "name1");
+ props.put(PerformAction.PARENT_REFERENCE, "validParentView");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+ other1.setCreateSession(true);
+ other1.setSessionClass(ChildPojo.class);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(service);
+
+ service.setModel(model);
+
+ PerformAction action=new PerformAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateBindDetailsNotFound() {
+ TestESBService service=new TestESBService();
+
+ String varName="fred";
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(PerformAction.SERVICE_CATEGORY, "cat1");
+ props.put(PerformAction.SERVICE_NAME, "name1");
+
+ java.util.Map<String,String> customProps=new java.util.Hashtable<String,String>();
+ customProps.put(PerformAction.BIND_DETAILS,
+ "<root><bind to-variable=\""+varName+"\" /></root>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, customProps);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+ other1.setCreateSession(true);
+ other1.setSessionClass(Object.class);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(service);
+
+ service.setModel(model);
+
+ PerformAction action=new PerformAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_FOUND_VARIABLE",
+ new String[]{varName, Object.class.getName()}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateBindDetailsNotWritable() {
+ TestESBService service=new TestESBService();
+
+ String varName="class";
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(PerformAction.SERVICE_CATEGORY, "cat1");
+ props.put(PerformAction.SERVICE_NAME, "name1");
+
+ java.util.Map<String,String> customProps=new java.util.Hashtable<String,String>();
+ customProps.put(PerformAction.BIND_DETAILS,
+ "<root><bind to-variable=\""+varName+"\" /></root>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, customProps);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+ other1.setCreateSession(true);
+ other1.setSessionClass(Object.class);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(service);
+
+ service.setModel(model);
+
+ PerformAction action=new PerformAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_WRITABLE_PROPERTY",
+ new String[]{varName, Object.class.getName()}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateBindDetailsCorrect() {
+ TestESBService service=new TestESBService();
+
+ String varName="validParent";
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(PerformAction.SERVICE_CATEGORY, "cat1");
+ props.put(PerformAction.SERVICE_NAME, "name1");
+
+ java.util.Map<String,String> customProps=new java.util.Hashtable<String,String>();
+ customProps.put(PerformAction.BIND_DETAILS,
+ "<root><bind to-variable=\""+varName+"\" /></root>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, customProps);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+ other1.setCreateSession(true);
+ other1.setSessionClass(ChildPojo.class);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(service);
+
+ service.setModel(model);
+
+ PerformAction action=new PerformAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testConvertRun() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(PerformAction.SERVICE_CATEGORY, "cat1");
+ props.put(PerformAction.SERVICE_NAME, "name1");
+ props.put(PerformAction.RETURN_SERVICE_CATEGORY, "cat2");
+ props.put(PerformAction.RETURN_SERVICE_NAME, "name2");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestActivity act1=new TestActivity();
+ other1.getContents().add(act1);
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestActivity act2=new TestActivity();
+ other2.getContents().add(act2);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(service);
+
+ service.setModel(model);
+
+ PerformAction action=new PerformAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, null);
+
+ if (activities.size() != 2) {
+ fail("Expecting two activities, but got: "+activities.size());
+ }
+
+ Activity act=activities.get(0);
+
+ if ((act instanceof Run) == false) {
+ fail("Expecting an 'Run' activity");
+ }
+
+ Run runAction=(Run)act;
+
+ if (runAction.getDefinition() == null) {
+ fail("Run definition was null");
+ }
+
+ if (runAction.getDefinition().getBlock().getContents().size() != 1) {
+ fail("Expecting one ran block activity: "+runAction.getDefinition().getBlock().getContents().size());
+ }
+
+ if (runAction.getDefinition().getBlock().getContents().get(0) != act1) {
+ fail("Run model block should have 1 activity = act1");
+ }
+
+ if (activities.get(1) != act2) {
+ fail("Subsequent activity after run was not act2");
+ }
+ }
+
+ public void testConvertSpawn() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(PerformAction.SERVICE_CATEGORY, "cat1");
+ props.put(PerformAction.SERVICE_NAME, "name1");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestActivity act1=new TestActivity();
+ other1.getContents().add(act1);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(service);
+
+ service.setModel(model);
+
+ PerformAction action=new PerformAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, null);
+
+ if (activities.size() != 1) {
+ fail("Expecting 1 activity, but got: "+activities.size());
+ }
+
+ Activity act=activities.get(0);
+
+ if ((act instanceof Spawn) == false) {
+ fail("Expecting a 'Spawn' activity");
+ }
+
+ Spawn spawnAction=(Spawn)act;
+
+ if (spawnAction.getDefinition() == null) {
+ fail("Run definition was null");
+ }
+
+ if (spawnAction.getDefinition().getBlock().getContents().size() != 1) {
+ fail("Expecting one block activity: "+spawnAction.getDefinition().getBlock().getContents().size());
+ }
+
+ if (spawnAction.getDefinition().getBlock().getContents().get(0) != act1) {
+ fail("Spawn model block should have 1 activity = act1");
+ }
+ }
+
+ public void testConvertNotExcludingEmptyPath() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(PerformAction.SERVICE_CATEGORY, "cat1");
+ props.put(PerformAction.SERVICE_NAME, "name1");
+ props.put(PerformAction.RETURN_SERVICE_CATEGORY, "cat2");
+ props.put(PerformAction.RETURN_SERVICE_NAME, "name2");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestActivity act2=new TestActivity();
+ other2.getContents().add(act2);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(service);
+
+ service.setModel(model);
+
+ PerformAction action=new PerformAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, null);
+
+ if (activities.size() != 2) {
+ fail("Expecting two activities, but got: "+activities.size());
+ }
+
+ Activity act=activities.get(0);
+
+ if ((act instanceof Run) == false) {
+ fail("Expecting an 'Run' activity");
+ }
+
+ Run runAction=(Run)act;
+
+ if (runAction.getDefinition() == null) {
+ fail("Run definition was null");
+ }
+
+ if (runAction.getDefinition().getBlock().getContents().size() != 0) {
+ fail("Expecting zero ran block activities: "+runAction.getDefinition().getBlock().getContents().size());
+ }
+
+ if (activities.get(1) != act2) {
+ fail("Subsequent activity after run was not act2");
+ }
+ }
+
+ public void testIsCreateSession() {
+ TestESBService service=new TestESBService();
+
+ PerformAction action=new PerformAction(service, null);
+
+ if (action.isSessionType() == true) {
+ fail("Action is flagged as a 'CreateSession'");
+ }
+ }
+
+ public void testIsSessionBased() {
+ TestESBService service=new TestESBService();
+
+ PerformAction action=new PerformAction(service, null);
+
+ if (action.isSessionBased() == false) {
+ fail("Action is not flagged as a 'SessionBased'");
+ }
+ }
+
+ public interface ParentView {
+
+ }
+
+ public class ParentPojo implements ParentView {
+
+ }
+
+ public class ChildPojo {
+
+ public void setValidParent(ParentPojo p) {
+ }
+
+ public void setValidParentView(ParentView p) {
+ }
+
+ public void setInvalidParent(String p) {
+ }
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/PerformActionTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ReceiveMessageActionTest.java (from rev 531, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ReceiveMessageActionTest.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ReceiveMessageActionTest.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ReceiveMessageActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -0,0 +1,288 @@
+/*
+ * 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.runtime.jbossesb.model.actions.stateful;
+
+import org.scribble.model.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.ESBActionTestUtil;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.ReceiveMessageAction;
+
+import junit.framework.TestCase;
+
+public class ReceiveMessageActionTest extends TestCase {
+
+ public void testValidateNoMessageType() {
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("identities", "");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ ReceiveMessageAction action=new ReceiveMessageAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_PROPERTY",
+ new String[]{"messageType"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateNoIdentities() {
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("messageType", "");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ ReceiveMessageAction action=new ReceiveMessageAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_PROPERTY",
+ new String[]{"identities"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testConvertRoles() {
+ TestESBService service=new TestESBService();
+
+ String ns="MessageTypeNS";
+ String lp="MessageType";
+ String role="Buyer";
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("messageType", "{"+ns+"}"+lp);
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(service);
+
+ service.setModel(model);
+
+ ReceiveMessageAction action=new ReceiveMessageAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, new DefaultConversionContext(role));
+
+ if (activities.size() != 1) {
+ fail("Expecting one activity, but got: "+activities.size());
+ }
+
+ Activity act=activities.get(0);
+
+ if ((act instanceof Interaction) == false) {
+ fail("Expecting an 'Interaction' activity");
+ }
+
+ Interaction interaction=(Interaction)act;
+
+ if (interaction.getToRole() == null) {
+ fail("'To' role is null");
+ }
+
+ if (interaction.getToRole().getName().equals(role) == false) {
+ fail("'To' role should be '"+role+"', but found: "+interaction.getToRole().getName());
+ }
+
+ if (interaction.getFromRole() != null) {
+ fail("'From' role should be null");
+ }
+ }
+
+ public void testConvertMessageBased() {
+ TestESBService service=new TestESBService();
+
+ String ns="MessageTypeNS";
+ String lp="MessageType";
+ String role="Buyer";
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("messageType", "{"+ns+"}"+lp);
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(service);
+
+ service.setModel(model);
+
+ ReceiveMessageAction action=new ReceiveMessageAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, new DefaultConversionContext(role));
+
+ if (activities.size() != 1) {
+ fail("Expecting one activity, but got: "+activities.size());
+ }
+
+ Activity act=activities.get(0);
+
+ if ((act instanceof Interaction) == false) {
+ fail("Expecting an 'Interaction' activity");
+ }
+
+ Interaction interaction=(Interaction)act;
+
+ if (interaction.getMessageSignature() == null) {
+ fail("Message signature is null");
+ }
+
+ if (interaction.getMessageSignature().getOperation() != null) {
+ fail("Operation should be null");
+ }
+
+ if (interaction.getMessageSignature().getTypes().size() != 1) {
+ fail("Only one type expected, but got: "+interaction.getMessageSignature().getTypes().size());
+ }
+
+ TypeReference ref=interaction.getMessageSignature().getTypes().get(0);
+
+ if (ref.getNamespace() == null ||
+ ref.getNamespace().equals(ns) == false) {
+ fail("Namespace should be '"+ns+"', but found: "+ref.getNamespace());
+ }
+
+ if (ref.getLocalpart() == null ||
+ ref.getLocalpart().equals(lp) == false) {
+ fail("Local type should be '"+lp+"', but found: "+ref.getLocalpart());
+ }
+ }
+
+ public void testConvertRPCBased() {
+ TestESBService service=new TestESBService();
+
+ String ns="MessageTypeNS";
+ String lp="MessageType";
+ String opname="op";
+ String role="Buyer";
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("operation", opname);
+ props.put("messageType", "{"+ns+"}"+lp);
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(service);
+
+ service.setModel(model);
+
+ ReceiveMessageAction action=new ReceiveMessageAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, new DefaultConversionContext(role));
+
+ if (activities.size() != 1) {
+ fail("Expecting one activity, but got: "+activities.size());
+ }
+
+ Activity act=activities.get(0);
+
+ if ((act instanceof Interaction) == false) {
+ fail("Expecting an 'Interaction' activity");
+ }
+
+ Interaction interaction=(Interaction)act;
+
+ if (interaction.getMessageSignature() == null) {
+ fail("Message signature is null");
+ }
+
+ if (interaction.getMessageSignature().getOperation() == null) {
+ fail("Operation should not be null");
+ }
+
+ if (interaction.getMessageSignature().getOperation().equals(opname) == false) {
+ fail("Operation expected '"+opname+"', but got: "+
+ interaction.getMessageSignature().getOperation());
+ }
+
+ if (interaction.getMessageSignature().getTypes().size() != 1) {
+ fail("Only one type expected, but got: "+interaction.getMessageSignature().getTypes().size());
+ }
+
+ TypeReference ref=interaction.getMessageSignature().getTypes().get(0);
+
+ if (ref.getNamespace() == null ||
+ ref.getNamespace().equals(ns) == false) {
+ fail("Namespace should be '"+ns+"', but found: "+ref.getNamespace());
+ }
+
+ if (ref.getLocalpart() == null ||
+ ref.getLocalpart().equals(lp) == false) {
+ fail("Local type should be '"+lp+"', but found: "+ref.getLocalpart());
+ }
+ }
+
+ public void testIsCreateSession() {
+ TestESBService service=new TestESBService();
+
+ ReceiveMessageAction action=new ReceiveMessageAction(service, null);
+
+ if (action.isSessionType() == true) {
+ fail("Action is flagged as a 'CreateSession'");
+ }
+ }
+
+ public void testIsSessionBased() {
+ TestESBService service=new TestESBService();
+
+ ReceiveMessageAction action=new ReceiveMessageAction(service, null);
+
+ if (action.isSessionBased() == false) {
+ fail("Action is not flagged as a 'SessionBased'");
+ }
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ReceiveMessageActionTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/RetrieveSessionActionTest.java (from rev 531, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/RetrieveSessionActionTest.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/RetrieveSessionActionTest.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/RetrieveSessionActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -0,0 +1,129 @@
+/*
+ * 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.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.ESBActionTestUtil;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.RetrieveSessionAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.UnsupportedAction;
+
+import junit.framework.TestCase;
+
+public class RetrieveSessionActionTest extends TestCase {
+
+ public void testValidateFirstAction() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("identities", "");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ UnsupportedAction unsupported=new UnsupportedAction(service, null);
+
+ RetrieveSessionAction action=new RetrieveSessionAction(service, elem);
+
+ service.getActions().add(action);
+ service.getActions().add(unsupported);
+
+ TestModelListener l=new TestModelListener();
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateNotFirstAction() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("identities", "");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ UnsupportedAction unsupported=new UnsupportedAction(service, null);
+
+ RetrieveSessionAction action=new RetrieveSessionAction(service, elem);
+
+ service.getActions().add(unsupported);
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_MUST_BE_FIRST_ACTION",
+ new String[]{"RetrieveSession"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateNoIdentities() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ RetrieveSessionAction action=new RetrieveSessionAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_PROPERTY",
+ new String[]{"identities"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testIsCreateSession() {
+ TestESBService service=new TestESBService();
+
+ RetrieveSessionAction action=new RetrieveSessionAction(service, null);
+
+ if (action.isSessionType() == true) {
+ fail("Action is flagged as a 'CreateSession'");
+ }
+ }
+
+ public void testIsSessionBased() {
+ TestESBService service=new TestESBService();
+
+ RetrieveSessionAction action=new RetrieveSessionAction(service, null);
+
+ if (action.isSessionBased() == false) {
+ fail("Action is not flagged as a 'SessionBased'");
+ }
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/RetrieveSessionActionTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ScheduleStateActionTest.java (from rev 531, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ScheduleStateActionTest.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ScheduleStateActionTest.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ScheduleStateActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -0,0 +1,259 @@
+/*
+ * 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.runtime.jbossesb.model.actions.stateful;
+
+import org.scribble.model.Activity;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.ESBActionTestUtil;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.TestActivity;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.ScheduleStateAction;
+
+import junit.framework.TestCase;
+
+public class ScheduleStateActionTest extends TestCase {
+
+ public void testValidateNoServiceCategory() {
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("serviceName", "");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ ScheduleStateAction action=new ScheduleStateAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_PROPERTY",
+ new String[]{"serviceCategory"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateNoServiceName() {
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("serviceCategory", "");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ ScheduleStateAction action=new ScheduleStateAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_PROPERTY",
+ new String[]{"serviceName"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateService() {
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("serviceCategory", "cat1");
+ props.put("serviceName", "name1");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(service);
+
+ service.setModel(model);
+
+ ScheduleStateAction action=new ScheduleStateAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{"cat1", "name1"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testConvert() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("serviceCategory", "cat1");
+ props.put("serviceName", "name1");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestActivity act1=new TestActivity();
+ other1.getContents().add(act1);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(service);
+
+ service.setModel(model);
+
+ ScheduleStateAction action=new ScheduleStateAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, new DefaultConversionContext(null));
+
+ if (activities.size() != 1) {
+ fail("Expecting one activity, but got: "+activities.size());
+ }
+
+ if (activities.get(0) != act1) {
+ fail("Activity was not act1");
+ }
+ }
+
+ public void testConvertBackToWhileLoop() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("serviceCategory", "cat1");
+ props.put("serviceName", "name1");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+ other1.setLoop(true);
+
+ TestActivity act1=new TestActivity();
+ other1.getContents().add(act1);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(service);
+
+ service.setModel(model);
+
+ ScheduleStateAction action=new ScheduleStateAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ DefaultConversionContext context=new DefaultConversionContext(null);
+ context.push(other1);
+
+ action.convert(activities, context);
+
+ if (activities.size() != 0) {
+ fail("Should be no activities, but found: "+activities.size());
+ }
+ }
+
+ public void testConvertBackToJoinState() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("serviceCategory", "cat1");
+ props.put("serviceName", "name1");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestActivity act1=new TestActivity();
+ other1.getContents().add(act1);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(service);
+
+ service.setModel(model);
+
+ ScheduleStateAction action=new ScheduleStateAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ DefaultConversionContext context=new DefaultConversionContext(null);
+ context.markJoin(other1);
+
+ action.convert(activities, context);
+
+ if (activities.size() != 0) {
+ fail("Should be no activities, but found: "+activities.size());
+ }
+ }
+
+ public void testIsCreateSession() {
+ TestESBService service=new TestESBService();
+
+ ScheduleStateAction action=new ScheduleStateAction(service, null);
+
+ if (action.isSessionType() == true) {
+ fail("Action is flagged as a 'CreateSession'");
+ }
+ }
+
+ public void testIsSessionBased() {
+ TestESBService service=new TestESBService();
+
+ ScheduleStateAction action=new ScheduleStateAction(service, null);
+
+ if (action.isSessionBased() == false) {
+ fail("Action is not flagged as a 'SessionBased'");
+ }
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ScheduleStateActionTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SendMessageActionTest.java (from rev 531, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SendMessageActionTest.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SendMessageActionTest.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SendMessageActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -0,0 +1,364 @@
+/*
+ * 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.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.DefaultConversionContext;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.ESBActionTestUtil;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.SendMessageAction;
+import org.scribble.model.Activity;
+import org.scribble.model.Interaction;
+import org.scribble.model.TypeReference;
+
+import junit.framework.TestCase;
+
+public class SendMessageActionTest extends TestCase {
+
+ public void testValidateNoMessageType() {
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("identities", "");
+ props.put("serviceCategory", "");
+ props.put("serviceName", "");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ SendMessageAction action=new SendMessageAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_PROPERTY",
+ new String[]{"messageType"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateNoIdentities() {
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("messageType", "");
+ props.put("clientRole", "");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ SendMessageAction action=new SendMessageAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_PROPERTY",
+ new String[]{"identities"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateNoDestination() {
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("messageType", "");
+ props.put("identities", "");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ SendMessageAction action=new SendMessageAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_REQ_RESP_EPR",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateResponseService() {
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("messageType", "");
+ props.put("identities", "");
+ props.put("serviceCategory", "cat1");
+ props.put("serviceName", "name1");
+ props.put("responseServiceCategory", "cat2");
+ props.put("responseServiceName", "name2");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(service);
+
+ service.setModel(model);
+
+ SendMessageAction action=new SendMessageAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{"cat2", "name2"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testConvertRoles() {
+ TestESBService service=new TestESBService();
+
+ String ns="MessageTypeNS";
+ String lp="MessageType";
+ String role="Buyer";
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("messageType", "{"+ns+"}"+lp);
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(service);
+
+ service.setModel(model);
+
+ SendMessageAction action=new SendMessageAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, new DefaultConversionContext(role));
+
+ if (activities.size() != 1) {
+ fail("Expecting one activity, but got: "+activities.size());
+ }
+
+ Activity act=activities.get(0);
+
+ if ((act instanceof Interaction) == false) {
+ fail("Expecting an 'Interaction' activity");
+ }
+
+ Interaction interaction=(Interaction)act;
+
+ if (interaction.getFromRole() == null) {
+ fail("'From' role is null");
+ }
+
+ if (interaction.getFromRole().getName().equals(role) == false) {
+ fail("'From' role should be '"+role+"', but found: "+interaction.getFromRole().getName());
+ }
+
+ if (interaction.getToRole() != null) {
+ fail("'To' role should be null");
+ }
+ }
+
+ public void testConvertMessageBased() {
+ TestESBService service=new TestESBService();
+
+ String ns="MessageTypeNS";
+ String lp="MessageType";
+ String role="Buyer";
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("messageType", "{"+ns+"}"+lp);
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(service);
+
+ service.setModel(model);
+
+ SendMessageAction action=new SendMessageAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, new DefaultConversionContext(role));
+
+ if (activities.size() != 1) {
+ fail("Expecting one activity, but got: "+activities.size());
+ }
+
+ Activity act=activities.get(0);
+
+ if ((act instanceof Interaction) == false) {
+ fail("Expecting an 'Interaction' activity");
+ }
+
+ Interaction interaction=(Interaction)act;
+
+ if (interaction.getMessageSignature() == null) {
+ fail("Message signature is null");
+ }
+
+ if (interaction.getMessageSignature().getOperation() != null) {
+ fail("Operation should be null");
+ }
+
+ if (interaction.getMessageSignature().getTypes().size() != 1) {
+ fail("Only one type expected, but got: "+interaction.getMessageSignature().getTypes().size());
+ }
+
+ TypeReference ref=interaction.getMessageSignature().getTypes().get(0);
+
+ if (ref.getNamespace() == null ||
+ ref.getNamespace().equals(ns) == false) {
+ fail("Namespace should be '"+ns+"', but found: "+ref.getNamespace());
+ }
+
+ if (ref.getLocalpart() == null ||
+ ref.getLocalpart().equals(lp) == false) {
+ fail("Local type should be '"+lp+"', but found: "+ref.getLocalpart());
+ }
+ }
+
+ public void testConvertRPCBased() {
+ TestESBService service=new TestESBService();
+
+ String ns="MessageTypeNS";
+ String lp="MessageType";
+ String opname="op";
+ String role="Buyer";
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("operation", opname);
+ props.put("messageType", "{"+ns+"}"+lp);
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(service);
+
+ service.setModel(model);
+
+ SendMessageAction action=new SendMessageAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, new DefaultConversionContext(role));
+
+ if (activities.size() != 1) {
+ fail("Expecting one activity, but got: "+activities.size());
+ }
+
+ Activity act=activities.get(0);
+
+ if ((act instanceof Interaction) == false) {
+ fail("Expecting an 'Interaction' activity");
+ }
+
+ Interaction interaction=(Interaction)act;
+
+ if (interaction.getMessageSignature() == null) {
+ fail("Message signature is null");
+ }
+
+ if (interaction.getMessageSignature().getOperation() == null) {
+ fail("Operation should not be null");
+ }
+
+ if (interaction.getMessageSignature().getOperation().equals(opname) == false) {
+ fail("Operation expected '"+opname+"', but got: "+
+ interaction.getMessageSignature().getOperation());
+ }
+
+ if (interaction.getMessageSignature().getTypes().size() != 1) {
+ fail("Only one type expected, but got: "+interaction.getMessageSignature().getTypes().size());
+ }
+
+ TypeReference ref=interaction.getMessageSignature().getTypes().get(0);
+
+ if (ref.getNamespace() == null ||
+ ref.getNamespace().equals(ns) == false) {
+ fail("Namespace should be '"+ns+"', but found: "+ref.getNamespace());
+ }
+
+ if (ref.getLocalpart() == null ||
+ ref.getLocalpart().equals(lp) == false) {
+ fail("Local type should be '"+lp+"', but found: "+ref.getLocalpart());
+ }
+ }
+
+ public void testIsCreateSession() {
+ TestESBService service=new TestESBService();
+
+ SendMessageAction action=new SendMessageAction(service, null);
+
+ if (action.isSessionType() == true) {
+ fail("Action is flagged as a 'CreateSession'");
+ }
+ }
+
+ public void testIsSessionBased() {
+ TestESBService service=new TestESBService();
+
+ SendMessageAction action=new SendMessageAction(service, null);
+
+ if (action.isSessionBased() == false) {
+ fail("Action is not flagged as a 'SessionBased'");
+ }
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SendMessageActionTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetMessageActionTest.java (from rev 531, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetMessageActionTest.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetMessageActionTest.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetMessageActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -0,0 +1,75 @@
+/*
+ * 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.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.ESBActionTestUtil;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.SetMessageAction;
+
+import junit.framework.TestCase;
+
+public class SetMessageActionTest extends TestCase {
+
+ public void testValidateNoExpression() {
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ SetMessageAction action=new SetMessageAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_PROPERTY",
+ new String[]{SetMessageAction.STATE_EXPRESSION}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testIsCreateSession() {
+ TestESBService service=new TestESBService();
+
+ SetMessageAction action=new SetMessageAction(service, null);
+
+ if (action.isSessionType() == true) {
+ fail("Action is flagged as a 'CreateSession'");
+ }
+ }
+
+ public void testIsSessionBased() {
+ TestESBService service=new TestESBService();
+
+ SetMessageAction action=new SetMessageAction(service, null);
+
+ if (action.isSessionBased() == false) {
+ fail("Action is not flagged as a 'SessionBased'");
+ }
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetMessageActionTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetStateActionTest.java (from rev 531, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetStateActionTest.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetStateActionTest.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetStateActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -0,0 +1,359 @@
+/*
+ * 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.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.ESBActionTestUtil;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.SetStateAction;
+
+import junit.framework.TestCase;
+
+public class SetStateActionTest extends TestCase {
+
+ public void testValidateNoVariable() {
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(SetStateAction.STATE_EXPRESSION, "");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ SetStateAction action=new SetStateAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_PROPERTY",
+ new String[]{SetStateAction.VARIABLE}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateVariableNotClassProperty() {
+ String varName="classX";
+ Class<?> cls=java.lang.Object.class;
+
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+ service.setSessionClass(cls);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(SetStateAction.VARIABLE, varName);
+ props.put(SetStateAction.STATE_EXPRESSION, "");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null,
+ props, null);
+
+ SetStateAction action=new SetStateAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_FOUND_VARIABLE",
+ new String[]{varName, cls.getName()}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateVariableIsClassProperty() {
+ String varName="writableProperty";
+ Class<?> cls=TestClass2.class;
+
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+ service.setSessionClass(cls);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(SetStateAction.VARIABLE, varName);
+ props.put(SetStateAction.STATE_EXPRESSION, "");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null,
+ props, null);
+
+ SetStateAction action=new SetStateAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateMultiPartVariableIsClassWritableProperty() {
+ String varName="testClass2.writableProperty";
+ Class<?> cls=TestClass1.class;
+
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+ service.setSessionClass(cls);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(SetStateAction.VARIABLE, varName);
+ props.put(SetStateAction.STATE_EXPRESSION, "");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null,
+ props, null);
+
+ SetStateAction action=new SetStateAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateMultiPartVariableIsClassNotWritableProperty() {
+ String varName="testClass2.readableProperty";
+ Class<?> cls=TestClass1.class;
+
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+ service.setSessionClass(cls);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(SetStateAction.VARIABLE, varName);
+ props.put(SetStateAction.STATE_EXPRESSION, "");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null,
+ props, null);
+
+ SetStateAction action=new SetStateAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_WRITABLE_PROPERTY",
+ new String[]{"readableProperty", TestClass2.class.getName()}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateMultiPartVariableIsClassNotReadableProperty() {
+ String varName="testClass2.writableProperty";
+ Class<?> cls=TestClass3.class;
+
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+ service.setSessionClass(cls);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(SetStateAction.VARIABLE, varName);
+ props.put(SetStateAction.STATE_EXPRESSION, "");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null,
+ props, null);
+
+ SetStateAction action=new SetStateAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_READABLE_PROPERTY",
+ new String[]{"testClass2", TestClass3.class.getName()}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateMissingExpression() {
+ String varName="writableProperty";
+ Class<?> cls=TestClass2.class;
+
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+ service.setSessionClass(cls);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(SetStateAction.VARIABLE, varName);
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null,
+ props, null);
+
+ SetStateAction action=new SetStateAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_MUST_SPECIFY_STATE_OR_MESSAGE_EXPRESSION",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateBothExpressions() {
+ String varName="writableProperty";
+ Class<?> cls=TestClass2.class;
+
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+ service.setSessionClass(cls);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(SetStateAction.VARIABLE, varName);
+ props.put(SetStateAction.MESSAGE_EXPRESSION, "mesg");
+ props.put(SetStateAction.STATE_EXPRESSION, "state");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null,
+ props, null);
+
+ SetStateAction action=new SetStateAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_MUST_SPECIFY_STATE_OR_MESSAGE_EXPRESSION",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateMessageExpression() {
+ String varName="writableProperty";
+ Class<?> cls=TestClass2.class;
+
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+ service.setSessionClass(cls);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put(SetStateAction.VARIABLE, varName);
+ props.put(SetStateAction.MESSAGE_EXPRESSION, "mesg");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null,
+ props, null);
+
+ SetStateAction action=new SetStateAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testIsCreateSession() {
+ TestESBService service=new TestESBService();
+
+ SetStateAction action=new SetStateAction(service, null);
+
+ if (action.isSessionType() == true) {
+ fail("Action is flagged as a 'CreateSession'");
+ }
+ }
+
+ public void testIsSessionBased() {
+ TestESBService service=new TestESBService();
+
+ SetStateAction action=new SetStateAction(service, null);
+
+ if (action.isSessionBased() == false) {
+ fail("Action is not flagged as a 'SessionBased'");
+ }
+ }
+
+ public class TestClass1 {
+ public TestClass1() {
+ }
+
+ public TestClass2 getTestClass2() {
+ return(null);
+ }
+ }
+
+ public class TestClass2 {
+ public TestClass2() {
+ }
+
+ public String getReadableProperty() {
+ return(null);
+ }
+
+ public void setWritableProperty(String str) {
+ }
+ }
+
+ public class TestClass3 {
+ public TestClass3() {
+ }
+
+ public void setTestClass2(TestClass2 tc2) {
+ }
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetStateActionTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SwitchActionTest.java (from rev 531, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SwitchActionTest.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SwitchActionTest.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SwitchActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -0,0 +1,384 @@
+/*
+ * 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.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.ESBActionTestUtil;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.TestActivity;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.SwitchAction;
+import org.scribble.conversation.model.If;
+import org.scribble.model.Activity;
+
+import junit.framework.TestCase;
+
+public class SwitchActionTest extends TestCase {
+
+ public void testValidatePathsSpecified() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ SwitchAction action=new SwitchAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_PROPERTY",
+ new String[]{"paths"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateServiceNotFound() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><case service-category=\"cat1\" " +
+ "service-name=\"name1\" /><case service-category=\"cat2\" " +
+ "service-name=\"name2\" /><case service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(service);
+
+ service.setModel(model);
+
+ SwitchAction action=new SwitchAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{"cat1","name1"}));
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{"cat2","name2"}));
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{"cat3","name3"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateLessThanOnePath() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat3");
+ other2.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(service);
+
+ service.setModel(model);
+
+ SwitchAction action=new SwitchAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_SWITCH_ONE_OR_MORE_PATHS",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateMissingServiceDetails() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><case service-category=\"cat1\" " +
+ "service-name=\"name1\" /><case " +
+ "service-name=\"name2\" /><case service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ SwitchAction action=new SwitchAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PATH_SERVICE_DETAILS_MISSING",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testConvert() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><case service-category=\"cat1\" " +
+ "service-name=\"name1\" /><case service-category=\"cat2\" " +
+ "service-name=\"name2\" /><case service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestActivity act1=new TestActivity();
+ other1.getContents().add(act1);
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestActivity act2=new TestActivity();
+ other2.getContents().add(act2);
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestActivity act3=new TestActivity();
+ other3.getContents().add(act3);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ SwitchAction action=new SwitchAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, null);
+
+ if (activities.size() != 1) {
+ fail("Expecting one activity, but got: "+activities.size());
+ }
+
+ Activity act=activities.get(0);
+
+ if ((act instanceof If) == false) {
+ fail("Expecting an 'If' activity");
+ }
+
+ If ifAction=(If)act;
+
+ if (ifAction.getConditionalBlocks().size() != 3) {
+ fail("Expecting three conditional blocks: "+ifAction.getConditionalBlocks().size());
+ }
+
+ if (ifAction.getConditionalBlocks().get(0).getContents().size() != 1 ||
+ ifAction.getConditionalBlocks().get(0).getContents().get(0) != act1) {
+ fail("First conditional block should have 1 activity = act1");
+ }
+
+ if (ifAction.getConditionalBlocks().get(1).getContents().size() != 1 ||
+ ifAction.getConditionalBlocks().get(1).getContents().get(0) != act2) {
+ fail("Second conditional block should have 1 activity = act2");
+ }
+
+ if (ifAction.getConditionalBlocks().get(2).getContents().size() != 1 ||
+ ifAction.getConditionalBlocks().get(2).getContents().get(0) != act3) {
+ fail("Third conditional block should have 1 activity = act3");
+ }
+
+ if (ifAction.getElseBlock() != null) {
+ fail("Else block should not be defined");
+ }
+ }
+
+ public void testConvertNotExcludingEmptyPaths() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><case service-category=\"cat1\" " +
+ "service-name=\"name1\" /><case service-category=\"cat2\" " +
+ "service-name=\"name2\" /><case service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestActivity act1=new TestActivity();
+ other1.getContents().add(act1);
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestActivity act3=new TestActivity();
+ other3.getContents().add(act3);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ SwitchAction action=new SwitchAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, null);
+
+ if (activities.size() != 1) {
+ fail("Expecting one activity, but got: "+activities.size());
+ }
+
+ Activity act=activities.get(0);
+
+ if ((act instanceof If) == false) {
+ fail("Expecting an 'If' activity");
+ }
+
+ If ifAction=(If)act;
+
+ if (ifAction.getConditionalBlocks().size() != 3) {
+ fail("Expecting three conditional blocks: "+ifAction.getConditionalBlocks().size());
+ }
+
+ if (ifAction.getConditionalBlocks().get(0).getContents().size() != 1 ||
+ ifAction.getConditionalBlocks().get(0).getContents().get(0) != act1) {
+ fail("First conditional block should have 1 activity = act1");
+ }
+
+ if (ifAction.getConditionalBlocks().get(1).getContents().size() != 0) {
+ fail("Second conditional block should be empty");
+ }
+
+ if (ifAction.getConditionalBlocks().get(2).getContents().size() != 1 ||
+ ifAction.getConditionalBlocks().get(2).getContents().get(0) != act3) {
+ fail("Third conditional block should have 1 activity = act3");
+ }
+
+ if (ifAction.getElseBlock() != null) {
+ fail("Else block should not be defined");
+ }
+ }
+
+ public void testIsCreateSession() {
+ TestESBService service=new TestESBService();
+
+ SwitchAction action=new SwitchAction(service, null);
+
+ if (action.isSessionType() == true) {
+ fail("Action is flagged as a 'CreateSession'");
+ }
+ }
+
+ public void testIsSessionBased() {
+ TestESBService service=new TestESBService();
+
+ SwitchAction action=new SwitchAction(service, null);
+
+ if (action.isSessionBased() == false) {
+ fail("Action is not flagged as a 'SessionBased'");
+ }
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SwitchActionTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhenActionTest.java (from rev 531, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhenActionTest.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhenActionTest.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhenActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -0,0 +1,376 @@
+/*
+ * 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.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.ESBActionTestUtil;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.TestActivity;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.WhenAction;
+import org.scribble.conversation.model.*;
+import org.scribble.model.*;
+
+import junit.framework.TestCase;
+
+public class WhenActionTest extends TestCase {
+
+ public void testValidatePathsSpecified() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ WhenAction action=new WhenAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_PROPERTY",
+ new String[]{"paths"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateServiceNotFound() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><when service-category=\"cat1\" " +
+ "service-name=\"name1\" /><when service-category=\"cat2\" " +
+ "service-name=\"name2\" /><when service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(service);
+
+ service.setModel(model);
+
+ WhenAction action=new WhenAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{"cat1","name1"}));
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{"cat2","name2"}));
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{"cat3","name3"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateLessThanOnePath() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat3");
+ other2.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(service);
+
+ service.setModel(model);
+
+ WhenAction action=new WhenAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_WHEN_ONE_OR_MORE_PATHS",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateMissingServiceDetails() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><when service-category=\"cat1\" " +
+ "service-name=\"name1\" /><when " +
+ "service-name=\"name2\" /><when service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ WhenAction action=new WhenAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PATH_SERVICE_DETAILS_MISSING",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testConvert() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><when service-category=\"cat1\" " +
+ "service-name=\"name1\" /><when service-category=\"cat2\" " +
+ "service-name=\"name2\" /><when service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestActivity act1=new TestActivity();
+ other1.getContents().add(act1);
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestActivity act2=new TestActivity();
+ other2.getContents().add(act2);
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestActivity act3=new TestActivity();
+ other3.getContents().add(act3);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ WhenAction action=new WhenAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, null);
+
+ if (activities.size() != 1) {
+ fail("Expecting one activity, but got: "+activities.size());
+ }
+
+ Activity act=activities.get(0);
+
+ if ((act instanceof When) == false) {
+ fail("Expecting an 'When' activity");
+ }
+
+ When whenAction=(When)act;
+
+ if (whenAction.getConditionalBlocks().size() != 3) {
+ fail("Expecting three conditional blocks: "+whenAction.getConditionalBlocks().size());
+ }
+
+ if (whenAction.getConditionalBlocks().get(0).getContents().size() != 1 ||
+ whenAction.getConditionalBlocks().get(0).getContents().get(0) != act1) {
+ fail("First conditional block should have 1 activity = act1");
+ }
+
+ if (whenAction.getConditionalBlocks().get(1).getContents().size() != 1 ||
+ whenAction.getConditionalBlocks().get(1).getContents().get(0) != act2) {
+ fail("Second conditional block should have 1 activity = act2");
+ }
+
+ if (whenAction.getConditionalBlocks().get(2).getContents().size() != 1 ||
+ whenAction.getConditionalBlocks().get(2).getContents().get(0) != act3) {
+ fail("Second conditional block should have 1 activity = act3");
+ }
+ }
+
+ public void testConvertNotExcludingEmptyPath() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><when service-category=\"cat1\" " +
+ "service-name=\"name1\" /><when service-category=\"cat2\" " +
+ "service-name=\"name2\" /><when service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestActivity act1=new TestActivity();
+ other1.getContents().add(act1);
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestActivity act3=new TestActivity();
+ other3.getContents().add(act3);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ WhenAction action=new WhenAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, null);
+
+ if (activities.size() != 1) {
+ fail("Expecting one activity, but got: "+activities.size());
+ }
+
+ Activity act=activities.get(0);
+
+ if ((act instanceof When) == false) {
+ fail("Expecting an 'When' activity");
+ }
+
+ When whenAction=(When)act;
+
+ if (whenAction.getConditionalBlocks().size() != 3) {
+ fail("Expecting three conditional blocks: "+whenAction.getConditionalBlocks().size());
+ }
+
+ if (whenAction.getConditionalBlocks().get(0).getContents().size() != 1 ||
+ whenAction.getConditionalBlocks().get(0).getContents().get(0) != act1) {
+ fail("First conditional block should have 1 activity = act1");
+ }
+
+ if (whenAction.getConditionalBlocks().get(1).getContents().size() != 0) {
+ fail("Second conditional block should be empty");
+ }
+
+ if (whenAction.getConditionalBlocks().get(2).getContents().size() != 1 ||
+ whenAction.getConditionalBlocks().get(2).getContents().get(0) != act3) {
+ fail("Third conditional block should have 1 activity = act3");
+ }
+ }
+
+ public void testIsCreateSession() {
+ TestESBService service=new TestESBService();
+
+ WhenAction action=new WhenAction(service, null);
+
+ if (action.isSessionType() == true) {
+ fail("Action is flagged as a 'CreateSession'");
+ }
+ }
+
+ public void testIsSessionBased() {
+ TestESBService service=new TestESBService();
+
+ WhenAction action=new WhenAction(service, null);
+
+ if (action.isSessionBased() == false) {
+ fail("Action is not flagged as a 'SessionBased'");
+ }
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhenActionTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhileActionTest.java (from rev 531, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhileActionTest.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhileActionTest.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhileActionTest.java 2009-03-15 16:13:48 UTC (rev 539)
@@ -0,0 +1,567 @@
+/*
+ * 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.runtime.jbossesb.model.actions.stateful;
+
+import org.scribble.conversation.model.*;
+import org.scribble.model.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.ESBActionTestUtil;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.TestActivity;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.WhileAction;
+
+import junit.framework.TestCase;
+
+public class WhileActionTest extends TestCase {
+
+ public void testValidatePathsSpecified() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ WhileAction action=new WhileAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_PROPERTY",
+ new String[]{"paths"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateServiceNotFound() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><while service-category=\"cat1\" " +
+ "service-name=\"name1\" /><exit service-category=\"cat2\" " +
+ "service-name=\"name2\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(service);
+
+ service.setModel(model);
+
+ WhileAction action=new WhileAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{"cat1","name1"}));
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{"cat2","name2"}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateOneWhilePath() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><while service-category=\"cat1\" " +
+ "service-name=\"name1\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat3");
+ other2.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(service);
+
+ service.setModel(model);
+
+ WhileAction action=new WhileAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_MUST_DEFINE_SINGLE_WHILE_EXIT",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateOneWhileExit() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><exit service-category=\"cat2\" " +
+ "service-name=\"name2\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(service);
+
+ service.setModel(model);
+
+ WhileAction action=new WhileAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_MUST_DEFINE_SINGLE_WHILE_PATH",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateMissingServiceDetails1() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><while " +
+ "service-name=\"name2\" /><exit service-category=\"cat3\" " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ WhileAction action=new WhileAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PATH_SERVICE_DETAILS_MISSING",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateMissingServiceDetails2() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><while service-category=\"cat2\" " +
+ "service-name=\"name2\" /><exit " +
+ "service-name=\"name3\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ WhileAction action=new WhileAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PATH_SERVICE_DETAILS_MISSING",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateOutOfOrderExit() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><exit service-category=\"cat1\" " +
+ "service-name=\"name1\" /><while service-category=\"cat2\" " +
+ "service-name=\"name2\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBService other3=new TestESBService();
+ other3.setCategory("cat3");
+ other3.setName("name3");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(other3);
+ model.addService(service);
+
+ service.setModel(model);
+
+ WhileAction action=new WhileAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_WHILE_PATH_AFTER_EXIT",
+ new String[]{}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateImmediateWhile() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><while service-category=\"cat1\" " +
+ "service-name=\"name1\" immediate=\"fred\" /><exit service-category=\"cat2\" " +
+ "service-name=\"name2\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(service);
+
+ service.setModel(model);
+
+ WhileAction action=new WhileAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_BOOLEAN",
+ new String[]{WhileAction.IMMEDIATE}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testValidateImmediateExit() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><while service-category=\"cat1\" " +
+ "service-name=\"name1\" /><exit service-category=\"cat2\" " +
+ "service-name=\"name2\" immediate=\"fred\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(service);
+
+ service.setModel(model);
+
+ WhileAction action=new WhileAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_BOOLEAN",
+ new String[]{WhileAction.IMMEDIATE}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+
+ public void testConvert() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><while service-category=\"cat1\" " +
+ "service-name=\"name1\" /><exit service-category=\"cat2\" " +
+ "service-name=\"name2\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestActivity act1=new TestActivity();
+ other1.getContents().add(act1);
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestActivity act2=new TestActivity();
+ other2.getContents().add(act2);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(service);
+
+ service.setModel(model);
+
+ WhileAction action=new WhileAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, new DefaultConversionContext(null));
+
+ if (activities.size() != 2) {
+ fail("Expecting two activities, but got: "+activities.size());
+ }
+
+ Activity act=activities.get(0);
+
+ if ((act instanceof While) == false) {
+ fail("Expecting an 'While' activity");
+ }
+
+ While whileAction=(While)act;
+
+ if (whileAction.getBlock().getContents().size() != 1) {
+ fail("Expecting one entry in while block: "+whileAction.getBlock().getContents().size());
+ }
+
+ if (whileAction.getBlock().getContents().get(0) != act1) {
+ fail("While block should have 1 activity = act1");
+ }
+
+ if (activities.get(1) != act2) {
+ fail("Activity following while should be act2");
+ }
+ }
+
+ public void testConvertNotExcludingEmptyBody() {
+ TestESBService service=new TestESBService();
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+ props.put("paths", "<property><while service-category=\"cat1\" " +
+ "service-name=\"name1\" /><exit service-category=\"cat2\" " +
+ "service-name=\"name2\" /></property>");
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, null, props);
+
+ TestESBService other1=new TestESBService();
+ other1.setCategory("cat1");
+ other1.setName("name1");
+
+ TestESBService other2=new TestESBService();
+ other2.setCategory("cat2");
+ other2.setName("name2");
+
+ TestActivity act2=new TestActivity();
+ other2.getContents().add(act2);
+
+ TestESBLanguageModel model=new TestESBLanguageModel();
+ model.addService(other1);
+ model.addService(other2);
+ model.addService(service);
+
+ service.setModel(model);
+
+ WhileAction action=new WhileAction(service, elem);
+ action.initializeLinks();
+
+ service.getActions().add(action);
+
+ java.util.List<Activity> activities=new java.util.Vector<Activity>();
+
+ action.convert(activities, new DefaultConversionContext(null));
+
+ if (activities.size() != 2) {
+ fail("Expecting two activities, but got: "+activities.size());
+ }
+
+ Activity act=activities.get(0);
+
+ if ((act instanceof While) == false) {
+ fail("Expecting an 'While' activity");
+ }
+
+ While whileAction=(While)act;
+
+ if (whileAction.getBlock().getContents().size() != 0) {
+ fail("Expecting zero entries in while block: "+whileAction.getBlock().getContents().size());
+ }
+
+ if (activities.get(1) != act2) {
+ fail("Activity following while should be act2");
+ }
+ }
+
+ public void testIsCreateSession() {
+ TestESBService service=new TestESBService();
+
+ WhileAction action=new WhileAction(service, null);
+
+ if (action.isSessionType() == true) {
+ fail("Action is flagged as a 'CreateSession'");
+ }
+ }
+
+ public void testIsSessionBased() {
+ TestESBService service=new TestESBService();
+
+ WhileAction action=new WhileAction(service, null);
+
+ if (action.isSessionBased() == false) {
+ fail("Action is not flagged as a 'SessionBased'");
+ }
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhileActionTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
17 years, 4 months
Overlord SVN: r538 - in cdl/trunk/samples/jbossesb: common/creditAgency/stateless and 20 other directories.
by overlord-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2009-03-13 03:34:38 -0400 (Fri, 13 Mar 2009)
New Revision: 538
Added:
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/pom.xml
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/java/
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/java/com/
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/java/com/acme/
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/java/com/acme/services/
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/java/com/acme/services/creditAgency/
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/java/com/acme/services/creditAgency/CreditAgencyDecision.java
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/java/com/acme/services/creditAgency/SetCreditCheckInvalidMessageAction.java
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/java/com/acme/services/creditAgency/SetCreditCheckResponseMessageAction.java
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/META-INF/
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/META-INF/deployment.xml
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/META-INF/jboss-esb.xml
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/jbmq-queue-service.xml
cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/log4j.xml
cdl/trunk/samples/jbossesb/purchasing/store/stateless/
cdl/trunk/samples/jbossesb/purchasing/store/stateless/pom.xml
cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/
cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/
cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/
cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/
cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/acme/
cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/acme/services/
cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/acme/services/broker/
cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/acme/services/broker/PurchaseGoods.java
cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/acme/services/broker/SetBuyFailedMessageAction.java
cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/acme/services/broker/SetBuyResponseMessageAction.java
cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/acme/services/broker/SetCreditCheckRequestMessageAction.java
cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/
cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/META-INF/
cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/META-INF/deployment.xml
cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/META-INF/jboss-esb.xml
cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/jbmq-queue-service.xml
cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/log4j.xml
Log:
[SOAG-92] Add stateless files for the purchase example.
Added: cdl/trunk/samples/jbossesb/common/creditAgency/stateless/pom.xml
===================================================================
--- cdl/trunk/samples/jbossesb/common/creditAgency/stateless/pom.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/common/creditAgency/stateless/pom.xml 2009-03-13 07:34:38 UTC (rev 538)
@@ -0,0 +1,60 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.soa.overlord.cdl.samples</groupId>
+ <artifactId>jbossesb-stateless-creditAgency</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jboss-esb</packaging>
+ <name>Overlord::CDL::Samples::Stateless::CreditAgency</name>
+ <url>http://www.jboss.org/overlord</url>
+
+ <parent>
+ <groupId>org.jboss.soa.overlord.cdl</groupId>
+ <artifactId>samples</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${log4j.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.soa.overlord.cdl.runtime</groupId>
+ <artifactId>cdl-runtime-jbossesb</artifactId>
+ <version>${cdl.jbossesb.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>creditAgency-stateless</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <!--Deploy esb artifact to JBoss AS/ESB -->
+ <execution>
+ <id>deploy</id>
+ <phase>install</phase>
+ <configuration>
+ <tasks>
+ <!--copy file="target/creditAgency-stateless.esb" todir="${deploy.dir}" overwrite="true" /-->
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
+
Added: cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/java/com/acme/services/creditAgency/CreditAgencyDecision.java
===================================================================
--- cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/java/com/acme/services/creditAgency/CreditAgencyDecision.java (rev 0)
+++ cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/java/com/acme/services/creditAgency/CreditAgencyDecision.java 2009-03-13 07:34:38 UTC (rev 538)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., 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.
+ *
+ * (C) 2008,
+ */
+package com.acme.services.creditAgency;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.overlord.jbossesb.Decision;
+
+/**
+ * @author <a href="mailto:cyu@redhat.com">Jeff Yu</a>
+ *
+ */
+public class CreditAgencyDecision implements Decision {
+
+ /* (non-Javadoc)
+ * @see org.jboss.soa.overlord.jbossesb.Decision#executeDecision(org.jboss.soa.esb.message.Message)
+ */
+ public boolean executeDecision(Message message) {
+ return true;
+ }
+
+}
Added: cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/java/com/acme/services/creditAgency/SetCreditCheckInvalidMessageAction.java
===================================================================
--- cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/java/com/acme/services/creditAgency/SetCreditCheckInvalidMessageAction.java (rev 0)
+++ cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/java/com/acme/services/creditAgency/SetCreditCheckInvalidMessageAction.java 2009-03-13 07:34:38 UTC (rev 538)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., 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.
+ *
+ * (C) 2008,
+ */
+package com.acme.services.creditAgency;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.overlord.jbossesb.XMLUtils;
+import org.w3c.dom.Node;
+
+public class SetCreditCheckInvalidMessageAction extends AbstractActionLifecycle {
+
+ private static Logger logger = Logger.getLogger(SetCreditCheckInvalidMessageAction.class);
+
+ private ConfigTree config;
+
+ public SetCreditCheckInvalidMessageAction(ConfigTree config) {
+ this.config = config;
+ }
+
+ public Message process(Message message) throws Exception{
+
+ Node node = XMLUtils.getNode((String)message.getBody().get());
+ String idValue = node.getAttributes().getNamedItem("id").getNodeValue();
+ message.getBody().add("<CreditCheckInvalid id=\"" + idValue +"\"></CreditCheckInvalid>");
+
+ logger.info("Updated credit message: "+message);
+
+ return(message);
+ }
+
+}
+
+
Added: cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/java/com/acme/services/creditAgency/SetCreditCheckResponseMessageAction.java
===================================================================
--- cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/java/com/acme/services/creditAgency/SetCreditCheckResponseMessageAction.java (rev 0)
+++ cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/java/com/acme/services/creditAgency/SetCreditCheckResponseMessageAction.java 2009-03-13 07:34:38 UTC (rev 538)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., 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.
+ *
+ * (C) 2008,
+ */
+package com.acme.services.creditAgency;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.overlord.jbossesb.XMLUtils;
+import org.w3c.dom.Node;
+
+public class SetCreditCheckResponseMessageAction extends AbstractActionLifecycle {
+
+ private static Logger logger = Logger.getLogger(SetCreditCheckResponseMessageAction.class);
+
+ private ConfigTree config;
+
+ public SetCreditCheckResponseMessageAction(ConfigTree config) {
+ this.config = config;
+ }
+
+ public Message process(Message message) throws Exception{
+
+ Node node = XMLUtils.getNode((String)message.getBody().get());
+ String idValue = node.getAttributes().getNamedItem("id").getNodeValue();
+ message.getBody().add("<CreditCheckOk id=\"" + idValue +"\"></CreditCheckOk>");
+
+ logger.info("Updated credit message: "+message.getBody().get() +"' by thread of " + Thread.currentThread().getName());
+
+ return(message);
+ }
+
+
+}
+
+
Added: cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/META-INF/deployment.xml
===================================================================
--- cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/META-INF/deployment.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/META-INF/deployment.xml 2009-03-13 07:34:38 UTC (rev 538)
@@ -0,0 +1,7 @@
+<jbossesb-deployment>
+ <depends>jboss.esb:deployment=overlord-cdl-runtime.esb</depends>
+ <depends>jboss.esb.gen.destination:service=Queue,name=esb-stateless-creditAgency</depends>
+ <depends>jboss.esb.gen.destination:service=Queue,name=esb-stateless-creditAgency1</depends>
+ <depends>jboss.esb.gen.destination:service=Queue,name=esb-stateless-creditAgency2</depends>
+ <depends>jboss.esb.gen.destination:service=Queue,name=esb-stateless-creditAgency3</depends>
+</jbossesb-deployment>
Added: cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/META-INF/jboss-esb.xml
===================================================================
--- cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/META-INF/jboss-esb.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/META-INF/jboss-esb.xml 2009-03-13 07:34:38 UTC (rev 538)
@@ -0,0 +1,77 @@
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml..." parameterReloadSecs="5000">
+ <providers>
+ <jms-provider connection-factory="ConnectionFactory" jndi-URL="localhost" jndi-context-factory="org.jnp.interfaces.NamingContextFactory" name="JBossMQ">
+ <jms-bus busid="busId1">
+ <jms-message-filter dest-name="queue/esb-stateless-creditAgency" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId2">
+ <jms-message-filter dest-name="queue/esb-stateless-creditAgency1" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId3">
+ <jms-message-filter dest-name="queue/esb-stateless-creditAgency2" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId4">
+ <jms-message-filter dest-name="queue/esb-stateless-creditAgency3" dest-type="QUEUE"/>
+ </jms-bus>
+ </jms-provider>
+ </providers>
+ <services>
+ <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_CreditAgency">
+ <listeners>
+ <jms-listener busidref="busId1" maxThreads="1" name="esb-stateless-creditAgency"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SwitchAction">
+ <property name="serviceDescriptionName" value="{org.pi4soa.purchase.purchasegoods}PurchaseGoodsProcess-CreditAgency"/>
+ <property name="conversationType" value="overlord.cdl.samples.Common@CreditAgency"/>
+ <property name="paths">
+ <case service-category="org.pi4soa.purchase.purchasegoods" service-name="PurchaseGoodsProcess_CreditAgency__1">
+ <message type="CreditCheckRequest"/>
+ </case>
+ </property>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_CreditAgency__1">
+ <listeners>
+ <jms-listener busidref="busId2" maxThreads="1" name="esb-stateless-creditAgency1"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.ReceiveMessageAction">
+ <property name="operation" value="checkCredit"/>
+ <property name="messageType" value="CreditCheckRequest"/>
+ </action>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.IfAction">
+ <property name="paths">
+ <if service-category="org.pi4soa.purchase.purchasegoods" service-name="PurchaseGoodsProcess_CreditAgency__2" decision-class="com.acme.services.creditAgency.CreditAgencyDecision"/>
+ <else service-category="org.pi4soa.purchase.purchasegoods" service-name="PurchaseGoodsProcess_CreditAgency__3"/>
+ </property>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_CreditAgency__2">
+ <listeners>
+ <jms-listener busidref="busId3" maxThreads="1" name="esb-stateless-creditAgency2"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction">
+ <property name="operation" value="checkCredit"/>
+ <property name="messageType" value="CreditCheckOk"/>
+ <property name="clientRole" value="Store"/>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_CreditAgency__3">
+ <listeners>
+ <jms-listener busidref="busId4" maxThreads="1" name="esb-stateless-creditAgency3"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction">
+ <property name="operation" value="checkCredit"/>
+ <property name="messageType" value="CreditCheckInvalid"/>
+ <property name="clientRole" value="Store"/>
+ </action>
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Added: cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/jbmq-queue-service.xml
===================================================================
--- cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/jbmq-queue-service.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/jbmq-queue-service.xml 2009-03-13 07:34:38 UTC (rev 538)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+<mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.gen.destination:service=Queue,name=esb-stateless-creditAgency">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+</mbean>
+<mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.gen.destination:service=Queue,name=esb-stateless-creditAgency1">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+</mbean>
+<mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.gen.destination:service=Queue,name=esb-stateless-creditAgency2">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+</mbean>
+<mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.gen.destination:service=Queue,name=esb-stateless-creditAgency3">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+</mbean>
+</server>
Added: cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/log4j.xml
===================================================================
--- cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/log4j.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/common/creditAgency/stateless/src/main/resources/log4j.xml 2009-03-13 07:34:38 UTC (rev 538)
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A time/date based rolling appender -->
+ <appender name="FILE" class="org.apache.log4j.FileAppender">
+ <!--errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/-->
+ <param name="File" value="./creditAgency.log"/>
+ <param name="Append" value="false"/>
+
+ <!-- Rollover at midnight each day -->
+ <param name="DatePattern" value="'.'yyyy-MM-dd"/>
+
+ <!-- Rollover at the top of each hour
+ <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
+ -->
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+
+ <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
+ <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
+ -->
+ </layout>
+ </appender>
+
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <!--errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/-->
+ <param name="Target" value="System.out"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
+ <category name="org.apache">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit the org.jboss.serial (jboss-serialization) to INFO as its DEBUG is verbose -->
+ <category name="org.jboss.serial">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit the org.jgroups category to WARN as its INFO is verbose -->
+ <category name="org.jgroups">
+ <priority value="WARN"/>
+ </category>
+
+ <!-- Limit the jacorb category to WARN as its INFO is verbose -->
+ <category name="jacorb">
+ <priority value="WARN"/>
+ </category>
+
+
+ <!-- Limit the JSR77 categories -->
+ <category name="org.jboss.management">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit Axis based webservice category -->
+ <category name="org.jboss.webservice">
+ <priority value="DEBUG"/>
+ </category>
+ <category name="org.jboss.axis">
+ <priority value="INFO"/>
+ </category>
+
+ <category name="org.milyn">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.milyn.delivery.SmooksXML">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.milyn.delivery.serialize.Serializer">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.milyn.cdr.XMLConfigDigester">
+ <priority value="INFO"/>
+ </category>
+
+ <category name="org.jboss.soa.overlord">
+ <priority value="DEBUG" />
+ </category>
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <priority value="INFO" />
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+
+</log4j:configuration>
Added: cdl/trunk/samples/jbossesb/purchasing/store/stateless/pom.xml
===================================================================
--- cdl/trunk/samples/jbossesb/purchasing/store/stateless/pom.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/purchasing/store/stateless/pom.xml 2009-03-13 07:34:38 UTC (rev 538)
@@ -0,0 +1,58 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.soa.overlord.cdl.samples</groupId>
+ <artifactId>jbossesb-stateless-purchasing</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jboss-esb</packaging>
+ <name>Overlord::CDL::Samples::Stateless::Purchasing</name>
+ <url>http://www.jboss.org/soag</url>
+
+ <parent>
+ <groupId>org.jboss.soa.overlord.cdl</groupId>
+ <artifactId>samples</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${log4j.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.soa.overlord.cdl.runtime</groupId>
+ <artifactId>cdl-runtime-jbossesb</artifactId>
+ <version>${cdl.jbossesb.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>purchasing-stateless</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>deploy</id>
+ <phase>install</phase>
+ <configuration>
+ <tasks>
+ <!--copy file="target/purchasing-stateless.esb" todir="${deploy.dir}" overwrite="true" /-->
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
+
Added: cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/acme/services/broker/PurchaseGoods.java
===================================================================
--- cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/acme/services/broker/PurchaseGoods.java (rev 0)
+++ cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/acme/services/broker/PurchaseGoods.java 2009-03-13 07:34:38 UTC (rev 538)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., 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.
+ *
+ * (C) 2008,
+ */
+package com.acme.services.broker;
+
+import java.io.Serializable;
+
+import org.jboss.soa.overlord.jbossesb.stateful.actions.Service;
+
+
+@Service(name="{http://www.jboss.org/overlord/purchase}Store", conversationType="overlord.cdl.samples.Purchasing@Store", root=true)
+public class PurchaseGoods implements Serializable{
+
+ private long id;
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+
+
+}
Added: cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/acme/services/broker/SetBuyFailedMessageAction.java
===================================================================
--- cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/acme/services/broker/SetBuyFailedMessageAction.java (rev 0)
+++ cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/acme/services/broker/SetBuyFailedMessageAction.java 2009-03-13 07:34:38 UTC (rev 538)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., 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.
+ *
+ * (C) 2008,
+ */
+package com.acme.services.broker;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.overlord.jbossesb.XMLUtils;
+import org.w3c.dom.Node;
+
+/*
+ * @author gary
+ */
+public class SetBuyFailedMessageAction extends AbstractActionLifecycle {
+
+ private static Logger logger = Logger.getLogger(SetBuyFailedMessageAction.class);
+
+ private ConfigTree config=null;
+
+ public SetBuyFailedMessageAction(ConfigTree config) {
+ this.config = config;
+ }
+
+ public Message process(Message message) throws Exception{
+
+ Node node = XMLUtils.getNode((String)message.getBody().get());
+ String idValue = node.getAttributes().getNamedItem("id").getNodeValue();
+
+ message.getBody().add("<BuyFailed id=\"" + idValue +"\"></BuyFailed>");
+
+ logger.info("Updated buy message: "+message);
+
+ return(message);
+ }
+
+}
+
+
Added: cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/acme/services/broker/SetBuyResponseMessageAction.java
===================================================================
--- cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/acme/services/broker/SetBuyResponseMessageAction.java (rev 0)
+++ cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/acme/services/broker/SetBuyResponseMessageAction.java 2009-03-13 07:34:38 UTC (rev 538)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., 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.
+ *
+ * (C) 2008,
+ */
+package com.acme.services.broker;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.overlord.jbossesb.XMLUtils;
+import org.w3c.dom.Node;
+
+public class SetBuyResponseMessageAction extends AbstractActionLifecycle {
+
+ private static Logger logger = Logger.getLogger(SetBuyResponseMessageAction.class);
+
+ private ConfigTree config;
+
+ public SetBuyResponseMessageAction(ConfigTree config) {
+ this.config = config;
+ }
+
+ public Message process(Message message) throws Exception{
+
+ Node node = XMLUtils.getNode((String)message.getBody().get());
+ String idValue = node.getAttributes().getNamedItem("id").getNodeValue();
+ message.getBody().add("<BuyConfirmed id=\"" + idValue +"\"></BuyConfirmed>");
+
+ logger.info("Updated buy message: "+message);
+
+ return(message);
+ }
+
+
+}
+
+
Added: cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/acme/services/broker/SetCreditCheckRequestMessageAction.java
===================================================================
--- cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/acme/services/broker/SetCreditCheckRequestMessageAction.java (rev 0)
+++ cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/java/com/acme/services/broker/SetCreditCheckRequestMessageAction.java 2009-03-13 07:34:38 UTC (rev 538)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., 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.
+ *
+ * (C) 2008,
+ */
+package com.acme.services.broker;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.overlord.jbossesb.XMLUtils;
+import org.w3c.dom.Node;
+
+public class SetCreditCheckRequestMessageAction extends AbstractActionLifecycle {
+
+ private static Logger logger = Logger.getLogger(SetCreditCheckRequestMessageAction.class);
+
+ private ConfigTree config;
+
+ public SetCreditCheckRequestMessageAction(ConfigTree config) {
+ this.config = config;
+ }
+
+ public Message process(Message message) throws Exception{
+
+ Node node = XMLUtils.getNode((String)message.getBody().get());
+ String idValue = node.getAttributes().getNamedItem("id").getNodeValue();
+ message.getBody().add("<CreditCheckRequest id=\"" + idValue +"\"></CreditCheckRequest>");
+
+ logger.info("Updated credit check request message: "+message);
+
+ return(message);
+ }
+
+}
+
+
Added: cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/META-INF/deployment.xml
===================================================================
--- cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/META-INF/deployment.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/META-INF/deployment.xml 2009-03-13 07:34:38 UTC (rev 538)
@@ -0,0 +1,8 @@
+<jbossesb-deployment>
+ <depends>jboss.esb:deployment=overlord-cdl-runtime.esb</depends>
+ <depends>org.pi4soa.purchase.purchasegoods.destination:service=Queue,name=org_pi4soa_purchase_purchasegoods_PurchaseGoodsProcess_Store__3</depends>
+ <depends>org.pi4soa.purchase.purchasegoods.destination:service=Queue,name=org_pi4soa_purchase_purchasegoods_PurchaseGoodsProcess_Store__2</depends>
+ <depends>org.pi4soa.purchase.purchasegoods.destination:service=Queue,name=org_pi4soa_purchase_purchasegoods_PurchaseGoodsProcess_Store__1</depends>
+ <depends>org.pi4soa.purchase.purchasegoods.destination:service=Queue,name=org_pi4soa_purchase_purchasegoods_PurchaseGoodsProcess_Store</depends>
+ <depends>org.pi4soa.purchase.purchasegoods.destination:service=Queue,name=org_pi4soa_purchase_purchasegoods_checkCredit</depends>
+</jbossesb-deployment>
Added: cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/META-INF/jboss-esb.xml
===================================================================
--- cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/META-INF/jboss-esb.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/META-INF/jboss-esb.xml 2009-03-13 07:34:38 UTC (rev 538)
@@ -0,0 +1,107 @@
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml..." parameterReloadSecs="5000">
+ <providers>
+ <jms-provider connection-factory="ConnectionFactory" jndi-URL="localhost" jndi-context-factory="org.jnp.interfaces.NamingContextFactory" name="JBossMQ">
+ <jms-bus busid="busId1">
+ <jms-message-filter dest-name="queue/org_pi4soa_purchase_purchasegoods_PurchaseGoodsProcess_Store" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId2">
+ <jms-message-filter dest-name="queue/org_pi4soa_purchase_purchasegoods_PurchaseGoodsProcess_Store__1" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId3">
+ <jms-message-filter dest-name="queue/org_pi4soa_purchase_purchasegoods_PurchaseGoodsProcess_Store__2" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId4">
+ <jms-message-filter dest-name="queue/org_pi4soa_purchase_purchasegoods_PurchaseGoodsProcess_Store__3" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="busId5">
+ <jms-message-filter dest-name="queue/org_pi4soa_purchase_purchasegoods_checkCredit" dest-type="QUEUE"/>
+ </jms-bus>
+ </jms-provider>
+ </providers>
+ <services>
+ <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_Store">
+ <listeners>
+ <jms-listener busidref="busId1" maxThreads="1" name="org.pi4soa.purchase.purchasegoods-PurchaseGoodsProcess_Store"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.SwitchAction">
+ <property name="serviceDescriptionName" value="{org.pi4soa.purchase.purchasegoods}PurchaseGoodsProcess-Store"/>
+ <property name="conversationType" value="overlord.cdl.samples.Purchasing@Store"/>
+ <property name="paths">
+ <case service-category="org.pi4soa.purchase.purchasegoods" service-name="PurchaseGoodsProcess_Store__1">
+ <message type="BuyRequest"/>
+ </case>
+ </property>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_Store__1">
+ <listeners>
+ <jms-listener busidref="busId2" maxThreads="1" name="org.pi4soa.purchase.purchasegoods-PurchaseGoodsProcess_Store__1"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.actions.stateless.ReceiveMessageAction">
+ <property name="operation" value="buy"/>
+ <property name="messageType" value="BuyRequest"/>
+ </action>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction">
+ <property name="operation" value="checkCredit"/>
+ <property name="messageType" value="CreditCheckRequest"/>
+ <property name="serviceCategory" value="org.pi4soa.purchase.purchasegoods"/>
+ <property name="serviceName" value="PurchaseGoodsProcess_CreditAgency"/>
+ <property name="responseServiceCategory" value="org.pi4soa.purchase.purchasegoods"/>
+ <property name="responseServiceName" value="checkCredit"/>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_Store__2">
+ <listeners>
+ <jms-listener busidref="busId3" maxThreads="1" name="org.pi4soa.purchase.purchasegoods-PurchaseGoodsProcess_Store__2"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.ReceiveMessageAction">
+ <property name="operation" value="checkCredit"/>
+ <property name="messageType" value="CreditCheckOk"/>
+ </action>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction">
+ <property name="operation" value="buy"/>
+ <property name="messageType" value="BuyConfirmed"/>
+ <property name="clientRole" value="Buyer"/>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.purchase.purchasegoods" name="PurchaseGoodsProcess_Store__3">
+ <listeners>
+ <jms-listener busidref="busId4" maxThreads="1" name="org.pi4soa.purchase.purchasegoods-PurchaseGoodsProcess_Store__3"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.ReceiveMessageAction">
+ <property name="operation" value="checkCredit"/>
+ <property name="messageType" value="CreditCheckInvalid"/>
+ </action>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SendMessageAction">
+ <property name="operation" value="buy"/>
+ <property name="messageType" value="BuyFailed"/>
+ <property name="clientRole" value="Buyer"/>
+ </action>
+ </actions>
+ </service>
+ <service category="org.pi4soa.purchase.purchasegoods" name="checkCredit">
+ <listeners>
+ <jms-listener busidref="busId5" maxThreads="1" name="org.pi4soa.purchase.purchasegoods-checkCredit"/>
+ </listeners>
+ <actions>
+ <action class="org.jboss.soa.overlord.jbossesb.stateless.actions.SwitchAction">
+ <property name="paths">
+ <case service-category="org.pi4soa.purchase.purchasegoods" service-name="PurchaseGoodsProcess_Store__2">
+ <message type="CreditCheckOk"/>
+ </case>
+ <case service-category="org.pi4soa.purchase.purchasegoods" service-name="PurchaseGoodsProcess_Store__3">
+ <message type="CreditCheckInvalid"/>
+ </case>
+ </property>
+ </action>
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Added: cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/jbmq-queue-service.xml
===================================================================
--- cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/jbmq-queue-service.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/jbmq-queue-service.xml 2009-03-13 07:34:38 UTC (rev 538)
@@ -0,0 +1,32 @@
+<server>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.purchase.purchasegoods.destination:service=Queue,name=org_pi4soa_purchase_purchasegoods_PurchaseGoodsProcess_Store__3">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.purchase.purchasegoods.destination:service=Queue,name=org_pi4soa_purchase_purchasegoods_PurchaseGoodsProcess_Store__2">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.purchase.purchasegoods.destination:service=Queue,name=org_pi4soa_purchase_purchasegoods_PurchaseGoodsProcess_Store__1">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.purchase.purchasegoods.destination:service=Queue,name=org_pi4soa_purchase_purchasegoods_PurchaseGoodsProcess_Store">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="org.pi4soa.purchase.purchasegoods.destination:service=Queue,name=org_pi4soa_purchase_purchasegoods_checkCredit">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+</server>
Added: cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/log4j.xml
===================================================================
--- cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/log4j.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/purchasing/store/stateless/src/main/resources/log4j.xml 2009-03-13 07:34:38 UTC (rev 538)
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A time/date based rolling appender -->
+ <appender name="FILE" class="org.apache.log4j.FileAppender">
+ <!--errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/-->
+ <param name="File" value="./purchasing.log"/>
+ <param name="Append" value="false"/>
+
+ <!-- Rollover at midnight each day -->
+ <param name="DatePattern" value="'.'yyyy-MM-dd"/>
+
+ <!-- Rollover at the top of each hour
+ <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
+ -->
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+
+ <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
+ <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
+ -->
+ </layout>
+ </appender>
+
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <!--errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/-->
+ <param name="Target" value="System.out"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
+ <category name="org.apache">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit the org.jboss.serial (jboss-serialization) to INFO as its DEBUG is verbose -->
+ <category name="org.jboss.serial">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit the org.jgroups category to WARN as its INFO is verbose -->
+ <category name="org.jgroups">
+ <priority value="WARN"/>
+ </category>
+
+ <!-- Limit the jacorb category to WARN as its INFO is verbose -->
+ <category name="jacorb">
+ <priority value="WARN"/>
+ </category>
+
+
+ <!-- Limit the JSR77 categories -->
+ <category name="org.jboss.management">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit Axis based webservice category -->
+ <category name="org.jboss.webservice">
+ <priority value="DEBUG"/>
+ </category>
+ <category name="org.jboss.axis">
+ <priority value="INFO"/>
+ </category>
+
+ <category name="org.milyn">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.milyn.delivery.SmooksXML">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.milyn.delivery.serialize.Serializer">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.milyn.cdr.XMLConfigDigester">
+ <priority value="INFO"/>
+ </category>
+
+ <category name="org.jboss.soa.overlord">
+ <priority value="DEBUG" />
+ </category>
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <priority value="INFO" />
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+
+</log4j:configuration>
17 years, 4 months
Overlord SVN: r537 - cdl/trunk/validator/jbossesb/src/main/java/org/jboss/soa/overlord/validator/jbossesb/pi4soa.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2009-03-10 10:31:07 -0400 (Tue, 10 Mar 2009)
New Revision: 537
Modified:
cdl/trunk/validator/jbossesb/src/main/java/org/jboss/soa/overlord/validator/jbossesb/pi4soa/ValidatorConfigGenerator.java
Log:
Protect against null choreography.
Modified: cdl/trunk/validator/jbossesb/src/main/java/org/jboss/soa/overlord/validator/jbossesb/pi4soa/ValidatorConfigGenerator.java
===================================================================
--- cdl/trunk/validator/jbossesb/src/main/java/org/jboss/soa/overlord/validator/jbossesb/pi4soa/ValidatorConfigGenerator.java 2009-03-06 18:51:52 UTC (rev 536)
+++ cdl/trunk/validator/jbossesb/src/main/java/org/jboss/soa/overlord/validator/jbossesb/pi4soa/ValidatorConfigGenerator.java 2009-03-10 14:31:07 UTC (rev 537)
@@ -59,7 +59,11 @@
ret = createValidatorConfig();
// Create the new entries for the supplied choreography
- createEntries(ret, model, cdlpack);
+ if (cdlpack != null) {
+ createEntries(ret, model, cdlpack);
+ } else {
+ logger.error("Choreography not supplied for '"+model+"'");
+ }
} catch(Exception e) {
e.printStackTrace();
17 years, 4 months
Overlord SVN: r536 - cdl/trunk/distribution/validator/jbossesb/pi4soa.sar.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2009-03-06 13:51:52 -0500 (Fri, 06 Mar 2009)
New Revision: 536
Added:
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.cdl_2.0.0.200903061741.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.common_2.0.0.200903061741.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.j2ee_2.0.0.200903061741.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jboss_2.0.0.200903061741.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jbossesb_2.0.0.200903061741.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.service_2.0.0.200903061741.jar
Removed:
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.cdl_2.0.0.200903031643.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.common_2.0.0.200903031643.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.j2ee_2.0.0.200903031643.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jboss_2.0.0.200903031643.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jbossesb_2.0.0.200903031643.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.service_2.0.0.200903031643.jar
Log:
Updated pi4soa jars.
Deleted: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.cdl_2.0.0.200903031643.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.cdl_2.0.0.200903061741.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.cdl_2.0.0.200903061741.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.common_2.0.0.200903031643.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.common_2.0.0.200903061741.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.common_2.0.0.200903061741.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.j2ee_2.0.0.200903031643.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.j2ee_2.0.0.200903061741.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.j2ee_2.0.0.200903061741.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jboss_2.0.0.200903031643.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jboss_2.0.0.200903061741.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jboss_2.0.0.200903061741.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jbossesb_2.0.0.200903031643.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jbossesb_2.0.0.200903061741.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jbossesb_2.0.0.200903061741.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.service_2.0.0.200903031643.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.service_2.0.0.200903061741.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.service_2.0.0.200903061741.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 4 months
Overlord SVN: r535 - cdl/trunk/distribution/validator/jbossesb/pi4soa.sar.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2009-03-03 12:22:53 -0500 (Tue, 03 Mar 2009)
New Revision: 535
Added:
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.cdl_2.0.0.200903031643.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.common_2.0.0.200903031643.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.j2ee_2.0.0.200903031643.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jboss_2.0.0.200903031643.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jbossesb_2.0.0.200903031643.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.service_2.0.0.200903031643.jar
Removed:
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.cdl_2.0.0.200902101645.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.common_2.0.0.200902101645.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.j2ee_2.0.0.200902101645.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jboss_2.0.0.200902101645.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jbossesb_2.0.0.200902101645.jar
cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.service_2.0.0.200902101645.jar
Log:
Updated pi4soa jars.
Deleted: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.cdl_2.0.0.200902101645.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.cdl_2.0.0.200903031643.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.cdl_2.0.0.200903031643.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.common_2.0.0.200902101645.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.common_2.0.0.200903031643.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.common_2.0.0.200903031643.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.j2ee_2.0.0.200902101645.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.j2ee_2.0.0.200903031643.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.j2ee_2.0.0.200903031643.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jboss_2.0.0.200902101645.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jboss_2.0.0.200903031643.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jboss_2.0.0.200903031643.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jbossesb_2.0.0.200902101645.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jbossesb_2.0.0.200903031643.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.jbossesb_2.0.0.200903031643.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.service_2.0.0.200902101645.jar
===================================================================
(Binary files differ)
Added: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.service_2.0.0.200903031643.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/distribution/validator/jbossesb/pi4soa.sar/org.pi4soa.service_2.0.0.200903031643.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 4 months