You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/02/21 08:28:18 UTC

[1/4] camel git commit: CAMEL-8162- UT to invalidate the issue.

Repository: camel
Updated Branches:
  refs/heads/master eb3f69493 -> 0872f9118


CAMEL-8162- UT to invalidate the issue.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b1c57662
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b1c57662
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b1c57662

Branch: refs/heads/master
Commit: b1c5766251d9818040b5cfb5de7608e41cfa710c
Parents: b413617
Author: onders86 <on...@gmail.com>
Authored: Mon Feb 20 15:28:45 2017 +0300
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Feb 21 09:22:35 2017 +0100

----------------------------------------------------------------------
 .../javacrumbs/calc/model/ObjectFactory.java    |  65 +++++++++++
 .../net/javacrumbs/calc/model/PlusRequest.java  |  97 +++++++++++++++++
 .../net/javacrumbs/calc/model/PlusResponse.java |  78 ++++++++++++++
 .../net/javacrumbs/calc/model/package-info.java |  26 +++++
 .../ProducerWss4JSecurityHeaderTest.java        | 107 +++++++++++++++++++
 ...ducerWss4JSecurityHeaderTestInterceptor.java |  44 ++++++++
 .../ProducerWss4JSecurityHeaderTest-context.xml |  80 ++++++++++++++
 .../src/test/resources/xsd/calc.xsd             |  21 ++++
 8 files changed, 518 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b1c57662/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/ObjectFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/ObjectFactory.java b/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/ObjectFactory.java
new file mode 100644
index 0000000..2df1574
--- /dev/null
+++ b/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/ObjectFactory.java
@@ -0,0 +1,65 @@
+/**
+ * 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.
+ */
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) 
+// Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2017.02.12 at 12:58:35 AM EET 
+//
+
+
+package net.javacrumbs.calc.model;
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+
+/**
+ * This object contains factory methods for each 
+ * Java content interface and Java element interface 
+ * generated in the net.javacrumbs.calc.model package. 
+ * An ObjectFactory allows you to programatically 
+ * construct new instances of the Java representation 
+ * for XML content. The Java representation of XML 
+ * content can consist of schema derived interfaces 
+ * and classes representing the binding of schema 
+ * type definitions, element declarations and model 
+ * groups.  Factory methods for each of these are 
+ * provided in this class.
+ * 
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+
+  /**
+   * Create a new ObjectFactory that can be used to create new instances of 
+   * schema derived classes for package: net.javacrumbs.calc.model
+   * 
+   */
+  public ObjectFactory() {
+  }
+
+  public PlusResponse createPlusResponse() {
+    return new PlusResponse();
+  }
+
+  public PlusRequest createPlusRequest() {
+    return new PlusRequest();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/b1c57662/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/PlusRequest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/PlusRequest.java b/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/PlusRequest.java
new file mode 100644
index 0000000..2d6426e
--- /dev/null
+++ b/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/PlusRequest.java
@@ -0,0 +1,97 @@
+/**
+ * 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.
+ */
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) 
+// Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2017.02.12 at 12:58:35 AM EET 
+//
+
+
+package net.javacrumbs.calc.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="a" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *         &lt;element name="b" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "a",
+    "b"
+    })
+@XmlRootElement(name = "plusRequest")
+public class PlusRequest {
+
+  protected int a;
+  protected int b;
+
+  /**
+   * Gets the value of the a property.
+   * 
+   */
+  public int getA() {
+    return a;
+  }
+
+  /**
+   * Sets the value of the a property.
+   * 
+   */
+  public void setA(int value) {
+    this.a = value;
+  }
+
+  /**
+   * Gets the value of the b property.
+   * 
+   */
+  public int getB() {
+    return b;
+  }
+
+  /**
+   * Sets the value of the b property.
+   * 
+   */
+  public void setB(int value) {
+    this.b = value;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/b1c57662/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/PlusResponse.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/PlusResponse.java b/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/PlusResponse.java
new file mode 100644
index 0000000..11a6a5e
--- /dev/null
+++ b/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/PlusResponse.java
@@ -0,0 +1,78 @@
+//
+/**
+ * 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.
+ */
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) 
+// Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2017.02.12 at 12:58:35 AM EET 
+//
+
+
+package net.javacrumbs.calc.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="result" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "result"
+    })
+@XmlRootElement(name = "plusResponse")
+public class PlusResponse {
+
+  protected int result;
+
+  /**
+   * Gets the value of the result property.
+   * 
+   */
+  public int getResult() {
+    return result;
+  }
+
+  /**
+   * Sets the value of the result property.
+   * 
+   */
+  public void setResult(int value) {
+    this.result = value;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/b1c57662/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/package-info.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/package-info.java b/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/package-info.java
new file mode 100644
index 0000000..04ca6cb
--- /dev/null
+++ b/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/package-info.java
@@ -0,0 +1,26 @@
+/**
+ * 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.
+ */
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) 
+// Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2017.02.12 at 12:58:35 AM EET 
+//
+
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://javacrumbs.net/calc", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package net.javacrumbs.calc.model;

http://git-wip-us.apache.org/repos/asf/camel/blob/b1c57662/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest.java b/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest.java
new file mode 100644
index 0000000..6e6c724
--- /dev/null
+++ b/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest.java
@@ -0,0 +1,107 @@
+/**
+ * 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.camel.component.spring.ws.security;
+
+import net.javacrumbs.calc.model.PlusRequest;
+import net.javacrumbs.calc.model.PlusResponse;
+
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.test.spring.CamelSpringTestSupport;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.springframework.ws.client.core.WebServiceTemplate;
+import org.springframework.ws.client.support.interceptor.ClientInterceptor;
+import org.springframework.ws.soap.security.wss4j2.Wss4jSecurityInterceptor;
+
+@Ignore("run manually since it requires running sample"
+        + " secured ws on j2ee-compliant application server")
+public class ProducerWss4JSecurityHeaderTest extends CamelSpringTestSupport {
+
+  @Produce
+  private ProducerTemplate template;
+
+  private WebServiceTemplate webServiceTemplate;
+  
+  @Override
+  public void setUp() throws Exception {
+    super.setUp();
+    webServiceTemplate = applicationContext.getBean("webServiceTemplate", WebServiceTemplate.class);
+  }
+
+  @Test
+  public void testResponseUsingWss4jSampleInterceptorWithoutHeadersRemoved() throws Exception {
+
+    setRemoveHeaders(false);
+
+    PlusResponse result = createSampleRequestResponsePair();
+    
+    assertNotNull(result);
+    assertEquals(3, result.getResult());
+    
+    assertTrue(ProducerWss4JSecurityHeaderTestInterceptor.isX509DataPresent);
+
+  }
+
+  @Test
+  public void testResponseUsingWss4jSampleInterceptorWithHeadersRemoved() throws Exception {
+
+    setRemoveHeaders(true);
+
+    PlusResponse result = createSampleRequestResponsePair();
+
+    assertNotNull(result);
+    assertEquals(3, result.getResult());
+
+    assertTrue(ProducerWss4JSecurityHeaderTestInterceptor.isX509DataPresent);
+
+  }
+
+  private PlusResponse createSampleRequestResponsePair() {
+    PlusRequest request = new PlusRequest();
+    request.setA(new Integer(1));
+    request.setB(new Integer(2));
+
+    PlusResponse result = (PlusResponse) template.requestBody("direct:testHeader", request);
+
+    return result;
+  }
+
+  private void setRemoveHeaders(boolean isRemoved) {
+    ClientInterceptor[] clientInterceptors = webServiceTemplate.getInterceptors();
+
+    for (int i = 0; i < clientInterceptors.length; i++) {
+      if (clientInterceptors[i] instanceof Wss4jSecurityInterceptor) {
+        Wss4jSecurityInterceptor wss4jSampleInterceptor 
+                                     = (Wss4jSecurityInterceptor) clientInterceptors[i];
+        wss4jSampleInterceptor.setRemoveSecurityHeader(isRemoved);
+      }
+    }
+  }
+
+  @Override
+  protected AbstractXmlApplicationContext createApplicationContext() {
+    return new ClassPathXmlApplicationContext(
+      "org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest-context.xml");
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/b1c57662/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTestInterceptor.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTestInterceptor.java b/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTestInterceptor.java
new file mode 100644
index 0000000..33a02a3
--- /dev/null
+++ b/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTestInterceptor.java
@@ -0,0 +1,44 @@
+/**
+ * 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.camel.component.spring.ws.security;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import org.springframework.ws.context.MessageContext;
+import org.springframework.ws.soap.SoapMessage;
+import org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor;
+
+public class ProducerWss4JSecurityHeaderTestInterceptor extends Wss4jSecurityInterceptor{
+
+  public static boolean isX509DataPresent = false;
+  
+  protected void validateMessage(SoapMessage soapMessage, MessageContext messageContext) {
+    ByteArrayOutputStream out = new ByteArrayOutputStream();
+    try {
+      soapMessage.writeTo(out);
+    } catch (IOException exception) {
+      // do nothing - because this is a sample class
+    }
+    String strMsg = new String(out.toByteArray());
+      
+    isX509DataPresent = strMsg.contains("X509Data");
+    super.validateMessage(soapMessage, messageContext);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/b1c57662/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest-context.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest-context.xml b/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest-context.xml
new file mode 100644
index 0000000..a8be027
--- /dev/null
+++ b/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest-context.xml
@@ -0,0 +1,80 @@
+<?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.xsd
+         http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
+
+  <!-- ============================== -->
+  <!-- Camel routes -->
+  <!-- ============================== -->
+
+  <camelContext xmlns="http://camel.apache.org/schema/spring">
+    <dataFormats>
+      <jaxb id="jaxb" contextPath="net.javacrumbs.calc.model" />
+    </dataFormats>
+    <route>
+      <from uri="direct:testHeader" />
+      <to
+        uri="spring-ws:uri:http://localhost:8080/simple-server-test/soap/calc?webServiceTemplate=#webServiceTemplate&amp;endpointMapping=#endpointMapping" />
+      <!-- <convertBodyTo type="java.lang.String"/> -->
+      <unmarshal ref="jaxb" />
+    </route>
+  </camelContext>
+
+  <bean id="endpointMapping"
+    class="org.apache.camel.component.spring.ws.bean.CamelEndpointMapping" />
+
+  <!-- ============================== -->
+  <!-- Supporting Spring-WS beans -->
+  <!-- ============================== -->
+
+  <bean id="webServiceTemplate" class="org.springframework.ws.client.core.WebServiceTemplate">
+    <property name="defaultUri"
+      value="http://localhost:8080/simple-server-test/soap/calc" />
+    <property name="interceptors">
+      <list>
+        <bean id="wsClientSecurityInterceptor"
+          class="org.apache.camel.component.spring.ws.security.ProducerWss4JSecurityHeaderTestInterceptor">
+          <property name="securementActions" value="Timestamp Signature Encrypt" />
+          <!-- Key alias for signature -->
+          <property name="securementUsername" value="client" />
+          <property name="securementPassword" value="onder123" />
+          <property name="securementSignatureCrypto" ref="clientCrypto" />
+          <property name="securementEncryptionCrypto" ref="clientCrypto" />
+          <property name="securementEncryptionParts" value="{Content}{http://javacrumbs.net/calc}a" />
+          <!-- Key alias for encryption -->
+          <property name="securementEncryptionUser" value="server" />
+
+          <!-- Validation config -->
+          <property name="validationActions" value="Signature" />
+          <property name="validationSignatureCrypto" ref="clientCrypto" />
+        </bean>
+      </list>
+    </property>
+    <property name="marshaller" ref="marshaller" />
+    <property name="unmarshaller" ref="marshaller" />
+  </bean>
+
+  <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
+    <property name="contextPath" value="net.javacrumbs.calc.model" />
+  </bean>
+
+
+  <bean id="clientCrypto"
+    class="org.springframework.ws.soap.security.wss4j.support.CryptoFactoryBean">
+    <property name="keyStorePassword" value="onder123" />
+    <property name="keyStoreLocation" value="classpath:security/client.jks" />
+  </bean>
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/b1c57662/components/camel-spring-ws/src/test/resources/xsd/calc.xsd
----------------------------------------------------------------------
diff --git a/components/camel-spring-ws/src/test/resources/xsd/calc.xsd b/components/camel-spring-ws/src/test/resources/xsd/calc.xsd
new file mode 100644
index 0000000..f033d50
--- /dev/null
+++ b/components/camel-spring-ws/src/test/resources/xsd/calc.xsd
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://javacrumbs.net/calc"
+	xmlns:tns="http://javacrumbs.net/calc" elementFormDefault="qualified">
+
+	<element name="plusRequest">
+		<complexType>
+			<sequence>
+				<element name="a" type="int" />
+				<element name="b" type="int" />
+			</sequence>
+		</complexType>
+	</element>
+
+	<element name="plusResponse">
+		<complexType>
+			<sequence>
+				<element name="result" type="int" />
+			</sequence>
+		</complexType>
+	</element>
+</schema>
\ No newline at end of file


[4/4] camel git commit: Fixed stuff. This closes #1478

Posted by da...@apache.org.
Fixed stuff. This closes #1478


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0872f911
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0872f911
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0872f911

Branch: refs/heads/master
Commit: 0872f9118b4956cc5351f0289e9982ff83db8459
Parents: 2fd9719
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Feb 21 09:27:43 2017 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Feb 21 09:27:43 2017 +0100

----------------------------------------------------------------------
 components/camel-spring-ws/pom.xml              | 13 ++--
 .../ProducerWss4JSecurityHeaderTest-context.xml | 77 ++++++++++----------
 2 files changed, 47 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/0872f911/components/camel-spring-ws/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring-ws/pom.xml b/components/camel-spring-ws/pom.xml
index 96bd68d..106bbd7 100644
--- a/components/camel-spring-ws/pom.xml
+++ b/components/camel-spring-ws/pom.xml
@@ -67,19 +67,20 @@
       <artifactId>spring-ws-support</artifactId>
       <version>${spring-ws-version}</version>
     </dependency>
+
+    <!-- test dependencies -->
     <dependency>
       <groupId>org.springframework.ws</groupId>
       <artifactId>spring-ws-security</artifactId>
       <version>${spring-ws-version}</version>
+      <scope>test</scope>
       <exclusions>
-            <exclusion>
-                <groupId>xalan</groupId>
-                <artifactId>xalan</artifactId>
-            </exclusion>
+        <exclusion>
+          <groupId>xalan</groupId>
+          <artifactId>xalan</artifactId>
+        </exclusion>
       </exclusions>
     </dependency>
-
-    <!-- test dependencies -->
     <dependency>
       <groupId>org.eclipse.jetty</groupId>
       <artifactId>jetty-server</artifactId>

http://git-wip-us.apache.org/repos/asf/camel/blob/0872f911/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest-context.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest-context.xml b/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest-context.xml
index a8be027..bd308f1 100644
--- a/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest-context.xml
+++ b/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest-context.xml
@@ -1,17 +1,23 @@
 <?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. -->
+<!--
+  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="
+       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.xsd
          http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
 
@@ -21,19 +27,17 @@
 
   <camelContext xmlns="http://camel.apache.org/schema/spring">
     <dataFormats>
-      <jaxb id="jaxb" contextPath="net.javacrumbs.calc.model" />
+      <jaxb id="jaxb" contextPath="net.javacrumbs.calc.model"/>
     </dataFormats>
     <route>
-      <from uri="direct:testHeader" />
-      <to
-        uri="spring-ws:uri:http://localhost:8080/simple-server-test/soap/calc?webServiceTemplate=#webServiceTemplate&amp;endpointMapping=#endpointMapping" />
-      <!-- <convertBodyTo type="java.lang.String"/> -->
-      <unmarshal ref="jaxb" />
+      <from uri="direct:testHeader"/>
+      <to uri="spring-ws:uri:http://localhost:8080/simple-server-test/soap/calc?webServiceTemplate=#webServiceTemplate&amp;endpointMapping=#endpointMapping"/>
+      <unmarshal ref="jaxb"/>
     </route>
   </camelContext>
 
   <bean id="endpointMapping"
-    class="org.apache.camel.component.spring.ws.bean.CamelEndpointMapping" />
+        class="org.apache.camel.component.spring.ws.bean.CamelEndpointMapping"/>
 
   <!-- ============================== -->
   <!-- Supporting Spring-WS beans -->
@@ -41,40 +45,39 @@
 
   <bean id="webServiceTemplate" class="org.springframework.ws.client.core.WebServiceTemplate">
     <property name="defaultUri"
-      value="http://localhost:8080/simple-server-test/soap/calc" />
+              value="http://localhost:8080/simple-server-test/soap/calc"/>
     <property name="interceptors">
       <list>
         <bean id="wsClientSecurityInterceptor"
-          class="org.apache.camel.component.spring.ws.security.ProducerWss4JSecurityHeaderTestInterceptor">
-          <property name="securementActions" value="Timestamp Signature Encrypt" />
+              class="org.apache.camel.component.spring.ws.security.ProducerWss4JSecurityHeaderTestInterceptor">
+          <property name="securementActions" value="Timestamp Signature Encrypt"/>
           <!-- Key alias for signature -->
-          <property name="securementUsername" value="client" />
-          <property name="securementPassword" value="onder123" />
-          <property name="securementSignatureCrypto" ref="clientCrypto" />
-          <property name="securementEncryptionCrypto" ref="clientCrypto" />
-          <property name="securementEncryptionParts" value="{Content}{http://javacrumbs.net/calc}a" />
+          <property name="securementUsername" value="client"/>
+          <property name="securementPassword" value="onder123"/>
+          <property name="securementSignatureCrypto" ref="clientCrypto"/>
+          <property name="securementEncryptionCrypto" ref="clientCrypto"/>
+          <property name="securementEncryptionParts" value="{Content}{http://javacrumbs.net/calc}a"/>
           <!-- Key alias for encryption -->
-          <property name="securementEncryptionUser" value="server" />
+          <property name="securementEncryptionUser" value="server"/>
 
           <!-- Validation config -->
-          <property name="validationActions" value="Signature" />
-          <property name="validationSignatureCrypto" ref="clientCrypto" />
+          <property name="validationActions" value="Signature"/>
+          <property name="validationSignatureCrypto" ref="clientCrypto"/>
         </bean>
       </list>
     </property>
-    <property name="marshaller" ref="marshaller" />
-    <property name="unmarshaller" ref="marshaller" />
+    <property name="marshaller" ref="marshaller"/>
+    <property name="unmarshaller" ref="marshaller"/>
   </bean>
 
   <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
-    <property name="contextPath" value="net.javacrumbs.calc.model" />
+    <property name="contextPath" value="net.javacrumbs.calc.model"/>
   </bean>
 
-
   <bean id="clientCrypto"
-    class="org.springframework.ws.soap.security.wss4j.support.CryptoFactoryBean">
-    <property name="keyStorePassword" value="onder123" />
-    <property name="keyStoreLocation" value="classpath:security/client.jks" />
+        class="org.springframework.ws.soap.security.wss4j.support.CryptoFactoryBean">
+    <property name="keyStorePassword" value="onder123"/>
+    <property name="keyStoreLocation" value="classpath:security/client.jks"/>
   </bean>
 
 </beans>
\ No newline at end of file


[3/4] camel git commit: CAMEL-8162 - UTs to invalidate the issue with cs fixes

Posted by da...@apache.org.
CAMEL-8162 - UTs to invalidate the issue with cs fixes


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2fd97199
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2fd97199
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2fd97199

Branch: refs/heads/master
Commit: 2fd971997ebb4cb35f655d49e4eb10d620d3dafa
Parents: b1c5766
Author: onders86 <on...@gmail.com>
Authored: Mon Feb 20 16:19:07 2017 +0300
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Feb 21 09:23:01 2017 +0100

----------------------------------------------------------------------
 components/camel-spring-ws/pom.xml              |  11 ++
 .../javacrumbs/calc/model/ObjectFactory.java    |  26 ++--
 .../net/javacrumbs/calc/model/PlusRequest.java  |  66 +++++-----
 .../net/javacrumbs/calc/model/PlusResponse.java |  35 +++---
 .../ProducerWss4JSecurityHeaderTest.java        | 126 +++++++++----------
 ...ducerWss4JSecurityHeaderTestInterceptor.java |  28 ++---
 .../src/test/resources/log4j2.properties        |   1 +
 7 files changed, 152 insertions(+), 141 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2fd97199/components/camel-spring-ws/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring-ws/pom.xml b/components/camel-spring-ws/pom.xml
index 0f5ba65..96bd68d 100644
--- a/components/camel-spring-ws/pom.xml
+++ b/components/camel-spring-ws/pom.xml
@@ -67,6 +67,17 @@
       <artifactId>spring-ws-support</artifactId>
       <version>${spring-ws-version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.springframework.ws</groupId>
+      <artifactId>spring-ws-security</artifactId>
+      <version>${spring-ws-version}</version>
+      <exclusions>
+            <exclusion>
+                <groupId>xalan</groupId>
+                <artifactId>xalan</artifactId>
+            </exclusion>
+      </exclusions>
+    </dependency>
 
     <!-- test dependencies -->
     <dependency>

http://git-wip-us.apache.org/repos/asf/camel/blob/2fd97199/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/ObjectFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/ObjectFactory.java b/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/ObjectFactory.java
index 2df1574..39ee886 100644
--- a/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/ObjectFactory.java
+++ b/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/ObjectFactory.java
@@ -46,20 +46,20 @@ import javax.xml.bind.annotation.XmlRegistry;
 public class ObjectFactory {
 
 
-  /**
-   * Create a new ObjectFactory that can be used to create new instances of 
-   * schema derived classes for package: net.javacrumbs.calc.model
-   * 
-   */
-  public ObjectFactory() {
-  }
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of 
+     * schema derived classes for package: net.javacrumbs.calc.model
+     * 
+     */
+    public ObjectFactory() {
+    }
 
-  public PlusResponse createPlusResponse() {
-    return new PlusResponse();
-  }
+    public PlusResponse createPlusResponse() {
+        return new PlusResponse();
+    }
 
-  public PlusRequest createPlusRequest() {
-    return new PlusRequest();
-  }
+    public PlusRequest createPlusRequest() {
+        return new PlusRequest();
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/2fd97199/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/PlusRequest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/PlusRequest.java b/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/PlusRequest.java
index 2d6426e..57ade88 100644
--- a/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/PlusRequest.java
+++ b/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/PlusRequest.java
@@ -59,39 +59,39 @@ import javax.xml.bind.annotation.XmlType;
 @XmlRootElement(name = "plusRequest")
 public class PlusRequest {
 
-  protected int a;
-  protected int b;
+    protected int a;
+    protected int b;
 
-  /**
-   * Gets the value of the a property.
-   * 
-   */
-  public int getA() {
-    return a;
-  }
-
-  /**
-   * Sets the value of the a property.
-   * 
-   */
-  public void setA(int value) {
-    this.a = value;
-  }
-
-  /**
-   * Gets the value of the b property.
-   * 
-   */
-  public int getB() {
-    return b;
-  }
-
-  /**
-   * Sets the value of the b property.
-   * 
-   */
-  public void setB(int value) {
-    this.b = value;
-  }
+    /**
+     * Gets the value of the a property.
+     * 
+     */
+    public int getA() {
+        return a;
+    }
+    
+    /**
+     * Sets the value of the a property.
+     * 
+     */
+    public void setA(int value) {
+        this.a = value;
+    }
+    
+    /**
+     * Gets the value of the b property.
+     * 
+     */
+    public int getB() {
+        return b;
+    }
+    
+    /**
+     * Sets the value of the b property.
+     * 
+     */
+    public void setB(int value) {
+        this.b = value;
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/2fd97199/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/PlusResponse.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/PlusResponse.java b/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/PlusResponse.java
index 11a6a5e..4c25d8d 100644
--- a/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/PlusResponse.java
+++ b/components/camel-spring-ws/src/test/java/net/javacrumbs/calc/model/PlusResponse.java
@@ -1,4 +1,3 @@
-//
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -57,22 +56,22 @@ import javax.xml.bind.annotation.XmlType;
 @XmlRootElement(name = "plusResponse")
 public class PlusResponse {
 
-  protected int result;
-
-  /**
-   * Gets the value of the result property.
-   * 
-   */
-  public int getResult() {
-    return result;
-  }
-
-  /**
-   * Sets the value of the result property.
-   * 
-   */
-  public void setResult(int value) {
-    this.result = value;
-  }
+    protected int result;
+    
+    /**
+     * Gets the value of the result property.
+     * 
+     */
+    public int getResult() {
+        return result;
+    }
+    
+    /**
+     * Sets the value of the result property.
+     * 
+     */
+    public void setResult(int value) {
+        this.result = value;
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/2fd97199/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest.java b/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest.java
index 6e6c724..671848a 100644
--- a/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest.java
+++ b/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest.java
@@ -37,71 +37,71 @@ import org.springframework.ws.soap.security.wss4j2.Wss4jSecurityInterceptor;
         + " secured ws on j2ee-compliant application server")
 public class ProducerWss4JSecurityHeaderTest extends CamelSpringTestSupport {
 
-  @Produce
-  private ProducerTemplate template;
-
-  private WebServiceTemplate webServiceTemplate;
-  
-  @Override
-  public void setUp() throws Exception {
-    super.setUp();
-    webServiceTemplate = applicationContext.getBean("webServiceTemplate", WebServiceTemplate.class);
-  }
-
-  @Test
-  public void testResponseUsingWss4jSampleInterceptorWithoutHeadersRemoved() throws Exception {
-
-    setRemoveHeaders(false);
-
-    PlusResponse result = createSampleRequestResponsePair();
+    @Produce
+    private ProducerTemplate template;
     
-    assertNotNull(result);
-    assertEquals(3, result.getResult());
+    private WebServiceTemplate webServiceTemplate;
     
-    assertTrue(ProducerWss4JSecurityHeaderTestInterceptor.isX509DataPresent);
-
-  }
-
-  @Test
-  public void testResponseUsingWss4jSampleInterceptorWithHeadersRemoved() throws Exception {
-
-    setRemoveHeaders(true);
-
-    PlusResponse result = createSampleRequestResponsePair();
-
-    assertNotNull(result);
-    assertEquals(3, result.getResult());
-
-    assertTrue(ProducerWss4JSecurityHeaderTestInterceptor.isX509DataPresent);
-
-  }
-
-  private PlusResponse createSampleRequestResponsePair() {
-    PlusRequest request = new PlusRequest();
-    request.setA(new Integer(1));
-    request.setB(new Integer(2));
-
-    PlusResponse result = (PlusResponse) template.requestBody("direct:testHeader", request);
-
-    return result;
-  }
-
-  private void setRemoveHeaders(boolean isRemoved) {
-    ClientInterceptor[] clientInterceptors = webServiceTemplate.getInterceptors();
-
-    for (int i = 0; i < clientInterceptors.length; i++) {
-      if (clientInterceptors[i] instanceof Wss4jSecurityInterceptor) {
-        Wss4jSecurityInterceptor wss4jSampleInterceptor 
-                                     = (Wss4jSecurityInterceptor) clientInterceptors[i];
-        wss4jSampleInterceptor.setRemoveSecurityHeader(isRemoved);
-      }
+    @Override
+    public void setUp() throws Exception {
+        super.setUp();
+        webServiceTemplate = applicationContext.getBean("webServiceTemplate", WebServiceTemplate.class);
+    }
+    
+    @Test
+    public void testResponseUsingWss4jSampleInterceptorWithoutHeadersRemoved() throws Exception {
+    
+        setRemoveHeaders(false);
+         
+        PlusResponse result = createSampleRequestResponsePair();
+         
+        assertNotNull(result);
+        assertEquals(3, result.getResult());
+         
+        assertTrue(ProducerWss4JSecurityHeaderTestInterceptor.isX509DataPresent);
+    
+    }
+    
+    @Test
+    public void testResponseUsingWss4jSampleInterceptorWithHeadersRemoved() throws Exception {
+        
+        setRemoveHeaders(true);
+        
+        PlusResponse result = createSampleRequestResponsePair();
+        
+        assertNotNull(result);
+        assertEquals(3, result.getResult());
+        
+        assertTrue(ProducerWss4JSecurityHeaderTestInterceptor.isX509DataPresent);
+    
+    }
+    
+    private PlusResponse createSampleRequestResponsePair() {
+        PlusRequest request = new PlusRequest();
+        request.setA(new Integer(1));
+        request.setB(new Integer(2));
+        
+        PlusResponse result = (PlusResponse) template.requestBody("direct:testHeader", request);
+        
+        return result;
+    }
+    
+    private void setRemoveHeaders(boolean isRemoved) {
+        ClientInterceptor[] clientInterceptors = webServiceTemplate.getInterceptors();
+        
+        for (int i = 0; i < clientInterceptors.length; i++) {
+            if (clientInterceptors[i] instanceof Wss4jSecurityInterceptor) {
+                Wss4jSecurityInterceptor wss4jSampleInterceptor 
+                                           = (Wss4jSecurityInterceptor) clientInterceptors[i];
+                wss4jSampleInterceptor.setRemoveSecurityHeader(isRemoved);
+            }
+        }
+    }
+    
+    @Override
+    protected AbstractXmlApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext(
+          "org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest-context.xml");
     }
-  }
-
-  @Override
-  protected AbstractXmlApplicationContext createApplicationContext() {
-    return new ClassPathXmlApplicationContext(
-      "org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTest-context.xml");
-  }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/2fd97199/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTestInterceptor.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTestInterceptor.java b/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTestInterceptor.java
index 33a02a3..98f146c 100644
--- a/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTestInterceptor.java
+++ b/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderTestInterceptor.java
@@ -24,21 +24,21 @@ import org.springframework.ws.context.MessageContext;
 import org.springframework.ws.soap.SoapMessage;
 import org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor;
 
-public class ProducerWss4JSecurityHeaderTestInterceptor extends Wss4jSecurityInterceptor{
+public class ProducerWss4JSecurityHeaderTestInterceptor extends Wss4jSecurityInterceptor {
 
-  public static boolean isX509DataPresent = false;
-  
-  protected void validateMessage(SoapMessage soapMessage, MessageContext messageContext) {
-    ByteArrayOutputStream out = new ByteArrayOutputStream();
-    try {
-      soapMessage.writeTo(out);
-    } catch (IOException exception) {
-      // do nothing - because this is a sample class
+    public static boolean isX509DataPresent;
+    
+    protected void validateMessage(SoapMessage soapMessage, MessageContext messageContext) {
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        try {
+            soapMessage.writeTo(out);
+        } catch (IOException exception) {
+          // do nothing - because this is a sample class
+        }
+        String strMsg = new String(out.toByteArray());
+          
+        isX509DataPresent = strMsg.contains("X509Data");
+        super.validateMessage(soapMessage, messageContext);
     }
-    String strMsg = new String(out.toByteArray());
-      
-    isX509DataPresent = strMsg.contains("X509Data");
-    super.validateMessage(soapMessage, messageContext);
-  }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/2fd97199/components/camel-spring-ws/src/test/resources/log4j2.properties
----------------------------------------------------------------------
diff --git a/components/camel-spring-ws/src/test/resources/log4j2.properties b/components/camel-spring-ws/src/test/resources/log4j2.properties
index aa2649d..453a261 100644
--- a/components/camel-spring-ws/src/test/resources/log4j2.properties
+++ b/components/camel-spring-ws/src/test/resources/log4j2.properties
@@ -25,4 +25,5 @@ appender.out.name = out
 appender.out.layout.type = PatternLayout
 appender.out.layout.pattern = [%30.30t] %-30.30c{1} %-5p %m%n
 rootLogger.level = INFO
+org.springframework.ws.client.MessageTracing=DEBUG
 rootLogger.appenderRef.file.ref = file


[2/4] camel git commit: test certificates created with the help of keytool

Posted by da...@apache.org.
test certificates created with the help of keytool


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b413617c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b413617c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b413617c

Branch: refs/heads/master
Commit: b413617c57dcb6cc661c633386845dbabd8d8868
Parents: eb3f694
Author: onders86 <on...@gmail.com>
Authored: Mon Feb 20 14:21:15 2017 +0300
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Feb 21 09:22:35 2017 +0100

----------------------------------------------------------------------
 .../src/test/resources/security/client.jks          | Bin 0 -> 3155 bytes
 .../src/test/resources/security/server.jks          | Bin 0 -> 3157 bytes
 2 files changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b413617c/components/camel-spring-ws/src/test/resources/security/client.jks
----------------------------------------------------------------------
diff --git a/components/camel-spring-ws/src/test/resources/security/client.jks b/components/camel-spring-ws/src/test/resources/security/client.jks
new file mode 100644
index 0000000..7748016
Binary files /dev/null and b/components/camel-spring-ws/src/test/resources/security/client.jks differ

http://git-wip-us.apache.org/repos/asf/camel/blob/b413617c/components/camel-spring-ws/src/test/resources/security/server.jks
----------------------------------------------------------------------
diff --git a/components/camel-spring-ws/src/test/resources/security/server.jks b/components/camel-spring-ws/src/test/resources/security/server.jks
new file mode 100644
index 0000000..b389530
Binary files /dev/null and b/components/camel-spring-ws/src/test/resources/security/server.jks differ