cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf git commit: Fixing build with JDK 6
Date Fri, 27 Jan 2017 18:29:58 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes e97d225d2 -> 20582279c


Fixing build with JDK 6


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

Branch: refs/heads/3.0.x-fixes
Commit: 20582279cdbf74fbcb16197052b2cf38f32b469e
Parents: e97d225
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Fri Jan 27 18:29:39 2017 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Fri Jan 27 18:29:54 2017 +0000

----------------------------------------------------------------------
 osgi/itests/pom.xml                             | 40 +++++++++++++++
 .../jaxrs/impl/HttpServletRequestFilter.java    |  3 +-
 .../apache/cxf/transport/http/HeadersTest.java  |  4 +-
 services/sts/systests/sts-itests/pom.xml        | 54 +++++++++++++++++---
 services/xkms/xkms-itests/pom.xml               | 54 +++++++++++++++++---
 .../validator/internal/SchemaValidator.java     |  8 ++-
 6 files changed, 144 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/20582279/osgi/itests/pom.xml
----------------------------------------------------------------------
diff --git a/osgi/itests/pom.xml b/osgi/itests/pom.xml
index 7a1ce96..b3f7d38 100644
--- a/osgi/itests/pom.xml
+++ b/osgi/itests/pom.xml
@@ -164,6 +164,46 @@
             </exclusions>
         </dependency>
     </dependencies>
+
+    <profiles>
+        <profile>
+            <id>jdk16</id>
+            <activation>
+                <jdk>1.6</jdk>
+            </activation>
+            <build>
+                <pluginManagement>
+                    <plugins>
+                        <plugin>
+                            <groupId>org.apache.maven.plugins</groupId>
+                            <artifactId>maven-surefire-plugin</artifactId>
+                            <configuration>
+                                <skipTests>true</skipTests>
+                            </configuration>
+                         </plugin>
+                     </plugins>
+                 </pluginManagement>
+             </build>
+         </profile>
+         <profile>
+            <id>alt-jdks</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <build>
+                <pluginManagement>
+                    <plugins>
+                        <plugin>
+                            <groupId>org.apache.maven.plugins</groupId>
+                            <artifactId>maven-surefire-plugin</artifactId>
+                         </plugin>
+                     </plugins>
+                 </pluginManagement>
+             </build>
+         </profile>
+
+    </profiles>
+
     <build>
         <plugins>
             <!-- generate dependencies versions -->

http://git-wip-us.apache.org/repos/asf/cxf/blob/20582279/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpServletRequestFilter.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpServletRequestFilter.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpServletRequestFilter.java
index eb1758a..d598f60 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpServletRequestFilter.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpServletRequestFilter.java
@@ -20,7 +20,6 @@ package org.apache.cxf.jaxrs.impl;
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.nio.charset.StandardCharsets;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.Iterator;
@@ -117,7 +116,7 @@ public class HttpServletRequestFilter extends HttpServletRequestWrapper
{
         if (formParams == null) {
             formParams = new MetadataMap<String, String>();
             MediaType mt = JAXRSUtils.toMediaType((String)m.get(Message.CONTENT_TYPE));
-            String enc = HttpUtils.getEncoding(mt, StandardCharsets.UTF_8.name());
+            String enc = HttpUtils.getEncoding(mt, "UTF-8");
             String body = FormUtils.readBody(m.getContent(InputStream.class), enc);
             FormUtils.populateMapFromString(formParams, m, body, enc, true);
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/20582279/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HeadersTest.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HeadersTest.java
b/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HeadersTest.java
index e26e5ff..34cb0a2 100755
--- a/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HeadersTest.java
+++ b/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HeadersTest.java
@@ -180,7 +180,7 @@ public class HeadersTest extends Assert {
         // second check - null specified in request, valid content-type specified in message
         // expect that determineContentType returns the content-type specified in the message
         HttpServletRequest req = control.createMock(HttpServletRequest.class);
-        EasyMock.expect(req.getHeaderNames()).andReturn(Collections.<String>emptyEnumeration());
+        EasyMock.expect(req.getHeaderNames()).andReturn(Collections.enumeration(Collections.<String>emptyList()));
         EasyMock.expect(req.getContentType()).andReturn(null).anyTimes();
         control.replay();
         message = new MessageImpl();
@@ -196,7 +196,7 @@ public class HeadersTest extends Assert {
         // expect that determineContentType returns the default value of text/xml
         control = EasyMock.createNiceControl();
         req = control.createMock(HttpServletRequest.class);
-        EasyMock.expect(req.getHeaderNames()).andReturn(Collections.<String>emptyEnumeration());
+        EasyMock.expect(req.getHeaderNames()).andReturn(Collections.enumeration(Collections.<String>emptyList()));
         EasyMock.expect(req.getContentType()).andReturn(null).anyTimes();
         control.replay();
         message = new MessageImpl();

http://git-wip-us.apache.org/repos/asf/cxf/blob/20582279/services/sts/systests/sts-itests/pom.xml
----------------------------------------------------------------------
diff --git a/services/sts/systests/sts-itests/pom.xml b/services/sts/systests/sts-itests/pom.xml
index b115954..bbb814f 100644
--- a/services/sts/systests/sts-itests/pom.xml
+++ b/services/sts/systests/sts-itests/pom.xml
@@ -98,6 +98,53 @@
             <artifactId>slf4j-jdk14</artifactId>
         </dependency>
     </dependencies>
+  
+    <profiles>
+        <profile>
+            <id>jdk16</id>
+            <activation>
+                <jdk>1.6</jdk>
+            </activation>
+            <build>
+                <pluginManagement>
+                    <plugins>
+                        <plugin>
+                            <groupId>org.apache.maven.plugins</groupId>
+                            <artifactId>maven-surefire-plugin</artifactId>
+                            <configuration>
+                                <skipTests>true</skipTests>
+                            </configuration>
+                         </plugin>
+                     </plugins>
+                 </pluginManagement>
+             </build>
+         </profile>
+         <profile>
+            <id>alt-jdks</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <build>
+                <pluginManagement>
+                    <plugins>
+                        <plugin>
+                            <groupId>org.apache.maven.plugins</groupId>
+                            <artifactId>maven-surefire-plugin</artifactId>
+                            <configuration>
+                                <systemPropertyVariables>
+                                    <org.ops4j.pax.logging.DefaultServiceLog.level>WARN</org.ops4j.pax.logging.DefaultServiceLog.level>
+                                    <karaf.version>${cxf.karaf.version}</karaf.version>
+                                    <localRepository>${maven.repo.local}</localRepository>
+                                </systemPropertyVariables>
+                            </configuration>
+                         </plugin>
+                     </plugins>
+                 </pluginManagement>
+             </build>
+         </profile>
+
+    </profiles>
+
     <build>
         <plugins>
             <!-- generate dependency versions -->
@@ -117,13 +164,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <configuration>
-                    <systemPropertyVariables>
-                        <org.ops4j.pax.logging.DefaultServiceLog.level>WARN</org.ops4j.pax.logging.DefaultServiceLog.level>
-                        <karaf.version>${cxf.karaf.version}</karaf.version>
-                        <localRepository>${maven.repo.local}</localRepository>
-                    </systemPropertyVariables>
-                </configuration>
             </plugin>
         </plugins>
         <pluginManagement>

http://git-wip-us.apache.org/repos/asf/cxf/blob/20582279/services/xkms/xkms-itests/pom.xml
----------------------------------------------------------------------
diff --git a/services/xkms/xkms-itests/pom.xml b/services/xkms/xkms-itests/pom.xml
index 4906239..ec69c7f 100644
--- a/services/xkms/xkms-itests/pom.xml
+++ b/services/xkms/xkms-itests/pom.xml
@@ -105,6 +105,53 @@
             <version>1.7.7</version>
         </dependency>
     </dependencies>
+
+    <profiles>
+        <profile>
+            <id>jdk16</id>
+            <activation>
+                <jdk>1.6</jdk>
+            </activation>
+            <build>
+                <pluginManagement>
+                    <plugins>
+                        <plugin>
+                            <groupId>org.apache.maven.plugins</groupId>
+                            <artifactId>maven-surefire-plugin</artifactId>
+                            <configuration>
+                                <skipTests>true</skipTests>
+                            </configuration>
+                         </plugin>
+                     </plugins>
+                 </pluginManagement>
+             </build>
+         </profile>
+         <profile>
+            <id>alt-jdks</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <build>
+                <pluginManagement>
+                    <plugins>
+                        <plugin>
+                            <groupId>org.apache.maven.plugins</groupId>
+                            <artifactId>maven-surefire-plugin</artifactId>
+                            <configuration>
+                                <systemPropertyVariables>
+                                    <org.ops4j.pax.logging.DefaultServiceLog.level>WARN</org.ops4j.pax.logging.DefaultServiceLog.level>
+                                    <karaf.version>${cxf.karaf.version}</karaf.version>
+                                    <localRepository>${maven.repo.local}</localRepository>
+                                </systemPropertyVariables>
+                            </configuration>
+                         </plugin>
+                     </plugins>
+                 </pluginManagement>
+             </build>
+         </profile>
+
+    </profiles>
+
     <build>
         <plugins>
             <!-- generate dependency versions -->
@@ -124,13 +171,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <configuration>
-                    <systemPropertyVariables>
-                        <org.ops4j.pax.logging.DefaultServiceLog.level>WARN</org.ops4j.pax.logging.DefaultServiceLog.level>
-                        <karaf.version>${cxf.karaf.version}</karaf.version>
-                        <org.ops4j.pax.url.mvn.localRepository>${maven.repo.local}</org.ops4j.pax.url.mvn.localRepository>
-                    </systemPropertyVariables>
-                </configuration>
             </plugin>
         </plugins>
     </build>

http://git-wip-us.apache.org/repos/asf/cxf/blob/20582279/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/SchemaValidator.java
----------------------------------------------------------------------
diff --git a/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/SchemaValidator.java
b/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/SchemaValidator.java
index d642a42..5957d02 100644
--- a/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/SchemaValidator.java
+++ b/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/SchemaValidator.java
@@ -65,6 +65,8 @@ import org.apache.cxf.tools.common.ToolException;
 public class SchemaValidator extends AbstractDefinitionValidator {
     protected static final Logger LOG = LogUtils.getL7dLogger(SchemaValidator.class);
 
+    private static final String ACCESS_EXTERNAL_SCHEMA = "http://javax.xml.XMLConstants/property/accessExternalSchema";
+
     protected String[] defaultSchemas;
 
     protected String schemaLocation = "./";
@@ -126,7 +128,11 @@ public class SchemaValidator extends AbstractDefinitionValidator {
 
         SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
         sf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE);
-        sf.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "file");
+        try {
+            sf.setProperty(ACCESS_EXTERNAL_SCHEMA, "file");
+        } catch (SAXException ex) {
+            LOG.fine("Error setting the ACCESS_EXTERNAL_SCHEMA property");
+        }
         SchemaResourceResolver resourceResolver = new SchemaResourceResolver();
 
         sf.setResourceResolver(resourceResolver);


Mime
View raw message