You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2018/04/19 13:38:31 UTC

[cxf] branch master updated (88bae9b -> 278d918)

This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git.


    from 88bae9b  [CXF-7715]EmptySOAPBodyTest fails on master with Java 9
     new 7aec1ef  Change OpenAPI pom name + description to differentiate from description-swagger module
     new fd178bc  Removing printStackTrace from STS code
     new a26e9fe  Upgrading Mockito to get the tests to pass with Java 10
     new e677408  Updating CryptoUtils to work with Java 10
     new a4a9341  Use JavaUtils method instead to determine JDK compatability
     new 8a1adae  More work on the samples
     new ddc5633  Updating EasyMock
     new ae0e2ba  Porting SAAJ 1.4 changes from WSS4J
     new 278d918  Using .valueOf() for Short + Byte as well

The 9 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/java/org/apache/cxf/helpers/DOMUtils.java | 31 +++++++++-----
 .../src/main/java/demo/callback/server/Server.java |  4 +-
 .../src/main/resources/callback_infoset.xml        | 18 +++++++++
 .../samples/configuration_interceptor/pom.xml      |  7 ----
 .../src/main/java/demo/stream/client/Client.java   | 11 ++++-
 .../src/main/java/demo/stream/server/Server.java   |  9 ++++-
 .../src/main/resources/client.xml                  | 40 ------------------
 .../src/main/resources/server.xml                  | 47 ----------------------
 integration/cdi/pom.xml                            |  2 +-
 parent/pom.xml                                     |  3 +-
 .../corba/runtime/CorbaObjectReaderTest.java       |  2 +-
 .../corba/runtime/CorbaObjectWriterTest.java       |  2 +-
 .../corba/types/CorbaPrimitiveHandlerTest.java     | 10 ++---
 .../org/apache/cxf/aegis/type/basic/BeanTest.java  |  4 +-
 rt/rs/description-openapi-v3/pom.xml               |  4 +-
 rt/rs/sse/pom.xml                                  |  2 +-
 .../apache/cxf/rt/security/crypto/CryptoUtils.java |  4 +-
 .../security/wss4j/PolicyBasedWss4JInOutTest.java  | 11 +----
 .../sts/token/provider/jwt/JWTTokenProvider.java   |  1 -
 .../sts/token/provider/SAMLProviderActAsTest.java  |  3 --
 systests/cdi/cdi-owb/cdi-producers-owb/pom.xml     |  4 +-
 .../org/apache/cxf/systest/jaxrs/BookServer.java   |  2 +-
 .../systest/type_test/AbstractTypeTestClient2.java | 24 +++++------
 23 files changed, 93 insertions(+), 152 deletions(-)
 delete mode 100644 distribution/src/main/release/samples/configuration_interceptor/src/main/resources/client.xml
 delete mode 100644 distribution/src/main/release/samples/configuration_interceptor/src/main/resources/server.xml

-- 
To stop receiving notification emails like this one, please contact
coheigea@apache.org.

[cxf] 02/09: Removing printStackTrace from STS code

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit fd178bcf4805ca01d77afe07b70cfe93e1bc25c9
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Thu Apr 19 09:57:27 2018 +0100

    Removing printStackTrace from STS code
---
 .../java/org/apache/cxf/sts/token/provider/jwt/JWTTokenProvider.java   | 1 -
 .../java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java  | 3 ---
 2 files changed, 4 deletions(-)

diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/JWTTokenProvider.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/JWTTokenProvider.java
index c3d1ac8..8b1d3f4 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/JWTTokenProvider.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/JWTTokenProvider.java
@@ -155,7 +155,6 @@ public class JWTTokenProvider implements TokenProvider {
             LOG.fine("JWT Token successfully created");
             return response;
         } catch (Exception e) {
-            e.printStackTrace();
             LOG.log(Level.WARNING, "", e);
             throw new STSException("Can't serialize JWT token", e, STSException.REQUEST_FAILED);
         }
diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java
index 2534489..f67bc96 100644
--- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java
+++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java
@@ -353,9 +353,6 @@ public class SAMLProviderActAsTest extends org.junit.Assert {
         assertion = new SamlAssertionWrapper(token);
         Assert.assertEquals("service-A", assertion.getSubjectName());
 
-        String tokenString = DOM2Writer.nodeToString(token);
-        System.out.println(tokenString);
-
         boolean foundBob = false;
         boolean foundTechnical = false;
         for (org.opensaml.saml.saml2.core.AttributeStatement attributeStatement

-- 
To stop receiving notification emails like this one, please contact
coheigea@apache.org.

[cxf] 03/09: Upgrading Mockito to get the tests to pass with Java 10

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit a26e9feb89ed5ba81c9ab5b336cfb78eecd34edc
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Thu Apr 19 10:07:12 2018 +0100

    Upgrading Mockito to get the tests to pass with Java 10
---
 integration/cdi/pom.xml                        | 2 +-
 parent/pom.xml                                 | 1 +
 rt/rs/sse/pom.xml                              | 2 +-
 systests/cdi/cdi-owb/cdi-producers-owb/pom.xml | 4 ++--
 4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/integration/cdi/pom.xml b/integration/cdi/pom.xml
index 5ca34e3..077a1e8 100644
--- a/integration/cdi/pom.xml
+++ b/integration/cdi/pom.xml
@@ -83,7 +83,7 @@
         <dependency>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-core</artifactId>
-            <version>2.7.14</version>
+            <version>${cxf.mockito.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
diff --git a/parent/pom.xml b/parent/pom.xml
index d956a2b..d04c3d4 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -102,6 +102,7 @@
         <cxf.log4j.version>1.2.17</cxf.log4j.version>
         <cxf.lucene.version>4.9.0</cxf.lucene.version>
         <cxf.mina.version>2.0.15</cxf.mina.version>
+        <cxf.mockito.version>2.18.0</cxf.mockito.version>
         <cxf.rxjava.version>1.3.5</cxf.rxjava.version>
         <cxf.rxjava2.version>2.1.7</cxf.rxjava2.version>
         <cxf.javax.annotation-api.version>1.3</cxf.javax.annotation-api.version>
diff --git a/rt/rs/sse/pom.xml b/rt/rs/sse/pom.xml
index 1d254f8..3da405f 100644
--- a/rt/rs/sse/pom.xml
+++ b/rt/rs/sse/pom.xml
@@ -64,7 +64,7 @@
         <dependency>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-core</artifactId>
-            <version>2.7.14</version>
+            <version>${cxf.mockito.version}</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
diff --git a/systests/cdi/cdi-owb/cdi-producers-owb/pom.xml b/systests/cdi/cdi-owb/cdi-producers-owb/pom.xml
index 60fa35d..67c8e69 100644
--- a/systests/cdi/cdi-owb/cdi-producers-owb/pom.xml
+++ b/systests/cdi/cdi-owb/cdi-producers-owb/pom.xml
@@ -48,8 +48,8 @@
         <dependency>
              <groupId>org.mockito</groupId>
              <artifactId>mockito-core</artifactId>
-             <version>2.7.14</version>
+             <version>${cxf.mockito.version}</version>
              <scope>test</scope>
         </dependency>
     </dependencies>
-</project>
\ No newline at end of file
+</project>

-- 
To stop receiving notification emails like this one, please contact
coheigea@apache.org.

[cxf] 09/09: Using .valueOf() for Short + Byte as well

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 278d9185150d743ff4b411d070b023e8758d372e
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Thu Apr 19 13:23:03 2018 +0100

    Using .valueOf() for Short + Byte as well
---
 .../corba/runtime/CorbaObjectReaderTest.java       |  2 +-
 .../corba/runtime/CorbaObjectWriterTest.java       |  2 +-
 .../corba/types/CorbaPrimitiveHandlerTest.java     | 10 ++++-----
 .../org/apache/cxf/aegis/type/basic/BeanTest.java  |  4 ++--
 .../org/apache/cxf/systest/jaxrs/BookServer.java   |  2 +-
 .../systest/type_test/AbstractTypeTestClient2.java | 24 +++++++++++-----------
 6 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/runtime/CorbaObjectReaderTest.java b/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/runtime/CorbaObjectReaderTest.java
index a36dbf0..f72c92c 100644
--- a/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/runtime/CorbaObjectReaderTest.java
+++ b/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/runtime/CorbaObjectReaderTest.java
@@ -446,7 +446,7 @@ public class CorbaObjectReaderTest extends Assert {
         reader.readException(obj);
 
         List<CorbaObjectHandler> nestedObjs = obj.getMembers();
-        assertTrue(new Short(((CorbaPrimitiveHandler)nestedObjs.get(0))
+        assertTrue(Short.valueOf(((CorbaPrimitiveHandler)nestedObjs.get(0))
                                  .getDataFromValue()).shortValue() == code);
         assertTrue(((CorbaPrimitiveHandler)nestedObjs.get(1)).getDataFromValue().equals(message));
     }
diff --git a/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/runtime/CorbaObjectWriterTest.java b/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/runtime/CorbaObjectWriterTest.java
index d77dc32..0cb0fbf 100644
--- a/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/runtime/CorbaObjectWriterTest.java
+++ b/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/runtime/CorbaObjectWriterTest.java
@@ -118,7 +118,7 @@ public class CorbaObjectWriterTest extends Assert {
         OutputStream oStream = orb.create_output_stream();
 
         CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
-        Short shortValue = new Short((short)-123);
+        Short shortValue = Short.valueOf((short)-123);
         writer.writeShort(shortValue);
 
         InputStream iStream = oStream.create_input_stream();
diff --git a/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandlerTest.java b/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandlerTest.java
index b17bff4..16603a9 100644
--- a/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandlerTest.java
+++ b/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandlerTest.java
@@ -84,10 +84,10 @@ public class CorbaPrimitiveHandlerTest extends Assert {
         assertNotNull(obj);
 
         //CXF corba maps the XML char type to a Byte so we need to provide the string data as a Byte value
-        Byte byteValue = new Byte((byte)val.charValue());
+        Byte byteValue = Byte.valueOf((byte)val.charValue());
         obj.setValueFromData(byteValue.toString());
         String result = obj.getDataFromValue();
-        Byte byteResult = new Byte(result);
+        Byte byteResult = Byte.valueOf(result);
         assertTrue(byteResult.byteValue() == byteValue.byteValue());
 
         // However, internally, we also hold the data as a character to make it easier to marshal the data
@@ -125,7 +125,7 @@ public class CorbaPrimitiveHandlerTest extends Assert {
 
     @Test
     public void testCreateCorbaOctet() {
-        Byte val = new Byte((byte)100);
+        Byte val = Byte.valueOf((byte)100);
         CorbaPrimitiveHandler obj =
             new CorbaPrimitiveHandler(new QName("octet"),
                                       CorbaConstants.NT_CORBA_OCTET,
@@ -147,7 +147,7 @@ public class CorbaPrimitiveHandlerTest extends Assert {
 
     @Test
     public void testCreateCorbaShort() {
-        Short val = new Short((short)1234);
+        Short val = Short.valueOf((short)1234);
         CorbaPrimitiveHandler obj =
             new CorbaPrimitiveHandler(new QName("short"),
                                       CorbaConstants.NT_CORBA_SHORT,
@@ -169,7 +169,7 @@ public class CorbaPrimitiveHandlerTest extends Assert {
 
     @Test
     public void testCreateCorbaUShort() {
-        Short val = new Short((short)4321);
+        Short val = Short.valueOf((short)4321);
         CorbaPrimitiveHandler obj =
             new CorbaPrimitiveHandler(new QName("ushort"),
                                       CorbaConstants.NT_CORBA_USHORT,
diff --git a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java
index b03a0af..f0eddcb 100644
--- a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java
+++ b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java
@@ -488,10 +488,10 @@ public class BeanTest extends AbstractAegisTest {
         assertTrue(bigByteOk);
 
         SimpleBean bean = new SimpleBean();
-        bean.setBigByte(new Byte((byte)0xfe));
+        bean.setBigByte(Byte.valueOf((byte)0xfe));
         bean.setLittleByte((byte)0xfd);
         Element element = writeObjectToElement(type, bean, getContext());
-        Byte bb = new Byte((byte)0xfe);
+        Byte bb = Byte.valueOf((byte)0xfe);
         String bbs = bb.toString();
         assertValid("/b:root/bz:bigByte[text()='" + bbs + "']", element);
 
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
index 5e9e1fb..66417ad 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
@@ -296,7 +296,7 @@ public class BookServer extends AbstractBusTestServerBase {
         private static class ByteConverter implements ParamConverter<Byte> {
             @Override
             public Byte fromString(String t) {
-                return new Byte(t);
+                return Byte.valueOf(t);
             }
 
             @Override
diff --git a/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient2.java b/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient2.java
index 38a67a3..867cb0c 100644
--- a/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient2.java
+++ b/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient2.java
@@ -2057,13 +2057,13 @@ public abstract class AbstractTypeTestClient2 extends AbstractTypeTestClient {
         }
         SimpleContent1 x1 = new SimpleContent1();
         x1.setValue("foo");
-        x1.setAttrib1A(new Byte((byte)1));
-        x1.setAttrib1B(new Short((short)2));
+        x1.setAttrib1A(Byte.valueOf((byte)1));
+        x1.setAttrib1B(Short.valueOf((short)2));
 
         SimpleContent1 y1 = new SimpleContent1();
         y1.setValue("bar");
-        y1.setAttrib1A(new Byte((byte)3));
-        y1.setAttrib1B(new Short((short)4));
+        y1.setAttrib1A(Byte.valueOf((byte)3));
+        y1.setAttrib1B(Short.valueOf((short)4));
 
         Holder<SimpleContent1> y1Holder = new Holder<SimpleContent1>(y1);
         Holder<SimpleContent1> z1 = new Holder<SimpleContent1>();
@@ -2094,15 +2094,15 @@ public abstract class AbstractTypeTestClient2 extends AbstractTypeTestClient {
         }
         SimpleContent2 x2 = new SimpleContent2();
         x2.setValue("foo");
-        x2.setAttrib1A(new Byte((byte)1));
-        x2.setAttrib1B(new Short((short)2));
+        x2.setAttrib1A(Byte.valueOf((byte)1));
+        x2.setAttrib1B(Short.valueOf((short)2));
         x2.setAttrib2A(Integer.valueOf(5));
         x2.setAttrib2B(Long.valueOf(6));
 
         SimpleContent2 y2 = new SimpleContent2();
         y2.setValue("bar");
-        y2.setAttrib1A(new Byte((byte)3));
-        y2.setAttrib1B(new Short((short)4));
+        y2.setAttrib1A(Byte.valueOf((byte)3));
+        y2.setAttrib1B(Short.valueOf((short)4));
         y2.setAttrib2A(Integer.valueOf(7));
         y2.setAttrib2B(Long.valueOf(8));
 
@@ -2135,8 +2135,8 @@ public abstract class AbstractTypeTestClient2 extends AbstractTypeTestClient {
         }
         SimpleContent3 x3 = new SimpleContent3();
         x3.setValue("foo");
-        x3.setAttrib1A(new Byte((byte)1));
-        x3.setAttrib1B(new Short((short)2));
+        x3.setAttrib1A(Byte.valueOf((byte)1));
+        x3.setAttrib1B(Short.valueOf((short)2));
         x3.setAttrib2A(Integer.valueOf(5));
         x3.setAttrib2B(Long.valueOf(6));
         x3.setAttrib3A("xxx");
@@ -2144,8 +2144,8 @@ public abstract class AbstractTypeTestClient2 extends AbstractTypeTestClient {
 
         SimpleContent3 y3 = new SimpleContent3();
         y3.setValue("bar");
-        y3.setAttrib1A(new Byte((byte)3));
-        y3.setAttrib1B(new Short((short)4));
+        y3.setAttrib1A(Byte.valueOf((byte)3));
+        y3.setAttrib1B(Short.valueOf((short)4));
         y3.setAttrib2A(Integer.valueOf(7));
         y3.setAttrib2B(Long.valueOf(8));
         y3.setAttrib3A("yyy");

-- 
To stop receiving notification emails like this one, please contact
coheigea@apache.org.

[cxf] 04/09: Updating CryptoUtils to work with Java 10

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit e677408bc243a8494d711ff93be05a159f692144
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Thu Apr 19 10:21:43 2018 +0100

    Updating CryptoUtils to work with Java 10
---
 .../java/org/apache/cxf/rt/security/crypto/CryptoUtils.java    | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/CryptoUtils.java b/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/CryptoUtils.java
index e1e62cf..20475a9 100644
--- a/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/CryptoUtils.java
+++ b/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/CryptoUtils.java
@@ -545,7 +545,7 @@ public final class CryptoUtils {
             } else {
                 if (blockSize == -1) {
                     String javaVersion = System.getProperty("java.version");
-                    if (javaVersion.startsWith("9") || isJava8Release161OrLater(javaVersion)) {
+                    if (isJava9Compatible(javaVersion) || isJava8Release161OrLater(javaVersion)) {
                         //the default block size is 256 when use private key under java9
                         blockSize = secretKey instanceof PublicKey ? 117 : 256;
                     } else {
@@ -575,6 +575,14 @@ public final class CryptoUtils {
         }
     }
 
+    private static boolean isJava9Compatible(String javaVersion) {
+        if (javaVersion.indexOf(".") > 0) {
+            javaVersion = javaVersion.substring(0, javaVersion.indexOf("."));
+        }
+
+        return Integer.valueOf(javaVersion) >= 9;
+    }
+
     private static boolean isJava8Release161OrLater(String javaVersion) {
         return javaVersion.startsWith("1.8.0_") && Integer.parseInt(javaVersion.substring(6)) >= 161;
     }

-- 
To stop receiving notification emails like this one, please contact
coheigea@apache.org.

[cxf] 01/09: Change OpenAPI pom name + description to differentiate from description-swagger module

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 7aec1effe947366c8821a2f90d2ce8864ad29290
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Thu Apr 19 09:47:04 2018 +0100

    Change OpenAPI pom name + description to differentiate from description-swagger module
---
 rt/rs/description-openapi-v3/pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rt/rs/description-openapi-v3/pom.xml b/rt/rs/description-openapi-v3/pom.xml
index d7d81c1..e200e45 100644
--- a/rt/rs/description-openapi-v3/pom.xml
+++ b/rt/rs/description-openapi-v3/pom.xml
@@ -21,8 +21,8 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>cxf-rt-rs-service-description-openapi-v3</artifactId>
     <packaging>bundle</packaging>
-    <name>Apache CXF JAX-RS Service Description Swagger</name>
-    <description>Apache CXF JAX-RS Service Description Swagger</description>
+    <name>Apache CXF JAX-RS Service Description OpenAPI v3</name>
+    <description>Apache CXF JAX-RS Service Description OpenAPI v3</description>
     <url>http://cxf.apache.org</url>
     <parent>
         <groupId>org.apache.cxf</groupId>

-- 
To stop receiving notification emails like this one, please contact
coheigea@apache.org.

[cxf] 06/09: More work on the samples

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 8a1adaeb07799a077153cd67fd4ec4769fe8b16a
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Thu Apr 19 11:46:28 2018 +0100

    More work on the samples
---
 .../src/main/java/demo/callback/server/Server.java |  4 +-
 .../src/main/resources/callback_infoset.xml        | 18 +++++++++
 .../samples/configuration_interceptor/pom.xml      |  7 ----
 .../src/main/java/demo/stream/client/Client.java   | 11 ++++-
 .../src/main/java/demo/stream/server/Server.java   |  9 ++++-
 .../src/main/resources/client.xml                  | 40 ------------------
 .../src/main/resources/server.xml                  | 47 ----------------------
 7 files changed, 38 insertions(+), 98 deletions(-)

diff --git a/distribution/src/main/release/samples/callback/src/main/java/demo/callback/server/Server.java b/distribution/src/main/release/samples/callback/src/main/java/demo/callback/server/Server.java
index b6e793f..620e345 100644
--- a/distribution/src/main/release/samples/callback/src/main/java/demo/callback/server/Server.java
+++ b/distribution/src/main/release/samples/callback/src/main/java/demo/callback/server/Server.java
@@ -22,13 +22,15 @@ package demo.callback.server;
 
 import javax.xml.ws.Endpoint;
 
+import org.apache.cxf.ext.logging.LoggingFeature;
+
 public class Server {
 
     protected Server() throws Exception {
         System.out.println("Starting Server");
         Object implementor = new ServerImpl();
         String address = "http://localhost:9000/SoapContext/SoapPort";
-        Endpoint.publish(address, implementor);
+        Endpoint.publish(address, implementor, new LoggingFeature());
     }
 
     public static void main(String args[]) throws Exception {
diff --git a/distribution/src/main/release/samples/callback/src/main/resources/callback_infoset.xml b/distribution/src/main/release/samples/callback/src/main/resources/callback_infoset.xml
index 6defc59..eea7e4d 100644
--- a/distribution/src/main/release/samples/callback/src/main/resources/callback_infoset.xml
+++ b/distribution/src/main/release/samples/callback/src/main/resources/callback_infoset.xml
@@ -1,4 +1,22 @@
 <?xml version="1.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.
+-->
 <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
     <wsa:Address>http://localhost:9005/CallbackContext/CallbackPort</wsa:Address>
     <wsa:ReferenceProperties/>
diff --git a/distribution/src/main/release/samples/configuration_interceptor/pom.xml b/distribution/src/main/release/samples/configuration_interceptor/pom.xml
index 4b221b5..e0939ae 100644
--- a/distribution/src/main/release/samples/configuration_interceptor/pom.xml
+++ b/distribution/src/main/release/samples/configuration_interceptor/pom.xml
@@ -74,7 +74,6 @@
                                 <configuration>
                                     <executable>java</executable>
                                     <arguments>
-                                        <argument>-Dcxf.config.file=${project.build.directory}/classes/server.xml</argument>
                                         <argument>-classpath</argument>
                                         <classpath />
                                         <argument>demo.stream.server.Server</argument>
@@ -103,7 +102,6 @@
                                 <configuration>
                                     <executable>java</executable>
                                     <arguments>
-                                        <argument>-Dcxf.config.file=${project.build.directory}/classes/client.xml</argument>
                                         <argument>-classpath</argument>
                                         <classpath />
                                         <argument>demo.stream.client.Client</argument>
@@ -132,10 +130,5 @@
             <artifactId>cxf-rt-transports-http-jetty</artifactId>
             <version>3.2.5-SNAPSHOT</version>
         </dependency>
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-management</artifactId>
-            <version>3.2.5-SNAPSHOT</version>
-        </dependency>
     </dependencies>
 </project>
diff --git a/distribution/src/main/release/samples/configuration_interceptor/src/main/java/demo/stream/client/Client.java b/distribution/src/main/release/samples/configuration_interceptor/src/main/java/demo/stream/client/Client.java
index 709f2e3..74304fa 100644
--- a/distribution/src/main/release/samples/configuration_interceptor/src/main/java/demo/stream/client/Client.java
+++ b/distribution/src/main/release/samples/configuration_interceptor/src/main/java/demo/stream/client/Client.java
@@ -21,9 +21,13 @@ package demo.stream.client;
 
 import java.net.URL;
 import javax.xml.namespace.QName;
+
+import org.apache.cxf.frontend.ClientProxy;
 import org.apache.hello_world_soap_http.Greeter;
 import org.apache.hello_world_soap_http.SOAPService;
 
+import demo.stream.interceptor.StreamInterceptor;
+
 
 public final class Client {
 
@@ -39,10 +43,13 @@ public final class Client {
         URL wsdlURL = Client.class.getResource("/wsdl/hello_world.wsdl");
         SOAPService ss = new SOAPService(wsdlURL, SERVICE_NAME);
         Greeter port = ss.getSoapPort();
-        String resp;
+
+        org.apache.cxf.endpoint.Client client = ClientProxy.getClient(port);
+        client.getInInterceptors().add(new StreamInterceptor());
+        client.getInFaultInterceptors().add(new StreamInterceptor());
 
         System.out.println("Invoking sayHi...");
-        resp = port.sayHi();
+        String resp = port.sayHi();
         System.out.println("Server responded with: " + resp);
         System.out.println();
 
diff --git a/distribution/src/main/release/samples/configuration_interceptor/src/main/java/demo/stream/server/Server.java b/distribution/src/main/release/samples/configuration_interceptor/src/main/java/demo/stream/server/Server.java
index bcd1727..b7a2b93 100644
--- a/distribution/src/main/release/samples/configuration_interceptor/src/main/java/demo/stream/server/Server.java
+++ b/distribution/src/main/release/samples/configuration_interceptor/src/main/java/demo/stream/server/Server.java
@@ -21,6 +21,11 @@ package demo.stream.server;
 
 import javax.xml.ws.Endpoint;
 
+import org.apache.cxf.ext.logging.LoggingFeature;
+import org.apache.cxf.jaxws.EndpointImpl;
+
+import demo.stream.interceptor.StreamInterceptor;
+
 public class Server {
 
     protected Server() throws Exception {
@@ -28,7 +33,9 @@ public class Server {
 
         Object implementor = new GreeterImpl();
         String address = "http://localhost:9000/SoapContext/SoapPort";
-        Endpoint.publish(address, implementor);
+        EndpointImpl ep = (EndpointImpl)Endpoint.publish(address, implementor, new LoggingFeature());
+
+        ep.getOutInterceptors().add(new StreamInterceptor());
     }
 
     public static void main(String args[]) throws Exception {
diff --git a/distribution/src/main/release/samples/configuration_interceptor/src/main/resources/client.xml b/distribution/src/main/release/samples/configuration_interceptor/src/main/resources/client.xml
deleted file mode 100644
index 19a5287..0000000
--- a/distribution/src/main/release/samples/configuration_interceptor/src/main/resources/client.xml
+++ /dev/null
@@ -1,40 +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://cxf.apache.org/core" xmlns:http="http://cxf.apache.org/transports/http/configuration" xsi:schemaLocation="        http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd        http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd        http://www.springframework.org/schema/beans http://www.sp [...]
-    <http:conduit name="{http://apache.org/hello_world_soap_http}SoapPort9001.http-conduit">
-        <http:client DecoupledEndpoint="http://localhost:9990/decoupled_endpoint"/>
-    </http:conduit>
-    <bean id="GZIPStream" class="demo.stream.interceptor.StreamInterceptor"/>
-    <!-- We are adding the interceptors to the bus as we will have only one endpoint/service/bus. -->
-    <cxf:bus>
-        <cxf:inInterceptors>
-            <ref bean="GZIPStream"/>
-        </cxf:inInterceptors>
-        <cxf:inFaultInterceptors>
-            <ref bean="GZIPStream"/>
-        </cxf:inFaultInterceptors>
-        <!--cxf:outInterceptors>            
-            <ref bean="GZIPStream"/>        
-        </cxf:outInterceptors>
-        <cxf:outFaultInterceptors>           
-             <ref bean="GZIPStream"/>
-        </cxf:outFaultInterceptors-->
-    </cxf:bus>
-</beans>
diff --git a/distribution/src/main/release/samples/configuration_interceptor/src/main/resources/server.xml b/distribution/src/main/release/samples/configuration_interceptor/src/main/resources/server.xml
deleted file mode 100644
index e8530c7..0000000
--- a/distribution/src/main/release/samples/configuration_interceptor/src/main/resources/server.xml
+++ /dev/null
@@ -1,47 +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://cxf.apache.org/core" xsi:schemaLocation=" http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd">
-    <bean id="GZIPStream" class="demo.stream.interceptor.StreamInterceptor"/>
-    <!-- We are adding the interceptors to the bus as we will have only one endpoint/service/bus. -->
-    <cxf:bus>
-        <!--cxf:inInterceptors>
-            <ref bean="GZIPStream"/>
-        </cxf:inInterceptors>
-        <cxf:inFaultInterceptors>
-            <ref bean="GZIPStream"/>            
-        </cxf:inFaultInterceptors-->
-        <cxf:outInterceptors>
-            <ref bean="GZIPStream"/>
-        </cxf:outInterceptors>
-        <!--cxf:outFaultInterceptors>           
-             <ref bean="GZIPStream"/>
-        </cxf:outFaultInterceptors-->
-    </cxf:bus>
-    <bean id="org.apache.cxf.management.InstrumentationManager" class="org.apache.cxf.management.jmx.InstrumentationManagerImpl">
-        <property name="bus" ref="cxf"/>
-        <property name="enabled" value="true"/>
-        <property name="threaded" value="false"/>
-        <property name="daemon" value="false"/>
-        <property name="JMXServiceURL" value="service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi"/>
-    </bean>
-    <bean id="org.apache.cxf.management.counters.CounterRepository" class="org.apache.cxf.management.counters.CounterRepository">
-        <property name="bus" ref="cxf"/>
-    </bean>
-</beans>

-- 
To stop receiving notification emails like this one, please contact
coheigea@apache.org.

[cxf] 08/09: Porting SAAJ 1.4 changes from WSS4J

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit ae0e2ba3df88cc33c9d5ba0b212a230491c56b1a
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Thu Apr 19 12:39:04 2018 +0100

    Porting SAAJ 1.4 changes from WSS4J
---
 .../main/java/org/apache/cxf/helpers/DOMUtils.java | 31 +++++++++++++++-------
 1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/core/src/main/java/org/apache/cxf/helpers/DOMUtils.java b/core/src/main/java/org/apache/cxf/helpers/DOMUtils.java
index 908cb2c..56ecae9 100644
--- a/core/src/main/java/org/apache/cxf/helpers/DOMUtils.java
+++ b/core/src/main/java/org/apache/cxf/helpers/DOMUtils.java
@@ -67,7 +67,19 @@ public final class DOMUtils {
 
 
     static {
-        if (JavaUtils.isJava9Compatible()) {
+        try {
+            Method[] methods = DOMUtils.class.getClassLoader().
+                loadClass("com.sun.xml.messaging.saaj.soap.SOAPDocumentImpl").getMethods();
+            for (Method method : methods) {
+                if (method.getName().equals("register")) {
+                    //this is the 1.4+ SAAJ impl
+                    setJava9SAAJ(true);
+                    break;
+                }
+            }
+        } catch (ClassNotFoundException cnfe) {
+            LogUtils.getL7dLogger(DOMUtils.class).finest(
+                "can't load class com.sun.xml.messaging.saaj.soap.SOAPDocumentImpl");
 
             try {
                 Method[] methods = DOMUtils.class.getClassLoader().
@@ -79,11 +91,10 @@ public final class DOMUtils {
                         break;
                     }
                 }
-            } catch (ClassNotFoundException cnfe) {
+            } catch (ClassNotFoundException cnfe1) {
                 LogUtils.getL7dLogger(DOMUtils.class).finest(
                     "can't load class com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl");
             }
-
         }
     }
 
@@ -152,17 +163,17 @@ public final class DOMUtils {
             throw new RuntimeException(e);
         }
     }
-    
+
     private static synchronized Document createEmptyDocument() {
         if (emptyDocument == null) {
             emptyDocument = createDocument();
-            
+
             // uncomment this to see if anything is actually setting anything into the empty doc
             /*
             final Document doc  = createDocument();
             emptyDocument = (Document)org.apache.cxf.common.util.ProxyHelper.getProxy(
-                DOMUtils.class.getClassLoader(), 
-                new Class<?>[] {Document.class}, 
+                DOMUtils.class.getClassLoader(),
+                new Class<?>[] {Document.class},
                 new java.lang.reflect.InvocationHandler() {
                     @Override
                     public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
@@ -177,9 +188,9 @@ public final class DOMUtils {
         return emptyDocument;
     }
     /**
-     * Returns a static Document that should always be "empty".  It's useful as a factory for 
-     * for creating Elements and other nodes that will be traversed later and don't need to 
-     * be attached into a document 
+     * Returns a static Document that should always be "empty".  It's useful as a factory for
+     * for creating Elements and other nodes that will be traversed later and don't need to
+     * be attached into a document
      * @return
      */
     public static Document getEmptyDocument() {

-- 
To stop receiving notification emails like this one, please contact
coheigea@apache.org.

[cxf] 05/09: Use JavaUtils method instead to determine JDK compatability

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit a4a93414e7cc1ce8d844b146ba8559c7f2485c0c
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Thu Apr 19 10:35:03 2018 +0100

    Use JavaUtils method instead to determine JDK compatability
---
 .../java/org/apache/cxf/rt/security/crypto/CryptoUtils.java  | 12 ++----------
 .../cxf/ws/security/wss4j/PolicyBasedWss4JInOutTest.java     | 11 ++---------
 2 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/CryptoUtils.java b/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/CryptoUtils.java
index 20475a9..c6a899b 100644
--- a/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/CryptoUtils.java
+++ b/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/CryptoUtils.java
@@ -62,6 +62,7 @@ import org.apache.cxf.common.util.Base64UrlUtility;
 import org.apache.cxf.common.util.Base64Utility;
 import org.apache.cxf.common.util.CompressionUtils;
 import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.helpers.JavaUtils;
 
 
 /**
@@ -544,8 +545,7 @@ public final class CryptoUtils {
                 result = c.doFinal(bytes);
             } else {
                 if (blockSize == -1) {
-                    String javaVersion = System.getProperty("java.version");
-                    if (isJava9Compatible(javaVersion) || isJava8Release161OrLater(javaVersion)) {
+                    if (JavaUtils.isJava9Compatible() || isJava8Release161OrLater(System.getProperty("java.version"))) {
                         //the default block size is 256 when use private key under java9
                         blockSize = secretKey instanceof PublicKey ? 117 : 256;
                     } else {
@@ -575,14 +575,6 @@ public final class CryptoUtils {
         }
     }
 
-    private static boolean isJava9Compatible(String javaVersion) {
-        if (javaVersion.indexOf(".") > 0) {
-            javaVersion = javaVersion.substring(0, javaVersion.indexOf("."));
-        }
-
-        return Integer.valueOf(javaVersion) >= 9;
-    }
-
     private static boolean isJava8Release161OrLater(String javaVersion) {
         return javaVersion.startsWith("1.8.0_") && Integer.parseInt(javaVersion.substring(6)) >= 161;
     }
diff --git a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWss4JInOutTest.java b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWss4JInOutTest.java
index 6e8a015..269396e 100644
--- a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWss4JInOutTest.java
+++ b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWss4JInOutTest.java
@@ -22,6 +22,7 @@ import java.util.Arrays;
 
 import javax.xml.namespace.QName;
 
+import org.apache.cxf.helpers.JavaUtils;
 import org.apache.cxf.ws.security.wss4j.CryptoCoverageUtil.CoverageType;
 import org.apache.wss4j.policy.SP12Constants;
 
@@ -430,7 +431,7 @@ public class PolicyBasedWss4JInOutTest extends AbstractPolicySecurityTest {
                 null,
                 Arrays.asList(CoverageType.ENCRYPTED, CoverageType.SIGNED));
 
-        if (!isJava9Compatible()) {
+        if (!JavaUtils.isJava9Compatible()) {
             // CXF-7270
             this.runAndValidate(
                 "wsse-request-clean.xml",
@@ -556,12 +557,4 @@ public class PolicyBasedWss4JInOutTest extends AbstractPolicySecurityTest {
         // TODO: Tests for derived keys.
     }
 
-    private boolean isJava9Compatible() {
-        String version = System.getProperty("java.version");
-        if (version.indexOf(".") > 0) {
-            version = version.substring(0, version.indexOf("."));
-        }
-
-        return Integer.valueOf(version) >= 9;
-    }
 }

-- 
To stop receiving notification emails like this one, please contact
coheigea@apache.org.

[cxf] 07/09: Updating EasyMock

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit ddc5633a62972882588ef3f3f3ab3cff6aa813a4
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Thu Apr 19 12:27:47 2018 +0100

    Updating EasyMock
---
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parent/pom.xml b/parent/pom.xml
index d04c3d4..b542f7a 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -1503,7 +1503,7 @@
             <dependency>
                 <groupId>org.easymock</groupId>
                 <artifactId>easymock</artifactId>
-                <version>3.5.1</version>
+                <version>3.6</version>
                 <scope>test</scope>
             </dependency>
             <dependency>

-- 
To stop receiving notification emails like this one, please contact
coheigea@apache.org.