http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/GreeterImpl.java ---------------------------------------------------------------------- diff --git a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/GreeterImpl.java b/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/GreeterImpl.java deleted file mode 100644 index fcba2c9..0000000 --- a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/GreeterImpl.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * 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. - */ -package org.apache.servicemix.camel.nmr.ws.addressing; - -import java.util.concurrent.Future; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.annotation.Resource; -import javax.jws.WebService; -import javax.xml.ws.AsyncHandler; -import javax.xml.ws.Response; -import javax.xml.ws.WebServiceContext; - -import org.apache.cxf.ws.addressing.AddressingProperties; -import org.apache.hello_world_soap_http.BadRecordLitFault; -import org.apache.hello_world_soap_http.Greeter; -import org.apache.hello_world_soap_http.NoSuchCodeLitFault; -import org.apache.hello_world_soap_http.types.BareDocumentResponse; -import org.apache.hello_world_soap_http.types.ErrorCode; -import org.apache.hello_world_soap_http.types.GreetMeLaterResponse; -import org.apache.hello_world_soap_http.types.GreetMeResponse; -import org.apache.hello_world_soap_http.types.GreetMeSometimeResponse; -import org.apache.hello_world_soap_http.types.NoSuchCodeLit; -import org.apache.hello_world_soap_http.types.SayHiResponse; -import org.apache.hello_world_soap_http.types.TestDocLitFaultResponse; -import org.apache.hello_world_soap_http.types.TestNillableResponse; - -import static org.apache.cxf.ws.addressing.JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND; - - -@WebService(serviceName = "SOAPServiceAddressing", - portName = "SoapPort", - endpointInterface = "org.apache.hello_world_soap_http.Greeter", - targetNamespace = "http://apache.org/hello_world_soap_http", - wsdlLocation = "org/apache/servicemix/camel/ws/addressing/hello_world.wsdl") -public class GreeterImpl implements Greeter, VerificationCache { - - private String verified; - /** - * Injectable context. - */ - @Resource - private WebServiceContext context; - - - public String greetMe(String me) { - System.out.println("\n\n*** GreetMe called with: " + me + "***\n\n"); - verifyMAPs(); - return "Hello " + me; - } - - public String greetMeLater(long delay) { - System.out.println("\n\n*** GreetMeLater called with: " + delay + "***\n\n"); - if (delay > 0) { - try { - Thread.sleep(delay); - } catch (InterruptedException ex) { - // ignore - } - } - verifyMAPs(); - return "Hello, finally"; - } - - public void greetMeOneWay(String requestType) { - System.out.println("\n\n*** GreetMeOneWay called with: " + requestType + "***\n\n"); - verifyMAPs(); - } - - public String sayHi() { - verifyMAPs(); - return "sayHi:Bonjour"; - } - - public void testDocLitFault(String faultType) throws BadRecordLitFault, NoSuchCodeLitFault { - verifyMAPs(); - if (faultType.equals(BadRecordLitFault.class.getSimpleName())) { - throw new BadRecordLitFault("TestBadRecordLit", "BadRecordLitFault"); - } - if (faultType.equals(NoSuchCodeLitFault.class.getSimpleName())) { - ErrorCode ec = new ErrorCode(); - ec.setMajor((short)1); - ec.setMinor((short)1); - NoSuchCodeLit nscl = new NoSuchCodeLit(); - nscl.setCode(ec); - throw new NoSuchCodeLitFault("TestNoSuchCodeLit", nscl); - } - } - - public BareDocumentResponse testDocLitBare(String in) { - BareDocumentResponse res = new BareDocumentResponse(); - res.setCompany("Celtix"); - res.setId(1); - return res; - } - - private void verifyMAPs() { - if (context.getMessageContext() != null) { - String property = SERVER_ADDRESSING_PROPERTIES_INBOUND; - AddressingProperties maps = (AddressingProperties) - context.getMessageContext().get(property); - put(WSAddressingTest.verifyMAPs(maps, this)); - } - } - - public String greetMeSometime(String me) { - return "greetMeSomeTime:How are you " + me; - } - - public Future<?> greetMeSometimeAsync(String requestType, - AsyncHandler<GreetMeSometimeResponse> asyncHandler) { - return null; - /*not called */ - } - - public Response<GreetMeSometimeResponse> greetMeSometimeAsync(String requestType) { - return null; - /*not called */ - } - - public Response<TestDocLitFaultResponse> testDocLitFaultAsync(String faultType) { - return null; - /*not called */ - } - - public Future<?> testDocLitFaultAsync(String faultType, AsyncHandler ah) { - return null; - /*not called */ - } - - public Future<?> testDocLitBareAsync(String bare, AsyncHandler ah) { - return null; - /* not called */ - } - - public Response<BareDocumentResponse> testDocLitBareAsync(String bare) { - return null; - /* not called */ - } - - public Future<?> greetMeAsync(String requestType, AsyncHandler<GreetMeResponse> asyncHandler) { - return null; - /*not called */ - } - - public Response<GreetMeResponse> greetMeAsync(String requestType) { - return null; - /*not called */ - } - - public Future<?> greetMeLaterAsync(long requestType, AsyncHandler<GreetMeLaterResponse> asyncHandler) { - return null; - /*not called */ - } - - public Response<GreetMeLaterResponse> greetMeLaterAsync(long requestType) { - return null; - /*not called */ - } - - public Future<?> sayHiAsync(AsyncHandler<SayHiResponse> asyncHandler) { - return null; - /*not called */ - } - - public Response<SayHiResponse> sayHiAsync() { - return null; - /*not called */ - } - - public String testNillable(String nillElem, int intElem) { - // TODO Auto-generated method stub - return null; - } - - public Response<TestNillableResponse> testNillableAsync(String nillElem, - int intElem) { - return null; - } - - public Future<?> testNillableAsync(String nillElem, - int intElem, - AsyncHandler<TestNillableResponse> asyncHandler) { - return null; - } - - protected boolean verify(Logger log) { - if (verified != null) { - System.out.println("MAP/Header verification failed: " + verified); - log.log(Level.WARNING, - "MAP/Header verification failed: {0}", - verified); - } - return verified == null; - } - - - public void put(String verification) { - if (verification != null) { - verified = verified == null - ? verification - : verified + "; " + verification; - } - } -} - -
http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/HeaderVerifier.java ---------------------------------------------------------------------- diff --git a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/HeaderVerifier.java b/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/HeaderVerifier.java deleted file mode 100644 index 510b85f..0000000 --- a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/HeaderVerifier.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * 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. - */ -package org.apache.servicemix.camel.nmr.ws.addressing; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; -import javax.xml.namespace.QName; -import javax.xml.soap.SOAPException; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - -import org.apache.cxf.binding.soap.SoapMessage; -import org.apache.cxf.binding.soap.SoapVersion; -import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor; -import org.apache.cxf.headers.Header; -import org.apache.cxf.helpers.DOMUtils; -import org.apache.cxf.phase.Phase; -import org.apache.cxf.ws.addressing.AddressingProperties; -import org.apache.cxf.ws.addressing.AttributedURIType; -import org.apache.cxf.ws.addressing.ContextUtils; -import org.apache.cxf.ws.addressing.Names; -import org.apache.cxf.ws.addressing.soap.VersionTransformer; -import org.apache.cxf.ws.addressing.v200408.AttributedURI; - -import static org.apache.cxf.ws.addressing.JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND; -import static org.apache.cxf.ws.addressing.JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND; - - -/** - * Verifies presence of expected SOAP headers. - */ -public class HeaderVerifier extends AbstractSoapInterceptor { - VerificationCache verificationCache = new GreeterImpl(); - String currentNamespaceURI; - - public HeaderVerifier() { - super(Phase.POST_PROTOCOL); - } - - public Set<QName> getUnderstoodHeaders() { - return Names.HEADERS; - } - - public void handleMessage(SoapMessage message) { - mediate(message); - } - - public void handleFault(SoapMessage message) { - mediate(message); - } - - private void mediate(SoapMessage message) { - boolean outgoingPartialResponse = isOutgoingPartialResponse(message); - if (outgoingPartialResponse) { - addPartialResponseHeader(message); - } - verify(message, outgoingPartialResponse); - } - - private void addPartialResponseHeader(SoapMessage message) { - try { - // add piggybacked wsa:From header to partial response - List<Header> header = message.getHeaders(); - Document doc = DOMUtils.createDocument(); - SoapVersion ver = message.getVersion(); - Element hdr = doc.createElementNS(ver.getHeader().getNamespaceURI(), - ver.getHeader().getLocalPart()); - hdr.setPrefix(ver.getHeader().getPrefix()); - - marshallFrom("urn:piggyback_responder", hdr, getMarshaller()); - NodeList nl = hdr.getChildNodes(); - for (int i = 0; i < nl.getLength(); i++) { - Object obj = nl.item(i); - if (obj instanceof Element) { - Element elem = (Element) obj; - Header holder = new Header( - new QName(elem.getNamespaceURI(), elem.getLocalName()), - elem, null); - header.add(holder); - } - } - - } catch (Exception e) { - verificationCache.put("SOAP header addition failed: " + e); - e.printStackTrace(); - } - } - - private void verify(SoapMessage message, boolean outgoingPartialResponse) { - try { - List<String> wsaHeaders = new ArrayList<String>(); - List<Header> headers = message.getHeaders(); - if (headers != null) { - recordWSAHeaders(headers, - wsaHeaders, - Names.WSA_NAMESPACE_NAME); - recordWSAHeaders(headers, - wsaHeaders, - VersionTransformer.Names200408.WSA_NAMESPACE_NAME); - recordWSAHeaders(headers, - wsaHeaders, - WSAddressingTest.CUSTOMER_NAME.getNamespaceURI()); - } - boolean partialResponse = isIncomingPartialResponse(message) - || outgoingPartialResponse; - verificationCache.put(WSAddressingTest.verifyHeaders(wsaHeaders, - partialResponse, - isRequestLeg(message))); - } catch (SOAPException se) { - verificationCache.put("SOAP header verification failed: " + se); - } - } - - private void recordWSAHeaders(List<Header> headers, - List<String> wsaHeaders, - String namespaceURI) { - Iterator<Header> iter = headers.iterator(); - while (iter.hasNext()) { - Object obj = iter.next().getObject(); - if (obj instanceof Element) { - Element hdr = (Element) obj; - if (namespaceURI.equals(hdr.getNamespaceURI())) { - if (namespaceURI.endsWith("addressing")) { - currentNamespaceURI = namespaceURI; - wsaHeaders.add(hdr.getLocalName()); - } else if (WSAddressingTest.CUSTOMER_NAME.getNamespaceURI().equals(namespaceURI)) { - String headerText = hdr.getTextContent(); - if (WSAddressingTest.CUSTOMER_KEY.equals(headerText)) { - wsaHeaders.add(hdr.getLocalName()); - } - } - } - } - - } - } - - private boolean isRequestLeg(SoapMessage message) { - return (ContextUtils.isRequestor(message) && ContextUtils.isOutbound(message)) - || (!ContextUtils.isRequestor(message) && !ContextUtils.isOutbound(message)); - } - - private boolean isOutgoingPartialResponse(SoapMessage message) { - AddressingProperties maps = - (AddressingProperties)message.get(SERVER_ADDRESSING_PROPERTIES_OUTBOUND); - return ContextUtils.isOutbound(message) - && !ContextUtils.isRequestor(message) - && maps != null - && Names.WSA_ANONYMOUS_ADDRESS.equals(maps.getTo().getValue()); - } - - private boolean isIncomingPartialResponse(SoapMessage message) - throws SOAPException { - AddressingProperties maps = - (AddressingProperties)message.get(CLIENT_ADDRESSING_PROPERTIES_INBOUND); - return !ContextUtils.isOutbound(message) - && ContextUtils.isRequestor(message) - && maps != null - && Names.WSA_ANONYMOUS_ADDRESS.equals(maps.getTo().getValue()); - } - - private Marshaller getMarshaller() throws JAXBException { - JAXBContext jaxbContext = - VersionTransformer.getExposedJAXBContext(currentNamespaceURI); - Marshaller marshaller = jaxbContext.createMarshaller(); - marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE); - return marshaller; - } - - private void marshallFrom(String from, Element header, Marshaller marshaller) - throws JAXBException { - if (Names.WSA_NAMESPACE_NAME.equals(currentNamespaceURI)) { - String u = "urn:piggyback_responder"; - AttributedURIType value = - org.apache.cxf.ws.addressing.ContextUtils.getAttributedURI(u); - marshaller.marshal( - new JAXBElement<AttributedURIType>(Names.WSA_FROM_QNAME, - AttributedURIType.class, - value), - header); - } else if (VersionTransformer.Names200408.WSA_NAMESPACE_NAME.equals( - currentNamespaceURI)) { - AttributedURI value = - VersionTransformer.Names200408.WSA_OBJECT_FACTORY.createAttributedURI(); - value.setValue(from); - QName qname = new QName(VersionTransformer.Names200408.WSA_NAMESPACE_NAME, - Names.WSA_FROM_NAME); - marshaller.marshal( - new JAXBElement<AttributedURI>(qname, - AttributedURI.class, - value), - header); - } - } - - public void setVerificationCache(VerificationCache cache) { - verificationCache = cache; - } - - -} - - http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/MAPVerifier.java ---------------------------------------------------------------------- diff --git a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/MAPVerifier.java b/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/MAPVerifier.java deleted file mode 100644 index 1a97737..0000000 --- a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/MAPVerifier.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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. - */ -package org.apache.servicemix.camel.nmr.ws.addressing; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.cxf.message.Message; -import org.apache.cxf.phase.AbstractPhaseInterceptor; -import org.apache.cxf.phase.Phase; -import org.apache.cxf.ws.addressing.AddressingProperties; -import org.apache.cxf.ws.addressing.impl.AddressingPropertiesImpl; -import org.apache.cxf.ws.addressing.ContextUtils; -import org.apache.cxf.ws.addressing.Names; - -import static org.apache.cxf.ws.addressing.JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND; -import static org.apache.cxf.ws.addressing.JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND; - - -/** - * Verifies presence of MAPs in the context. - */ -public class MAPVerifier extends AbstractPhaseInterceptor<Message> { - VerificationCache verificationCache = new GreeterImpl(); - List<String> expectedExposedAs = new ArrayList<String>(); - private Map<String, Object> mapProperties; - - public MAPVerifier() { - super(Phase.POST_LOGICAL); - mapProperties = new HashMap<String, Object>(); - mapProperties.put(WSAddressingTest.INBOUND_KEY, CLIENT_ADDRESSING_PROPERTIES_INBOUND); - mapProperties.put(WSAddressingTest.OUTBOUND_KEY, CLIENT_ADDRESSING_PROPERTIES_OUTBOUND); - } - - public void handleMessage(Message message) { - verify(message); - } - - public void handleFault(Message message) { - verify(message); - } - - private void verify(Message message) { - boolean isOutbound = ContextUtils.isOutbound(message); - String mapProperty = - (String)mapProperties.get(isOutbound - ? WSAddressingTest.OUTBOUND_KEY - : WSAddressingTest.INBOUND_KEY); - AddressingProperties maps = - (AddressingPropertiesImpl)message.get(mapProperty); - if (ContextUtils.isRequestor(message)) { - if (isOutbound) { - String exposeAs = getExpectedExposeAs(false); - if (exposeAs != null) { - maps.exposeAs(exposeAs); - } - } else { - String exposeAs = getExpectedExposeAs(true); - String expected = exposeAs != null - ? exposeAs - : Names.WSA_NAMESPACE_NAME; - if (maps.getNamespaceURI() != expected) { - verificationCache.put("Incoming version mismatch" - + " expected: " + expected - + " got: " + maps.getNamespaceURI()); - } - exposeAs = null; - } - } - verificationCache.put(WSAddressingTest.verifyMAPs(maps, this)); - } - - private String getExpectedExposeAs(boolean remove) { - int size = expectedExposedAs.size(); - return size == 0 - ? null - : remove - ? expectedExposedAs.remove(size - 1) - : expectedExposedAs.get(size - 1); - } - - public void setVerificationCache(VerificationCache cache) { - verificationCache = cache; - } - - public void addToExpectedExposedAs(String str) { - expectedExposedAs.add(str); - } -} - - http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/VerificationCache.java ---------------------------------------------------------------------- diff --git a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/VerificationCache.java b/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/VerificationCache.java deleted file mode 100644 index 4292def..0000000 --- a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/VerificationCache.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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. - */ -package org.apache.servicemix.camel.nmr.ws.addressing; - -public interface VerificationCache { - void put(String verification); -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/WSAddressingTest.java ---------------------------------------------------------------------- diff --git a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/WSAddressingTest.java b/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/WSAddressingTest.java deleted file mode 100644 index 59dbc72..0000000 --- a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/addressing/WSAddressingTest.java +++ /dev/null @@ -1,386 +0,0 @@ -/* - * 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. - */ -package org.apache.servicemix.camel.nmr.ws.addressing; - -import java.lang.reflect.UndeclaredThrowableException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.JAXBElement; -import javax.xml.namespace.QName; -import javax.xml.ws.Endpoint; - -import org.apache.camel.CamelContext; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.spring.SpringCamelContext; -import org.apache.camel.test.CamelTestSupport; -import org.apache.cxf.Bus; -import org.apache.cxf.BusFactory; -import org.apache.cxf.bus.spring.SpringBusFactory; -import org.apache.cxf.endpoint.ServerImpl; -import org.apache.cxf.interceptor.Interceptor; -import org.apache.cxf.jaxws.ServiceImpl; -import org.apache.cxf.jaxws.support.ServiceDelegateAccessor; -import org.apache.cxf.message.Message; -import org.apache.cxf.ws.addressing.AddressingProperties; -import org.apache.cxf.ws.addressing.ContextUtils; -import org.apache.cxf.ws.addressing.EndpointReferenceType; -import org.apache.cxf.ws.addressing.Names; -import org.apache.cxf.ws.addressing.ReferenceParametersType; -import org.apache.cxf.ws.addressing.VersionTransformer; -import org.apache.cxf.wsdl.EndpointReferenceUtils; -import org.apache.hello_world_soap_http.BadRecordLitFault; -import org.apache.hello_world_soap_http.Greeter; -import org.apache.hello_world_soap_http.NoSuchCodeLitFault; -import org.apache.hello_world_soap_http.SOAPService; -import org.apache.servicemix.camel.nmr.ServiceMixComponent; -import org.apache.servicemix.nmr.api.NMR; -import org.apache.servicemix.nmr.core.ServiceMix; -import org.springframework.context.support.AbstractXmlApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -public class WSAddressingTest extends CamelTestSupport implements VerificationCache { - - - - protected static final String SERVICE_ADDRESS = "local://smx/hello_world"; - - static final String INBOUND_KEY = "inbound"; - static final String OUTBOUND_KEY = "outbound"; - static final String ADDRESS = "http://localhost:9008/SoapContext/SoapPort"; - static final QName CUSTOMER_NAME = - new QName("http://example.org/customer", "CustomerKey", "customer"); - static final String CUSTOMER_KEY = "Key#123456789"; - - private static Bus staticBus; - - - private static MAPVerifier mapVerifier; - private static HeaderVerifier headerVerifier; - - private static final QName SERVICE_NAME = - new QName("http://apache.org/hello_world_soap_http", "SOAPServiceAddressing"); - - private static final java.net.URL WSDL_LOC; - private static final String CONFIG; - - - private static Map<Object, Map<String, String>> messageIDs = - new HashMap<Object, Map<String, String>>(); - protected Greeter greeter; - private String verified; - - - protected AbstractXmlApplicationContext applicationContext; - - - private ServerImpl server; - private CamelContext camelContext; - private ServiceMixComponent smxComponent; - private NMR nmr; - private Endpoint endpoint; - - static { - CONFIG = "org/apache/servicemix/camel/ws/addressing/addressing" - + (("HP-UX".equals(System.getProperty("os.name")) - || "Windows XP".equals(System.getProperty("os.name"))) ? "-hpux" : "") - + ".xml"; - - java.net.URL tmp = null; - try { - tmp = WSAddressingTest.class.getClassLoader().getResource( - "org/apache/servicemix/camel/ws/addressing/hello_world.wsdl" - ); - } catch (final Exception e) { - e.printStackTrace(); - } - WSDL_LOC = tmp; - } - - @Override - protected void setUp() throws Exception { - applicationContext = createApplicationContext(); - super.setUp(); - startService(); - - if (staticBus == null) { - SpringBusFactory bf = new SpringBusFactory(); - staticBus = bf.createBus(getConfigFileName()); - } - messageIDs.clear(); - mapVerifier = new MAPVerifier(); - headerVerifier = new HeaderVerifier(); - Interceptor[] interceptors = {mapVerifier, headerVerifier }; - addInterceptors(staticBus.getInInterceptors(), interceptors); - addInterceptors(staticBus.getOutInterceptors(), interceptors); - addInterceptors(staticBus.getOutFaultInterceptors(), interceptors); - addInterceptors(staticBus.getInFaultInterceptors(), interceptors); - - EndpointReferenceType target = - EndpointReferenceUtils.getEndpointReference(ADDRESS); - ReferenceParametersType params = - ContextUtils.WSA_OBJECT_FACTORY.createReferenceParametersType(); - JAXBElement<String> param = - new JAXBElement<String>(CUSTOMER_NAME, String.class, CUSTOMER_KEY); - params.getAny().add(param); - target.setReferenceParameters(params); - - ServiceImpl serviceImpl = - ServiceDelegateAccessor.get(new SOAPService(WSDL_LOC, SERVICE_NAME)); - greeter = serviceImpl.getPort(target, Greeter.class); - - mapVerifier.verificationCache = this; - headerVerifier.verificationCache = this; - } - - protected void startService() { - Object implementor = new GreeterImpl(); - endpoint = javax.xml.ws.Endpoint.publish(SERVICE_ADDRESS, implementor); - } - - @Override - protected void tearDown() throws Exception { - if (applicationContext != null) { - applicationContext.destroy(); - } - if (server != null) { - server.stop(); - } - if (endpoint != null) { - endpoint.stop(); - } - Interceptor[] interceptors = {mapVerifier, headerVerifier }; - removeInterceptors(staticBus.getInInterceptors(), interceptors); - removeInterceptors(staticBus.getOutInterceptors(), interceptors); - removeInterceptors(staticBus.getOutFaultInterceptors(), interceptors); - removeInterceptors(staticBus.getInFaultInterceptors(), interceptors); - mapVerifier = null; - headerVerifier = null; - verified = null; - messageIDs.clear(); - super.tearDown(); - BusFactory.setDefaultBus(null); - Thread.sleep(5000); - } - - protected RouteBuilder createRouteBuilder() { - return new RouteBuilder() { - public void configure() { - // configure the route from spring application - errorHandler(noErrorHandler()); - from("cxf:bean:routerEndpoint").to("smx:testEndpoint"); - from("smx:testEndpoint").to("cxf:bean:serviceEndpoint"); - } - }; - } - - protected CamelContext createCamelContext() throws Exception { - camelContext = SpringCamelContext.springCamelContext(applicationContext); - smxComponent = new ServiceMixComponent(); - nmr = new ServiceMix(); - ((ServiceMix)nmr).init(); - smxComponent.setNmr(nmr); - camelContext.addComponent("smx", smxComponent); - return camelContext; - } - - protected ClassPathXmlApplicationContext createApplicationContext() { - return new ClassPathXmlApplicationContext("org/apache/servicemix/camel/ws/addressing/server.xml"); - } - - - public void testImplicitMAPs() throws Exception { - try { - String greeting = greeter.greetMe("implicit1"); - assertEquals("unexpected response received from service", - "Hello implicit1", - greeting); - checkVerification(); - greeting = greeter.greetMe("implicit2"); - assertEquals("unexpected response received from service", - "Hello implicit2", - greeting); - checkVerification(); - } catch (UndeclaredThrowableException ex) { - throw (Exception)ex.getCause(); - } - } - - - - - public void testOneway() throws Exception { - try { - greeter.greetMeOneWay("implicit_oneway1"); - checkVerification(); - } catch (UndeclaredThrowableException ex) { - throw (Exception)ex.getCause(); - } - } - - public void testApplicationFault() throws Exception { - try { - greeter.testDocLitFault("BadRecordLitFault"); - fail("expected fault from service"); - } catch (BadRecordLitFault brlf) { - checkVerification(); - } catch (UndeclaredThrowableException ex) { - throw (Exception)ex.getCause(); - } - String greeting = greeter.greetMe("intra-fault"); - assertEquals("unexpected response received from service", - "Hello intra-fault", - greeting); - try { - greeter.testDocLitFault("NoSuchCodeLitFault"); - fail("expected NoSuchCodeLitFault"); - } catch (NoSuchCodeLitFault nsclf) { - checkVerification(); - } catch (UndeclaredThrowableException ex) { - throw (Exception)ex.getCause(); - } - } - - - public void testVersioning() throws Exception { - try { - // expect two MAPs instances versioned with 200408, i.e. for both - // the partial and full responses - mapVerifier.expectedExposedAs.add(VersionTransformer.Names200408.WSA_NAMESPACE_NAME); - mapVerifier.expectedExposedAs.add(VersionTransformer.Names200408.WSA_NAMESPACE_NAME); - String greeting = greeter.greetMe("versioning1"); - assertEquals("unexpected response received from service", - "Hello versioning1", - greeting); - checkVerification(); - greeting = greeter.greetMe("versioning2"); - assertEquals("unexpected response received from service", - "Hello versioning2", - greeting); - checkVerification(); - } catch (UndeclaredThrowableException ex) { - throw (Exception)ex.getCause(); - } - } - - protected static String verifyMAPs(AddressingProperties maps, - Object checkPoint) { - if (maps == null) { - return "expected MAPs"; - } - String id = maps.getMessageID().getValue(); - if (id == null) { - return "expected MessageID MAP"; - } - if (!id.startsWith("urn:uuid")) { - return "bad URN format in MessageID MAP: " + id; - } - // ensure MessageID is unique for this check point - Map<String, String> checkPointMessageIDs = messageIDs.get(checkPoint); - if (checkPointMessageIDs != null) { - if (checkPointMessageIDs.containsKey(id)) { - // return "MessageID MAP duplicate: " + id; - return null; - } - } else { - checkPointMessageIDs = new HashMap<String, String>(); - messageIDs.put(checkPoint, checkPointMessageIDs); - } - checkPointMessageIDs.put(id, id); - // To - if (maps.getTo() == null) { - return "expected To MAP"; - } - return null; - } - - public String getConfigFileName() { - return CONFIG; - } - - public static void shutdownBus() throws Exception { - staticBus.shutdown(true); - } - - private void addInterceptors(List<Interceptor<? extends Message>> chain, - Interceptor[] interceptors) { - for (int i = 0; i < interceptors.length; i++) { - chain.add(interceptors[i]); - } - } - - private void removeInterceptors(List<Interceptor<? extends Message>> chain, - Interceptor[] interceptors) { - for (int i = 0; i < interceptors.length; i++) { - chain.add(interceptors[i]); - } - } - - public void put(String verification) { - if (verification != null) { - verified = verified == null - ? verification - : verified + "; " + verification; - } - } - - /** - * Verify presence of expected MAP headers. - * - * @param wsaHeaders a list of the wsa:* headers present in the SOAP - * message - * @param parial true if partial response - * @return null if all expected headers present, otherwise an error string. - */ - protected static String verifyHeaders(List<String> wsaHeaders, - boolean partial, - boolean requestLeg) { - - String ret = null; - if (!wsaHeaders.contains(Names.WSA_MESSAGEID_NAME)) { - ret = "expected MessageID header"; - } - if (!wsaHeaders.contains(Names.WSA_TO_NAME)) { - ret = "expected To header"; - } - - if (!(wsaHeaders.contains(Names.WSA_REPLYTO_NAME) - || wsaHeaders.contains(Names.WSA_RELATESTO_NAME))) { - ret = "expected ReplyTo or RelatesTo header"; - } - if (partial) { - if (!wsaHeaders.contains(Names.WSA_FROM_NAME)) { - //ret = "expected From header"; - } - } else { - // REVISIT Action missing from full response - //if (!wsaHeaders.contains(Names.WSA_ACTION_NAME)) { - // ret = "expected Action header"; - //} - } - if (requestLeg && !(wsaHeaders.contains(CUSTOMER_NAME.getLocalPart()))) { - ret = "expected CustomerKey header"; - } - return ret; - } - - private void checkVerification() { - assertNull("MAP/Header verification failed: " + verified, verified); - } - -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/policy/ConnectionHelper.java ---------------------------------------------------------------------- diff --git a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/policy/ConnectionHelper.java b/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/policy/ConnectionHelper.java deleted file mode 100644 index 811e986..0000000 --- a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/policy/ConnectionHelper.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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. - */ -package org.apache.servicemix.camel.nmr.ws.policy; - -import org.apache.cxf.endpoint.Client; -import org.apache.cxf.frontend.ClientProxy; -import org.apache.cxf.transport.http.HTTPConduit; -import org.apache.cxf.transports.http.configuration.ConnectionType; -import org.apache.cxf.transports.http.configuration.HTTPClientPolicy; - -public final class ConnectionHelper { - private ConnectionHelper() { - } - - public static void setKeepAliveConnection(Object proxy, boolean keepAlive) { - Client client = ClientProxy.getClient(proxy); - HTTPConduit hc = (HTTPConduit) client.getConduit(); - HTTPClientPolicy cp = hc.getClient(); - cp.setConnection(keepAlive ? ConnectionType.KEEP_ALIVE - : ConnectionType.CLOSE); - } - - public static boolean isKeepAliveConnection(Object proxy) { - Client client = ClientProxy.getClient(proxy); - HTTPConduit hc = (HTTPConduit) client.getConduit(); - HTTPClientPolicy cp = hc.getClient(); - return cp.getConnection() == ConnectionType.KEEP_ALIVE; - } -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/policy/GreeterImpl.java ---------------------------------------------------------------------- diff --git a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/policy/GreeterImpl.java b/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/policy/GreeterImpl.java deleted file mode 100644 index 892e920..0000000 --- a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/policy/GreeterImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ -package org.apache.servicemix.camel.nmr.ws.policy; - -import javax.jws.WebService; - -import org.apache.cxf.greeter_control.AbstractGreeterImpl; - -@WebService(serviceName = "BasicGreeterService", - portName = "GreeterPort", - endpointInterface = "org.apache.cxf.greeter_control.Greeter", - targetNamespace = "http://cxf.apache.org/greeter_control") -public class GreeterImpl extends AbstractGreeterImpl { - -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/policy/WSPolicyTest.java ---------------------------------------------------------------------- diff --git a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/policy/WSPolicyTest.java b/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/policy/WSPolicyTest.java deleted file mode 100644 index c6baaa2..0000000 --- a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/policy/WSPolicyTest.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * 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. - */ -package org.apache.servicemix.camel.nmr.ws.policy; - -import java.net.URL; -import java.util.logging.Logger; - -import javax.xml.namespace.QName; - -import org.apache.camel.CamelContext; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.spring.SpringCamelContext; -import org.apache.camel.test.CamelTestSupport; -import org.apache.cxf.Bus; -import org.apache.cxf.bus.spring.SpringBusFactory; -import org.apache.cxf.common.logging.LogUtils; -import org.apache.cxf.endpoint.ClientImpl; -import org.apache.cxf.endpoint.ServerImpl; -import org.apache.cxf.frontend.ClientProxy; -import org.apache.cxf.greeter_control.BasicGreeterService; -import org.apache.cxf.greeter_control.Greeter; -import org.apache.cxf.greeter_control.PingMeFault; -import org.apache.cxf.interceptor.LoggingInInterceptor; -import org.apache.cxf.interceptor.LoggingOutInterceptor; -import org.apache.servicemix.camel.nmr.ServiceMixComponent; -import org.apache.servicemix.nmr.api.NMR; -import org.apache.servicemix.nmr.core.ServiceMix; -import org.springframework.context.support.AbstractXmlApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -public class WSPolicyTest extends CamelTestSupport { - - private static final Logger LOG = LogUtils.getL7dLogger(WSPolicyTest.class); - - protected static final String SERVICE_ADDRESS = "local://smx/hello_world"; - - - protected AbstractXmlApplicationContext applicationContext; - - - private ServerImpl server; - private CamelContext camelContext; - private ServiceMixComponent smxComponent; - private NMR nmr; - private Bus bus; - - @Override - protected void setUp() throws Exception { - applicationContext = createApplicationContext(); - super.setUp(); - startService(); - } - - - - protected void startService() throws Exception { - Object implementor = new GreeterImpl(); - javax.xml.ws.Endpoint.publish(SERVICE_ADDRESS, implementor); - } - - @Override - protected void tearDown() throws Exception { - if (applicationContext != null) { - applicationContext.destroy(); - } - if (server != null) { - server.stop(); - } - super.tearDown(); - } - - protected RouteBuilder createRouteBuilder() { - return new RouteBuilder() { - public void configure() { - errorHandler(noErrorHandler()); - from("cxf:bean:routerEndpoint").to("smx:testEndpoint"); - from("smx:testEndpoint").to("cxf:bean:serviceEndpoint"); - - - } - }; - } - - - @Override - protected CamelContext createCamelContext() throws Exception { - camelContext = SpringCamelContext.springCamelContext(applicationContext); - - smxComponent = new ServiceMixComponent(); - nmr = new ServiceMix(); - ((ServiceMix)nmr).init(); - smxComponent.setNmr(nmr); - camelContext.addComponent("smx", smxComponent); - return camelContext; - } - - protected ClassPathXmlApplicationContext createApplicationContext() { - return new ClassPathXmlApplicationContext("org/apache/servicemix/camel/ws/policy/server.xml"); - } - - public void testUsingAddressing() throws Exception { - SpringBusFactory bf = new SpringBusFactory(); - bus = bf - .createBus("/org/apache/servicemix/camel/ws/policy/addr.xml"); - LoggingInInterceptor in = new LoggingInInterceptor(); - bus.getInInterceptors().add(in); - bus.getInFaultInterceptors().add(in); - LoggingOutInterceptor out = new LoggingOutInterceptor(); - bus.getOutInterceptors().add(out); - bus.getOutFaultInterceptors().add(out); - URL wsdl = getClass().getResource("/wsdl/greeter_control.wsdl"); - QName serviceName = new QName("http://cxf.apache.org/greeter_control", - "BasicGreeterService"); - BasicGreeterService gs = new BasicGreeterService(wsdl, serviceName); - final Greeter greeter = gs.getGreeterPort(); - LOG.info("Created greeter client."); - if ("HP-UX".equals(System.getProperty("os.name"))) { - ConnectionHelper.setKeepAliveConnection(greeter, true); - } - - //set timeout to 30 secs to avoid intermitly failed - ((ClientImpl)ClientProxy.getClient(greeter)).setSynchronousTimeout(30000); - - // oneway - greeter.greetMeOneWay("CXF"); - - // two-way - - assertEquals("CXF", greeter.greetMe("cxf")); - - // exception - - try { - greeter.pingMe(); - } catch (PingMeFault ex) { - fail("First invocation should have succeeded."); - } - - try { - greeter.pingMe(); - fail("Expected PingMeFault not thrown."); - } catch (PingMeFault ex) { - assertEquals(2, (int) ex.getFaultInfo().getMajor()); - assertEquals(1, (int) ex.getFaultInfo().getMinor()); - } - } - -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/rm/GreeterImpl.java ---------------------------------------------------------------------- diff --git a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/rm/GreeterImpl.java b/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/rm/GreeterImpl.java deleted file mode 100644 index bb98de6..0000000 --- a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/rm/GreeterImpl.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * 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. - */ -package org.apache.servicemix.camel.nmr.ws.rm; - -import java.util.concurrent.Future; -import java.util.logging.Logger; - -import javax.jws.WebService; -import javax.xml.ws.AsyncHandler; -import javax.xml.ws.Response; - -import org.apache.cxf.common.logging.LogUtils; -import org.apache.cxf.greeter_control.PingMeFault; -import org.apache.cxf.greeter_control.types.FaultDetail; -import org.apache.cxf.greeter_control.types.GreetMeResponse; -import org.apache.cxf.greeter_control.types.PingMeResponse; -import org.apache.cxf.greeter_control.types.SayHiResponse; -@WebService(serviceName = "GreeterService", - portName = "GreeterPort", - endpointInterface = "org.apache.cxf.greeter_control.Greeter", - targetNamespace = "http://cxf.apache.org/greeter_control") -public class GreeterImpl { - private static final Logger LOG = LogUtils.getL7dLogger(GreeterImpl.class); - private long delay; - private String lastOnewayArg; - private boolean throwAlways; - private boolean useLastOnewayArg; - private int pingMeCount; - - public long getDelay() { - return delay; - } - - public void setDelay(long d) { - delay = d; - } - - public void resetLastOnewayArg() { - lastOnewayArg = null; - } - - public void useLastOnewayArg(Boolean use) { - useLastOnewayArg = use; - } - - public void setThrowAlways(boolean t) { - throwAlways = t; - } - - public String greetMe(String arg0) { - LOG.info("Executing operation greetMe with parameter: " + arg0); - if ("twoway".equals(arg0)) { - useLastOnewayArg(true); - setDelay(5000); - } - if (delay > 0) { - try { - Thread.sleep(delay); - } catch (InterruptedException ex) { - // ignore - } - } - String result = null; - synchronized (this) { - result = useLastOnewayArg ? lastOnewayArg : arg0.toUpperCase(); - } - LOG.fine("returning: " + result); - return result; - } - - public Future<?> greetMeAsync(String arg0, AsyncHandler<GreetMeResponse> arg1) { - // TODO Auto-generated method stub - return null; - } - - public Response<GreetMeResponse> greetMeAsync(String arg0) { - // TODO Auto-generated method stub - return null; - } - - public void greetMeOneWay(String arg0) { - synchronized (this) { - lastOnewayArg = arg0; - } - LOG.info("Executing operation greetMeOneWay with parameter: " + arg0); - } - - public void pingMe() throws PingMeFault { - pingMeCount++; - if ((pingMeCount % 2) == 0 || throwAlways) { - LOG.fine("Throwing PingMeFault while executiong operation pingMe"); - FaultDetail fd = new FaultDetail(); - fd.setMajor((short)2); - fd.setMinor((short)1); - throw new PingMeFault("Pings succeed only every other time.", fd); - } else { - LOG.fine("Executing operation pingMe"); - } - } - - public Response<PingMeResponse> pingMeAsync() { - // TODO Auto-generated method stub - return null; - } - - public Future<?> pingMeAsync(AsyncHandler<PingMeResponse> arg0) { - // TODO Auto-generated method stub - return null; - } - - public String sayHi() { - // TODO Auto-generated method stub - return null; - } - - public Response<SayHiResponse> sayHiAsync() { - // TODO Auto-generated method stub - return null; - } - - public Future<?> sayHiAsync(AsyncHandler<SayHiResponse> arg0) { - // TODO Auto-generated method stub - return null; - } - -} - - http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/rm/TwowayThread.java ---------------------------------------------------------------------- diff --git a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/rm/TwowayThread.java b/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/rm/TwowayThread.java deleted file mode 100644 index 277fa6a..0000000 --- a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/rm/TwowayThread.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ -package org.apache.servicemix.camel.nmr.ws.rm; - -import org.apache.cxf.greeter_control.Greeter; - -public class TwowayThread extends Thread { - - private String response; - private Greeter greeter; - public TwowayThread(Greeter gr) { - greeter = gr; - } - @Override - public void run() { - - response = greeter.greetMe("twoway"); - } - - public String getResponse() { - return response; - } - -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/rm/WSRMTest.java ---------------------------------------------------------------------- diff --git a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/rm/WSRMTest.java b/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/rm/WSRMTest.java deleted file mode 100644 index 1ffe062..0000000 --- a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/rm/WSRMTest.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * 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. - */ -package org.apache.servicemix.camel.nmr.ws.rm; - -import java.net.URL; -import java.util.logging.Logger; - -import javax.xml.namespace.QName; - -import org.apache.camel.CamelContext; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.spring.SpringCamelContext; -import org.apache.camel.test.CamelTestSupport; -import org.apache.cxf.Bus; -import org.apache.cxf.BusFactory; -import org.apache.cxf.bus.spring.SpringBusFactory; -import org.apache.cxf.common.logging.LogUtils; -import org.apache.cxf.endpoint.ServerImpl; -import org.apache.cxf.greeter_control.Greeter; -import org.apache.cxf.greeter_control.GreeterService; -import org.apache.cxf.interceptor.LoggingInInterceptor; -import org.apache.cxf.interceptor.LoggingOutInterceptor; -import org.apache.servicemix.camel.nmr.ServiceMixComponent; -import org.apache.servicemix.camel.nmr.ws.policy.ConnectionHelper; -import org.apache.servicemix.nmr.api.NMR; -import org.apache.servicemix.nmr.core.ServiceMix; -import org.springframework.context.support.AbstractXmlApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.core.io.ClassPathResource; - -public class WSRMTest extends CamelTestSupport { - - private static final Logger LOG = LogUtils.getL7dLogger(WSRMTest.class); - - protected static final String SERVICE_ADDRESS = "local://smx/hello_world"; - - - protected AbstractXmlApplicationContext applicationContext; - - - private ServerImpl server; - private CamelContext camelContext; - private ServiceMixComponent smxComponent; - private NMR nmr; - private Bus bus; - - @Override - protected void setUp() throws Exception { - applicationContext = createApplicationContext(); - super.setUp(); - startService(); - - } - - - - protected void startService() { - Object implementor = new GreeterImpl(); - javax.xml.ws.Endpoint.publish(SERVICE_ADDRESS, implementor); - - } - - @Override - protected void tearDown() throws Exception { - if (applicationContext != null) { - applicationContext.destroy(); - } - if (server != null) { - server.stop(); - } - super.tearDown(); - } - - protected RouteBuilder createRouteBuilder() { - return new RouteBuilder() { - public void configure() { - from("cxf:bean:routerEndpoint").to("smx:testEndpoint"); - from("smx:testEndpoint").to("cxf:bean:serviceEndpoint"); - } - }; - } - - protected CamelContext createCamelContext() throws Exception { - camelContext = SpringCamelContext.springCamelContext(applicationContext); - smxComponent = new ServiceMixComponent(); - nmr = new ServiceMix(); - ((ServiceMix)nmr).init(); - smxComponent.setNmr(nmr); - camelContext.addComponent("smx", smxComponent); - return camelContext; - } - - protected ClassPathXmlApplicationContext createApplicationContext() { - return new ClassPathXmlApplicationContext("org/apache/servicemix/camel/ws/rm/server.xml"); - } - - - public void testDecoupled() throws Exception { - SpringBusFactory bf = new SpringBusFactory(); - bus = bf.createBus("/org/apache/servicemix/camel/ws/rm/decoupled.xml"); - LoggingInInterceptor in = new LoggingInInterceptor(); - bus.getInInterceptors().add(in); - bus.getInFaultInterceptors().add(in); - LoggingOutInterceptor out = new LoggingOutInterceptor(); - bus.getOutInterceptors().add(out); - bus.getOutFaultInterceptors().add(out); - QName serviceName = new QName("http://cxf.apache.org/greeter_control", "GreeterService"); - URL wsdl = new ClassPathResource("/wsdl/greeter_control.wsdl").getURL(); - GreeterService gs = new GreeterService(wsdl, serviceName); - final Greeter greeter = gs.getGreeterPort(); - LOG.fine("Created greeter client."); - - ConnectionHelper.setKeepAliveConnection(greeter, true); - - - TwowayThread t = new TwowayThread(greeter); - t.start(); - - // allow for partial response to twoway request to arrive - - long wait = 3000; - while (wait > 0) { - long start = System.currentTimeMillis(); - try { - Thread.sleep(wait); - } catch (InterruptedException ex) { - // ignore - } - wait -= System.currentTimeMillis() - start; - } - - greeter.greetMeOneWay("oneway"); - t.join(); - - assertEquals("Unexpected response to twoway request", "oneway", t.getResponse()); - } -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/security/GreeterImpl.java ---------------------------------------------------------------------- diff --git a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/security/GreeterImpl.java b/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/security/GreeterImpl.java deleted file mode 100644 index 70d5308..0000000 --- a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/security/GreeterImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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. - */ -package org.apache.servicemix.camel.nmr.ws.security; - [email protected]( - serviceName = "SOAPServiceWSSecurity", - portName = "TimestampSignEncrypt", - endpointInterface = "org.apache.hello_world_soap_http.Greeter", - targetNamespace = "http://apache.org/hello_world_soap_http", - wsdlLocation = "org/apache/servicemix/camel/ws/security/hello_world.wsdl" - ) - public class GreeterImpl - extends org.apache.hello_world_soap_http.GreeterImpl { - - public String greetMe(String me) { - System.out.println("\n\n*** GreetMe called with: " + me + "***\n\n"); - return "Hello " + me; - } - - } http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/security/KeystorePasswordCallback.java ---------------------------------------------------------------------- diff --git a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/security/KeystorePasswordCallback.java b/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/security/KeystorePasswordCallback.java deleted file mode 100644 index 892a658..0000000 --- a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/security/KeystorePasswordCallback.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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. - */ -package org.apache.servicemix.camel.nmr.ws.security; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -import javax.security.auth.callback.Callback; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.callback.UnsupportedCallbackException; - -import org.apache.ws.security.WSPasswordCallback; - -public class KeystorePasswordCallback implements CallbackHandler { - - private Map<String, String> passwords = - new HashMap<String, String>(); - - public KeystorePasswordCallback() { - passwords.put("alice", "password"); - passwords.put("bob", "password"); - } - - /** - * It attempts to get the password from the private - * alias/passwords map. - */ - public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { - for (int i = 0; i < callbacks.length; i++) { - WSPasswordCallback pc = (WSPasswordCallback)callbacks[i]; - - String pass = passwords.get(pc.getIdentifier()); - if (pass != null) { - pc.setPassword(pass); - return; - } - } - } - - /** - * Add an alias/password pair to the callback mechanism. - */ - public void setAliasPassword(String alias, String password) { - passwords.put(alias, password); - } -} - http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/security/WSSecurityTest.java ---------------------------------------------------------------------- diff --git a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/security/WSSecurityTest.java b/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/security/WSSecurityTest.java deleted file mode 100644 index 7e95dbb..0000000 --- a/camel/servicemix-camel/src/test/java/org/apache/servicemix/camel/nmr/ws/security/WSSecurityTest.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * 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. - */ -package org.apache.servicemix.camel.nmr.ws.security; - -import java.util.logging.Logger; - -import org.apache.camel.CamelContext; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.spring.SpringCamelContext; -import org.apache.camel.test.CamelTestSupport; -import org.apache.cxf.Bus; -import org.apache.cxf.BusFactory; -import org.apache.cxf.bus.spring.SpringBusFactory; -import org.apache.cxf.common.logging.LogUtils; -import org.apache.cxf.endpoint.ServerImpl; -import org.apache.cxf.interceptor.LoggingInInterceptor; -import org.apache.cxf.interceptor.LoggingOutInterceptor; -import org.apache.hello_world_soap_http.Greeter; -import org.apache.servicemix.camel.nmr.ServiceMixComponent; -import org.apache.servicemix.nmr.api.NMR; -import org.apache.servicemix.nmr.core.ServiceMix; -import org.springframework.context.support.AbstractXmlApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -public class WSSecurityTest extends CamelTestSupport { - - private static final Logger LOG = LogUtils.getL7dLogger(WSSecurityTest.class); - - private static final java.net.URL WSDL_LOC; - static { - java.net.URL tmp = null; - try { - tmp = WSSecurityTest.class.getClassLoader().getResource( - "org/apache/servicemix/camel/ws/security/hello_world.wsdl" - ); - } catch (final Exception e) { - e.printStackTrace(); - } - WSDL_LOC = tmp; - } - - - protected static final String SERVICE_ADDRESS = "local://smx/hello_world"; - - - protected AbstractXmlApplicationContext applicationContext; - - - private ServerImpl server; - private CamelContext camelContext; - private ServiceMixComponent smxComponent; - private NMR nmr; - - @Override - protected void setUp() throws Exception { - applicationContext = createApplicationContext(); - super.setUp(); - startService(); - - } - - - - protected void startService() { - Object implementor = new GreeterImpl(); - javax.xml.ws.Endpoint.publish(SERVICE_ADDRESS, implementor); - - } - - @Override - protected void tearDown() throws Exception { - if (applicationContext != null) { - applicationContext.destroy(); - } - if (server != null) { - server.stop(); - } - super.tearDown(); - } - - protected RouteBuilder createRouteBuilder() { - return new RouteBuilder() { - public void configure() { - from("cxf:bean:routerEndpoint").to("smx:testEndpoint"); - from("smx:testEndpoint").to("cxf:bean:serviceEndpoint"); - } - }; - } - - protected CamelContext createCamelContext() throws Exception { - camelContext = SpringCamelContext.springCamelContext(applicationContext); - - smxComponent = new ServiceMixComponent(); - nmr = new ServiceMix(); - ((ServiceMix)nmr).init(); - smxComponent.setNmr(nmr); - camelContext.addComponent("smx", smxComponent); - return camelContext; - } - - protected ClassPathXmlApplicationContext createApplicationContext() { - return new ClassPathXmlApplicationContext("org/apache/servicemix/camel/ws/security/server.xml"); - } - - public void testTimestampSignEncrypt() { - LOG.info("test security"); - Bus bus = new SpringBusFactory().createBus( - "org/apache/servicemix/camel/ws/security/client.xml"); - BusFactory.setDefaultBus(bus); - LoggingInInterceptor in = new LoggingInInterceptor(); - bus.getInInterceptors().add(in); - bus.getInFaultInterceptors().add(in); - LoggingOutInterceptor out = new LoggingOutInterceptor(); - bus.getOutInterceptors().add(out); - bus.getOutFaultInterceptors().add(out); - final javax.xml.ws.Service svc = javax.xml.ws.Service.create(WSDL_LOC, - new javax.xml.namespace.QName( - "http://apache.org/hello_world_soap_http", - "SOAPServiceWSSecurity")); - final Greeter greeter = svc.getPort(new javax.xml.namespace.QName( - "http://apache.org/hello_world_soap_http", - "TimestampSignEncrypt"), Greeter.class); - String ret = greeter.sayHi(); - assertEquals(ret, "Bonjour"); - ret = greeter.greetMe("ffang"); - assertEquals(ret, "Hello ffang"); - } - -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/camel/servicemix-camel/src/test/resources/log4j.properties ---------------------------------------------------------------------- diff --git a/camel/servicemix-camel/src/test/resources/log4j.properties b/camel/servicemix-camel/src/test/resources/log4j.properties deleted file mode 100644 index db2051e..0000000 --- a/camel/servicemix-camel/src/test/resources/log4j.properties +++ /dev/null @@ -1,37 +0,0 @@ -# -# 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. -# - -# -# The logging properties used during tests.. -# -log4j.rootLogger=INFO, out, stdout - -# Separate loggers for Camel and ServiceMix to reduce lock contention -log4j.org.apache.camel=INFO, out -#log4j.org.apache.servicemix=DEBUG,out - -# CONSOLE appender not used by default -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n - -# File appender -log4j.appender.out=org.apache.log4j.FileAppender -log4j.appender.out.layout=org.apache.log4j.PatternLayout -log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n -log4j.appender.out.file=target/servicemix-test.log -log4j.appender.out.append=true http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/camel/servicemix-camel/src/test/resources/org/apache/servicemix/camel/spring/CxfMessageBeans.xml ---------------------------------------------------------------------- diff --git a/camel/servicemix-camel/src/test/resources/org/apache/servicemix/camel/spring/CxfMessageBeans.xml b/camel/servicemix-camel/src/test/resources/org/apache/servicemix/camel/spring/CxfMessageBeans.xml deleted file mode 100644 index 4099665..0000000 --- a/camel/servicemix-camel/src/test/resources/org/apache/servicemix/camel/spring/CxfMessageBeans.xml +++ /dev/null @@ -1,57 +0,0 @@ -<?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. ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:cxf="http://camel.apache.org/schema/cxf" - xmlns:camel="http://camel.apache.org/schema/spring" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd - http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd - http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd - "> - - - <cxf:cxfEndpoint id="routerEndpoint" address="http://localhost:8192/PersonService/" - serviceClass="org.apache.servicemix.samples.wsdl_first.Person" - endpointName="person:soap" - serviceName="person:PersonService" - xmlns:person="http://servicemix.apache.org/samples/wsdl-first"/> - - - <cxf:cxfEndpoint id="serviceEndpoint" address="http://localhost:19000/PersonService/" - serviceClass="org.apache.servicemix.samples.wsdl_first.Person" - endpointName="person:soap" - serviceName="person:PersonService" - xmlns:person="http://servicemix.apache.org/samples/wsdl-first"/> - - <camelContext xmlns="http://camel.apache.org/schema/spring"> - <route> - <from uri="cxf:bean:routerEndpoint?dataFormat=MESSAGE"/> - <to uri="smx:bean:testEndpoint"/> - </route> - - <route> - <from uri="smx:bean:testEndpoint"/> - <to uri="cxf:bean:serviceEndpoint?dataFormat=MESSAGE"/> - </route> - - </camelContext> - - <bean id="org.apache.servicemix.nmr.api.NMR" class="org.apache.servicemix.nmr.core.ServiceMix" init-method="init" /> - -</beans> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/camel/servicemix-camel/src/test/resources/org/apache/servicemix/camel/spring/DummyBean.xml ---------------------------------------------------------------------- diff --git a/camel/servicemix-camel/src/test/resources/org/apache/servicemix/camel/spring/DummyBean.xml b/camel/servicemix-camel/src/test/resources/org/apache/servicemix/camel/spring/DummyBean.xml deleted file mode 100644 index 475dfa3..0000000 --- a/camel/servicemix-camel/src/test/resources/org/apache/servicemix/camel/spring/DummyBean.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?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. ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd - "> - - - - <bean id="org.apache.servicemix.nmr.api.NMR" class="org.apache.servicemix.nmr.core.ServiceMix" init-method="init" /> - -</beans> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/camel/servicemix-camel/src/test/resources/org/apache/servicemix/camel/spring/EndpointBeans.xml ---------------------------------------------------------------------- diff --git a/camel/servicemix-camel/src/test/resources/org/apache/servicemix/camel/spring/EndpointBeans.xml b/camel/servicemix-camel/src/test/resources/org/apache/servicemix/camel/spring/EndpointBeans.xml deleted file mode 100644 index 92af3a2..0000000 --- a/camel/servicemix-camel/src/test/resources/org/apache/servicemix/camel/spring/EndpointBeans.xml +++ /dev/null @@ -1,49 +0,0 @@ -<?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. ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:cxf="http://camel.apache.org/schema/cxf" - xmlns:camel="http://camel.apache.org/schema/spring" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd - http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd - http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd - "> - - - <cxf:cxfEndpoint id="routerEndpoint" address="http://localhost:19000/router" - serviceClass="org.apache.servicemix.camel.nmr.HelloService"> - <cxf:properties> - <entry key="setDefaultBus" value="true"/> - </cxf:properties> - </cxf:cxfEndpoint> - - - <cxf:cxfEndpoint id="serviceEndpoint" address="local://smx/helloworld" - serviceClass="org.apache.servicemix.camel.nmr.HelloService"> - <cxf:properties> - <entry key="setDefaultBus" value="true"/> - </cxf:properties> - </cxf:cxfEndpoint> - - <camel:camelContext> - </camel:camelContext> - - <bean id="org.apache.servicemix.nmr.api.NMR" class="org.apache.servicemix.nmr.core.ServiceMix" init-method="init" /> - -</beans> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/camel/servicemix-camel/src/test/resources/org/apache/servicemix/camel/spring/mtom.xml ---------------------------------------------------------------------- diff --git a/camel/servicemix-camel/src/test/resources/org/apache/servicemix/camel/spring/mtom.xml b/camel/servicemix-camel/src/test/resources/org/apache/servicemix/camel/spring/mtom.xml deleted file mode 100644 index cc532dc..0000000 --- a/camel/servicemix-camel/src/test/resources/org/apache/servicemix/camel/spring/mtom.xml +++ /dev/null @@ -1,51 +0,0 @@ -<?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. ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:cxf="http://camel.apache.org/schema/cxf" - xmlns:mtom="http://cxf.apache.org/mime" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd - http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd - "> - - - <cxf:cxfEndpoint id="routerEndpoint" - address="http://localhost:9036/mime-test" - serviceClass="org.apache.cxf.mime.TestMtom" - wsdlURL="/wsdl/mtom_xop.wsdl" - serviceName="mtom:TestMtomService"> - <cxf:properties> - <entry key="setDefaultBus" value="true"/> - </cxf:properties> - </cxf:cxfEndpoint> - - <cxf:cxfEndpoint id="serviceEndpoint" - address="local://smx/attachment" - serviceClass="org.apache.cxf.mime.TestMtom" - wsdlURL="/wsdl/mtom_xop.wsdl" - serviceName="mtom:TestMtomService" - transportId="http://cxf.apache.org/transports/local"> - <cxf:properties> - <entry key="setDefaultBus" value="true"/> - </cxf:properties> - </cxf:cxfEndpoint> - - <bean id="org.apache.servicemix.nmr.api.NMR" class="org.apache.servicemix.nmr.core.ServiceMix" init-method="init" /> - -</beans>
