[jboss-svn-commits] JBL Code SVN: r38102 - in labs/jbossesb/branches/JBESB_4_11_CP/product: docs/Programmers_Guide/en-US and 7 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu May 24 14:55:02 EDT 2012
Author: kevin.conner at jboss.com
Date: 2012-05-24 14:55:01 -0400 (Thu, 24 May 2012)
New Revision: 38102
Added:
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model131SchemaParser.java
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/Generator131ModelUnitTest.java
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.131.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_02.131.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_03.131.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_04.131.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_05.131.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_131_esbaware.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_131_gateways.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/CamelGatewayMapperUnitTest.java
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/FtpListenerMapperUnitTest.java
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/JmsListenerMapperJCAActivationUnitTest.java
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/JmsListenerMapperUnitTest.java
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/SecurityMapperUnitTest.java
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_config_escaping.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_config_jms_jca.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_config_readonly.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_config_security.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_01.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_02.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_03.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_04.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_05.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_06.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_07.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_08.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_09.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_10.xml
Modified:
labs/jbossesb/branches/JBESB_4_11_CP/product/.classpath
labs/jbossesb/branches/JBESB_4_11_CP/product/build.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/docs/Programmers_Guide/en-US/Example.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/install/build.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/build.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/ModelParser.java
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/GeneratorUnitTest.java
labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ServicePublisherUnitTest.java
labs/jbossesb/branches/JBESB_4_11_CP/product/services/base-project-build.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/services/soap/build.xml
Log:
Added 1.3.1 schema parser, updated tests and merged xmlbeans config: JBESB-3806
Modified: labs/jbossesb/branches/JBESB_4_11_CP/product/.classpath
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/.classpath 2012-05-24 17:39:48 UTC (rev 38101)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/.classpath 2012-05-24 18:55:01 UTC (rev 38102)
@@ -28,10 +28,7 @@
<classpathentry excluding="**/.svn/" kind="src" path="services/spring/src/main/java"/>
<classpathentry excluding="**/.svn/" kind="src" path="services/spring/src/test/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="lib" path="build/jbossesb/lib/jbossesb-config-model-1.0.1.jar"/>
- <classpathentry kind="lib" path="build/jbossesb/lib/jbossesb-config-model-1.1.0.jar"/>
- <classpathentry kind="lib" path="build/jbossesb/lib/jbossesb-config-model-1.2.0.jar"/>
- <classpathentry kind="lib" path="build/jbossesb/lib/jbossesb-config-model-1.3.0.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb/lib/jbossesb-config-model.jar"/>
<classpathentry kind="lib" path="build/lib/activation-1.1.jar"/>
<classpathentry kind="lib" path="build/lib/ant-1.7.0.jar"/>
<classpathentry kind="lib" path="build/lib/antlr-2.7.7.jar"/>
Modified: labs/jbossesb/branches/JBESB_4_11_CP/product/build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/build.xml 2012-05-24 17:39:48 UTC (rev 38101)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/build.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -665,7 +665,7 @@
<include name="jboss-system-*.jar"/>
<include name="jboss-vfs-*.jar"/>
<include name="jbossall-client-*.jar"/>
- <include name="jbossesb-config-model-*.jar"/>
+ <include name="jbossesb-config-model.jar"/>
<include name="jbossesb.esb/c3p0-*.jar"/>
<include name="jbossesb.esb/jackrabbit-api-*.jar"/>
<include name="jbossesb.esb/jackrabbit-core-*.jar"/>
Modified: labs/jbossesb/branches/JBESB_4_11_CP/product/docs/Programmers_Guide/en-US/Example.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/docs/Programmers_Guide/en-US/Example.xml 2012-05-24 17:39:48 UTC (rev 38101)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/docs/Programmers_Guide/en-US/Example.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -355,7 +355,7 @@
<simplelist type="vert" columns="2">
<member><filename>jbossesb-rosetta.jar</filename></member>
- <member><filename>jbossesb-config-model-1.0.1.jar</filename></member>
+ <member><filename>jbossesb-config-model.jar</filename></member>
<member><filename>jbossts-common.jar</filename></member>
<member><filename>log4j.jar</filename></member>
<member><filename>stax-ex.jar</filename></member>
Modified: labs/jbossesb/branches/JBESB_4_11_CP/product/install/build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/install/build.xml 2012-05-24 17:39:48 UTC (rev 38101)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/install/build.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -314,7 +314,7 @@
<copy todir="${deployers.dir}/esb.deployer/lib" overwrite="true">
<fileset dir="${org.jboss.esb.dist.lib}/jbossesb.sar/lib">
<include name="jbossesb-rosetta.jar"/>
- <include name="jbossesb-config-model-*.jar"/>
+ <include name="jbossesb-config-model*.jar"/>
<include name="camel-core-*.jar"/>
<include name="commons-management-*.jar"/>
<include name="commons-lang-*.jar"/>
@@ -385,7 +385,7 @@
<copy todir="${deploy.dir}/jbossesb.sar" includeemptydirs="false" overwrite="true">
<fileset dir="${org.jboss.esb.dist.lib}/jbossesb.sar">
<exclude name="lib/jbossesb-rosetta.jar"/>
- <exclude name="lib/jbossesb-config-model-*.jar"/>
+ <exclude name="lib/jbossesb-config-model*.jar"/>
<exclude name="lib/camel-core-*.jar"/>
<exclude name="lib/commons-management-*.jar"/>
<exclude name="lib/commons-codec-*.jar"/>
Modified: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/build.xml 2012-05-24 17:39:48 UTC (rev 38101)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/build.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -24,16 +24,8 @@
<property name="org.jboss.esb.rosetta.src.dir" location="src"/>
<property name="org.jboss.esb.root.dir" location="../"/>
<property name="gendir" location="${org.jboss.esb.internal.dest}/schema-model" />
- <property name="schema101.src.dir" location="${gendir}/src" />
- <property name="schema101.classes.dir" location="${gendir}/classes" />
- <property name="schema110.src.dir" location="${gendir}/src110" />
- <property name="schema110.classes.dir" location="${gendir}/classes110" />
- <property name="schema120.src.dir" location="${gendir}/src120" />
- <property name="schema120.classes.dir" location="${gendir}/classes120" />
- <property name="schema130.src.dir" location="${gendir}/src130" />
- <property name="schema130.classes.dir" location="${gendir}/classes130" />
- <property name="schema131.src.dir" location="${gendir}/src130" />
- <property name="schema131.classes.dir" location="${gendir}/classes130" />
+ <property name="schema.src.dir" location="${gendir}/src" />
+ <property name="schema.classes.dir" location="${gendir}/classes" />
<property environment="env"/>
@@ -49,11 +41,7 @@
<fileset dir="${org.jboss.esb.lib.dir}" includes="*.jar" excludes="${security.jars}"/>
<fileset dir="../../testlib" includes="emma*.jar"/>
<fileset dir="${org.jboss.esb.ext.lib.dir}/standalone" includes="*.jar"/>
- <pathelement location="${schema101.classes.dir}"/>
- <pathelement location="${schema110.classes.dir}"/>
- <pathelement location="${schema120.classes.dir}"/>
- <pathelement location="${schema130.classes.dir}"/>
- <pathelement location="${schema131.classes.dir}"/>
+ <pathelement location="${schema.classes.dir}"/>
</path>
<path id="org.jboss.esb.rosetta.as6.classpath">
@@ -69,11 +57,7 @@
</fileset>
<fileset dir="../../testlib" includes="emma*.jar"/>
<fileset dir="${org.jboss.esb.ext.lib.dir}/standalone" includes="*.jar"/>
- <pathelement location="${schema101.classes.dir}"/>
- <pathelement location="${schema110.classes.dir}"/>
- <pathelement location="${schema120.classes.dir}"/>
- <pathelement location="${schema130.classes.dir}"/>
- <pathelement location="${schema131.classes.dir}"/>
+ <pathelement location="${schema.classes.dir}"/>
</path>
<target name="org.jboss.esb.rosetta.init">
@@ -255,89 +239,24 @@
<delete dir="${gendir}" /><mkdir dir="${gendir}" />
<xmlbean
- classgendir="${schema101.classes.dir}"
+ classgendir="${schema.classes.dir}"
javasource="1.5"
debug="${org.jboss.esb.debug}"
- srcgendir="${schema101.src.dir}"
- destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model-1.0.1.jar"
+ srcgendir="${schema.src.dir}"
+ destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model.jar"
classpathref="xbeans-classpath">
<fileset dir="${org.jboss.esb.root.dir}/etc/schemas/xml/" includes="jbossesb-1.0.1.xsd,jbossesb-1.0.1.xsdconfig"/>
- </xmlbean>
- <!-- now add the xsd to it -->
- <jar destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model-1.0.1.jar" update="true" manifest="${org.jboss.esb.rosetta.classes.dir}/MANIFEST.MF"
- basedir="${org.jboss.esb.root.dir}/etc/schemas/xml/" includes="jbossesb-1.0.1.xsd">
- <fileset dir="${org.jboss.esb.rosetta.classes.dir}"
- includes="VERSION org/jboss/soa/**/Version.class"/>
- </jar>
-
- <!-- now handle 1.1.0 -->
- <xmlbean
- classgendir="${schema110.classes.dir}"
- javasource="1.5"
- debug="${org.jboss.esb.debug}"
- srcgendir="${schema110.src.dir}"
- destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model-1.1.0.jar"
- classpathref="xbeans-classpath">
<fileset dir="${org.jboss.esb.root.dir}/etc/schemas/xml/" includes="jbossesb-1.1.0.xsd,jbossesb-1.1.0.xsdconfig"/>
- </xmlbean>
- <!-- now add the xsd to it -->
- <jar destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model-1.1.0.jar" update="true" manifest="${org.jboss.esb.rosetta.classes.dir}/MANIFEST.MF"
- basedir="${org.jboss.esb.root.dir}/etc/schemas/xml/" includes="jbossesb-1.1.0.xsd">
- <fileset dir="${org.jboss.esb.rosetta.classes.dir}"
- includes="VERSION org/jboss/soa/**/Version.class"/>
- </jar>
-
- <!-- now handle 1.2.0 -->
- <xmlbean
- classgendir="${schema120.classes.dir}"
- javasource="1.5"
- debug="${org.jboss.esb.debug}"
- srcgendir="${schema120.src.dir}"
- destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model-1.2.0.jar"
- classpathref="xbeans-classpath">
<fileset dir="${org.jboss.esb.root.dir}/etc/schemas/xml/" includes="jbossesb-1.2.0.xsd,jbossesb-1.2.0.xsdconfig"/>
- </xmlbean>
- <!-- now add the xsd to it -->
- <jar destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model-1.2.0.jar" update="true" manifest="${org.jboss.esb.rosetta.classes.dir}/MANIFEST.MF"
- basedir="${org.jboss.esb.root.dir}/etc/schemas/xml/" includes="jbossesb-1.2.0.xsd">
- <fileset dir="${org.jboss.esb.rosetta.classes.dir}"
- includes="VERSION org/jboss/soa/**/Version.class"/>
- </jar>
-
- <!-- now handle 1.3.0 -->
- <xmlbean
- classgendir="${schema130.classes.dir}"
- javasource="1.5"
- debug="${org.jboss.esb.debug}"
- srcgendir="${schema130.src.dir}"
- destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model-1.3.0.jar"
- classpathref="xbeans-classpath">
<fileset dir="${org.jboss.esb.root.dir}/etc/schemas/xml/" includes="jbossesb-1.3.0.xsd,jbossesb-1.3.0.xsdconfig"/>
- </xmlbean>
- <!-- now add the xsd to it -->
- <jar destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model-1.3.0.jar" update="true" manifest="${org.jboss.esb.rosetta.classes.dir}/MANIFEST.MF"
- basedir="${org.jboss.esb.root.dir}/etc/schemas/xml/" includes="jbossesb-1.3.0.xsd">
- <fileset dir="${org.jboss.esb.rosetta.classes.dir}"
- includes="VERSION org/jboss/soa/**/Version.class"/>
- </jar>
-
- <!-- now handle 1.3.1 -->
- <xmlbean
- classgendir="${schema131.classes.dir}"
- javasource="1.5"
- debug="${org.jboss.esb.debug}"
- srcgendir="${schema131.src.dir}"
- destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model-1.3.1.jar"
- classpathref="xbeans-classpath">
<fileset dir="${org.jboss.esb.root.dir}/etc/schemas/xml/" includes="jbossesb-1.3.1.xsd,jbossesb-1.3.1.xsdconfig"/>
</xmlbean>
<!-- now add the xsd to it -->
- <jar destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model-1.3.1.jar" update="true" manifest="${org.jboss.esb.rosetta.classes.dir}/MANIFEST.MF"
- basedir="${org.jboss.esb.root.dir}/etc/schemas/xml/" includes="jbossesb-1.3.1.xsd">
+ <jar destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model.jar" update="true" manifest="${org.jboss.esb.rosetta.classes.dir}/MANIFEST.MF"
+ basedir="${org.jboss.esb.root.dir}/etc/schemas/xml/" includes="jbossesb-*.xsd">
<fileset dir="${org.jboss.esb.rosetta.classes.dir}"
includes="VERSION org/jboss/soa/**/Version.class"/>
</jar>
-
</target>
<path id="xbeans-classpath">
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model131SchemaParser.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model131SchemaParser.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model131SchemaParser.java 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,179 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * 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.
+ * 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.listeners.config.model;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.xmlbeans.XmlException;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.Service;
+import org.jboss.soa.esb.listeners.config.ServiceContract;
+import org.jboss.soa.esb.listeners.config.ServicePublisher;
+import org.jboss.soa.esb.listeners.config.WebserviceInfo;
+import org.jboss.soa.esb.listeners.config.mappers131.XMLBeansModel;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.JbossesbDocument.Factory;
+import org.w3c.dom.Document;
+
+/**
+ * Schema parser for jbossesb-1.3.1.xsd schema.
+ *
+ * <a href='mailto:Kevin.Conner at jboss.com>Kevin Conner</a>
+ */
+class Model131SchemaParser implements SchemaParser
+{
+ /**
+ * The namespace associated with this parser.
+ */
+ static final String NAMESPACE = "http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd" ;
+
+ /**
+ * The schema resource for validation.
+ */
+ static final String SCHEMA = "/jbossesb-1.3.1.xsd";
+
+ /**
+ * Obtain a model adapter from the specified stream.
+ * @param reader The XML stream reader.
+ * @return The model adapter
+ * @throws javax.xml.stream.XMLStreamException for errors during parsing.
+ */
+ public ModelAdapter parse(final XMLStreamReader reader)
+ throws ModelException
+ {
+ try
+ {
+ return new Model131Adapter(new XMLBeansModel(Factory.parse(reader).getJbossesb())) ;
+ }
+ catch (final XmlException xmle)
+ {
+ throw new ModelException("Error during schema parsing", xmle) ;
+ }
+ }
+
+ /**
+ * Model adapter for the jbossesb-1.3.1.xsd schema.
+ *
+ * <a href='mailto:Kevin.Conner at jboss.com>Kevin Conner</a>
+ *
+ */
+ private static final class Model131Adapter implements ModelAdapter
+ {
+ /**
+ * The model for jbossesb-1.3.1.xsd.
+ */
+ private final XMLBeansModel model ;
+
+ /**
+ * Create the jbossesb-1.3.1 model adapter.
+ * @param model The jbossesb-1.3.1 model.
+ */
+ Model131Adapter(final XMLBeansModel model)
+ {
+ this.model = model ;
+ }
+
+ /**
+ * Verify the schedule provider configuration.
+ * @throws org.jboss.soa.esb.ConfigurationException
+ */
+ public void verifyScheduleProviderConfig()
+ throws ConfigurationException
+ {
+ model.verifyScheduleProviderConfig() ;
+ }
+
+ /**
+ * Get a map of service publishers provided by each service.
+ *
+ * @return The map of service publishers, keyed by service.
+ */
+ public Map<Service, List<ServicePublisher>> getServicePublishers()
+ {
+ return model.getServicePublishers() ;
+ }
+
+
+ /**
+ * Generate the ESB Aware configuration document.
+ * @return The ESB aware configuration.
+ * @throws org.jboss.soa.esb.ConfigurationException Error creating configuration.
+ */
+ public Document generateESBAwareConfig()
+ throws ConfigurationException
+ {
+ return model.generateESBAwareConfig() ;
+ }
+
+ /**
+ * Generate the gateway configuration document.
+ * @return The gateway configuration.
+ * @throws org.jboss.soa.esb.ConfigurationException Error creating configuration.
+ */
+ public Document generateGatewayConfig()
+ throws ConfigurationException
+ {
+ return model.generateGatewayConfig() ;
+ }
+
+ /**
+ * Get the list of actions in this deployment.
+ * @return a list of actions or null if none present.
+ */
+ public Set<String> getActions()
+ {
+ return model.getActions() ;
+ }
+
+ /**
+ * Get the list of services which require a webservice endpoint.
+ * @return The list of services.
+ */
+ public List<WebserviceInfo> getWebserviceServices()
+ throws ConfigurationException
+ {
+ return model.getWebserviceServices() ;
+ }
+
+ /**
+ * Get the list of service contracts.
+ * @return The list of service contracts.
+ */
+ public List<ServiceContract> getServiceContracts()
+ {
+ return model.getServiceContracts() ;
+ }
+
+ public String getAuthDomain()
+ {
+ return model.getAuthDomain();
+ }
+
+ public String getAuthMethod()
+ {
+ return model.getAuthMethod();
+ }
+ }
+}
Modified: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/ModelParser.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/ModelParser.java 2012-05-24 17:39:48 UTC (rev 38101)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/ModelParser.java 2012-05-24 18:55:01 UTC (rev 38102)
@@ -69,12 +69,14 @@
SCHEMA_PARSERS.put(Model110SchemaParser.NAMESPACE, new Model110SchemaParser()) ;
SCHEMA_PARSERS.put(Model120SchemaParser.NAMESPACE, new Model120SchemaParser()) ;
SCHEMA_PARSERS.put(Model130SchemaParser.NAMESPACE, new Model130SchemaParser()) ;
+ SCHEMA_PARSERS.put(Model131SchemaParser.NAMESPACE, new Model131SchemaParser()) ;
Schema schema = null ;
try
{
schema = XMLHelper.getSchema(new String[] {Model101SchemaParser.SCHEMA,
- Model110SchemaParser.SCHEMA, Model120SchemaParser.SCHEMA, Model130SchemaParser.SCHEMA}) ;
+ Model110SchemaParser.SCHEMA, Model120SchemaParser.SCHEMA, Model130SchemaParser.SCHEMA,
+ Model131SchemaParser.SCHEMA}) ;
}
catch (SAXException saxe)
{
Modified: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java 2012-05-24 17:39:48 UTC (rev 38101)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java 2012-05-24 18:55:01 UTC (rev 38102)
@@ -62,6 +62,20 @@
executeTest("rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.120.xml",
"etc/schemas/xml/jbossesb-1.2.0.xsd");
}
+
+ @Test
+ public void readAndGenerateConfig130() throws Exception
+ {
+ executeTest("rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.130.xml",
+ "etc/schemas/xml/jbossesb-1.3.0.xsd");
+ }
+
+ @Test
+ public void readAndGenerateConfig131() throws Exception
+ {
+ executeTest("rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.131.xml",
+ "etc/schemas/xml/jbossesb-1.3.1.xsd");
+ }
private void executeTest(final String config, final String schema)
throws Exception
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/Generator131ModelUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/Generator131ModelUnitTest.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/Generator131ModelUnitTest.java 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * 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.
+ * 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.listeners.config;
+
+import junit.framework.TestCase;
+import org.jboss.soa.esb.listeners.config.mappers131.XMLBeansModel;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.DualListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.JmsProviderType;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.Listener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.JbossesbDocument.Factory;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.JmsBusDocument.JmsBus;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.JmsListenerDocument.JmsListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.JmsMessageFilterDocument.JmsMessageFilter;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.ServiceDocument.Service;
+
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.List;
+
+/**
+ * Model specific unit tests extracted from GeneratorUnitTest.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class Generator131ModelUnitTest extends TestCase {
+
+ public void test_model() throws Exception {
+ final InputStream is = getClass().getResourceAsStream("jbossesb_config_01.131.xml");
+ final Reader reader = new InputStreamReader(is) ;
+ XMLBeansModel model = new XMLBeansModel(Factory.parse(reader).getJbossesb());
+
+ JmsBus bus = (JmsBus)model.getBus("server1-jms");
+ JmsProviderType provider = (JmsProviderType) model.getProvider(bus);
+ assertEquals("server1-jms", bus.getBusid());
+ assertEquals("com.xyz.provider.XYZConnectionFactory", provider.getConnectionFactory());
+ assertEquals("com.xyz.provider.NamingContextFactory", provider.getJndiContextFactory());
+ assertEquals("xyz://server1:9876", provider.getJndiURL());
+ assertEquals("com.xyz", provider.getJndiPkgPrefix());
+ JmsMessageFilter busDestination = bus.getJmsMessageFilter();
+ assertEquals("queue/A", busDestination.getDestName());
+ assertEquals(JmsMessageFilter.DestType.QUEUE, busDestination.getDestType());
+ assertEquals("service='Reconciliation'", busDestination.getSelector());
+
+ List<Listener> gateways = model.getGatewayListeners();
+ assertEquals(2, gateways.size());
+ JmsListener gatewayListener = (JmsListener)gateways.get(0);
+ assertEquals("Bank-JMS-Gateway", gatewayListener.getName());
+ assertEquals("server1-jms", gatewayListener.getBusidref());
+ assertTrue(gatewayListener.getIsGateway());
+ assertEquals(1, gatewayListener.getMaxThreads());
+
+ List<Listener> awareListeners = model.getESBAwareListeners();
+ assertEquals(4, awareListeners.size());
+ JmsListener awareListener = (JmsListener)awareListeners.get(0);
+ assertEquals("Bank-Listener", awareListener.getName());
+ assertEquals("local-jms", awareListener.getBusidref());
+ assertTrue(!awareListener.getIsGateway());
+ assertEquals(2, awareListener.getMaxThreads());
+ JmsMessageFilter listenerDestination = awareListener.getJmsMessageFilter();
+ assertEquals("queue/B", listenerDestination.getDestName());
+ assertEquals(JmsMessageFilter.DestType.TOPIC, listenerDestination.getDestType());
+ assertEquals("service='Reconciliation'", listenerDestination.getSelector());
+
+ Listener untypedAwareListener = awareListeners.get(1);
+ assertEquals("Bank-Listener-Generic", untypedAwareListener.getName());
+ assertEquals("my-generic-bus", untypedAwareListener.getBusidref());
+ assertTrue("Type is Dual Listener", untypedAwareListener instanceof DualListener);
+ final DualListener dualListener = (DualListener)untypedAwareListener;
+ assertTrue(!dualListener.getIsGateway());
+
+ Service gatewayService = model.getService(gatewayListener);
+ Service awareService = model.getService(awareListener);
+ assertSame(gatewayService, awareService);
+ assertEquals("Bank", awareService.getCategory());
+ assertEquals("Reconciliation", awareService.getName());
+ assertEquals("Bank Reconciliation Service", awareService.getDescription());
+ }
+}
Modified: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/GeneratorUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/GeneratorUnitTest.java 2012-05-24 17:39:48 UTC (rev 38101)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/GeneratorUnitTest.java 2012-05-24 18:55:01 UTC (rev 38102)
@@ -67,6 +67,16 @@
test_generate_badargs(new File("build.xml"), "'outdir' exists, but is not a directory", "jbossesb_config_01.120.xml");
}
+ public void test_generate_badargs_130() throws ConfigurationException, IOException {
+ test_generate_badargs(null, "null 'outdir' arg in method call", "jbossesb_config_01.130.xml");
+ test_generate_badargs(new File("build.xml"), "'outdir' exists, but is not a directory", "jbossesb_config_01.130.xml");
+ }
+
+ public void test_generate_badargs_131() throws ConfigurationException, IOException {
+ test_generate_badargs(null, "null 'outdir' arg in method call", "jbossesb_config_01.131.xml");
+ test_generate_badargs(new File("build.xml"), "'outdir' exists, but is not a directory", "jbossesb_config_01.131.xml");
+ }
+
public void test_generate_files() throws Exception {
System.setProperty("jboss.esb.invm.scope.default", "NONE");
execute_test_generate_files("jbossesb_config_01.xml");
@@ -84,7 +94,19 @@
execute_test_generate_files120("jbossesb_config_01.120.xml");
execute_test_generate_files120("jbossesb_config_02.120.xml");
}
+
+ public void test_generate_files130() throws Exception {
+ System.setProperty("jboss.esb.invm.scope.default", "NONE");
+ execute_test_generate_files130("jbossesb_config_01.130.xml");
+ execute_test_generate_files130("jbossesb_config_02.130.xml");
+ }
+ public void test_generate_files131() throws Exception {
+ System.setProperty("jboss.esb.invm.scope.default", "NONE");
+ execute_test_generate_files131("jbossesb_config_01.131.xml");
+ execute_test_generate_files131("jbossesb_config_02.131.xml");
+ }
+
private void execute_test_generate_files(String filename) throws Exception {
execute_test_generate_files(filename, "jbossesb_config_01_gateways.xml", "jbossesb_config_01_esbaware.xml");
}
@@ -97,6 +119,14 @@
execute_test_generate_files(filename, "jbossesb_config_120_gateways.xml", "jbossesb_config_120_esbaware.xml");
}
+ private void execute_test_generate_files130(String filename) throws Exception {
+ execute_test_generate_files(filename, "jbossesb_config_130_gateways.xml", "jbossesb_config_130_esbaware.xml");
+ }
+
+ private void execute_test_generate_files131(String filename) throws Exception {
+ execute_test_generate_files(filename, "jbossesb_config_131_gateways.xml", "jbossesb_config_131_esbaware.xml");
+ }
+
private void execute_test_generate_files(String filename, String esbGatewayConfig, String esbAwareConfig) throws Exception {
Generator generator = new Generator(getClass().getResourceAsStream(filename));
String expectedGatewayConfig = new String(StreamUtils.readStream(getClass().getResourceAsStream(esbGatewayConfig))).trim();
@@ -166,6 +196,32 @@
}
}
+ public void test_bad_base_listener_busref_130() throws ConfigurationException, IOException {
+ Generator generator = new Generator(getClass().getResourceAsStream("jbossesb_config_03.130.xml"));
+
+ try {
+ generator.generate(outdir);
+ fail("Expected ConfigurationException");
+ } catch(ConfigurationException e) {
+ if(!e.getMessage().equals("The base Listener config [JMS-ESBListener] must reference a base Bus config type (<bus>).")) {
+ fail("Wrong exception");
+ }
+ }
+ }
+
+ public void test_bad_base_listener_busref_131() throws ConfigurationException, IOException {
+ Generator generator = new Generator(getClass().getResourceAsStream("jbossesb_config_03.131.xml"));
+
+ try {
+ generator.generate(outdir);
+ fail("Expected ConfigurationException");
+ } catch(ConfigurationException e) {
+ if(!e.getMessage().equals("The base Listener config [JMS-ESBListener] must reference a base Bus config type (<bus>).")) {
+ fail("Wrong exception");
+ }
+ }
+ }
+
public static String removeEOL(String string) {
StringBuffer stringBuf = new StringBuffer(string.length());
Modified: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ServicePublisherUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ServicePublisherUnitTest.java 2012-05-24 17:39:48 UTC (rev 38101)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ServicePublisherUnitTest.java 2012-05-24 18:55:01 UTC (rev 38102)
@@ -29,6 +29,14 @@
executeTest("jbossesb_config_04.120.xml", "jbossesb_config_05.120.xml");
}
+ public void test_130() throws ConfigurationException, IOException {
+ executeTest("jbossesb_config_04.130.xml", "jbossesb_config_05.130.xml");
+ }
+
+ public void test_131() throws ConfigurationException, IOException {
+ executeTest("jbossesb_config_04.131.xml", "jbossesb_config_05.131.xml");
+ }
+
private void executeTest(final String resource1, final String resource2) throws ConfigurationException, IOException {
Generator generator;
ManagedLifecycleController controller1 = new ManagedLifecycleController(null);
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.131.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.131.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.131.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,113 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd">
+
+ <providers>
+ <jms-provider name="JBossMQ" connection-factory="ConnectionFactory" jndi-URL="jnp://localhost:1099">
+ <jms-bus busid="local-jms" />
+ </jms-provider>
+
+ <jms-provider name="JBossMessaging" connection-factory="com.xyz.provider.XYZConnectionFactory"
+ jndi-context-factory="com.xyz.provider.NamingContextFactory"
+ jndi-URL="xyz://server1:9876"
+ jndi-pkg-prefix="com.xyz">
+ <jms-bus busid="server1-jms">
+ <jms-message-filter dest-type="QUEUE" dest-name="queue/A" selector="service='Reconciliation'" />
+ </jms-bus>
+ </jms-provider>
+
+ <ftp-provider name="FTP" hostname="localhost:21">
+ <ftp-bus busid="Ftp-ServerTest">
+ <ftp-message-filter directory="/Temp" input-suffix=".txt" username="joe" password="secret" post-rename="true"/>
+ </ftp-bus>
+ </ftp-provider>
+
+ <sql-provider name="HSQLDB" url="jdbc:postgresql://myhost:5432/testDB" driver="org.postgresql.Driver" username="joe" password="secret">
+ <sql-bus busid="SQL-Test">
+ <sql-message-filter tablename="testtable" message-id-column="message_id" message-column="message" status-column="status" insert-timestamp-column="insert_timestamp"/>
+ </sql-bus>
+ </sql-provider>
+
+ <jbr-provider name="JBR" host="192.168.1.111" protocol="http">
+ <jbr-bus busid="HTTP-1" port="8765" />
+ <jbr-bus busid="HTTP-2" port="8766" />
+ </jbr-provider>
+
+ <bus-provider name="JBossAS">
+ <property name="my-generic-provider" value="my-generic-provider#someattribvalue" />
+
+ <bus busid="my-generic-bus">
+ <property name="my-generic-bus" value="my-generic-bus#someattribvalue" />
+ </bus>
+ </bus-provider>
+
+
+
+ </providers>
+ <services>
+ <service category="Bank" name="Reconciliation" description="Bank Reconciliation Service">
+
+ <listeners>
+ <jms-listener name="Bank-JMS-Gateway"
+ busidref="server1-jms"
+ maxThreads="1"
+ is-gateway="true"/>
+ <jbr-listener name="Bank-HTTP-Gateway"
+ busidref="HTTP-1"
+ maxThreads="1"
+ is-gateway="true"/>
+ <jms-listener name="Bank-Listener"
+ busidref="local-jms"
+ maxThreads="2">
+ <jms-message-filter dest-type="TOPIC" dest-name="queue/B" selector="service='Reconciliation'" />
+ </jms-listener>
+ <listener name="Bank-Listener-Generic"
+ busidref="my-generic-bus"
+ maxThreads="2">
+ <property name="my-generic-listener" value="my-generic-listener#someattribvalue" />
+ </listener>
+ </listeners>
+
+ <actions>
+ <action name="TestDefaultRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter">
+ <property name="propName" value="propValue" />
+ <property name="propName">
+ This is some complex..
+ <!-- property -->
+ value.
+ <xxxx>
+ boooo
+ <yyyy/>
+ </xxxx>
+ <![CDATA[ Some CDATA data...]]>
+ </property>
+ </action>
+ </actions>
+
+ </service>
+ <service category="Test2" name="FTPTest" description="FTP server Test">
+
+ <listeners>
+ <ftp-listener name="test-ftp-listener"
+ busidref="Ftp-ServerTest"
+ maxThreads="1"/>
+ </listeners>
+ <actions mep="OneWay">
+ <action name="TestFtpRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"/>
+ </actions>
+
+ </service>
+ <service category="Test3" name="SQLTest" description="SQL server Test">
+
+ <listeners>
+ <sql-listener name="test-sql-listener"
+ busidref="SQL-Test"
+ maxThreads="1"/>
+ </listeners>
+ <actions mep="RequestResponse">
+ <action name="TestSqlRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"/>
+ </actions>
+
+ </service>
+ </services>
+
+</jbossesb>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_02.131.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_02.131.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_02.131.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,164 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd">
+
+ <providers>
+ <bus-provider name="JBossMQ">
+ <property name="connection-factory" value="ConnectionFactory" />
+ <property name="jndi-URL" value="jnp://localhost:1099" />
+ <property name="protocol" value="jms" />
+
+ <bus busid="local-jms">
+ <property name="destination-type" value="topic" />
+ <property name="destination-name" value="queue/B" />
+ <property name="message-selector" value="service='Reconciliation'"/>
+ <property name="persistent" value="true" />
+ <property name="acknowledge-mode" value="AUTO_ACKNOWLEDGE" />
+ <property name="transacted" value="false" />
+ </bus>
+ </bus-provider>
+
+ <bus-provider name="JBossMessaging">
+ <property name="connection-factory" value="com.xyz.provider.XYZConnectionFactory" />
+ <property name="jndi-context-factory" value="com.xyz.provider.NamingContextFactory" />
+ <property name="jndi-URL" value="xyz://server1:9876" />
+ <property name="jndi-pkg-prefix" value="com.xyz" />
+ <property name="protocol" value="jms" />
+
+ <bus busid="server1-jms">
+ <property name="destination-type" value="queue" />
+ <property name="destination-name" value="queue/A" />
+ <property name="message-selector" value="service='Reconciliation'" />
+ <property name="persistent" value="true" />
+ <property name="acknowledge-mode" value="AUTO_ACKNOWLEDGE" />
+ <property name="transacted" value="false" />
+ </bus>
+ </bus-provider>
+
+ <bus-provider name="FTP">
+ <property name="URL" value="ftp://joe:secret@localhost:21/Temp" />
+
+ <bus busid="Ftp-ServerTest">
+ <property name="inputSuffix" value=".txt" />
+ <property name="errorDelete" value="true" />
+ <property name="postDelete" value="true" />
+ <property name="postRename" value="true" />
+ <property name="passive" value="false" />
+ <property name="workSuffix" value=".esbInProcess" />
+ </bus>
+ </bus-provider>
+
+ <bus-provider name="HSQLDB">
+ <property name="URL" value="jdbc:postgresql://myhost:5432/testDB" />
+ <property name="driver" value="org.postgresql.Driver" />
+ <property name="username" value="joe" />
+ <property name="password" value="secret" />
+
+ <bus busid="SQL-Test">
+ <property name="tablename" value="testtable" />
+
+ <property name="tablename" value="testtable" />
+ <property name="message_column" value="message" />
+ <property name="message_id_column" value="message_id" />
+ <property name="status_column" value="status" />
+ <property name="errorDelete" value="true" />
+ <property name="insert_timestamp_column" value="insert_timestamp" />
+ <property name="postDelete" value="true" />
+ </bus>
+ </bus-provider>
+
+ <bus-provider name="JBR">
+ <property name="jbr-serverBindAddress" value="192.168.1.111" />
+ <property name="jbr-serverProtocol" value="http" />
+
+ <bus busid="HTTP-1">
+ <property name="jbr-serverBindPort" value="8765" />
+ </bus>
+ <bus busid="HTTP-2">
+ <property name="jbr-serverBindPort" value="8766" />
+ </bus>
+ </bus-provider>
+
+ <bus-provider name="JBossAS">
+ <property name="my-generic-provider" value="my-generic-provider#someattribvalue" />
+
+ <bus busid="my-generic-bus">
+ <property name="my-generic-bus" value="my-generic-bus#someattribvalue" />
+ </bus>
+ </bus-provider>
+
+ </providers>
+ <services>
+ <service category="Bank" name="Reconciliation" description="Bank Reconciliation Service">
+
+ <listeners>
+ <listener name="Bank-JMS-Gateway"
+ busidref="server1-jms"
+ maxThreads="1"
+ is-gateway="true">
+ <property name="gatewayClass" value="org.jboss.soa.esb.listeners.gateway.JmsGatewayListener" />
+ </listener>
+ <listener name="Bank-HTTP-Gateway"
+ busidref="HTTP-1"
+ maxThreads="1"
+ is-gateway="true">
+ <property name="gatewayClass" value="org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener" />
+ </listener>
+ <listener name="Bank-Listener"
+ busidref="local-jms"
+ maxThreads="2">
+ </listener>
+ <listener name="Bank-Listener-Generic"
+ busidref="my-generic-bus"
+ maxThreads="2">
+ <property name="my-generic-listener" value="my-generic-listener#someattribvalue" />
+ </listener>
+ </listeners>
+
+ <actions>
+ <action name="TestDefaultRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter">
+ <property name="propName" value="propValue" />
+ <property name="propName">
+ This is some complex..
+ <!-- property -->
+ value.
+ <xxxx>
+ boooo
+ <yyyy/>
+ </xxxx>
+ <![CDATA[ Some CDATA data...]]>
+ </property>
+ </action>
+ </actions>
+
+ </service>
+ <service category="Test2" name="FTPTest" description="FTP server Test">
+
+ <listeners>
+ <listener name="test-ftp-listener"
+ busidref="Ftp-ServerTest"
+ maxThreads="1">
+ <property name="schedule-frequency" value="10" />
+ </listener>
+ </listeners>
+ <actions mep="OneWay">
+ <action name="TestFtpRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"/>
+ </actions>
+
+ </service>
+ <service category="Test3" name="SQLTest" description="SQL server Test">
+
+ <listeners>
+ <listener name="test-sql-listener"
+ busidref="SQL-Test"
+ maxThreads="1">
+ <property name="pollLatencySeconds" value="10" />
+ </listener>
+ </listeners>
+ <actions mep="RequestResponse">
+ <action name="TestSqlRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"/>
+ </actions>
+
+ </service>
+ </services>
+
+</jbossesb>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_03.131.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_03.131.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_03.131.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,43 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd" >
+
+ <!--
+ This is a bad configuration. The listener below is of the base listener type, yet it references a non-base type bus (jms-bus).
+ Should generate an error.
+ -->
+
+ <providers>
+ <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
+ jndi-context-factory="org.jnp.interfaces.NamingContextFactory "
+ jndi-URL="localhost" >
+
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/B"
+ />
+ </jms-bus>
+
+ </jms-provider>
+ </providers>
+
+ <services>
+
+ <service category="HelloWorld_ActionESB" name="SimpleListener" description="Hello World">
+ <listeners>
+ <listener name="JMS-ESBListener"
+ busidref="quickstartEsbChannel"
+ maxThreads="1"
+ />
+ </listeners>
+ <actions>
+ <action name="displayAction"
+ class="org.jboss.soa.esb.samples.quickstart.helloworldaction.MyJMSListenerAction"
+ process="displayMessage">
+ <property name="exceptionMethod" value="exceptionHandler"/>
+ </action>
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_04.131.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_04.131.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_04.131.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,47 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd">
+
+ <providers>
+
+ <jbr-provider name="JBR" host="192.168.1.111" protocol="http">
+ <jbr-bus busid="HTTP-1" port="8765" />
+ <jbr-bus busid="HTTP-2" port="8766" />
+ </jbr-provider>
+
+ </providers>
+ <services>
+
+ <service category="A" name="1" description="A1">
+ <listeners>
+ <jbr-listener name="A1-HTTP"
+ busidref="HTTP-1"
+ maxThreads="1"
+ is-gateway="true"/>
+ <jbr-listener name="A2-HTTP"
+ busidref="HTTP-2"
+ maxThreads="1" />
+ </listeners>
+
+ <actions>
+ <action name="a1" class="org.jboss.soa.esb.actions.converters.ByteArrayToString" />
+ </actions>
+ </service>
+ <service category="B" name="2" description="A1">
+ <listeners>
+ <jbr-listener name="A1-HTTP"
+ busidref="HTTP-1"
+ maxThreads="1"
+ is-gateway="true"/>
+ <jbr-listener name="A2-HTTP"
+ busidref="HTTP-2"
+ maxThreads="1" />
+ </listeners>
+
+ <actions>
+ <action name="a1" class="org.jboss.soa.esb.actions.converters.ByteArrayToString" />
+ </actions>
+ </service>
+
+ </services>
+
+</jbossesb>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_05.131.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_05.131.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_05.131.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,47 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd">
+
+ <providers>
+
+ <jbr-provider name="JBR" host="192.168.1.111" protocol="http">
+ <jbr-bus busid="HTTP-1" port="8765" />
+ <jbr-bus busid="HTTP-2" port="8766" />
+ </jbr-provider>
+
+ </providers>
+ <services>
+
+ <service category="C" name="3" description="A1">
+ <listeners>
+ <jbr-listener name="A1-HTTP"
+ busidref="HTTP-1"
+ maxThreads="1"
+ is-gateway="true"/>
+ <jbr-listener name="A2-HTTP"
+ busidref="HTTP-2"
+ maxThreads="1" />
+ </listeners>
+
+ <actions>
+ <action name="a1" class="org.jboss.soa.esb.actions.converters.ByteArrayToString" />
+ </actions>
+ </service>
+ <service category="D" name="4" description="A1">
+ <listeners>
+ <jbr-listener name="A1-HTTP"
+ busidref="HTTP-1"
+ maxThreads="1"
+ is-gateway="true"/>
+ <jbr-listener name="A2-HTTP"
+ busidref="HTTP-2"
+ maxThreads="1" />
+ </listeners>
+
+ <actions>
+ <action name="a1" class="org.jboss.soa.esb.listeners.config.MyPublishedAction" />
+ </actions>
+ </service>
+
+ </services>
+
+</jbossesb>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_131_esbaware.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_131_esbaware.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_131_esbaware.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ NOTE: DO NOT MODIFY
+ This file was auto-generated.
+-->
+<jbossesb-listeners parameterReloadSecs="180">
+<listener busIdRef="local-jms" listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener" maxThreads="2" name="Bank-Listener" service-category="Bank" service-description="Bank Reconciliation Service" service-name="Reconciliation" service-record-route="false">
+<EPR acknowledge-mode="AUTO_ACKNOWLEDGE" connection-factory="ConnectionFactory" destination-name="queue/B" destination-type="topic" jndi-URL="jnp://localhost:1099" message-selector="service='Reconciliation'" persistent="true" protocol="jms" transacted="false"/>
+<action action="TestDefaultRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter" propName="propValue">
+ This is some complex..
+ <!-- property -->
+ value.
+ <xxxx>
+ boooo
+ <yyyy/>
+ </xxxx>
+ Some CDATA data...
+ </action>
+</listener>
+<listener busIdRef="my-generic-bus" listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener" maxThreads="2" my-generic-listener="my-generic-listener#someattribvalue" name="Bank-Listener-Generic" service-category="Bank" service-description="Bank Reconciliation Service" service-name="Reconciliation" service-record-route="false">
+<EPR my-generic-bus="my-generic-bus#someattribvalue" my-generic-provider="my-generic-provider#someattribvalue"/>
+<action action="TestDefaultRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter" propName="propValue">
+ This is some complex..
+ <!-- property -->
+ value.
+ <xxxx>
+ boooo
+ <yyyy/>
+ </xxxx>
+ Some CDATA data...
+ </action>
+</listener>
+<listener busIdRef="Ftp-ServerTest" listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener" maxThreads="1" mep="OneWay" name="test-ftp-listener" schedule-frequency="10" service-category="Test2" service-description="FTP server Test" service-name="FTPTest" service-record-route="false">
+<EPR URL="ftp://joe:secret@localhost:21/Temp" errorDelete="true" inputSuffix=".txt" passive="false" postDelete="true" postRename="true" workSuffix=".esbInProcess"/>
+<action action="TestFtpRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"/>
+</listener>
+<listener busIdRef="SQL-Test" listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener" maxThreads="1" mep="RequestResponse" name="test-sql-listener" pollLatencySeconds="10" service-category="Test3" service-description="SQL server Test" service-name="SQLTest" service-record-route="false">
+<EPR URL="jdbc:postgresql://myhost:5432/testDB" driver="org.postgresql.Driver" errorDelete="true" insert_timestamp_column="insert_timestamp" message_column="message" message_id_column="message_id" password="secret" postDelete="true" status_column="status" tablename="testtable" username="joe"/>
+<action action="TestSqlRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"/>
+</listener>
+</jbossesb-listeners>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_131_gateways.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_131_gateways.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_131_gateways.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ NOTE: DO NOT MODIFY
+ This file was auto-generated.
+-->
+<jbossesb-gateways parameterReloadSecs="180">
+<listener acknowledge-mode="AUTO_ACKNOWLEDGE" busIdRef="server1-jms" connection-factory="com.xyz.provider.XYZConnectionFactory" destination-name="queue/A" destination-type="queue" gatewayClass="org.jboss.soa.esb.listeners.gateway.JmsGatewayListener" is-gateway="true" jndi-URL="xyz://server1:9876" jndi-context-factory="com.xyz.provider.NamingContextFactory" jndi-pkg-prefix="com.xyz" maxThreads="1" message-selector="service='Reconciliation'" name="Bank-JMS-Gateway" persistent="true" protocol="jms" service-description="Bank Reconciliation Service" service-record-route="false" target-service-category="Bank" target-service-name="Reconciliation" transacted="false"/>
+<listener busIdRef="HTTP-1" gatewayClass="org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener" is-gateway="true" jbr-serverBindAddress="192.168.1.111" jbr-serverBindPort="8765" jbr-serverProtocol="http" maxThreads="1" name="Bank-HTTP-Gateway" service-description="Bank Reconciliation Service" service-record-route="false" target-service-category="Bank" target-service-name="Reconciliation"/>
+</jbossesb-gateways>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/CamelGatewayMapperUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/CamelGatewayMapperUnitTest.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/CamelGatewayMapperUnitTest.java 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.listeners.config.mappers131;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.soa.esb.ConfigurationException;
+
+import junit.framework.TestCase;
+
+/**
+ * @author <a href="mailto:tom.fennelly at gmail.com">tom.fennelly at gmail.com</a>
+ */
+public class CamelGatewayMapperUnitTest extends TestCase {
+
+ public void test_addRouteXML() throws ConfigurationException {
+
+ List<String> routeXMLs = new ArrayList<String>();
+
+ CamelGatewayMapper.addRouteXML(URI.create("file://indir?delete=true"), URI.create("jbossesb://blah"), routeXMLs);
+ CamelGatewayMapper.addRouteXML(URI.create("esbschedule:5000:file://indir?delete=true"), URI.create("jbossesb://blah"), routeXMLs);
+
+ assertEquals("<route><from uri=\"file://indir?delete=true\"/><to uri=\"jbossesb://blah\"/></route>", routeXMLs.get(0));
+ assertTrue(routeXMLs.get(1).startsWith("<route><from uri=\"timer://"));
+ assertTrue(routeXMLs.get(1).endsWith("?fixedRate=true&delay=0&period=5000\"/><to uri=\"file://indir?delete=true\"/><to uri=\"jbossesb://blah\"/></route>"));
+ }
+}
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/FtpListenerMapperUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/FtpListenerMapperUnitTest.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/FtpListenerMapperUnitTest.java 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,128 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of individual
+ * contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY 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
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.listeners.config.mappers131;
+
+import junit.framework.TestCase;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.net.URI;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.apache.xmlbeans.XmlException;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.FtpListenerDocument;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.Listener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.FtpBusDocument;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.JbossesbDocument.Factory;
+import org.jboss.soa.esb.listeners.gateway.ReadOnlyRemoteGatewayListener;
+import org.junit.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Tests the class FtpListenerMapper
+ *
+ * @author Daniel Bevenius
+ *
+ */
+public class FtpListenerMapperUnitTest extends TestCase
+{
+ @SuppressWarnings("unused")
+ private Logger log = Logger.getLogger(FtpListenerMapperUnitTest.class);
+
+ private static final String ESB_CONFIG_READ_ONLY = "jbossesb_config_readonly.xml";
+ private static final String ESB_CONFIG_ESCAPING = "jbossesb_config_escaping.xml";
+
+ private static final String GATEWAY_CLASS_ATTRIBUTE = "gatewayClass";
+
+ @Test
+ public void testReadOnlyConfiguration() throws Exception
+ {
+ Element root = createRootElement();
+ XMLBeansModel model = getXmlBeanModel( ESB_CONFIG_READ_ONLY );
+
+ List<Listener> gateways = model.getGatewayListeners();
+ FtpListenerDocument.FtpListener ftpListener = (FtpListenerDocument.FtpListener) gateways.get(0);
+ assertEquals ( true, ftpListener.getIsGateway() );
+
+ FtpBusDocument.FtpBus ftpBus = (FtpBusDocument.FtpBus) model.getBus( ftpListener.getBusidref() );
+ assertNotNull( "FtpBus element should exist", ftpBus );
+ assertEquals ( "read-only attribute should be true", true, ftpBus.getFtpMessageFilter().getReadOnly() );
+
+ FtpListenerMapper.map( root , ftpListener, model );
+
+ Node ftpMapperListener = root.getFirstChild();
+ assertNotNull ("ftpMapperListener should not be null", ftpMapperListener );
+
+ NamedNodeMap attributes = ftpMapperListener.getAttributes();
+ Node gatewayClass = attributes.getNamedItem( GATEWAY_CLASS_ATTRIBUTE );
+ assertNotNull( "gatewayClass should have been set", gatewayClass );
+ assertEquals( ReadOnlyRemoteGatewayListener.class.getName(), gatewayClass.getNodeValue() );
+ }
+
+ @Test
+ public void testEscaping() throws Exception
+ {
+ final XMLBeansModel model = getXmlBeanModel( ESB_CONFIG_ESCAPING );
+ final GatewayGenerator gatewayGenerator = new GatewayGenerator(model);
+ final Document gatewayConfig = gatewayGenerator.generate();
+ final Element root = gatewayConfig.getDocumentElement() ;
+ final NodeList listenerList = root.getElementsByTagName("listener") ;
+ assertEquals("Listener count", 1, listenerList.getLength()) ;
+ final Node listener = listenerList.item(0) ;
+ final NamedNodeMap attributes = listener.getAttributes() ;
+ final Node urlNode = attributes.getNamedItem(ListenerTagNames.URL_TAG) ;
+ assertNotNull("URL node", urlNode) ;
+ final String urlValue = urlNode.getNodeValue() ;
+ assertNotNull("URL value", urlValue) ;
+ final URI uri = new URI(urlValue) ;
+ assertEquals("host", "localhost", uri.getHost()) ;
+ assertEquals("port", 21, uri.getPort()) ;
+ assertEquals("path", "/directory/####", uri.getPath()) ;
+ assertEquals("userInfo", "user%3A##user:password:##password", uri.getUserInfo()) ;
+ }
+
+ private XMLBeansModel getXmlBeanModel( String fileName ) throws ConfigurationException, IOException, XmlException
+ {
+ InputStream inputStream = getClass().getResourceAsStream( fileName );
+ final Reader reader = new InputStreamReader(inputStream);
+ XMLBeansModel model = new XMLBeansModel(Factory.parse(reader).getJbossesb());
+ return model;
+ }
+
+ private Element createRootElement() throws ConfigurationException
+ {
+ Document doc = YADOMUtil.createDocument();
+ Element root = YADOMUtil.addElement(doc, "jbossesb-gateways");
+ root.setAttribute("parameterReloadSecs", "1000" );
+ return root;
+ }
+}
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/JmsListenerMapperJCAActivationUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/JmsListenerMapperJCAActivationUnitTest.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/JmsListenerMapperJCAActivationUnitTest.java 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,358 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of individual
+ * contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY 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
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.listeners.config.mappers131;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.jms.Queue;
+import javax.jms.Topic;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.common.ModulePropertyManager;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.Listener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.JbossesbDocument.Factory;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.JmsListenerDocument.JmsListener;
+import org.jboss.soa.esb.listeners.jca.ActivationMapper;
+import org.jboss.soa.esb.listeners.jca.JBossActivationMapper;
+import org.jboss.soa.esb.listeners.jca.JcaConstants;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import com.arjuna.common.util.propertyservice.PropertyManager;
+
+/**
+ * Tests the JCA activation mapping of the JmsListenerMapper
+ *
+ * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+public class JmsListenerMapperJCAActivationUnitTest
+{
+ private static final String TEST_DESTINATION = "TestDestination" ;
+ private static final String TEST_PROVIDER_ADAPTER_JNDI = "TestProviderAdapterJNDI" ;
+ private static final String TEST_DESTINATION_TYPE = "TestDestinationType" ;
+ private static final String TEST_MESSAGE_SELECTOR = "TestMessageSelector" ;
+ private static final String TEST_MAX_THREADS = "TestMaxThreads" ;
+
+ private static final String TEST_QUEUE = "TestQueue" ;
+ private static final String TEST_TOPIC = "TestTopic" ;
+ private static final String DEFAULT_TEST_PROVIDER_ADAPTER_JNDI = "DefaultTestProviderAdapterJNDI" ;
+ private static final String DEFAULT_TEST_MESSAGE_SELECTOR = "DefaultTestMessageSelector" ;
+ private static final String DEFAULT_TEST_MAX_THREADS = "DefaultTestMaxThreads" ;
+
+ @BeforeClass
+ public static void setUp () throws Exception
+ {
+ final PropertyManager propertyManager = ModulePropertyManager.getPropertyManager(ModulePropertyManager.JCA_MODULE) ;
+ propertyManager.setProperty(Environment.JCA_ACTIVATION_MAPPER + ".jms-ra.rar", JBossActivationMapper.class.getName()) ;
+ propertyManager.setProperty(Environment.JCA_ACTIVATION_MAPPER + ".test-ra.rar", TestActivationMapper.class.getName()) ;
+ }
+
+ @Test
+ public void testDefaultAllValues()
+ throws Exception
+ {
+ final Map<String, String> activationConfig = generateConfig("jbossesb_jca_config_01.xml") ;
+
+ final Map<String, String> expected = new HashMap<String, String>() ;
+ expected.put("destination", "DestName") ;
+ expected.put("providerAdapterJNDI", "ProviderAdapterJNDI") ;
+ expected.put("destinationType", Queue.class.getName()) ;
+ expected.put("messageSelector", "selector") ;
+ expected.put("maxSession", "100") ;
+
+ verifyConfiguration(expected, activationConfig) ;
+ }
+
+ @Test
+ public void testDefaultMandatoryValues()
+ throws Exception
+ {
+ final Map<String, String> activationConfig = generateConfig("jbossesb_jca_config_02.xml") ;
+
+ final Map<String, String> expected = new HashMap<String, String>() ;
+ expected.put("destination", "DestName") ;
+ expected.put("destinationType", Topic.class.getName()) ;
+
+ verifyConfiguration(expected, activationConfig) ;
+ }
+
+ @Test
+ public void testAdapterAllValues()
+ throws Exception
+ {
+ final Map<String, String> activationConfig = generateConfig("jbossesb_jca_config_03.xml") ;
+
+ final Map<String, String> expected = new HashMap<String, String>() ;
+ expected.put(TEST_DESTINATION, "DestName") ;
+ expected.put(TEST_PROVIDER_ADAPTER_JNDI, "ProviderAdapterJNDI") ;
+ expected.put(TEST_DESTINATION_TYPE, TEST_QUEUE) ;
+ expected.put(TEST_MESSAGE_SELECTOR, "selector") ;
+ expected.put(TEST_MAX_THREADS, "100") ;
+
+ verifyConfiguration(expected, activationConfig) ;
+ }
+
+ @Test
+ public void testAdapterMandatoryValues()
+ throws Exception
+ {
+ final Map<String, String> activationConfig = generateConfig("jbossesb_jca_config_04.xml") ;
+
+ final Map<String, String> expected = new HashMap<String, String>() ;
+ expected.put(TEST_DESTINATION, "DestName") ;
+ expected.put(TEST_PROVIDER_ADAPTER_JNDI, DEFAULT_TEST_PROVIDER_ADAPTER_JNDI) ;
+ expected.put(TEST_DESTINATION_TYPE, TEST_TOPIC) ;
+ expected.put(TEST_MESSAGE_SELECTOR, DEFAULT_TEST_MESSAGE_SELECTOR) ;
+ expected.put(TEST_MAX_THREADS, DEFAULT_TEST_MAX_THREADS) ;
+
+ verifyConfiguration(expected, activationConfig) ;
+ }
+
+ @Test
+ public void testListenerPropertyAllValues()
+ throws Exception
+ {
+ final Map<String, String> activationConfig = generateConfig("jbossesb_jca_config_05.xml") ;
+
+ final Map<String, String> expected = new HashMap<String, String>() ;
+ expected.put(TEST_DESTINATION, "DestName") ;
+ expected.put(TEST_PROVIDER_ADAPTER_JNDI, "ProviderAdapterJNDI") ;
+ expected.put(TEST_DESTINATION_TYPE, TEST_QUEUE) ;
+ expected.put(TEST_MESSAGE_SELECTOR, "selector") ;
+ expected.put(TEST_MAX_THREADS, "100") ;
+
+ verifyConfiguration(expected, activationConfig) ;
+ }
+
+ @Test
+ public void testListenerPropertyMandatoryValues()
+ throws Exception
+ {
+ final Map<String, String> activationConfig = generateConfig("jbossesb_jca_config_06.xml") ;
+
+ final Map<String, String> expected = new HashMap<String, String>() ;
+ expected.put(TEST_DESTINATION, "DestName") ;
+ expected.put(TEST_PROVIDER_ADAPTER_JNDI, DEFAULT_TEST_PROVIDER_ADAPTER_JNDI) ;
+ expected.put(TEST_DESTINATION_TYPE, TEST_TOPIC) ;
+ expected.put(TEST_MESSAGE_SELECTOR, DEFAULT_TEST_MESSAGE_SELECTOR) ;
+ expected.put(TEST_MAX_THREADS, DEFAULT_TEST_MAX_THREADS) ;
+
+ verifyConfiguration(expected, activationConfig) ;
+ }
+
+ @Test
+ public void testBusPropertyAllValues()
+ throws Exception
+ {
+ final Map<String, String> activationConfig = generateConfig("jbossesb_jca_config_07.xml") ;
+
+ final Map<String, String> expected = new HashMap<String, String>() ;
+ expected.put(TEST_DESTINATION, "DestName") ;
+ expected.put(TEST_PROVIDER_ADAPTER_JNDI, "ProviderAdapterJNDI") ;
+ expected.put(TEST_DESTINATION_TYPE, TEST_QUEUE) ;
+ expected.put(TEST_MESSAGE_SELECTOR, "selector") ;
+ expected.put(TEST_MAX_THREADS, "100") ;
+
+ verifyConfiguration(expected, activationConfig) ;
+ }
+
+ @Test
+ public void testBusPropertyMandatoryValues()
+ throws Exception
+ {
+ final Map<String, String> activationConfig = generateConfig("jbossesb_jca_config_08.xml") ;
+
+ final Map<String, String> expected = new HashMap<String, String>() ;
+ expected.put(TEST_DESTINATION, "DestName") ;
+ expected.put(TEST_PROVIDER_ADAPTER_JNDI, DEFAULT_TEST_PROVIDER_ADAPTER_JNDI) ;
+ expected.put(TEST_DESTINATION_TYPE, TEST_TOPIC) ;
+ expected.put(TEST_MESSAGE_SELECTOR, DEFAULT_TEST_MESSAGE_SELECTOR) ;
+ expected.put(TEST_MAX_THREADS, DEFAULT_TEST_MAX_THREADS) ;
+
+ verifyConfiguration(expected, activationConfig) ;
+ }
+
+ @Test
+ public void testProviderPropertyAllValues()
+ throws Exception
+ {
+ final Map<String, String> activationConfig = generateConfig("jbossesb_jca_config_09.xml") ;
+
+ final Map<String, String> expected = new HashMap<String, String>() ;
+ expected.put(TEST_DESTINATION, "DestName") ;
+ expected.put(TEST_PROVIDER_ADAPTER_JNDI, "ProviderAdapterJNDI") ;
+ expected.put(TEST_DESTINATION_TYPE, TEST_QUEUE) ;
+ expected.put(TEST_MESSAGE_SELECTOR, "selector") ;
+ expected.put(TEST_MAX_THREADS, "100") ;
+
+ verifyConfiguration(expected, activationConfig) ;
+ }
+
+ @Test
+ public void testProviderPropertyMandatoryValues()
+ throws Exception
+ {
+ final Map<String, String> activationConfig = generateConfig("jbossesb_jca_config_10.xml") ;
+
+ final Map<String, String> expected = new HashMap<String, String>() ;
+ expected.put(TEST_DESTINATION, "DestName") ;
+ expected.put(TEST_PROVIDER_ADAPTER_JNDI, DEFAULT_TEST_PROVIDER_ADAPTER_JNDI) ;
+ expected.put(TEST_DESTINATION_TYPE, TEST_TOPIC) ;
+ expected.put(TEST_MESSAGE_SELECTOR, DEFAULT_TEST_MESSAGE_SELECTOR) ;
+ expected.put(TEST_MAX_THREADS, DEFAULT_TEST_MAX_THREADS) ;
+
+ verifyConfiguration(expected, activationConfig) ;
+ }
+
+ private Map<String, String> generateConfig(final String config)
+ throws Exception
+ {
+ final InputStream is = getClass().getResourceAsStream(config) ;
+ assertNotNull("Configuration " + config, is) ;
+ final XMLBeansModel model = new XMLBeansModel(Factory.parse(is).getJbossesb());
+
+ final List<Listener> awareListeners = model.getESBAwareListeners() ;
+ assertEquals("Listener count", 1, awareListeners.size()) ;
+
+ final Listener listener = awareListeners.get(0) ;
+ assertTrue("JmsListener", listener instanceof JmsListener) ;
+
+ final Document doc = YADOMUtil.createDocument() ;
+ final Element root = doc.createElement("root") ;
+ final Element listenerElement = JmsListenerMapper.map(root, (JmsListener)listener, model) ;
+ assertNotNull("Listener Element", listenerElement) ;
+
+ final NodeList activationNodes = listenerElement.getElementsByTagName(JcaConstants.ELEMENT_ACTIVATION_CONFIG) ;
+ final int numActivationNodes = (activationNodes == null ? 0 : activationNodes.getLength()) ;
+ assertEquals("Activation node count", 1, numActivationNodes) ;
+
+ final Element activationConfig = (Element)activationNodes.item(0) ;
+ final NodeList propertyNodes = activationConfig.getElementsByTagName(JcaConstants.ELEMENT_PROPERTY) ;
+
+ final Map<String, String> properties = new HashMap<String, String>() ;
+ final int numProperties = (propertyNodes == null ? 0 : propertyNodes.getLength()) ;
+ for(int count = 0 ; count < numProperties ; count++)
+ {
+ final Node node = propertyNodes.item(count) ;
+ if (node instanceof Element)
+ {
+ final Element element = (Element)node ;
+ final String name = element.getAttribute("name") ;
+ final String value = element.getAttribute("value") ;
+ properties.put(name, value) ;
+ }
+ }
+ return properties ;
+ }
+
+ private static void verifyConfiguration(final Map<String, String> expected, final Map<String, String> activationConfig)
+ {
+ assertEquals("Number of activation properties", expected.size(), activationConfig.size()) ;
+
+ for(Map.Entry<String, String> entry: expected.entrySet())
+ {
+ final String name = entry.getKey() ;
+ assertEquals("Value of " + name, expected.get(name), activationConfig.get(name)) ;
+ }
+ }
+
+ public static class TestActivationMapper implements ActivationMapper
+ {
+ public void setDestination(final Map<String, String> activationConfig, final String name)
+ throws ConfigurationException
+ {
+ activationConfig.put(TEST_DESTINATION, name) ;
+ }
+
+ public void setProviderAdapterJNDI(final Map<String, String> activationConfig, final String providerAdapterJNDI)
+ throws ConfigurationException
+ {
+ if (providerAdapterJNDI != null)
+ {
+ activationConfig.put(TEST_PROVIDER_ADAPTER_JNDI, providerAdapterJNDI) ;
+ }
+ else
+ {
+ activationConfig.put(TEST_PROVIDER_ADAPTER_JNDI, DEFAULT_TEST_PROVIDER_ADAPTER_JNDI) ;
+ }
+ }
+
+ public void setDestinationType(final Map<String, String> activationConfig, final boolean queue)
+ throws ConfigurationException
+ {
+ if (queue)
+ {
+ activationConfig.put(TEST_DESTINATION_TYPE, TEST_QUEUE) ;
+ }
+ else
+ {
+ activationConfig.put(TEST_DESTINATION_TYPE, TEST_TOPIC) ;
+ }
+ }
+
+ public void setMessageSelector(final Map<String, String> activationConfig, final String messageSelector)
+ throws ConfigurationException
+ {
+ if (messageSelector != null)
+ {
+ activationConfig.put(TEST_MESSAGE_SELECTOR, messageSelector) ;
+ }
+ else
+ {
+ activationConfig.put(TEST_MESSAGE_SELECTOR, DEFAULT_TEST_MESSAGE_SELECTOR) ;
+ }
+ }
+
+ public void setMaxThreads(final Map<String, String> activationConfig, final Integer maxThreads)
+ throws ConfigurationException
+ {
+ if (maxThreads != null)
+ {
+ activationConfig.put(TEST_MAX_THREADS, maxThreads.toString()) ;
+ }
+ else
+ {
+ activationConfig.put(TEST_MAX_THREADS, DEFAULT_TEST_MAX_THREADS) ;
+ }
+ }
+ }
+
+ public static junit.framework.Test suite ()
+ {
+ return new JUnit4TestAdapter(JmsListenerMapperJCAActivationUnitTest.class);
+ }
+}
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/JmsListenerMapperUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/JmsListenerMapperUnitTest.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/JmsListenerMapperUnitTest.java 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,166 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of individual
+ * contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY 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
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.listeners.config.mappers131;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.List;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.xmlbeans.XmlException;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.JmsBusDocument;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.JmsListenerDocument;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.Listener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.Provider;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.ActivationConfigDocument.ActivationConfig;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.JbossesbDocument.Factory;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.JmsJcaProviderDocument.JmsJcaProvider;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.JmsListenerDocument.JmsListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.PropertyDocument.Property;
+import org.junit.Before;
+import org.junit.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * Unit test for JmsListenerMapper
+ *
+ * @author Daniel Bevenius
+ *
+ */
+public class JmsListenerMapperUnitTest
+{
+ private static final String ESB_CONFIG = "jbossesb_config_jms_jca.xml";
+
+ private Element root;
+ private XMLBeansModel model;
+ private JmsListenerDocument.JmsListener jmsListener;
+ private JmsJcaProvider jmsJcaProvider;
+
+ @Test ( expected = ConfigurationException.class )
+ public void tryToOverrideDestinationActivationConfigProperty() throws ConfigurationException, IOException
+ {
+ callJmsListenerMap( "destination", "/queue/dummyQueue" );
+ }
+
+ @Test ( expected = ConfigurationException.class )
+ public void tryToOverride_DestinationType_ActivationConfigProperty() throws ConfigurationException, IOException
+ {
+ callJmsListenerMap( "destinationType", "Topic" );
+ }
+
+ @Test ( expected = ConfigurationException.class )
+ public void tryToOverrideMessageSelectorActivationConfigProperty() throws ConfigurationException, IOException
+ {
+ callJmsListenerMap( "messageSelector", "dummyselector" );
+ }
+
+ @Test ( expected = ConfigurationException.class )
+ public void tryToOverrideMaxMessagesActivationConfigProperty() throws ConfigurationException, IOException
+ {
+ callJmsListenerMap( "maxMessages", "300" );
+ }
+
+ // setup methods
+
+ @Before
+ public void setup() throws ConfigurationException, IOException, XmlException
+ {
+ root = createRootElement();
+ model = getXmlBeanModel( ESB_CONFIG );
+ jmsListener = getListener( model );
+ jmsJcaProvider = getJmsJcaProvider( model );
+ }
+
+ // helper methods
+
+ private void callJmsListenerMap(
+ String activationConfigPropertyName,
+ String activationConfigPropertyValue
+ ) throws ConfigurationException
+ {
+ ActivationConfig activationConfig = jmsJcaProvider.getActivationConfig();
+ createActivationProperty( activationConfig, activationConfigPropertyName, activationConfigPropertyValue );
+
+ JmsListenerMapper.map( root , jmsListener, model );
+ }
+
+ private Property createActivationProperty(
+ final ActivationConfig activationConfig,
+ final String name,
+ final String value )
+ {
+ Property property = activationConfig.addNewProperty();
+ property.setName( name );
+ property.setValue( value );
+ return property;
+ }
+
+ private JmsListener getListener( final XMLBeansModel model ) throws ConfigurationException
+ {
+ List<Listener> listeners = model.getESBAwareListeners();
+ return (JmsListener) listeners.get(0);
+ }
+
+ private JmsJcaProvider getJmsJcaProvider( final XMLBeansModel model ) throws ConfigurationException, IOException
+ {
+ List<Listener> listeners = model.getESBAwareListeners();
+ JmsListenerDocument.JmsListener jmsListener = (JmsListener) listeners.get(0);
+ assertEquals ( false, jmsListener.getIsGateway() );
+
+ JmsBusDocument.JmsBus jmsBus = (JmsBusDocument.JmsBus) model.getBus( jmsListener.getBusidref() );
+ assertNotNull( "JmsBus element should exist", jmsBus );
+ Provider provider = model.getProvider( jmsBus );
+ assertTrue( provider instanceof JmsJcaProvider );
+ return (JmsJcaProvider) provider;
+ }
+
+ private XMLBeansModel getXmlBeanModel( String fileName ) throws ConfigurationException, IOException, XmlException
+ {
+ InputStream inputStream = getClass().getResourceAsStream( ESB_CONFIG );
+ final Reader reader = new InputStreamReader(inputStream);
+ XMLBeansModel model = new XMLBeansModel(Factory.parse(reader).getJbossesb());
+ return model;
+ }
+
+ private Element createRootElement() throws ConfigurationException
+ {
+ Document doc = YADOMUtil.createDocument();
+ Element root = YADOMUtil.addElement(doc, "jbossesb-gateways");
+ root.setAttribute("parameterReloadSecs", "1000" );
+ return root;
+ }
+
+ public static junit.framework.Test suite()
+ {
+ return new JUnit4TestAdapter( JmsListenerMapperUnitTest.class );
+ }
+}
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/SecurityMapperUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/SecurityMapperUnitTest.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/SecurityMapperUnitTest.java 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,121 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of individual
+ * contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY 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
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.listeners.config.mappers131;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.xmlbeans.XmlException;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.JbossesbDocument.Factory;
+import org.jboss.soa.esb.listeners.config.xbeanmodel131.ServiceDocument.Service;
+import org.junit.Before;
+import org.junit.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Unit test for {@link SecurityMapper}
+ * <p/>
+ *
+ * @author Daniel Bevenius
+ *
+ */
+public class SecurityMapperUnitTest
+{
+ private static final String ESB_CONFIG = "jbossesb_config_security.xml";
+
+ private Element root;
+ private XMLBeansModel model;
+
+ private Service service;
+
+ private Node securityNode;
+
+ @Test
+ public void mapRunAs() throws ConfigurationException
+ {
+ Node runAsNode = securityNode.getAttributes().getNamedItem( ListenerTagNames.RUN_AS_TAG );
+ assertNotNull( runAsNode.getNodeName() );
+ assertEquals( "MrPoon", runAsNode.getNodeValue() );
+ }
+
+ @Test
+ public void mapModuleName() throws ConfigurationException
+ {
+ Node moduleNameNode = securityNode.getAttributes().getNamedItem( ListenerTagNames.MODULE_NAME_TAG );
+ assertNotNull( moduleNameNode.getNodeName() );
+ assertEquals( "mod1", moduleNameNode.getNodeValue());
+ }
+
+ @Test
+ public void mapUseCallersIdentity() throws ConfigurationException
+ {
+ Node userIdentityNode = securityNode.getAttributes().getNamedItem( ListenerTagNames.USE_CALLERS_IDENTIDY_TAG );
+ assertNotNull( userIdentityNode.getNodeName() );
+ assertEquals( "user1", userIdentityNode.getNodeValue());
+ }
+
+ // setup methods
+
+ @Before
+ public void setup() throws ConfigurationException, IOException, XmlException
+ {
+ root = createRootElement();
+ model = getXmlBeanModel( ESB_CONFIG );
+ service = model.getServices().get( 0 );
+
+ SecurityMapper.map( root, service );
+ securityNode = root.getFirstChild();
+ }
+
+ private XMLBeansModel getXmlBeanModel( String fileName ) throws ConfigurationException, IOException, XmlException
+ {
+ InputStream inputStream = getClass().getResourceAsStream( ESB_CONFIG );
+ final Reader reader = new InputStreamReader(inputStream);
+ XMLBeansModel model = new XMLBeansModel(Factory.parse(reader).getJbossesb());
+ return model;
+ }
+
+ private Element createRootElement() throws ConfigurationException
+ {
+ Document doc = YADOMUtil.createDocument();
+ Element root = YADOMUtil.addElement(doc, "jbossesb-gateways");
+ root.setAttribute("parameterReloadSecs", "1000" );
+ return root;
+ }
+
+ public static junit.framework.Test suite()
+ {
+ return new JUnit4TestAdapter( SecurityMapperUnitTest.class );
+ }
+}
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_config_escaping.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_config_escaping.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_config_escaping.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,18 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd">
+ <providers>
+ <ftp-provider name="FTP" hostname="localhost:21">
+ <ftp-bus busid="FTPbus">
+ <ftp-message-filter directory="/directory/####" username="user:##user" password="password:##password"/>
+ </ftp-bus>
+ </ftp-provider>
+ </providers>
+
+ <services>
+ <service category="Test" name="FTPTest" description="FTP escaping Test">
+ <listeners>
+ <ftp-listener name="FtpMapperListener" busidref="FTPbus" is-gateway="true"/>
+ </listeners>
+ </service>
+ </services>
+</jbossesb>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_config_jms_jca.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_config_jms_jca.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_config_jms_jca.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,38 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd">
+
+ <providers>
+
+ <jms-jca-provider
+ name="JBossMessaging"
+ connection-factory="XAConnectionFactory"
+ jndi-URL="jnp://127.0.0.1:1099"
+ transacted="true"
+ jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+ jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
+
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_jms_transacted_Request_esb"
+ selector="CorrelationID = '13'"
+ transacted="true" />
+ </jms-bus>
+ <activation-config>
+ <property name="dLQMaxResent" value="12"/>
+ <property name="dLQJNDIName" value="/queue/quickstart_jms_transacted_error"/>
+ <property name="reconnectInterval" value="1000"/>
+ </activation-config>
+ </jms-jca-provider>
+
+ </providers>
+ <services>
+ <service category="Test2" name="JMSJCATest" description="JMS JCA Test">
+
+ <listeners>
+ <jms-listener name="JMSListener" busidref="quickstartEsbChannel" maxThreads="1"/>
+ </listeners>
+ </service>
+ </services>
+
+</jbossesb>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_config_readonly.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_config_readonly.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_config_readonly.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,32 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd">
+
+ <providers>
+
+ <ftp-provider name="FTP" hostname="localhost:21">
+ <ftp-bus busid="FtpMapperTest">
+ <ftp-message-filter directory="/Temp" read-only="true" input-suffix=".txt" username="joe" password="secret"/>
+ </ftp-bus>
+ </ftp-provider>
+
+ <jbr-provider name="JBR" host="192.168.1.111" protocol="http">
+ <jbr-bus busid="HTTP-2" port="8766" />
+ </jbr-provider>
+
+ </providers>
+ <services>
+ <service category="Test2" name="FTPTest" description="FTP server Test">
+
+ <listeners>
+ <ftp-listener name="FtpMapperListener"
+ busidref="FtpMapperTest"
+ is-gateway="true"
+ maxThreads="1"/>
+ <jbr-listener name="A2-HTTP"
+ busidref="HTTP-2"
+ maxThreads="1" />
+ </listeners>
+ </service>
+ </services>
+
+</jbossesb>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_config_security.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_config_security.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_config_security.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,34 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd">
+
+ <providers>
+
+ <jms-provider
+ name="JBossMessaging"
+ connection-factory="XAConnectionFactory"
+ jndi-URL="jnp://127.0.0.1:1099"
+ jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+ jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
+
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_jms_transacted_Request_esb"
+ selector="CorrelationID = '13'"/>
+ </jms-bus>
+ </jms-provider>
+
+ </providers>
+ <services>
+ <service category="Test2" name="JMSJCATest" description="JMS JCA Test">
+ <security runAs="MrPoon" moduleName="mod1" useCallersIdentity="user1"/>
+ <listeners>
+ <jms-listener name="JMSListener" busidref="quickstartEsbChannel" maxThreads="1"/>
+ </listeners>
+ <actions>
+ <action name="TestDefaultRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"/>
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_01.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_01.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_01.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,24 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd" parameterReloadSecs="5">
+ <providers>
+ <jms-jca-provider name="provider" connection-factory="ConnectionFactory" adapter="jms-ra.rar"
+ providerAdapterJNDI="ProviderAdapterJNDI"> <!-- providerAdapterJNDI -->
+ <jms-bus busid="bus">
+ <!-- destinationType, destination and selector -->
+ <jms-message-filter dest-type="QUEUE" dest-name="DestName" selector="selector"/>
+ </jms-bus>
+ </jms-jca-provider>
+ </providers>
+
+ <services>
+ <service category="category" name="name" description="description">
+ <listeners>
+ <!-- maxThreads -->
+ <jms-listener name="listener" busidref="bus" maxThreads="100"/>
+ <actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ </actions>
+ </listeners>
+ </service>
+ </services>
+</jbossesb>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_02.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_02.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_02.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,22 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd" parameterReloadSecs="5">
+ <providers>
+ <jms-jca-provider name="provider" connection-factory="ConnectionFactory">
+ <jms-bus busid="bus">
+ <!-- destinationType and destination-->
+ <jms-message-filter dest-type="TOPIC" dest-name="DestName"/>
+ </jms-bus>
+ </jms-jca-provider>
+ </providers>
+
+ <services>
+ <service category="category" name="name" description="description">
+ <listeners>
+ <jms-listener name="listener" busidref="bus"/>
+ <actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ </actions>
+ </listeners>
+ </service>
+ </services>
+</jbossesb>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_03.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_03.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_03.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,24 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd" parameterReloadSecs="5">
+ <providers>
+ <jms-jca-provider name="provider" connection-factory="ConnectionFactory" adapter="test-ra.rar"
+ providerAdapterJNDI="ProviderAdapterJNDI"> <!-- providerAdapterJNDI -->
+ <jms-bus busid="bus">
+ <!-- destinationType, destination and selector -->
+ <jms-message-filter dest-type="QUEUE" dest-name="DestName" selector="selector"/>
+ </jms-bus>
+ </jms-jca-provider>
+ </providers>
+
+ <services>
+ <service category="category" name="name" description="description">
+ <listeners>
+ <!-- maxThreads -->
+ <jms-listener name="listener" busidref="bus" maxThreads="100"/>
+ <actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ </actions>
+ </listeners>
+ </service>
+ </services>
+</jbossesb>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_04.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_04.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_04.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,22 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd" parameterReloadSecs="5">
+ <providers>
+ <jms-jca-provider name="provider" connection-factory="ConnectionFactory" adapter="test-ra.rar">
+ <jms-bus busid="bus">
+ <!-- destinationType and destination-->
+ <jms-message-filter dest-type="TOPIC" dest-name="DestName"/>
+ </jms-bus>
+ </jms-jca-provider>
+ </providers>
+
+ <services>
+ <service category="category" name="name" description="description">
+ <listeners>
+ <jms-listener name="listener" busidref="bus"/>
+ <actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ </actions>
+ </listeners>
+ </service>
+ </services>
+</jbossesb>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_05.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_05.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_05.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,26 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd" parameterReloadSecs="5">
+ <providers>
+ <jms-jca-provider name="provider" connection-factory="ConnectionFactory"
+ providerAdapterJNDI="ProviderAdapterJNDI"> <!-- providerAdapterJNDI -->
+ <jms-bus busid="bus">
+ <!-- destinationType, destination and selector -->
+ <jms-message-filter dest-type="QUEUE" dest-name="DestName" selector="selector"/>
+ </jms-bus>
+ </jms-jca-provider>
+ </providers>
+
+ <services>
+ <service category="category" name="name" description="description">
+ <listeners>
+ <!-- maxThreads -->
+ <jms-listener name="listener" busidref="bus" maxThreads="100">
+ <property name="jcaActivationMapper" value="org.jboss.soa.esb.listeners.config.mappers.JmsListenerMapperJCAActivationUnitTest$TestActivationMapper"/>
+ </jms-listener>
+ <actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ </actions>
+ </listeners>
+ </service>
+ </services>
+</jbossesb>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_06.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_06.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_06.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,24 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd" parameterReloadSecs="5">
+ <providers>
+ <jms-jca-provider name="provider" connection-factory="ConnectionFactory">
+ <jms-bus busid="bus">
+ <!-- destinationType and destination-->
+ <jms-message-filter dest-type="TOPIC" dest-name="DestName"/>
+ </jms-bus>
+ </jms-jca-provider>
+ </providers>
+
+ <services>
+ <service category="category" name="name" description="description">
+ <listeners>
+ <jms-listener name="listener" busidref="bus">
+ <property name="jcaActivationMapper" value="org.jboss.soa.esb.listeners.config.mappers.JmsListenerMapperJCAActivationUnitTest$TestActivationMapper"/>
+ </jms-listener>
+ <actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ </actions>
+ </listeners>
+ </service>
+ </services>
+</jbossesb>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_07.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_07.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_07.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,25 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd" parameterReloadSecs="5">
+ <providers>
+ <jms-jca-provider name="provider" connection-factory="ConnectionFactory"
+ providerAdapterJNDI="ProviderAdapterJNDI"> <!-- providerAdapterJNDI -->
+ <jms-bus busid="bus">
+ <property name="jcaActivationMapper" value="org.jboss.soa.esb.listeners.config.mappers.JmsListenerMapperJCAActivationUnitTest$TestActivationMapper"/>
+ <!-- destinationType, destination and selector -->
+ <jms-message-filter dest-type="QUEUE" dest-name="DestName" selector="selector"/>
+ </jms-bus>
+ </jms-jca-provider>
+ </providers>
+
+ <services>
+ <service category="category" name="name" description="description">
+ <listeners>
+ <!-- maxThreads -->
+ <jms-listener name="listener" busidref="bus" maxThreads="100"/>
+ <actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ </actions>
+ </listeners>
+ </service>
+ </services>
+</jbossesb>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_08.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_08.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_08.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,23 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd" parameterReloadSecs="5">
+ <providers>
+ <jms-jca-provider name="provider" connection-factory="ConnectionFactory">
+ <jms-bus busid="bus">
+ <property name="jcaActivationMapper" value="org.jboss.soa.esb.listeners.config.mappers.JmsListenerMapperJCAActivationUnitTest$TestActivationMapper"/>
+ <!-- destinationType and destination-->
+ <jms-message-filter dest-type="TOPIC" dest-name="DestName"/>
+ </jms-bus>
+ </jms-jca-provider>
+ </providers>
+
+ <services>
+ <service category="category" name="name" description="description">
+ <listeners>
+ <jms-listener name="listener" busidref="bus"/>
+ <actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ </actions>
+ </listeners>
+ </service>
+ </services>
+</jbossesb>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_09.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_09.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_09.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,25 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd" parameterReloadSecs="5">
+ <providers>
+ <jms-jca-provider name="provider" connection-factory="ConnectionFactory"
+ providerAdapterJNDI="ProviderAdapterJNDI"> <!-- providerAdapterJNDI -->
+ <property name="jcaActivationMapper" value="org.jboss.soa.esb.listeners.config.mappers.JmsListenerMapperJCAActivationUnitTest$TestActivationMapper"/>
+ <jms-bus busid="bus">
+ <!-- destinationType, destination and selector -->
+ <jms-message-filter dest-type="QUEUE" dest-name="DestName" selector="selector"/>
+ </jms-bus>
+ </jms-jca-provider>
+ </providers>
+
+ <services>
+ <service category="category" name="name" description="description">
+ <listeners>
+ <!-- maxThreads -->
+ <jms-listener name="listener" busidref="bus" maxThreads="100"/>
+ <actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ </actions>
+ </listeners>
+ </service>
+ </services>
+</jbossesb>
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_10.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_10.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers131/jbossesb_jca_config_10.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -0,0 +1,23 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.1.xsd" parameterReloadSecs="5">
+ <providers>
+ <jms-jca-provider name="provider" connection-factory="ConnectionFactory">
+ <property name="jcaActivationMapper" value="org.jboss.soa.esb.listeners.config.mappers.JmsListenerMapperJCAActivationUnitTest$TestActivationMapper"/>
+ <jms-bus busid="bus">
+ <!-- destinationType and destination-->
+ <jms-message-filter dest-type="TOPIC" dest-name="DestName"/>
+ </jms-bus>
+ </jms-jca-provider>
+ </providers>
+
+ <services>
+ <service category="category" name="name" description="description">
+ <listeners>
+ <jms-listener name="listener" busidref="bus"/>
+ <actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ </actions>
+ </listeners>
+ </service>
+ </services>
+</jbossesb>
Modified: labs/jbossesb/branches/JBESB_4_11_CP/product/services/base-project-build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/services/base-project-build.xml 2012-05-24 17:39:48 UTC (rev 38101)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/services/base-project-build.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -57,7 +57,7 @@
</fileset>
<fileset dir="lib/ext/build-time" includes="*.jar" />
<fileset dir="${esb.product.lib.ext}/endorsed" includes="jboss-saaj.jar" />
- <fileset dir="${esb.product.lib.dir}" includes="jbossesb-rosetta.jar jbossesb-config-model*.jar test-util.jar" />
+ <fileset dir="${esb.product.lib.dir}" includes="jbossesb-rosetta.jar jbossesb-config-model.jar test-util.jar" />
<fileset dir="${esb.product.lib.ext}" includes="jaxb-impl.jar jbossts-common.jar jboss-messaging-client.jar wstx-asl-3.2.8.jar" />
<fileset dir="${esb.main.lib}" includes="activation*.jar" />
<fileset dir="${esb.main.lib}" includes="antlr*.jar" />
Modified: labs/jbossesb/branches/JBESB_4_11_CP/product/services/soap/build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/services/soap/build.xml 2012-05-24 17:39:48 UTC (rev 38101)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/services/soap/build.xml 2012-05-24 18:55:01 UTC (rev 38102)
@@ -49,7 +49,7 @@
<fileset dir="lib/ext" includes="*.jar" />
<fileset dir="lib/ext/build-time" includes="*.jar" />
<fileset dir="${esb.product.lib.ext}/endorsed" includes="jboss-saaj.jar" />
- <fileset dir="${esb.product.lib.dir}" includes="jbossesb-rosetta.jar jbossesb-config-model*.jar test-util.jar" />
+ <fileset dir="${esb.product.lib.dir}" includes="jbossesb-rosetta.jar jbossesb-config-model.jar test-util.jar" />
<fileset dir="${esb.product.lib.ext}" includes="jaxb-impl.jar jbossts-common.jar jboss-messaging-client.jar wstx-asl-3.2.8.jar" />
<fileset dir="../../lib/ext" includes="*.jar"/>
<fileset dir="../../build/lib">
More information about the jboss-svn-commits
mailing list