Author: asoldano
Date: 2014-11-27 12:40:48 -0500 (Thu, 27 Nov 2014)
New Revision: 19116
Added:
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/SAMLValidator.java
Modified:
stack/cxf/branches/jbossws-cxf-4.1.x/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2311Impl.java
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2321Impl.java
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/wsdl/SecurityService.wsdl
stack/cxf/branches/jbossws-cxf-4.1.x/pom.xml
Log:
Upgrade to Apache CXF 2.7 series and related Apache dependencies + fix for JBWS-3831
Modified:
stack/cxf/branches/jbossws-cxf-4.1.x/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.1.x/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java 2014-11-26
17:51:25 UTC (rev 19115)
+++
stack/cxf/branches/jbossws-cxf-4.1.x/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java 2014-11-27
17:40:48 UTC (rev 19116)
@@ -32,25 +32,23 @@
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.tools.FileObject;
import javax.tools.ForwardingJavaFileManager;
-import javax.tools.JavaCompiler;
-import javax.tools.JavaCompiler.CompilationTask;
import javax.tools.JavaFileManager;
import javax.tools.JavaFileObject;
+import javax.tools.JavaFileObject.Kind;
import javax.tools.SimpleJavaFileObject;
import javax.tools.StandardJavaFileManager;
import javax.tools.StandardLocation;
-import javax.tools.ToolProvider;
import javax.xml.ws.spi.Provider;
import org.apache.cxf.common.util.Compiler;
import org.apache.cxf.helpers.FileUtils;
+import org.apache.cxf.helpers.IOUtils;
import org.apache.cxf.tools.common.ToolConstants;
import org.apache.cxf.tools.common.ToolContext;
import org.apache.cxf.tools.wsdlto.WSDLToJava;
@@ -303,7 +301,6 @@
}
}
}
-
/**
* A CXF Compiler that installs a custom JavaFileManager to load JAXWS and JAXB apis
from
* the proper JBoss module (the one providing the JAXWS SPI Provider) instead of from
the
@@ -312,22 +309,12 @@
private final class JBossModulesAwareCompiler extends Compiler
{
@Override
- protected boolean useJava6Compiler(String[] files) throws Exception
+ protected JavaFileManager wrapJavaFileManager(StandardJavaFileManager
standardJavaFileManger)
{
- JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
- StandardJavaFileManager stdFileManager = compiler.getStandardFileManager(null,
null, null);
- Iterable<? extends JavaFileObject> fileList =
stdFileManager.getJavaFileObjectsFromStrings(Arrays.asList(files));
- JavaFileManager fileManager = new CustomJavaFileManager(stdFileManager);
-
- List<String> args = new ArrayList<String>();
- addArgs(args);
- CompilationTask task = compiler.getTask(null, fileManager, null, args, null,
fileList);
- Boolean ret = task.call();
- fileManager.close();
- return ret;
+ return new CustomJavaFileManager(standardJavaFileManger);
}
}
-
+
final class CustomJavaFileManager extends
ForwardingJavaFileManager<JavaFileManager>
{
private ClassLoader classLoader = new
ClassLoader(Provider.provider().getClass().getClassLoader())
@@ -364,7 +351,7 @@
}
@Override
- public Iterable<JavaFileObject> list(Location location, String packageName,
Set<JavaFileObject.Kind> kinds, boolean recurse)
+ public Iterable<JavaFileObject> list(Location location, String packageName,
Set<Kind> kinds, boolean recurse)
throws IOException
{
Iterable<JavaFileObject> result = super.list(location, packageName, kinds,
recurse);
@@ -377,7 +364,7 @@
final JavaFileObject obj = it.next();
final String objName = obj.getName();
Class<?> clazz = null;
- final String className = packageName + "." +
objName.substring(0, objName.length() - 6);
+ final String className = getFullClassName(packageName, objName);
try
{
clazz = classLoader.loadClass(className);
@@ -416,6 +403,24 @@
return files;
}
}
+
+ private static String getFullClassName(String packageName, String objName)
+ {
+ // * OpenJDK returns objName strings like:
+ //
"/usr/java/java-1.6.0-openjdk-1.6.0.0.x86_64/lib/ct.sym(META-INF/sym/rt.jar/java/lang/AbstractMethodError.class)"
+ // * Oracle & IBM JDK return objName strings like:
+ // "AbstractMethodError.class"
+ // ... from either of those we need to get
+ // "java.lang.AbstractMethodError"
+ String cn = objName.substring(0, objName.indexOf(".class"));
+ int startIdx = Math.max(cn.lastIndexOf("."),
cn.lastIndexOf("/"));
+ if (startIdx > 0)
+ {
+ cn = cn.substring(startIdx + 1);
+ }
+ // objName.substring(0, objName.length() - 6)
+ return packageName + "." + cn;
+ }
final class JavaFileObjectImpl extends SimpleJavaFileObject
{
Modified:
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2014-11-26
17:51:25 UTC (rev 19115)
+++
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2014-11-27
17:40:48 UTC (rev 19116)
@@ -141,4 +141,9 @@
// filtering not supported, move on
chain.doFilter(request, response);
}
+
+ protected Bus getBus()
+ {
+ return bus;
+ }
}
Modified:
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml 2014-11-26
17:51:25 UTC (rev 19115)
+++
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml 2014-11-27
17:40:48 UTC (rev 19116)
@@ -174,6 +174,7 @@
<include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service23*Impl.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/jaxws/Say*.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/KeystorePasswordCallback.class"/>
+ <include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/SAMLValidator.class"/>
</classes>
<webinf
dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/oasis/WEB-INF">
<include name="wsdl/*.xsd"/>
Added:
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/SAMLValidator.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/SAMLValidator.java
(rev 0)
+++
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/SAMLValidator.java 2014-11-27
17:40:48 UTC (rev 19116)
@@ -0,0 +1,9 @@
+package org.jboss.test.ws.jaxws.samples.wsse.policy.oasis;
+
+public class SAMLValidator extends
org.apache.ws.security.validate.SamlAssertionValidator
+{
+ public SAMLValidator() {
+ super();
+ setRequireBearerSignature(false);
+ }
+}
Property changes on:
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/SAMLValidator.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified:
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2311Impl.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2311Impl.java 2014-11-26
17:51:25 UTC (rev 19115)
+++
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2311Impl.java 2014-11-27
17:40:48 UTC (rev 19116)
@@ -24,6 +24,8 @@
import javax.ejb.Stateless;
import javax.jws.WebService;
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
import org.jboss.ws.api.annotation.WebContext;
@WebService
@@ -35,6 +37,10 @@
endpointInterface =
"org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServiceIface"
)
@Stateless
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.saml1.validator", value =
"org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.SAMLValidator")
+ }
+)
@WebContext(urlPattern = "SecurityService2311")
public class Service2311Impl implements ServiceIface
{
Modified:
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2321Impl.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2321Impl.java 2014-11-26
17:51:25 UTC (rev 19115)
+++
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2321Impl.java 2014-11-27
17:40:48 UTC (rev 19116)
@@ -41,6 +41,7 @@
@EndpointProperty(key = "ws-security.signature.username", value =
"bob"),
@EndpointProperty(key = "ws-security.encryption.properties", value =
"bob.properties"),
@EndpointProperty(key = "ws-security.encryption.username", value =
"useReqSigCert"),
+ @EndpointProperty(key = "ws-security.saml2.validator", value =
"org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.SAMLValidator"),
@EndpointProperty(key = "ws-security.callback-handler", value =
"org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.KeystorePasswordCallback")
}
)
Modified:
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/wsdl/SecurityService.wsdl
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/wsdl/SecurityService.wsdl 2014-11-26
17:51:25 UTC (rev 19115)
+++
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/wsdl/SecurityService.wsdl 2014-11-27
17:40:48 UTC (rev 19116)
@@ -78,7 +78,7 @@
<sp:OnlySignEntireHeadersAndBody/>
<sp:AlgorithmSuite>
<wsp:Policy>
- <sp-cxf:Basic192GCM
xmlns:sp-cxf="http://cxf.apache.org/custom/security-policy"/>
+ <sp-cxf:Basic256GCM
xmlns:sp-cxf="http://cxf.apache.org/custom/security-policy"/>
</wsp:Policy>
</sp:AlgorithmSuite>
</wsp:Policy>
Modified: stack/cxf/branches/jbossws-cxf-4.1.x/pom.xml
===================================================================
--- stack/cxf/branches/jbossws-cxf-4.1.x/pom.xml 2014-11-26 17:51:25 UTC (rev 19115)
+++ stack/cxf/branches/jbossws-cxf-4.1.x/pom.xml 2014-11-27 17:40:48 UTC (rev 19116)
@@ -73,7 +73,7 @@
<jboss713.version>7.1.3.Final</jboss713.version>
<jboss720.version>7.2.2-internal-SNAPSHOT</jboss720.version>
<ejb.api.version>1.0.1.Final</ejb.api.version>
- <cxf.version>2.6.8</cxf.version>
+ <cxf.version>2.7.13</cxf.version>
<cxf.asm.version>3.3.1</cxf.asm.version>
<cxf.xjcplugins.version>2.6.0</cxf.xjcplugins.version>
<jboss.common.core.version>2.2.17.GA</jboss.common.core.version>
@@ -103,8 +103,8 @@
<jms.api.version>1.0.0.Final</jms.api.version>
<velocity.version>1.7</velocity.version>
<xerces.version>2.9.1</xerces.version>
- <xmlsec.version>1.5.4</xmlsec.version>
- <wss4j.version>1.6.10</wss4j.version>
+ <xmlsec.version>1.5.7</xmlsec.version>
+ <wss4j.version>1.6.17</wss4j.version>
<wstx.version>4.2.0</wstx.version>
<spring.version>3.0.7.RELEASE</spring.version>
</properties>