Author: tli
Date: Sun Sep 3 22:42:55 2006
New Revision: 439938
URL: http://svn.apache.org/viewvc?view=rev&rev=439938
Log:
Added the JMS configuration metadate and wsdl4j extension
Added:
incubator/cxf/trunk/api/src/test/resources/wsdl/jms_test.wsdl (with props)
Modified:
incubator/cxf/trunk/api/src/main/resources/META-INF/config-metadata-mappings.xml
incubator/cxf/trunk/api/src/main/resources/config-metadata/jms-client-config.xml
incubator/cxf/trunk/api/src/main/resources/config-metadata/jms-server-config.xml
incubator/cxf/trunk/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java
incubator/cxf/trunk/rt/core/src/main/resources/META-INF/extensions.xml
Modified:
incubator/cxf/trunk/api/src/main/resources/META-INF/config-metadata-mappings.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/resources/META-INF/config-metadata-mappings.xml?view=diff&rev=439938&r1=439937&r2=439938
==============================================================================
---
incubator/cxf/trunk/api/src/main/resources/META-INF/config-metadata-mappings.xml
(original)
+++
incubator/cxf/trunk/api/src/main/resources/META-INF/config-metadata-mappings.xml
Sun Sep 3 22:42:55 2006
@@ -20,8 +20,10 @@
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>mapping of configuration namespace - configuration metadata resource
name</comment>
-<entry
key="http://cxf.apache.org/configuration/bus">config-metadata/bus-config.xml</entry>
-<entry
key="http://cxf.apache.org/configuration/transport/http-client">config-metadata/http-client-config.xml</entry>
-<entry
key="http://cxf.apache.org/configuration/transport/http-listener">config-metadata/http-listener-config.xml</entry>
-<entry
key="http://cxf.apache.org/configuration/transport/http-server">config-metadata/http-server-config.xml</entry>
+ <entry
key="http://cxf.apache.org/configuration/bus">config-metadata/bus-config.xml</entry>
+ <entry
key="http://cxf.apache.org/configuration/transport/http-client">config-metadata/http-client-config.xml</entry>
+ <entry
key="http://cxf.apache.org/configuration/transport/http-listener">config-metadata/http-listener-config.xml</entry>
+ <entry
key="http://cxf.apache.org/configuration/transport/http-server">config-metadata/http-server-config.xml</entry>
+ <entry
key="http://cxf.apache.org/configuration/transport/jms-client">config-metadata/jms-client-config.xml</entry>
+ <entry
key="http://cxf.apache.org/configuration/transport/jms-server">config-metadata/jms-server-config.xml</entry>
</properties>
Modified:
incubator/cxf/trunk/api/src/main/resources/config-metadata/jms-client-config.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/resources/config-metadata/jms-client-config.xml?view=diff&rev=439938&r1=439937&r2=439938
==============================================================================
---
incubator/cxf/trunk/api/src/main/resources/config-metadata/jms-client-config.xml
(original)
+++
incubator/cxf/trunk/api/src/main/resources/config-metadata/jms-client-config.xml
Sun Sep 3 22:42:55 2006
@@ -23,7 +23,7 @@
xmlns:jms-conf="http://cxf.apache.org/transports/jms/jms-conf"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
- namespace="http://cxf.apache.org/transports/jms/jms-client-config"
+ namespace="http://cxf.apache.org/configuration/transport/jms-client"
>
<cm:configImport namespace="http://cxf.apache.org/transports/jms"
location="schemas/wsdl/jms.xsd"/>
Modified:
incubator/cxf/trunk/api/src/main/resources/config-metadata/jms-server-config.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/resources/config-metadata/jms-server-config.xml?view=diff&rev=439938&r1=439937&r2=439938
==============================================================================
---
incubator/cxf/trunk/api/src/main/resources/config-metadata/jms-server-config.xml
(original)
+++
incubator/cxf/trunk/api/src/main/resources/config-metadata/jms-server-config.xml
Sun Sep 3 22:42:55 2006
@@ -23,7 +23,7 @@
xmlns:jms-conf="http://cxf.apache.org/transports/jms/jms-conf"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
- namespace="http://cxf.apache.org/transports/jms/jms-server-config"
+ namespace="http://cxf.apache.org/configuration/transport/jms-server"
>
<cm:configImport namespace="http://cxf.apache.org/transports/jms"
location="schemas/wsdl/jms.xsd"/>
Modified:
incubator/cxf/trunk/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java?view=diff&rev=439938&r1=439937&r2=439938
==============================================================================
---
incubator/cxf/trunk/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java
(original)
+++
incubator/cxf/trunk/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java
Sun Sep 3 22:42:55 2006
@@ -19,13 +19,14 @@
package org.apache.cxf.wsdl;
-import java.lang.reflect.Method;
import java.util.List;
import javax.wsdl.Binding;
import javax.wsdl.BindingInput;
import javax.wsdl.BindingOperation;
import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.wsdl.Service;
import javax.wsdl.extensions.ExtensionRegistry;
import javax.wsdl.factory.WSDLFactory;
import javax.wsdl.xml.WSDLReader;
@@ -33,8 +34,13 @@
import junit.framework.TestCase;
-public class JAXBExtensionHelperTest
- extends TestCase {
+import org.apache.cxf.bindings.xformat.XMLBindingMessageFormat;
+import org.apache.cxf.transports.jms.JMSAddressPolicyType;
+import org.apache.cxf.transports.jms.JMSClientBehaviorPolicyType;
+import org.apache.cxf.transports.jms.JMSNamingPropertyType;
+import org.apache.cxf.transports.jms.JMSServerBehaviorPolicyType;
+
+public class JAXBExtensionHelperTest extends TestCase {
private WSDLFactory wsdlFactory;
@@ -53,18 +59,17 @@
if (registry == null) {
registry = wsdlFactory.newPopulatedExtensionRegistry();
}
- JAXBExtensionHelper.addExtensions(registry, "javax.wsdl.BindingInput",
-
"org.apache.cxf.bindings.xformat.XMLBindingMessageFormat",
Thread.currentThread()
- .getContextClassLoader());
}
public void tearDown() {
}
- public void testAddExtension() throws Exception {
+ public void testAddXMLBindingExtension() throws Exception {
- Class extClass =
Class.forName("org.apache.cxf.bindings.xformat.XMLBindingMessageFormat");
+ JAXBExtensionHelper.addExtensions(registry, "javax.wsdl.BindingInput",
+
"org.apache.cxf.bindings.xformat.XMLBindingMessageFormat",
Thread.currentThread()
+ .getContextClassLoader());
String file =
this.getClass().getResource("/wsdl/hello_world_xml_bare.wsdl").getFile();
@@ -77,22 +82,67 @@
BindingOperation bo = b.getBindingOperation("sayHi", null, null);
BindingInput bi = bo.getBindingInput();
List extList = bi.getExtensibilityElements();
- Object extIns = null;
+ XMLBindingMessageFormat extIns = null;
for (Object ext : extList) {
- extIns = extClass.cast(ext);
+ if (ext instanceof XMLBindingMessageFormat) {
+ extIns = (XMLBindingMessageFormat) ext;
+ }
}
assertEquals("can't found ext element XMLBindingMessageFormat", true,
extIns != null);
- QName rootNode = getRootNode(extIns);
+ QName rootNode = extIns.getRootNode();
assertEquals("get rootNode value back from extension element",
"sayHi", rootNode.getLocalPart());
}
- private QName getRootNode(Object ext) throws Exception {
- for (int i = 0; i < ext.getClass().getMethods().length; i++) {
- Method method = ext.getClass().getMethods()[i];
- if (method.getName().equals("getRootNode")) {
- return (QName) method.invoke(ext, new Object[] {});
+ public void testAddJMSExtension() throws Exception {
+
+ JAXBExtensionHelper.addExtensions(registry, "javax.wsdl.Port",
+ "org.apache.cxf.transports.jms.JMSAddressPolicyType",
Thread.currentThread()
+ .getContextClassLoader());
+
+ JAXBExtensionHelper.addExtensions(registry, "javax.wsdl.Port",
+
"org.apache.cxf.transports.jms.JMSClientBehaviorPolicyType",
Thread.currentThread()
+ .getContextClassLoader());
+
+ JAXBExtensionHelper.addExtensions(registry, "javax.wsdl.Port",
+
"org.apache.cxf.transports.jms.JMSServerBehaviorPolicyType",
Thread.currentThread()
+ .getContextClassLoader());
+
+ String file =
this.getClass().getResource("/wsdl/jms_test.wsdl").getFile();
+
+ wsdlReader.setExtensionRegistry(registry);
+
+ wsdlDefinition = wsdlReader.readWSDL(file);
+ Service s = wsdlDefinition.getService(new
QName("http://cxf.apache.org/hello_world_jms",
+ "HelloWorldQueueBinMsgService"));
+ Port p = s.getPort("HelloWorldQueueBinMsgPort");
+ List extPortList = p.getExtensibilityElements();
+
+ JMSAddressPolicyType extAddr = null;
+ JMSClientBehaviorPolicyType extClient = null;
+ JMSServerBehaviorPolicyType extServer = null;
+ for (Object ext : extPortList) {
+ if (ext instanceof JMSAddressPolicyType) {
+ extAddr = (JMSAddressPolicyType) ext;
+ }
+ if (ext instanceof JMSClientBehaviorPolicyType) {
+ extClient = (JMSClientBehaviorPolicyType) ext;
+ }
+ if (ext instanceof JMSServerBehaviorPolicyType) {
+ extServer = (JMSServerBehaviorPolicyType) ext;
}
}
- return null;
+ assertEquals("can't found ext element JMSAddress ExtensionElement",
true, extAddr != null);
+ assertEquals("can't found ext element JMS Client Behavior", true,
extClient != null);
+ assertEquals("can't found ext element JMS Server Behavior", true,
extServer != null);
+ assertEquals("can't get JndiDestinationName",
"dynamicQueues/test.jmstransport.binary", extAddr
+ .getJndiDestinationName());
+
+ List<JMSNamingPropertyType> extJmsNamingPropertiesList = null;
+ extJmsNamingPropertiesList = extAddr.getJMSNamingProperty();
+ assertEquals("can't found ext element extJmsNamingPropertiesList",
true,
+ extJmsNamingPropertiesList != null);
+ assertEquals("can't get 2 element of list", 2,
extJmsNamingPropertiesList.size());
+
}
+
}
Added: incubator/cxf/trunk/api/src/test/resources/wsdl/jms_test.wsdl
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/test/resources/wsdl/jms_test.wsdl?view=auto&rev=439938
==============================================================================
--- incubator/cxf/trunk/api/src/test/resources/wsdl/jms_test.wsdl (added)
+++ incubator/cxf/trunk/api/src/test/resources/wsdl/jms_test.wsdl Sun Sep 3
22:42:55 2006
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<definitions name="HelloWorldService"
+ targetNamespace="http://cxf.apache.org/hello_world_jms"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:jms="http://cxf.apache.org/transports/jms"
+ xmlns:x1="http://cxf.apache.org/hello_world_jms/types"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://cxf.apache.org/hello_world_jms"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <types>
+ <schema targetNamespace="http://cxf.apache.org/hello_world_jms/types"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:x1="http://cxf.apache.org/hello_world_jms/types"
elementFormDefault="qualified">
+ <complexType name="ErrorCode">
+ <sequence>
+ <element name="minor" type="short"/>
+ <element name="major" type="short"/>
+ </sequence>
+ </complexType>
+ <complexType name="testRpcLitFault">
+ <sequence>
+ <element name="faultType" type="string"/>
+ </sequence>
+ </complexType>
+ <complexType name="testRpcLitFaultResponse">
+ <sequence/>
+ </complexType>
+
+ <complexType name="NoSuchCodeLit">
+ <sequence>
+ <element name="code" type="x1:ErrorCode"/>
+ </sequence>
+ </complexType>
+ <complexType name="BadRecord">
+ <sequence>
+ <element name="reason" type="string"/>
+ <element name="code" type="short"/>
+ </sequence>
+ </complexType>
+ </schema>
+ </types>
+
+ <message name="greetMe">
+ <part name="stringParam0" type="xsd:string"/>
+ </message>
+ <message name="greetMeResponse">
+ <part name="return" type="xsd:string"/>
+ </message>
+ <message name="sayHi"/>
+ <message name="sayHiResponse">
+ <part name="return" type="xsd:string"/>
+ </message>
+ <message name="greetMeOneWay">
+ <part name="stringParam0" type="xsd:string"/>
+ </message>
+
+ <message name="testRpcLitFaultRequest">
+ <part name="in" type="xsd:string"/>
+ </message>
+ <message name="testRpcLitFaultResponse">
+ <part name="out" type="x1:testRpcLitFaultResponse"/>
+ </message>
+ <message name="NoSuchCodeLitFault">
+ <part name="NoSuchCodeLit" type="x1:NoSuchCodeLit"/>
+ </message>
+ <message name="BadRecordLitFault">
+ <part name="BadRecordLit" type="xsd:string"/>
+ </message>
+
+ <portType name="HelloWorldPortType">
+ <operation name="greetMe">
+ <input message="tns:greetMe" name="greetMe"/>
+ <output message="tns:greetMeResponse" name="greetMeResponse"/>
+ </operation>
+ <operation name="sayHi">
+ <input message="tns:sayHi" name="sayHi"/>
+ <output message="tns:sayHiResponse" name="sayHiResponse"/>
+ </operation>
+ <operation name="greetMeOneWay">
+ <input message="tns:greetMeOneWay" name="greetMeOneWay"/>
+ </operation>
+ <operation name="testRpcLitFault">
+ <input name="testRpcLitFaultRequest"
message="tns:testRpcLitFaultRequest"/>
+ <output name="testRpcLitFaultResponse"
message="tns:testRpcLitFaultResponse"/>
+ <fault name="NoSuchCodeLitFault" message="tns:NoSuchCodeLitFault"/>
+ <fault name="BadRecordLitFault" message="tns:BadRecordLitFault"/>
+ </operation>
+ </portType>
+
+ <binding name="HelloWorldQueueBinMsgBinding" type="tns:HelloWorldPortType">
+ <soap:binding style="rpc"
transport="http://cxf.apache.org/transports/jms"/>
+ <operation name="greetMe">
+ <soap:operation soapAction="" style="rpc"/>
+ <input name="greetMe">
+ <soap:body
+ namespace="http://cxf.apache.org/hello_world_jms"
use="literal"/>
+ </input>
+ <output name="greetMeResponse">
+ <soap:body
+ namespace="http://cxf.apache.org/hello_world_jms"
use="literal"/>
+ </output>
+ </operation>
+ <operation name="sayHi">
+ <soap:operation soapAction="" style="rpc"/>
+ <input name="sayHi">
+ <soap:body
+ namespace="http://cxf.apache.org/hello_world_jms"
use="literal"/>
+ </input>
+ <output name="sayHiResponse">
+ <soap:body
+ namespace="http://cxf.apache.org/hello_world_jms"
use="literal"/>
+ </output>
+ </operation>
+ <operation name="greetMeOneWay">
+ <soap:operation style="rpc"/>
+ <input name="greetMeOneWay">
+ <soap:body
+ namespace="http://cxf.apache.org/hello_world_jms"
use="literal"/>
+ </input>
+ </operation>
+ </binding>
+
+ <service name="HelloWorldQueueBinMsgService">
+ <port binding="tns:HelloWorldQueueBinMsgBinding"
name="HelloWorldQueueBinMsgPort">
+ <jms:address
+ jndiConnectionFactoryName="ConnectionFactory"
+ jndiDestinationName="dynamicQueues/test.jmstransport.binary">
+ <jms:JMSNamingProperty name="java.naming.factory.initial"
value="org.activemq.jndi.ActiveMQInitialContextFactory"/>
+ <jms:JMSNamingProperty name="java.naming.provider.url"
value="tcp://localhost:61500"/>
+ </jms:address>
+
+ <jms:client messageType="binary"/>
+ <jms:server durableSubscriberName="CXF_subscriber"/>
+ </port>
+ </service>
+
+</definitions>
+
+
Propchange: incubator/cxf/trunk/api/src/test/resources/wsdl/jms_test.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/api/src/test/resources/wsdl/jms_test.wsdl
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: incubator/cxf/trunk/rt/core/src/main/resources/META-INF/extensions.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/resources/META-INF/extensions.xml?view=diff&rev=439938&r1=439937&r2=439938
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/resources/META-INF/extensions.xml
(original)
+++ incubator/cxf/trunk/rt/core/src/main/resources/META-INF/extensions.xml Sun
Sep 3 22:42:55 2006
@@ -21,4 +21,7 @@
<properties>
<entry
key="javax.wsdl.BindingInput">org.apache.cxf.bindings.xformat.XMLBindingMessageFormat</entry>
<entry
key="javax.wsdl.BindingOutput">org.apache.cxf.bindings.xformat.XMLBindingMessageFormat</entry>
+ <entry
key="javax.wsdl.Port">org.apache.cxf.transports.jms.JMSAddressPolicyType</entry>
+ <entry
key="javax.wsdl.Port">org.apache.cxf.transports.jms.JMSClientBehaviorPolicyType</entry>
+ <entry
key="javax.wsdl.Port">org.apache.cxf.transports.jms.JMSServerBehaviorPolicyType</entry>
</properties>