JBossWS SVN: r18186 - in stack/cxf/branches/jaspi/modules: server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect and 13 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2013-12-17 03:34:08 -0500 (Tue, 17 Dec 2013)
New Revision: 18186
Added:
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/module/UsernameTokenServerAuthModule.java
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/JaspiSubjectCreatingInterceptor.java
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/JaspiAuthenticationTestCase.java
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/ServiceIface.java
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/ServiceImpl.java
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/UsernamePasswordCallback.java
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/jboss-webservices.xml
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/web.xml
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/wsdl/
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/wsdl/SecurityService.wsdl
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/wsdl/SecurityService_schema1.xsd
Removed:
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/module/SOAPServerAuthModule.java
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/validator/
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/
Modified:
stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/JaspiServerAuthenticator.java
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSClientAuthConfig.java
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSServerAuthConfig.java
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml
Log:
Transparently direct the wsse authentication in ServerAuthModule without define the wss4j actions
Modified: stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java
===================================================================
--- stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java 2013-12-16 20:46:04 UTC (rev 18185)
+++ stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java 2013-12-17 08:34:08 UTC (rev 18186)
@@ -216,4 +216,9 @@
@LogMessage(level = WARN)
@Message(id = 24098, value = "No JASPIAuthenticationInfo found for security domain '%s'")
void noJaspiApplicationPolicy(String securityDomain);
+
+ @LogMessage(level = WARN)
+ @Message(id = 24099, value = "Can not create Jaspi ServerAuthContext for security domain '%s'")
+ void cannotCreateServerAuthContext(String securityDomain);
+
}
Modified: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
===================================================================
--- stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2013-12-16 20:46:04 UTC (rev 18185)
+++ stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2013-12-17 08:34:08 UTC (rev 18186)
@@ -29,8 +29,10 @@
import javax.security.auth.message.config.AuthConfigFactory;
import javax.security.auth.message.config.AuthConfigProvider;
import javax.security.auth.message.config.ServerAuthConfig;
+import javax.security.auth.message.config.ServerAuthContext;
import javax.xml.ws.spi.Provider;
+import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.configuration.Configurer;
import org.jboss.security.auth.callback.JBossCallbackHandler;
@@ -138,7 +140,7 @@
epConfigFile = wsmd.getConfigFile();
}
- JaspiServerAuthenticator jaspiAuthenticator = getJaspiAuthenticator(dep, wsmd);
+ JaspiServerAuthenticator jaspiAuthenticator = getJaspiAuthenticator(dep, wsmd, holder.getBus());
Configurer configurer = holder.createServerConfigurer(dep.getAttachment(BindingCustomization.class),
new WSDLFilePublisher(aDep), dep.getService().getEndpoints(), aDep.getRootFile(), epConfigName, epConfigFile);
@@ -152,7 +154,7 @@
}
}
- private JaspiServerAuthenticator getJaspiAuthenticator(Deployment dep, JBossWebservicesMetaData wsmd) {
+ private JaspiServerAuthenticator getJaspiAuthenticator(Deployment dep, JBossWebservicesMetaData wsmd, Bus bus) {
String securityDomain = null;
if (wsmd != null) {
securityDomain = wsmd.getProperty(JaspiServerAuthenticator.JASPI_SECURITY_DOMAIN);
@@ -183,11 +185,17 @@
try
{
ServerAuthConfig serverConfig = provider.getServerAuthConfig(JBossWSAuthConstants.SOAP_LAYER, appId, callbackHandler);
- return new JaspiServerAuthenticator(serverConfig, securityDomain, jai);
+ Properties serverContextProperties = new Properties();
+ serverContextProperties.put("security-domain", securityDomain);
+ serverContextProperties.put("jaspi-policy", jai);
+ serverContextProperties.put(Bus.class, bus);
+ String authContextID = dep.getSimpleName();
+ ServerAuthContext sctx = serverConfig.getAuthContext(authContextID, null, serverContextProperties);
+ return new JaspiServerAuthenticator(sctx);
}
catch (Exception e)
{
- e.printStackTrace();
+ Loggers.DEPLOYMENT_LOGGER.cannotCreateServerAuthContext(securityDomain);
}
return null;
Modified: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/JaspiServerAuthenticator.java
===================================================================
--- stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/JaspiServerAuthenticator.java 2013-12-16 20:46:04 UTC (rev 18185)
+++ stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/JaspiServerAuthenticator.java 2013-12-17 08:34:08 UTC (rev 18186)
@@ -21,13 +21,9 @@
*/
package org.jboss.wsf.stack.cxf.jaspi;
-import java.util.Properties;
-
-import javax.security.auth.Subject;
import javax.security.auth.message.AuthException;
import javax.security.auth.message.AuthStatus;
import javax.security.auth.message.MessageInfo;
-import javax.security.auth.message.config.ServerAuthConfig;
import javax.security.auth.message.config.ServerAuthContext;
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPMessage;
@@ -42,138 +38,104 @@
import org.apache.cxf.interceptor.OutgoingChainInterceptor;
import org.apache.cxf.message.Message;
import org.apache.cxf.message.MessageImpl;
-import org.jboss.security.auth.login.JASPIAuthenticationInfo;
import org.jboss.security.auth.message.GenericMessageInfo;
-/**
+
+/**
* @author <a href="ema(a)redhat.com">Jim Ma</a>
*/
-public class JaspiServerAuthenticator
-{
- public static final String JASPI_SECURITY_DOMAIN = "jaspi.security.domain";
- private ServerAuthConfig serverConfig;
- private String securityDomain;
- private JASPIAuthenticationInfo jpi;
+public class JaspiServerAuthenticator {
+ public static final String JASPI_SECURITY_DOMAIN = "jaspi.security.domain";
+ private ServerAuthContext sctx;
- public JaspiServerAuthenticator(ServerAuthConfig serverConfig, String securityDomain, JASPIAuthenticationInfo jpi)
- {
+ public JaspiServerAuthenticator(ServerAuthContext sctx) {
+ this.sctx = sctx;
+ }
- this.serverConfig = serverConfig;
- this.securityDomain = securityDomain;
- this.jpi = jpi;
- }
+ public void validateRequest(SoapMessage message) {
+ SOAPMessage soapMessage = message.getContent(SOAPMessage.class);
+ MessageInfo messageInfo = new GenericMessageInfo(soapMessage, null);
+ AuthStatus authStatus;
+ try {
+ authStatus = sctx.validateRequest(messageInfo, null, null);
+ } catch (AuthException e) {
+ if (isSOAP12(message)) {
+ SoapFault soap12Fault = new SoapFault(e.getMessage(), Soap12
+ .getInstance().getReceiver());
+ throw soap12Fault;
+ } else {
+ throw new SoapFault(e.getMessage(), new QName("",
+ "japsi AuthException"));
+ }
+ }
+ Message response = null;
+ if (messageInfo.getResponseMessage() != null
+ && !message.getExchange().isOneWay()) {
- public void validateRequest(SoapMessage message)
- {
- SOAPMessage soapMessage = message.getContent(SOAPMessage.class);
- MessageInfo messageInfo = new GenericMessageInfo(soapMessage, null);
- String authContextID = serverConfig.getAuthContextID(messageInfo);
+ Endpoint e = message.getExchange().get(Endpoint.class);
- Properties serverContextProperties = new Properties();
- serverContextProperties.put("security-domain", securityDomain);
- serverContextProperties.put("jaspi-policy", jpi);
- Subject clientSubject = new Subject();
- AuthStatus authStatus = null;
- try
- {
- ServerAuthContext sctx = serverConfig.getAuthContext(authContextID, clientSubject, serverContextProperties);
-
- authStatus = sctx.validateRequest(messageInfo, clientSubject, null);
- }
- catch (AuthException e)
- {
- if (isSOAP12(message))
- {
- SoapFault soap12Fault = new SoapFault(e.getMessage(), Soap12.getInstance().getReceiver());
- throw soap12Fault;
- }
- else
- {
- throw new SoapFault(e.getMessage(), new QName("", "japsi AuthException"));
- }
- }
- Message response = null;
- if (messageInfo.getResponseMessage() != null && !message.getExchange().isOneWay())
- {
+ response = new MessageImpl();
+ response.setExchange(message.getExchange());
+ response = e.getBinding().createMessage(response);
+ message.getExchange().setOutMessage(response);
+ response.setContent(SOAPMessage.class,
+ messageInfo.getResponseMessage());
+ if (AuthStatus.SEND_CONTINUE == authStatus) {
+ response.put(Message.RESPONSE_CODE, Integer.valueOf(303));
+ }
+ if (AuthStatus.SEND_FAILURE == authStatus) {
+ response.put(Message.RESPONSE_CODE, Integer.valueOf(500));
+ }
- Endpoint e = message.getExchange().get(Endpoint.class);
+ message.getInterceptorChain().abort();
+ InterceptorChain chain = OutgoingChainInterceptor
+ .getOutInterceptorChain(message.getExchange());
+ response.setInterceptorChain(chain);
+ chain.doInterceptStartingAfter(response,
+ SoapPreProtocolOutInterceptor.class.getName());
- response = new MessageImpl();
- response.setExchange(message.getExchange());
- response = e.getBinding().createMessage(response);
- message.getExchange().setOutMessage(response);
- response.setContent(SOAPMessage.class, messageInfo.getResponseMessage());
- if (AuthStatus.SEND_CONTINUE == authStatus)
- {
- response.put(Message.RESPONSE_CODE, Integer.valueOf(303));
- }
- if (AuthStatus.SEND_FAILURE == authStatus)
- {
- response.put(Message.RESPONSE_CODE, Integer.valueOf(500));
- }
+ }
- message.getInterceptorChain().abort();
- InterceptorChain chain = OutgoingChainInterceptor.getOutInterceptorChain(message.getExchange());
- response.setInterceptorChain(chain);
- chain.doInterceptStartingAfter(response, SoapPreProtocolOutInterceptor.class.getName());
+ }
- }
+ public void secureResponse(SoapMessage message) {
+ SOAPMessage request = message.getExchange().getInMessage()
+ .get(SOAPMessage.class);
+ SOAPMessage response = message.getContent(SOAPMessage.class);
+ MessageInfo messageInfo = new GenericMessageInfo(request, response);
+ AuthStatus authStatus = null;
+ try {
+ authStatus = sctx.secureResponse(messageInfo, null);
+ } catch (AuthException e) {
+ if (isSOAP12(message)) {
+ SoapFault soap12Fault = new SoapFault(e.getMessage(), Soap12
+ .getInstance().getReceiver());
+ throw soap12Fault;
+ } else {
+ throw new SoapFault(e.getMessage(), new QName("",
+ "japsi AuthException"));
+ }
+ }
+ if (messageInfo.getResponseMessage() != null
+ && !message.getExchange().isOneWay()) {
+ if (AuthStatus.SEND_CONTINUE == authStatus) {
+ message.put(Message.RESPONSE_CODE, Integer.valueOf(303));
+ }
+ if (AuthStatus.SEND_FAILURE == authStatus) {
+ message.put(Message.RESPONSE_CODE, Integer.valueOf(500));
+ }
+ }
- }
+ }
- public void secureResponse(SoapMessage message)
- {
- SOAPMessage request = message.getExchange().getInMessage().get(SOAPMessage.class);
- SOAPMessage response = message.getContent(SOAPMessage.class);
- MessageInfo messageInfo = new GenericMessageInfo(request, response);
- String authContextID = serverConfig.getAuthContextID(messageInfo);
+ private boolean isSOAP12(Message message) {
+ if (message.getExchange().getBinding() instanceof SoapBinding) {
+ SoapBinding binding = (SoapBinding) message.getExchange()
+ .getBinding();
+ if (binding.getSoapVersion() == Soap12.getInstance()) {
+ return true;
+ }
+ }
+ return false;
+ }
- Properties serverContextProperties = new Properties();
- serverContextProperties.put("security-domain", securityDomain);
- serverContextProperties.put("jaspi-policy", jpi);
- Subject clientSubject = new Subject();
- AuthStatus authStatus = null;
- try
- {
- ServerAuthContext sctx = serverConfig.getAuthContext(authContextID, clientSubject, serverContextProperties);
- authStatus = sctx.secureResponse(messageInfo, null);
- }
- catch (AuthException e)
- {
- if (isSOAP12(message))
- {
- SoapFault soap12Fault = new SoapFault(e.getMessage(), Soap12.getInstance().getReceiver());
- throw soap12Fault;
- }
- else
- {
- throw new SoapFault(e.getMessage(), new QName("", "japsi AuthException"));
- }
- }
- if (messageInfo.getResponseMessage() != null && !message.getExchange().isOneWay())
- {
- if (AuthStatus.SEND_CONTINUE == authStatus)
- {
- message.put(Message.RESPONSE_CODE, Integer.valueOf(303));
- }
- if (AuthStatus.SEND_FAILURE == authStatus)
- {
- message.put(Message.RESPONSE_CODE, Integer.valueOf(500));
- }
- }
-
- }
-
- private boolean isSOAP12(Message message)
- {
- if (message.getExchange().getBinding() instanceof SoapBinding)
- {
- SoapBinding binding = (SoapBinding)message.getExchange().getBinding();
- if (binding.getSoapVersion() == Soap12.getInstance())
- {
- return true;
- }
- }
- return false;
- }
-
}
Modified: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSClientAuthConfig.java
===================================================================
--- stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSClientAuthConfig.java 2013-12-16 20:46:04 UTC (rev 18185)
+++ stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSClientAuthConfig.java 2013-12-17 08:34:08 UTC (rev 18186)
@@ -63,8 +63,6 @@
Map<String, Map> mapOptionsByName = new HashMap<String, Map>();
- String secDomain = (String)properties.get("security-domain");
-
JASPIAuthenticationInfo jai = (JASPIAuthenticationInfo)properties.get("jaspi-policy");
AuthModuleEntry[] amearr = jai.getAuthModuleEntry();
Modified: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSServerAuthConfig.java
===================================================================
--- stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSServerAuthConfig.java 2013-12-16 20:46:04 UTC (rev 18185)
+++ stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSServerAuthConfig.java 2013-12-17 08:34:08 UTC (rev 18186)
@@ -45,7 +45,9 @@
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
+import org.apache.cxf.Bus;
import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.interceptor.InterceptorProvider;
import org.jboss.security.auth.callback.JBossCallbackHandler;
import org.jboss.security.auth.container.config.AuthModuleEntry;
import org.jboss.security.auth.login.JASPIAuthenticationInfo;
@@ -62,7 +64,7 @@
private CallbackHandler callbackHandler = new JBossCallbackHandler();
@SuppressWarnings("rawtypes")
private List modules = new ArrayList();
- @SuppressWarnings({ "unused", "rawtypes" })
+ @SuppressWarnings({"rawtypes" })
private Map contextProperties;
@SuppressWarnings("rawtypes")
@@ -80,8 +82,6 @@
List<ControlFlag> controlFlags = new ArrayList<ControlFlag>();
Map<String, Map> mapOptionsByName = new HashMap<String, Map>();
- String secDomain = (String)properties.get("security-domain");
-
JASPIAuthenticationInfo jai = (JASPIAuthenticationInfo)properties.get("jaspi-policy");
AuthModuleEntry[] amearr = jai.getAuthModuleEntry();
@@ -94,6 +94,7 @@
moduleCL = locator.get(jbossModule);
}
+ InterceptorProvider ip = (InterceptorProvider)contextProperties.get(InterceptorProvider.class);
for (AuthModuleEntry ame : amearr)
{
if (ame.getLoginModuleStackHolderName() != null)
@@ -105,7 +106,10 @@
ServerAuthModule sam = this.createSAM(moduleCL, ame.getAuthModuleName(), ame.getLoginModuleStackHolderName());
Map options = new HashMap();
-
+ options.put(InterceptorProvider.class, ip);
+ Bus bus = (Bus)properties.get(Bus.class);
+ options.put(Bus.class, bus);
+
sam.initialize(null, null, callbackHandler, options);
modules.add(sam);
}
Deleted: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/module/SOAPServerAuthModule.java
===================================================================
--- stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/module/SOAPServerAuthModule.java 2013-12-16 20:46:04 UTC (rev 18185)
+++ stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/module/SOAPServerAuthModule.java 2013-12-17 08:34:08 UTC (rev 18186)
@@ -1,139 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2013, Red Hat, Inc., and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.stack.cxf.jaspi.module;
-
-import java.util.Map.Entry;
-import java.util.Properties;
-
-import javax.security.auth.Subject;
-import javax.security.auth.message.AuthException;
-import javax.security.auth.message.AuthStatus;
-import javax.security.auth.message.MessageInfo;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-
-import org.apache.cxf.binding.soap.SoapMessage;
-import org.apache.cxf.binding.soap.SoapVersion;
-import org.apache.cxf.binding.soap.SoapVersionFactory;
-import org.apache.cxf.message.Exchange;
-import org.apache.cxf.message.ExchangeImpl;
-import org.apache.cxf.message.Message;
-import org.apache.cxf.message.MessageImpl;
-import org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor;
-import org.apache.ws.security.WSSConfig;
-import org.apache.ws.security.WSSecurityEngine;
-import org.jboss.security.auth.container.modules.AbstractServerAuthModule;
-import org.jboss.wsf.stack.cxf.jaspi.config.JBossWSAuthConstants;
-import org.jboss.wsf.stack.cxf.jaspi.validator.UsernameTokenValidator;
-/**
- * @author <a href="ema(a)redhat.com">Jim Ma</a>
- */
-public class SOAPServerAuthModule extends AbstractServerAuthModule {
- private String securityDomainName = null;
- private WSSConfig wssConfig = WSSConfig.getNewInstance();
- private WSS4JInInterceptor wss4jInterceptor = new WSS4JInInterceptor();
- public SOAPServerAuthModule() {
- supportedTypes.add(Object.class);
- supportedTypes.add(SOAPMessage.class);
- }
-
- public SOAPServerAuthModule(String lmshName) {
- supportedTypes.add(Object.class);
- this.supportedTypes.add(SOAPMessage.class);
- securityDomainName = lmshName;
- }
-
- @Override
- public AuthStatus validateRequest(MessageInfo messageInfo,
- Subject clientSubject, Subject serviceSubject) throws AuthException {
- return validate(clientSubject, messageInfo) ? AuthStatus.SUCCESS : AuthStatus.FAILURE;
- }
-
- @Override
- protected boolean validate(Subject clientSubject, MessageInfo messageInfo)
- throws AuthException {
-
- SOAPMessage soapMessage = (SOAPMessage)messageInfo.getRequestMessage();
- SoapVersion soapVersion = null;
- try {
- String ns = soapMessage.getSOAPBody().getNamespaceURI();
- soapVersion = SoapVersionFactory.getInstance().getSoapVersion(ns);
- } catch (SOAPException e) {
- throw new AuthException(e.getMessage());
- }
- if (soapVersion == null) {
- throw new AuthException("Invalid soap message");
- }
-
-
- Exchange exchange = new ExchangeImpl();
- MessageImpl messageImpl = new MessageImpl();
- messageImpl.setExchange(exchange);
- SoapMessage cxfSoapMessage = new SoapMessage(messageImpl);
- cxfSoapMessage.setVersion(soapVersion);
- cxfSoapMessage.setContent(SOAPMessage.class, soapMessage);
- cxfSoapMessage.put(Message.HTTP_REQUEST_METHOD, "POST");
-
- setJASPICValidator(wssConfig, clientSubject);
- cxfSoapMessage.put(WSSConfig.class.getName(), wssConfig);
-
- for (Object key : options.keySet()) {
- cxfSoapMessage.put((String)key, options.get(key));
- }
- //set the wss4j config from messageinfo
- if (messageInfo.getMap().get(JBossWSAuthConstants.WSS4J_CONFIG) != null) {
- Properties props = (Properties)messageInfo.getMap().get(JBossWSAuthConstants.WSS4J_CONFIG);
- for(Entry<Object, Object> e : props.entrySet()) {
- cxfSoapMessage.put(e.getKey().toString(), e.getValue());
- }
- }
- wss4jInterceptor.handleMessage(cxfSoapMessage);
-
- return true;
-
- }
-
- public AuthStatus secureResponse(MessageInfo arg0, Subject arg1)
- throws AuthException {
- throw new UnsupportedOperationException();
- }
-
- protected void setJASPICValidator(WSSConfig wssconfig, Subject subject) {
- UsernameTokenValidator usernameTokenValidator = new UsernameTokenValidator(subject);
- usernameTokenValidator.setContextName(getSecurityDomainName());
- wssconfig.setValidator(WSSecurityEngine.USERNAME_TOKEN, usernameTokenValidator);
- }
-
- protected String getSecurityDomainName() {
- if (this.securityDomainName != null)
- return securityDomainName;
-
- // Check if it is passed in the options
- String domainName = (String) options
- .get("javax.security.auth.login.LoginContext");
- if (domainName == null) {
- domainName = getClass().getName();
- }
- return domainName;
- }
-
-}
\ No newline at end of file
Added: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/module/UsernameTokenServerAuthModule.java
===================================================================
--- stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/module/UsernameTokenServerAuthModule.java (rev 0)
+++ stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/module/UsernameTokenServerAuthModule.java 2013-12-17 08:34:08 UTC (rev 18186)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.cxf.jaspi.module;
+
+import java.util.Map;
+
+import javax.security.auth.Subject;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.message.AuthException;
+import javax.security.auth.message.AuthStatus;
+import javax.security.auth.message.MessageInfo;
+import javax.security.auth.message.MessagePolicy;
+import javax.xml.soap.SOAPMessage;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.interceptor.InterceptorProvider;
+import org.apache.cxf.ws.security.SecurityConstants;
+import org.jboss.security.auth.container.modules.AbstractServerAuthModule;
+import org.jboss.wsf.stack.cxf.security.authentication.JaspiSubjectCreatingInterceptor;
+
+/**
+ * @author <a href="ema(a)redhat.com">Jim Ma</a>
+ */
+public class UsernameTokenServerAuthModule extends AbstractServerAuthModule
+{
+ private String securityDomainName = null;
+ private Endpoint endpoint = null;
+ private Bus bus = null;
+ private InterceptorProvider ip = null;
+
+ @SuppressWarnings("rawtypes")
+ public void initialize(MessagePolicy requestPolicy, MessagePolicy responsePolicy, CallbackHandler handler, Map options) throws AuthException
+ {
+ super.initialize(requestPolicy, responsePolicy, handler, options);
+ endpoint = (Endpoint)options.get(Endpoint.class);
+ if (endpoint == null && options.get(Bus.class) != null)
+ {
+ bus = (Bus)options.get(Bus.class);
+ bus.setProperty(SecurityConstants.VALIDATE_TOKEN, false);
+ ip = (InterceptorProvider)bus;
+ }
+ if (endpoint != null) {
+ endpoint.put(SecurityConstants.VALIDATE_TOKEN, false);
+ ip = (InterceptorProvider)endpoint;
+ }
+ if (ip != null)
+ {
+ JaspiSubjectCreatingInterceptor jaspiInterceptor = new JaspiSubjectCreatingInterceptor(securityDomainName);
+ ip.getInInterceptors().add(jaspiInterceptor);
+ }
+
+ }
+
+ public UsernameTokenServerAuthModule()
+ {
+ supportedTypes.add(Object.class);
+ supportedTypes.add(SOAPMessage.class);
+ }
+
+ public UsernameTokenServerAuthModule(String lmshName)
+ {
+ supportedTypes.add(Object.class);
+ this.supportedTypes.add(SOAPMessage.class);
+ securityDomainName = lmshName;
+ }
+
+ @Override
+ public AuthStatus validateRequest(MessageInfo messageInfo, Subject clientSubject, Subject serviceSubject) throws AuthException
+ {
+ return AuthStatus.SUCCESS;
+ }
+
+ public AuthStatus secureResponse(MessageInfo arg0, Subject arg1) throws AuthException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ protected String getSecurityDomainName()
+ {
+ if (this.securityDomainName != null)
+ return securityDomainName;
+
+ // Check if it is passed in the options
+ String domainName = (String)options.get("javax.security.auth.login.LoginContext");
+ if (domainName == null)
+ {
+ domainName = getClass().getName();
+ }
+ return domainName;
+ }
+
+ @Override
+ protected boolean validate(Subject clientSubject, MessageInfo messageInfo) throws AuthException
+ {
+ return true;
+ }
+
+}
\ No newline at end of file
Property changes on: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/module/UsernameTokenServerAuthModule.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/JaspiSubjectCreatingInterceptor.java
===================================================================
--- stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/JaspiSubjectCreatingInterceptor.java (rev 0)
+++ stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/JaspiSubjectCreatingInterceptor.java 2013-12-17 08:34:08 UTC (rev 18186)
@@ -0,0 +1,72 @@
+package org.jboss.wsf.stack.cxf.security.authentication;
+
+import java.security.Principal;
+
+import javax.security.auth.Subject;
+
+import org.apache.cxf.common.security.SecurityToken;
+import org.apache.cxf.common.security.TokenType;
+import org.apache.cxf.common.security.UsernameToken;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.security.SecurityContext;
+import org.apache.ws.security.WSUsernameTokenPrincipal;
+import org.jboss.security.auth.callback.JBossCallbackHandler;
+import org.jboss.security.plugins.JBossAuthenticationManager;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.security.SecurityDomainContext;
+import org.jboss.wsf.stack.cxf.Loggers;
+import org.jboss.wsf.stack.cxf.Messages;
+
+public class JaspiSubjectCreatingInterceptor extends SubjectCreatingPolicyInterceptor
+{
+ private JBossAuthenticationManager authenticationManger;
+
+ public JaspiSubjectCreatingInterceptor(String securityDomain) {
+ super();
+ authenticationManger = new JBossAuthenticationManager(securityDomain, new JBossCallbackHandler());
+ }
+
+
+ @Override
+ public void handleMessage(Message message) throws Fault
+ {
+ Endpoint ep = message.getExchange().get(Endpoint.class);
+ SecurityDomainContext sdc = ep.getSecurityDomainContext();
+ SecurityContext context = message.get(SecurityContext.class);
+ if (context == null || context.getUserPrincipal() == null)
+ {
+ Loggers.SECURITY_LOGGER.userPrincipalNotAvailableOnCurrentMessage();
+ return;
+ }
+
+ SecurityToken token = message.get(SecurityToken.class);
+ Subject subject = null;
+ if (token != null)
+ {
+ //Try authenticating using SecurityToken info
+ if (token.getTokenType() != TokenType.UsernameToken)
+ {
+ throw Messages.MESSAGES.unsupportedTokenType(token.getTokenType());
+ }
+ UsernameToken ut = (UsernameToken) token;
+ subject = helper.createSubject(authenticationManger,ut.getName(), ut.getPassword(), ut.isHashed(), ut.getNonce(), ut.getCreatedTime());
+
+ }
+ else
+ {
+ //Try authenticating using WSS4J internal info (previously set into SecurityContext by WSS4JInInterceptor)
+ Principal p = context.getUserPrincipal();
+ if (!(p instanceof WSUsernameTokenPrincipal)) {
+ throw Messages.MESSAGES.couldNotGetSubjectInfo();
+ }
+ WSUsernameTokenPrincipal up = (WSUsernameTokenPrincipal) p;
+ subject = createSubject(sdc, up.getName(), up.getPassword(), up.isPasswordDigest(), up.getNonce(), up.getCreatedTime());
+ }
+
+ Principal principal = getPrincipal(context.getUserPrincipal(), subject);
+ message.put(SecurityContext.class, createSecurityContext(principal, subject));
+ }
+
+
+}
Property changes on: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/JaspiSubjectCreatingInterceptor.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java
===================================================================
--- stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java 2013-12-16 20:46:04 UTC (rev 18185)
+++ stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java 2013-12-17 08:34:08 UTC (rev 18186)
@@ -60,12 +60,12 @@
*/
public class SubjectCreatingInterceptor extends WSS4JInInterceptor
{
+ protected SubjectCreator helper = new SubjectCreator();
+
private static final Logger LOG = LogUtils.getL7dLogger(SubjectCreatingInterceptor.class);
private ThreadLocal<SecurityDomainContext> sdc = new ThreadLocal<SecurityDomainContext>();
-
- private SubjectCreator helper = new SubjectCreator();
-
+
private boolean supportDigestPasswords;
public SubjectCreatingInterceptor()
Modified: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java
===================================================================
--- stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java 2013-12-16 20:46:04 UTC (rev 18185)
+++ stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java 2013-12-17 08:34:08 UTC (rev 18186)
@@ -51,7 +51,7 @@
*/
public class SubjectCreatingPolicyInterceptor extends AbstractPhaseInterceptor<Message>
{
- private SubjectCreator helper = new SubjectCreator();
+ protected SubjectCreator helper = new SubjectCreator();
public SubjectCreatingPolicyInterceptor()
{
@@ -99,7 +99,7 @@
message.put(SecurityContext.class, createSecurityContext(principal, subject));
}
- private Subject createSubject(SecurityDomainContext sdc, String name, String password, boolean isDigest, String nonce, String creationTime)
+ protected Subject createSubject(SecurityDomainContext sdc, String name, String password, boolean isDigest, String nonce, String creationTime)
{
Subject subject = null;
try
Modified: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java
===================================================================
--- stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java 2013-12-16 20:46:04 UTC (rev 18185)
+++ stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java 2013-12-17 08:34:08 UTC (rev 18186)
@@ -35,6 +35,7 @@
import org.apache.cxf.common.security.SimplePrincipal;
import org.jboss.security.auth.callback.CallbackHandlerPolicyContextHandler;
+import org.jboss.security.plugins.JBossAuthenticationManager;
import org.jboss.ws.common.utils.DelegateClassLoader;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.security.SecurityDomainContext;
@@ -124,8 +125,67 @@
}
return subject;
}
+ //TODO:refactor this
+ public Subject createSubject(JBossAuthenticationManager manager, String name, String password, boolean isDigest, String nonce, String created)
+ {
+ if (isDigest)
+ {
+ verifyUsernameToken(nonce, created);
+ // It is not possible at the moment to figure out if the digest has been created
+ // using the original nonce bytes or the bytes of the (Base64)-encoded nonce, some
+ // legacy clients might use the (Base64)-encoded nonce bytes when creating a digest;
+ // lets default to true and assume the nonce has been Base-64 encoded, given that
+ // WSS4J client Base64-decodes the nonce before creating the digest
- private void verifyUsernameToken(String nonce, String created)
+ CallbackHandler handler = new UsernameTokenCallbackHandler(nonce, created, decodeNonce);
+ CallbackHandlerPolicyContextHandler.setCallbackHandler(handler);
+ }
+
+ // authenticate and populate Subject
+
+
+ Principal principal = new SimplePrincipal(name);
+ Subject subject = new Subject();
+
+ boolean TRACE = SECURITY_LOGGER.isTraceEnabled();
+ if (TRACE)
+ SECURITY_LOGGER.aboutToAuthenticate(manager.getSecurityDomain());
+
+ try
+ {
+ ClassLoader tccl = SecurityActions.getContextClassLoader();
+ //allow PicketBox to see jbossws modules' classes
+ SecurityActions.setContextClassLoader(createDelegateClassLoader(ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader(), tccl));
+ try
+ {
+ if (manager.isValid(principal, password, subject) == false)
+ {
+ throw MESSAGES.authenticationFailed(principal.getName());
+ }
+ }
+ finally
+ {
+ SecurityActions.setContextClassLoader(tccl);
+ }
+ }
+ finally
+ {
+ if (isDigest)
+ {
+ // does not remove the TL entry completely but limits the potential
+ // growth to a number of available threads in a container
+ CallbackHandlerPolicyContextHandler.setCallbackHandler(null);
+ }
+ }
+
+ if (TRACE)
+ SECURITY_LOGGER.authenticated(name);
+
+ return subject;
+ }
+
+
+ protected void verifyUsernameToken(String nonce, String created)
{
if (created != null)
{
Modified: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2013-12-16 20:46:04 UTC (rev 18185)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2013-12-17 08:34:08 UTC (rev 18186)
@@ -291,16 +291,6 @@
dir="${tests.output.dir}/test-resources/jaxws/cxf/httpauth/digest"
prefix="WEB-INF/"/>
</war>
-
- <war warfile="${tests.output.dir}/test-libs/jaxws-cxf-jaspi.war" webxml="${tests.output.dir}/test-resources/jaxws/cxf/jaspi/WEB-INF/web.xml">
- <classes dir="${tests.output.dir}/test-classes">
- <include name="org/jboss/test/ws/jaxws/cxf/jaspi/Endpoint*.class"/>
- </classes>
-
- <webinf dir="${tests.output.dir}/test-resources//jaxws/cxf/jaspi/WEB-INF">
- <include name="jboss-*.xml"/>
- </webinf>
- </war>
<!-- jaxws-cxf-jaxbintros -->
<jar destfile="${tests.output.dir}/test-libs/jaxws-cxf-jaxbintros.jar">
Modified: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml 2013-12-16 20:46:04 UTC (rev 18185)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml 2013-12-17 08:34:08 UTC (rev 18186)
@@ -509,7 +509,7 @@
<!-- jaxws-samples-wsse-policy-username -->
<war
- warfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-policy-username.war"
+ warfile="${tests.output.dir}/test-libs/jaxws-samples--username.war"
webxml="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/basic/username/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
<include name="org/jboss/test/ws/jaxws/samples/wsse/policy/basic/Service*.class"/>
@@ -543,6 +543,24 @@
<attribute name="Dependencies" value="org.jboss.ws.cxf.jbossws-cxf-client,org.apache.cxf.impl"/> <!-- cxf impl required due to custom interceptor in deployment -->
</manifest>
</war>
+
+ <!-- jaxws-samples-wsse-policy-username-jaspi -->
+ <war
+ warfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-policy-username-jaspi.war"
+ webxml="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/Service*.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wsse/policy/jaxws/*.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/jaspi/WEB-INF">
+ <include name="jboss-*.xml"/>
+ <include name="wsdl/*"/>
+ </webinf>
+ <manifest>
+ <attribute name="Dependencies" value="org.jboss.ws.cxf.jbossws-cxf-client,org.apache.cxf.impl"/> <!-- cxf impl required due to custom interceptor in deployment -->
+ </manifest>
+ </war>
+
<!-- jaxws-samples-wsse-policy-username-jaas-digest -->
<war
Added: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/JaspiAuthenticationTestCase.java
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/JaspiAuthenticationTestCase.java (rev 0)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/JaspiAuthenticationTestCase.java 2013-12-17 08:34:08 UTC (rev 18186)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.jaspi;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+
+import org.apache.cxf.ws.security.SecurityConstants;
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+
+//TODO: reuse jaas test
+public final class JaspiAuthenticationTestCase extends JBossWSTest
+{
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-username-jaspi";
+
+ public static Test suite()
+ {
+ TestSetup testSetup = new JBossWSCXFTestSetup(JaspiAuthenticationTestCase.class, "jaxws-samples-wsse-policy-username-jaspi.war") {
+
+ public void setUp() throws Exception
+ {
+ Map<String, String> loginModuleOptions = new HashMap<String, String>();
+ String usersPropFile = System.getProperty("org.jboss.ws.testsuite.securityDomain.users.propfile");
+ String rolesPropFile = System.getProperty("org.jboss.ws.testsuite.securityDomain.roles.propfile");
+ if (usersPropFile != null)
+ {
+ loginModuleOptions.put("usersProperties", usersPropFile);
+ }
+ if (rolesPropFile != null)
+ {
+ loginModuleOptions.put("rolesProperties", rolesPropFile);
+ }
+
+ Map<String, String> authModuleOptions = new HashMap<String, String>();
+ //authModuleOptions.put("action", "UsernameToken Timestamp");
+ JBossWSTestHelper.addJaspiSecurityDomain("jaspi", "jaas-lm-stack", loginModuleOptions, "org.jboss.wsf.stack.cxf.jaspi.module.UsernameTokenServerAuthModule",
+ authModuleOptions);
+ super.setUp();
+ }
+
+ public void tearDown() throws Exception
+ {
+ JBossWSTestHelper.removeSecurityDomain("jaspi");
+ super.tearDown();
+
+ }
+ };
+ return testSetup;
+ }
+
+ public void testAuthenticated() throws Exception
+ {
+ QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+ setupWsse(proxy, "kermit");
+ assertEquals("Secure Hello World!", proxy.sayHello());
+ }
+
+ public void testUnauthenticated() throws Exception
+ {
+ QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+ setupWsse(proxy, "snoopy");
+ try
+ {
+ proxy.sayHello();
+ fail("User snoopy shouldn't be authenticated.");
+ }
+ catch (Exception e)
+ {
+ //OK
+ }
+ }
+
+ private void setupWsse(ServiceIface proxy, String username)
+ {
+ ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.USERNAME, username);
+ ((BindingProvider)proxy).getRequestContext()
+ .put(SecurityConstants.CALLBACK_HANDLER, "org.jboss.test.ws.jaxws.samples.wsse.policy.jaspi.UsernamePasswordCallback");
+ }
+}
Property changes on: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/JaspiAuthenticationTestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/ServiceIface.java
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/ServiceIface.java (rev 0)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/ServiceIface.java 2013-12-17 08:34:08 UTC (rev 18186)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.jaspi;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@WebService
+(
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy"
+)
+public interface ServiceIface
+{
+ @WebMethod
+ String sayHello();
+
+ @WebMethod
+ String greetMe();
+}
Property changes on: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/ServiceIface.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/ServiceImpl.java
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/ServiceImpl.java (rev 0)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/ServiceImpl.java 2013-12-17 08:34:08 UTC (rev 18186)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.jaspi;
+
+import javax.jws.WebService;
+
+@WebService
+(
+ portName = "SecurityServicePort",
+ serviceName = "SecurityService",
+ wsdlLocation = "WEB-INF/wsdl/SecurityService.wsdl",
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.wsse.policy.jaspi.ServiceIface"
+)
+public class ServiceImpl implements ServiceIface
+{
+ public String sayHello()
+ {
+ return "Secure Hello World!";
+ }
+
+ public String greetMe()
+ {
+ return "Greetings!";
+ }
+}
Property changes on: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/ServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/UsernamePasswordCallback.java
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/UsernamePasswordCallback.java (rev 0)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/UsernamePasswordCallback.java 2013-12-17 08:34:08 UTC (rev 18186)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.jaspi;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import org.apache.ws.security.WSPasswordCallback;
+
+public class UsernamePasswordCallback implements CallbackHandler
+{
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
+ {
+ WSPasswordCallback pc = (WSPasswordCallback)callbacks[0];
+ if ("kermit".equals(pc.getIdentifier()))
+ pc.setPassword("thefrog");
+ else
+ pc.setPassword("wrong password");
+ }
+}
Property changes on: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/UsernamePasswordCallback.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/jboss-webservices.xml
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/jboss-webservices.xml (rev 0)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/jboss-webservices.xml 2013-12-17 08:34:08 UTC (rev 18186)
@@ -0,0 +1,13 @@
+<?xml version="1.1" encoding="UTF-8"?>
+<webservices
+ xmlns="http://www.jboss.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ version="1.2"
+ xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee">
+
+ <property>
+ <name>jaspi.security.domain</name>
+ <value>jaspi</value>
+ </property>
+
+</webservices>
\ No newline at end of file
Property changes on: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/jboss-webservices.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/web.xml
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/web.xml (rev 0)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/web.xml 2013-12-17 08:34:08 UTC (rev 18186)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app
+ version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+ <servlet>
+ <servlet-name>TestService</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.samples.wsse.policy.jaspi.ServiceImpl</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestService</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+</web-app>
Property changes on: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/web.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/wsdl/SecurityService.wsdl
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/wsdl/SecurityService.wsdl (rev 0)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/wsdl/SecurityService.wsdl 2013-12-17 08:34:08 UTC (rev 18186)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<definitions targetNamespace="http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy" name="SecurityService"
+ xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsaws="http://www.w3.org/2005/08/addressing">
+ <types>
+ <xsd:schema>
+ <xsd:import namespace="http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy" schemaLocation="SecurityService_schema1.xsd"/>
+ </xsd:schema>
+ </types>
+ <message name="sayHello">
+ <part name="parameters" element="tns:sayHello"/>
+ </message>
+ <message name="sayHelloResponse">
+ <part name="parameters" element="tns:sayHelloResponse"/>
+ </message>
+ <message name="greetMe">
+ <part name="parameters" element="tns:greetMe"/>
+ </message>
+ <message name="greetMeResponse">
+ <part name="parameters" element="tns:greetMeResponse"/>
+ </message>
+ <portType name="ServiceIface">
+ <operation name="sayHello">
+ <input message="tns:sayHello"/>
+ <output message="tns:sayHelloResponse"/>
+ </operation>
+ <operation name="greetMe">
+ <input message="tns:greetMe"/>
+ <output message="tns:greetMeResponse"/>
+ </operation>
+ </portType>
+ <binding name="SecurityServicePortBinding" type="tns:ServiceIface">
+ <wsp:PolicyReference URI="#SecurityServiceUsernameUnsecureTransportPolicy"/>
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="greetMe">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="SecurityService">
+ <port name="SecurityServicePort" binding="tns:SecurityServicePortBinding">
+ <soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-username-jaas"/>
+ </port>
+ </service>
+
+ <wsp:Policy wsu:Id="SecurityServiceUsernameUnsecureTransportPolicy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SupportingTokens xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:UsernameToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <wsp:Policy>
+ <sp:WssUsernameToken10/>
+ </wsp:Policy>
+ </sp:UsernameToken>
+ </wsp:Policy>
+ </sp:SupportingTokens>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+</definitions>
Property changes on: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/wsdl/SecurityService.wsdl
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/wsdl/SecurityService_schema1.xsd
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/wsdl/SecurityService_schema1.xsd (rev 0)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/wsdl/SecurityService_schema1.xsd 2013-12-17 08:34:08 UTC (rev 18186)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy" xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:element name="sayHello" type="tns:sayHello"/>
+
+ <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
+
+ <xs:complexType name="sayHello">
+ <xs:sequence/>
+ </xs:complexType>
+
+ <xs:complexType name="sayHelloResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:element name="greetMe" type="tns:greetMe"/>
+
+ <xs:element name="greetMeResponse" type="tns:greetMeResponse"/>
+
+ <xs:complexType name="greetMe">
+ <xs:sequence/>
+ </xs:complexType>
+
+ <xs:complexType name="greetMeResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
+
Property changes on: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/WEB-INF/wsdl/SecurityService_schema1.xsd
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
11 years
JBossWS SVN: r18185 - stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsdd.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-16 15:46:04 -0500 (Mon, 16 Dec 2013)
New Revision: 18185
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsdd/WSDiscoveryTestCase.java
Log:
[JBWS-3709] Restoring TIMEOUT setup when sending probe messages
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsdd/WSDiscoveryTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsdd/WSDiscoveryTestCase.java 2013-12-16 20:42:36 UTC (rev 18184)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsdd/WSDiscoveryTestCase.java 2013-12-16 20:46:04 UTC (rev 18185)
@@ -66,7 +66,7 @@
ProbeType pt = new ProbeType();
ScopesType scopes = new ScopesType();
pt.setScopes(scopes);
- List<ProbeMatchType> pmts = filterProbeMatchesForHost(client.probe(pt).getProbeMatch(), getServerHost());
+ List<ProbeMatchType> pmts = filterProbeMatchesForHost(client.probe(pt, TIMEOUT).getProbeMatch(), getServerHost());
List<ResolveMatchType> rmts = new LinkedList<ResolveMatchType>();
for (ProbeMatchType pmt : pmts) {
@@ -124,7 +124,7 @@
ProbeType pt = new ProbeType();
ScopesType scopes = new ScopesType();
pt.setScopes(scopes);
- List<ProbeMatchType> pmts = filterProbeMatchesForHost(client.probe(pt).getProbeMatch(), getServerHost());
+ List<ProbeMatchType> pmts = filterProbeMatchesForHost(client.probe(pt, TIMEOUT).getProbeMatch(), getServerHost());
List<ResolveMatchType> rmts = new LinkedList<ResolveMatchType>();
for (ProbeMatchType pmt : pmts) {
11 years
JBossWS SVN: r18184 - stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsdd.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-16 15:42:36 -0500 (Mon, 16 Dec 2013)
New Revision: 18184
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsdd/WSDiscoveryTestCase.java
Log:
[JBWS-3709] Modifying testcase a bit to avoid counting probe matches from different hosts on the same network when possible. Moreover, actually checking match count on resolve matches only, as the address is optional and can theoretically be omitted in probe matches.
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsdd/WSDiscoveryTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsdd/WSDiscoveryTestCase.java 2013-12-16 16:07:06 UTC (rev 18183)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsdd/WSDiscoveryTestCase.java 2013-12-16 20:42:36 UTC (rev 18184)
@@ -21,6 +21,8 @@
*/
package org.jboss.test.ws.jaxws.samples.wsdd;
+import java.net.URL;
+import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
@@ -34,7 +36,6 @@
import org.apache.cxf.BusFactory;
import org.apache.cxf.ws.discovery.WSDiscoveryClient;
import org.apache.cxf.ws.discovery.wsdl.ProbeMatchType;
-import org.apache.cxf.ws.discovery.wsdl.ProbeMatchesType;
import org.apache.cxf.ws.discovery.wsdl.ProbeType;
import org.apache.cxf.ws.discovery.wsdl.ResolveMatchType;
import org.apache.cxf.ws.discovery.wsdl.ScopesType;
@@ -65,11 +66,10 @@
ProbeType pt = new ProbeType();
ScopesType scopes = new ScopesType();
pt.setScopes(scopes);
- ProbeMatchesType pmts = client.probe(pt, TIMEOUT);
- assertNotNull(pmts);
- assertEquals(3, pmts.getProbeMatch().size());
+ List<ProbeMatchType> pmts = filterProbeMatchesForHost(client.probe(pt).getProbeMatch(), getServerHost());
+
List<ResolveMatchType> rmts = new LinkedList<ResolveMatchType>();
- for (ProbeMatchType pmt : pmts.getProbeMatch()) {
+ for (ProbeMatchType pmt : pmts) {
W3CEndpointReference epr = pmt.getEndpointReference();
ResolveMatchType rmt = client.resolve(epr, TIMEOUT);
assertNotNull("Could not resolve (timeout = " + TIMEOUT + " ms) reference: " + epr, rmt);
@@ -86,6 +86,34 @@
}
}
+ private List<ProbeMatchType> filterProbeMatchesForHost(List<ProbeMatchType> probes, String serverHost)
+ {
+ final List<ProbeMatchType> filtered = new ArrayList<ProbeMatchType>();
+ for (ProbeMatchType probeMatchType : probes)
+ {
+ final List<String> addresses = probeMatchType.getXAddrs();
+ if (addresses == null || addresses.isEmpty()) {
+ //add Probe Match if it has no address (which is optional and might be omitted on probe match result)
+ filtered.add(probeMatchType);
+ } else {
+ for (String addr : addresses) {
+ try {
+ final URL url = new URL(addr);
+ //add Probe Match only if it's from the current serverHost (for test purposes we do not want
+ //to consider match results that might be coming from other services on the same network)
+ if (url.getHost().contains(serverHost)) {
+ filtered.add(probeMatchType);
+ break;
+ }
+ } catch (Exception e) {
+ //ignore and move on
+ }
+ }
+ }
+ }
+ return filtered;
+ }
+
public void testInvocation() throws Exception
{
Bus bus = null;
@@ -96,11 +124,10 @@
ProbeType pt = new ProbeType();
ScopesType scopes = new ScopesType();
pt.setScopes(scopes);
- ProbeMatchesType pmts = client.probe(pt, TIMEOUT);
- assertNotNull(pmts);
- assertEquals(3, pmts.getProbeMatch().size());
+ List<ProbeMatchType> pmts = filterProbeMatchesForHost(client.probe(pt).getProbeMatch(), getServerHost());
+
List<ResolveMatchType> rmts = new LinkedList<ResolveMatchType>();
- for (ProbeMatchType pmt : pmts.getProbeMatch()) {
+ for (ProbeMatchType pmt : pmts) {
W3CEndpointReference epr = pmt.getEndpointReference();
ResolveMatchType rmt = client.resolve(epr, TIMEOUT);
assertNotNull("Could not resolve (timeout = " + TIMEOUT + " ms) reference: " + epr, rmt);
11 years
JBossWS SVN: r18183 - common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/ws/core/utils.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2013-12-16 11:07:06 -0500 (Mon, 16 Dec 2013)
New Revision: 18183
Modified:
common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/ws/core/utils/ResourceURL.java
Log:
JBPAPP-10417: changed os.name check to set and maintain a boolean
Modified: common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/ws/core/utils/ResourceURL.java
===================================================================
--- common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/ws/core/utils/ResourceURL.java 2013-12-16 15:23:57 UTC (rev 18182)
+++ common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/ws/core/utils/ResourceURL.java 2013-12-16 16:07:06 UTC (rev 18183)
@@ -39,6 +39,8 @@
public class ResourceURL
{
private URL targetURL;
+ //- JBPAPP-10417 handling of spaces in path.
+ private boolean isMacOs = System.getProperty("os.name").toLowerCase().startsWith("mac os x");
public ResourceURL(URL targetURL)
{
@@ -54,9 +56,8 @@
{
boolean isJarUrl = "jar".equals(targetURL.getProtocol());
- //- JBPAPP-10417 handling of spaces in path.
URL tmpTargetURL = this.targetURL;
- if (System.getProperty("os.name").toLowerCase().startsWith("mac os x")){
+ if (isMacOs){
tmpTargetURL = new URL(targetURL.getProtocol(), targetURL.getHost(),
targetURL.getPort(), URLEncoder.encode(targetURL.getFile(), "UTF-8"));
}
11 years
JBossWS SVN: r18182 - in stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss: ws/metadata/builder/jaxws and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2013-12-16 10:23:57 -0500 (Mon, 16 Dec 2013)
New Revision: 18182
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
Log:
JBPAPP-10417: installed toURI() calls as described in jira.
Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2013-12-16 15:23:11 UTC (rev 18181)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2013-12-16 15:23:57 UTC (rev 18182)
@@ -109,7 +109,7 @@
|| (wsdlPublishLoc != null
&& resourceAbsPath.indexOf(new File(new URL(wsdlPublishLoc).getPath()).getCanonicalPath()) >= 0))
{
- Element wsdlElement = DOMUtils.parse(impResourceFile.toURL().openStream());
+ Element wsdlElement = DOMUtils.parse(impResourceFile.toURI().toURL().openStream());
wsdlDoc = wsdlElement.getOwnerDocument();
}
else
Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2013-12-16 15:23:11 UTC (rev 18181)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2013-12-16 15:23:57 UTC (rev 18182)
@@ -456,7 +456,7 @@
});
writer.close();
- serviceMetaData.setWsdlLocation(wsdlFile.toURL());
+ serviceMetaData.setWsdlLocation(wsdlFile.toURI().toURL());
}
Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2013-12-16 15:23:11 UTC (rev 18181)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2013-12-16 15:23:57 UTC (rev 18182)
@@ -564,14 +564,14 @@
tmpFile = SchemaUtils.getSchemaTempFile(targetNS, wsdlContent);
tempFiles.add(tmpFile);
- publishedLocations.put(wsdlLoc, tmpFile.toURL());
+ publishedLocations.put(wsdlLoc, tmpFile.toURI().toURL());
}
else
{
tmpFile = SchemaUtils.getSchemaTempFile("no_namespace", wsdlContent);
tempFiles.add(tmpFile);
- publishedLocations.put(wsdlLoc, tmpFile.toURL());
+ publishedLocations.put(wsdlLoc, tmpFile.toURI().toURL());
}
// Handle schema includes
@@ -607,7 +607,7 @@
if (targetNS != null)
{
- schemaLocationsMap.put(targetNS, tmpFile.toURL());
+ schemaLocationsMap.put(targetNS, tmpFile.toURI().toURL());
}
else
{
Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java 2013-12-16 15:23:11 UTC (rev 18181)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java 2013-12-16 15:23:57 UTC (rev 18182)
@@ -114,22 +114,22 @@
WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
new WSDLWriter(wsdlDefinitions).write(fWriter, Constants.DEFAULT_XML_CHARSET);
- URL wsdlPublishURL = wsdlFile.toURL();
+ URL wsdlPublishURL = wsdlFile.toURI().toURL();
log.info("WSDL published to: " + wsdlPublishURL);
// udpate the wsdl file location
- serviceMetaData.setWsdlLocation(wsdlFile.toURL());
+ serviceMetaData.setWsdlLocation(wsdlPublishURL);
// Process the wsdl imports
Definition wsdl11Definition = wsdlDefinitions.getWsdlOneOneDefinition();
if (wsdl11Definition != null)
{
List<String> published = new LinkedList<String>();
- publishWsdlImports(wsdlFile.toURL(), wsdl11Definition, published);
+ publishWsdlImports(wsdlPublishURL, wsdl11Definition, published);
// Publish XMLSchema imports
Document document = wsdlDefinitions.getWsdlDocument();
- publishSchemaImports(wsdlFile.toURL(), document.getDocumentElement(), published);
+ publishSchemaImports(wsdlPublishURL, document.getDocumentElement(), published);
}
else
{
@@ -307,7 +307,7 @@
else
{
if (file.delete() == false)
- log.warn("Cannot delete published wsdl document: " + file.toURL());
+ log.warn("Cannot delete published wsdl document: " + file.toURI().toURL());
}
}
11 years
JBossWS SVN: r18181 - common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/ws/core/utils.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2013-12-16 10:23:11 -0500 (Mon, 16 Dec 2013)
New Revision: 18181
Modified:
common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/ws/core/utils/ResourceURL.java
Log:
JBPAPP-10417: added URLEncoder.encode for MAC OS X env
Modified: common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/ws/core/utils/ResourceURL.java
===================================================================
--- common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/ws/core/utils/ResourceURL.java 2013-12-13 20:43:53 UTC (rev 18180)
+++ common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/ws/core/utils/ResourceURL.java 2013-12-16 15:23:11 UTC (rev 18181)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.net.URLEncoder;
/**
* A wrapper around an URL that can handle input streams for resources in nested jars.
@@ -52,7 +53,16 @@
public InputStream openStream() throws IOException
{
boolean isJarUrl = "jar".equals(targetURL.getProtocol());
- return isJarUrl ? new JarUrlConnection(targetURL).getInputStream() : targetURL.openStream();
+
+ //- JBPAPP-10417 handling of spaces in path.
+ URL tmpTargetURL = this.targetURL;
+ if (System.getProperty("os.name").toLowerCase().startsWith("mac os x")){
+ tmpTargetURL = new URL(targetURL.getProtocol(), targetURL.getHost(),
+ targetURL.getPort(), URLEncoder.encode(targetURL.getFile(), "UTF-8"));
+ }
+
+ return isJarUrl ? new JarUrlConnection(tmpTargetURL).getInputStream() : tmpTargetURL.openStream();
+
}
public int hashCode()
11 years
JBossWS SVN: r18180 - in thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927: common/common/src/main/java/org/apache/cxf/common/util and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: klape
Date: 2013-12-13 15:43:53 -0500 (Fri, 13 Dec 2013)
New Revision: 18180
Modified:
thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/
thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/common/common/src/main/java/org/apache/cxf/common/util/ASMHelper.java
thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/common/common/src/main/java/org/apache/cxf/common/util/ReflectionUtil.java
thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java
thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
Log:
[JBPAPP-10927] Fix generics issue with @WebFault annotated exceptions
Property changes on: thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927
___________________________________________________________________
Modified: svn:mergeinfo
- /thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10627:17298
/thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129:17139-17140,17225,17231-17235
+ /thirdparty/cxf/branches/cxf-2.2.12:18178
/thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10627:17298
/thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129:17139-17140,17225,17231-17235
Modified: thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/common/common/src/main/java/org/apache/cxf/common/util/ASMHelper.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/common/common/src/main/java/org/apache/cxf/common/util/ASMHelper.java 2013-12-13 19:15:17 UTC (rev 18179)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/common/common/src/main/java/org/apache/cxf/common/util/ASMHelper.java 2013-12-13 20:43:53 UTC (rev 18180)
@@ -73,7 +73,7 @@
return buf.toString();
}
- protected static String periodToSlashes(String s) {
+ public static String periodToSlashes(String s) {
char ch[] = s.toCharArray();
for (int x = 0; x < ch.length; x++) {
if (ch[x] == '.') {
Modified: thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/common/common/src/main/java/org/apache/cxf/common/util/ReflectionUtil.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/common/common/src/main/java/org/apache/cxf/common/util/ReflectionUtil.java 2013-12-13 19:15:17 UTC (rev 18179)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/common/common/src/main/java/org/apache/cxf/common/util/ReflectionUtil.java 2013-12-13 20:43:53 UTC (rev 18180)
@@ -23,9 +23,12 @@
import java.beans.PropertyDescriptor;
import java.io.File;
import java.io.IOException;
+import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.*;
import org.apache.cxf.common.classloader.ClassLoaderUtils;
@@ -82,6 +85,19 @@
}
}
+ public static <T> Constructor<T>[] getDeclaredConstructors(final Class<T> cls) {
+ return AccessController.doPrivileged(new PrivilegedAction<Constructor<T>[]>() {
+ @SuppressWarnings("unchecked")
+ public Constructor<T>[] run() {
+ try {
+ return (Constructor<T>[])cls.getDeclaredConstructors();
+ } catch (SecurityException e) {
+ return null;
+ }
+ }
+ });
+ }
+
private static String getPackageName(String clzName) {
if (clzName.indexOf("/") == -1) {
return null;
Modified: thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java 2013-12-13 19:15:17 UTC (rev 18179)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java 2013-12-13 20:43:53 UTC (rev 18180)
@@ -21,6 +21,7 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Array;
+import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.Method;
@@ -30,6 +31,7 @@
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
import java.util.Collection;
+import java.util.Map;
import java.util.Set;
import javax.xml.bind.annotation.XmlAccessType;
@@ -43,6 +45,8 @@
import javax.xml.namespace.QName;
import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.apache.cxf.common.util.ASMHelper;
+import org.apache.cxf.common.util.ReflectionUtil;
import org.apache.cxf.common.util.StringUtils;
import org.apache.cxf.service.ServiceModelVisitor;
import org.apache.cxf.service.model.MessageInfo;
@@ -51,6 +55,10 @@
import org.apache.cxf.service.model.ServiceInfo;
import org.apache.cxf.service.model.UnwrappedOperationInfo;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+
/**
* Walks the service model and sets up the classes for the context.
*/
@@ -58,13 +66,16 @@
private Set<Class<?>> classes;
private Collection<Object> typeReferences;
+ private Map<String, Object> unmarshallerProperties;
public JAXBContextInitializer(ServiceInfo serviceInfo,
Set<Class<?>> classes,
- Collection<Object> typeReferences) {
+ Collection<Object> typeReferences,
+ Map<String, Object> unmarshallerProperties) {
super(serviceInfo);
this.classes = classes;
this.typeReferences = typeReferences;
+ this.unmarshallerProperties = unmarshallerProperties;
}
@Override
@@ -263,16 +274,24 @@
}
}
-
- private void addClass(Class<?> cls) {
- if (Throwable.class.isAssignableFrom(cls)) {
- if (!Throwable.class.equals(cls)
- && !Exception.class.equals(cls)) {
- walkReferences(cls);
+ void addClass(Class<?> claz) {
+ if (Throwable.class.isAssignableFrom(claz)) {
+ if (!Throwable.class.equals(claz)
+ && !Exception.class.equals(claz)) {
+ walkReferences(claz);
}
addClass(String.class);
+ } else if (claz.getName().startsWith("java.")
+ || claz.getName().startsWith("javax.")) {
+ return;
} else {
- cls = JAXBUtils.getValidClass(cls);
+ Class<?> cls = JAXBUtils.getValidClass(claz);
+ if (cls == null && ReflectionUtil.getDeclaredConstructors(claz).length > 0) {
+ //there is no init(), but other constructors
+ Object factory = createFactory(claz, ReflectionUtil.getDeclaredConstructors(claz)[0]);
+ unmarshallerProperties.put("com.sun.xml.bind.ObjectFactory", factory);
+ cls = claz;
+ }
if (null != cls) {
if (cls.getSuperclass() != null) {
//JAXB should do this, but it doesn't always.
@@ -455,4 +474,54 @@
}
return false;
}
+
+ @SuppressWarnings("unused")
+ private Object createFactory(Class<?> cls, Constructor<?> contructor) {
+ String newClassName = cls.getName() + "Factory";
+ ASMHelper helper = new ASMHelper();
+ ClassWriter cw = helper.createClassWriter();
+ MethodVisitor mv;
+
+ cw.visit(Opcodes.V1_6, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER,
+ ASMHelper.periodToSlashes(newClassName), null, "java/lang/Object", null);
+
+ cw.visitSource(cls.getSimpleName() + "Factory" + ".java", null);
+
+ mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(Opcodes.ALOAD, 0);
+ mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
+ mv.visitInsn(Opcodes.RETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+
+ mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "create" + cls.getSimpleName(),
+ "()L" + ASMHelper.periodToSlashes(cls.getName()) + ";", null, null);
+ mv.visitCode();
+ String name = cls.getName().replace(".", "/");
+ mv.visitTypeInsn(Opcodes.NEW, name);
+ mv.visitInsn(Opcodes.DUP);
+ StringBuilder paraString = new StringBuilder("(");
+
+ for (Class<?> paraClass : contructor.getParameterTypes()) {
+ mv.visitInsn(Opcodes.ACONST_NULL);
+ paraString.append("Ljava/lang/Object;");
+ }
+ paraString.append(")V");
+
+ mv.visitMethodInsn(Opcodes.INVOKESPECIAL, name, "<init>", paraString.toString());
+
+ mv.visitInsn(Opcodes.ARETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+
+ cw.visitEnd();
+ Class<?> factoryClass = helper.loadClass(newClassName, cls, cw.toByteArray());
+ try {
+ return factoryClass.newInstance();
+ } catch (Exception e) {
+ //ignore
+ }
+ return null;
+ }
}
Modified: thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java 2013-12-13 19:15:17 UTC (rev 18179)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java 2013-12-13 20:43:53 UTC (rev 18180)
@@ -304,9 +304,16 @@
contextClasses = new LinkedHashSet<Class<?>>();
+ Map<String, Object> unmarshallerProps = new HashMap<String, Object>();
+ this.setUnmarshallerProperties(unmarshallerProps);
for (ServiceInfo serviceInfo : service.getServiceInfos()) {
- JAXBContextInitializer initializer
- = new JAXBContextInitializer(serviceInfo, contextClasses, typeRefs);
+
+ JAXBContextInitializer initializer = new JAXBContextInitializer(
+ serviceInfo,
+ contextClasses,
+ typeRefs,
+ this.getUnmarshallerProperties()
+ );
initializer.walk();
if (serviceInfo.getProperty("extra.class") != null) {
Set<Class<?>> exClasses = serviceInfo.getProperty("extra.class", Set.class);
Modified: thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java 2013-12-13 19:15:17 UTC (rev 18179)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java 2013-12-13 20:43:53 UTC (rev 18180)
@@ -26,8 +26,10 @@
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
@@ -50,6 +52,7 @@
import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.common.util.ReflectionInvokationHandler;
+import org.apache.cxf.common.util.StringUtils;
import org.apache.cxf.common.xmlschema.SchemaCollection;
import org.apache.cxf.common.xmlschema.XmlSchemaUtils;
import org.apache.cxf.interceptor.Fault;
@@ -572,9 +575,13 @@
for (Field f : Utils.getFields(cls, accessType)) {
//map field
Type type = Utils.getFieldType(f);
- JAXBBeanInfo beanInfo = getBeanInfo(type);
- if (beanInfo != null) {
- addElement(elementList, beanInfo, new QName(namespace, f.getName()), isArray(type));
+ if (generateGenericType(type)) {
+ buildGenericElements(schema, elementList, f);
+ } else {
+ JAXBBeanInfo beanInfo = getBeanInfo(type);
+ if (beanInfo != null) {
+ addElement(elementList, beanInfo, new QName(namespace, f.getName()), isArray(type));
+ }
}
}
for (Method m : Utils.getGetters(cls, accessType)) {
@@ -586,13 +593,18 @@
if ((type == null) && (m.getGenericReturnType() instanceof ParameterizedType)) {
type = m.getGenericReturnType();
}
- JAXBBeanInfo beanInfo = getBeanInfo(type);
- if (beanInfo != null) {
- int idx = m.getName().startsWith("get") ? 3 : 2;
- String name = m.getName().substring(idx);
- name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
- addElement(elementList, beanInfo, new QName(namespace, name), isArray(type));
- }
+
+ if (generateGenericType(type)) {
+ buildGenericElements(schema, elementList, m, type);
+ } else {
+ JAXBBeanInfo beanInfo = getBeanInfo(type);
+ if (beanInfo != null) {
+ int idx = m.getName().startsWith("get") ? 3 : 2;
+ String name = m.getName().substring(idx);
+ name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
+ addElement(elementList, beanInfo, new QName(namespace, name), isArray(type));
+ }
+ }
}
if (propertyOrder != null && propertyOrder.length == elementList.size()) {
@@ -614,11 +626,110 @@
part.setProperty(JAXBDataBinding.class.getName() + ".CUSTOM_EXCEPTION", Boolean.TRUE);
}
+ private boolean generateGenericType(Type type) {
+ if (type instanceof ParameterizedType) {
+ ParameterizedType paramType = (ParameterizedType)type;
+ if (paramType.getActualTypeArguments().length > 1) {
+ return true;
+
+ }
+ }
+ return false;
+ }
+
+ private void buildGenericElements(XmlSchema schema, List<XmlSchemaElement> elementList, Field f) {
+ XmlSchemaComplexType generics = new XmlSchemaComplexType(schema);
+ Type type = f.getGenericType();
+ String rawType = ((ParameterizedType)type).getRawType().toString();
+ String typeName = StringUtils.uncapitalize(rawType.substring(rawType.lastIndexOf(".") + 1));
+ generics.setName(typeName);
+
+ Class<?> genericsClass = f.getType();
+ buildGenericSeq(schema, generics, genericsClass);
+
+ String name = Character.toLowerCase(f.getName().charAt(0)) + f.getName().substring(1);
+ XmlSchemaElement newel = new XmlSchemaElement();
+ newel.setName(name);
+ newel.setSchemaTypeName(generics.getQName());
+ newel.setMinOccurs(0);
+ elementList.add(newel);
+ }
+
+ private void buildGenericElements(XmlSchema schema,
+ List<XmlSchemaElement> elementList, Method m, Type type) {
+ String rawType = ((ParameterizedType)type).getRawType().toString();
+ String typeName = StringUtils.uncapitalize(rawType.substring(rawType.lastIndexOf(".") + 1));
+
+ XmlSchemaComplexType generics = (XmlSchemaComplexType)schema.getTypeByName(typeName);
+ if (generics == null) {
+ generics = new XmlSchemaComplexType(schema);
+ generics.setName(typeName);
+ }
+
+ Class<?> genericsClass = m.getReturnType();
+ buildGenericSeq(schema, generics, genericsClass);
+
+ int idx = m.getName().startsWith("get") ? 3 : 2;
+ String name = m.getName().substring(idx);
+ name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
+ XmlSchemaElement newel = new XmlSchemaElement();
+ newel.setName(name);
+ newel.setSchemaTypeName(generics.getQName());
+ newel.setMinOccurs(0);
+ elementList.add(newel);
+ }
+
+ private void buildGenericSeq(XmlSchema schema, XmlSchemaComplexType generics, Class<?> genericsClass) {
+ XmlSchemaSequence genericsSeq = new XmlSchemaSequence();
+ generics.setParticle(genericsSeq);
+ XmlAccessType accessType = Utils.getXmlAccessType(genericsClass);
+
+ for (Field f : Utils.getFields(genericsClass, accessType)) {
+ if (f.getGenericType() instanceof TypeVariable) {
+ String genericName = Character.toLowerCase(f.getName().charAt(0)) + f.getName().substring(1);
+ XmlSchemaElement genericEle = new XmlSchemaElement();
+ genericEle.setName(genericName);
+ genericEle.setMinOccurs(0);
+ JAXBBeanInfo anyBean = getBeanInfo(context, f.getType());
+ Iterator<QName> itr = anyBean.getTypeNames().iterator();
+ if (!itr.hasNext()) {
+ return;
+ }
+ QName typeName = itr.next();
+ genericEle.setSchemaTypeName(typeName);
+ genericsSeq.getItems().add(genericEle);
+ }
+ }
+
+ for (Method genericMethod : Utils.getGetters(genericsClass, accessType)) {
+ if (genericMethod.getGenericReturnType() instanceof TypeVariable) {
+ int idx = genericMethod.getName().startsWith("get") ? 3 : 2;
+ String genericName = genericMethod.getName().substring(idx);
+ genericName = Character.toLowerCase(genericName.charAt(0)) + genericName.substring(1);
+ XmlSchemaElement genericEle = new XmlSchemaElement();
+ genericEle.setName(genericName);
+ genericEle.setMinOccurs(0);
+ JAXBBeanInfo anyBean = getBeanInfo(context, genericMethod.getReturnType());
+ Iterator<QName> itr = anyBean.getTypeNames().iterator();
+ if (!itr.hasNext()) {
+ return;
+ }
+ QName typeName = itr.next();
+ genericEle.setSchemaTypeName(typeName);
+ genericsSeq.getItems().add(genericEle);
+ }
+
+ }
+ }
+
static boolean isArray(Type cls) {
if (cls instanceof Class) {
return ((Class)cls).isArray();
} else if (cls instanceof ParameterizedType) {
- return true;
+ ParameterizedType pt = (ParameterizedType)cls;
+ return pt.getActualTypeArguments().length == 1
+ && pt.getRawType() instanceof Class
+ && Collection.class.isAssignableFrom((Class<?>)pt.getRawType());
} else if (cls instanceof GenericArrayType) {
return true;
}
Modified: thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java 2013-12-13 19:15:17 UTC (rev 18179)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java 2013-12-13 20:43:53 UTC (rev 18180)
@@ -204,6 +204,10 @@
static Class<?> getFieldType(Field f) {
XmlJavaTypeAdapter adapter = getFieldXJTA(f);
+ if (adapter == null && f.getGenericType() instanceof ParameterizedType
+ && ((ParameterizedType)f.getGenericType()).getActualTypeArguments().length == 1) {
+ return null;
+ }
Class<?> adapterType = getTypeFromXmlAdapter(adapter);
return adapterType != null ? adapterType : f.getType();
}
Modified: thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java 2013-12-13 19:15:17 UTC (rev 18179)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java 2013-12-13 20:43:53 UTC (rev 18180)
@@ -22,7 +22,9 @@
import java.io.OutputStream;
import java.io.StringWriter;
+import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -229,4 +231,24 @@
String xml = stringWriter.toString();
assertTrue(xml, xml.contains("greenland=\"uri:ultima:thule"));
}
+
+ @Test
+ public void testResursiveType() throws Exception {
+ Set<Class<?>> classes = new HashSet<Class<?>>();
+ Collection<Object> typeReferences = new ArrayList<Object>();
+ Map<String, Object> props = new HashMap<String, Object>();
+ JAXBContextInitializer init = new JAXBContextInitializer(null, classes, typeReferences, props);
+ init.addClass(Type2.class);
+ assertEquals(2, classes.size());
+ }
+
+ public abstract static class Type2 extends AddressEntity<Type2> {
+ }
+
+ public abstract static class AddressEntity<T extends AddressEntity<T>> {
+ public abstract Addressable<T> getEntity();
+ }
+
+ public interface Addressable<T extends AddressEntity<T>> {
+ }
}
11 years
JBossWS SVN: r18179 - thirdparty/cxf/branches.
by jbossws-commits@lists.jboss.org
Author: klape
Date: 2013-12-13 14:15:17 -0500 (Fri, 13 Dec 2013)
New Revision: 18179
Added:
thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10927/
Log:
Copying one-off branch
11 years
JBossWS SVN: r18178 - in thirdparty/cxf/branches/cxf-2.2.12: rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: klape
Date: 2013-12-13 14:06:32 -0500 (Fri, 13 Dec 2013)
New Revision: 18178
Modified:
thirdparty/cxf/branches/cxf-2.2.12/common/common/src/main/java/org/apache/cxf/common/util/ASMHelper.java
thirdparty/cxf/branches/cxf-2.2.12/common/common/src/main/java/org/apache/cxf/common/util/ReflectionUtil.java
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
Log:
[JBPAPP-10926][CXF-5437] Fix generics in @WebFault-annotated exceptions
Modified: thirdparty/cxf/branches/cxf-2.2.12/common/common/src/main/java/org/apache/cxf/common/util/ASMHelper.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/common/common/src/main/java/org/apache/cxf/common/util/ASMHelper.java 2013-12-13 12:26:19 UTC (rev 18177)
+++ thirdparty/cxf/branches/cxf-2.2.12/common/common/src/main/java/org/apache/cxf/common/util/ASMHelper.java 2013-12-13 19:06:32 UTC (rev 18178)
@@ -73,7 +73,7 @@
return buf.toString();
}
- protected static String periodToSlashes(String s) {
+ public static String periodToSlashes(String s) {
char ch[] = s.toCharArray();
for (int x = 0; x < ch.length; x++) {
if (ch[x] == '.') {
Modified: thirdparty/cxf/branches/cxf-2.2.12/common/common/src/main/java/org/apache/cxf/common/util/ReflectionUtil.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/common/common/src/main/java/org/apache/cxf/common/util/ReflectionUtil.java 2013-12-13 12:26:19 UTC (rev 18177)
+++ thirdparty/cxf/branches/cxf-2.2.12/common/common/src/main/java/org/apache/cxf/common/util/ReflectionUtil.java 2013-12-13 19:06:32 UTC (rev 18178)
@@ -23,9 +23,12 @@
import java.beans.PropertyDescriptor;
import java.io.File;
import java.io.IOException;
+import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.*;
import org.apache.cxf.common.classloader.ClassLoaderUtils;
@@ -82,6 +85,19 @@
}
}
+ public static <T> Constructor<T>[] getDeclaredConstructors(final Class<T> cls) {
+ return AccessController.doPrivileged(new PrivilegedAction<Constructor<T>[]>() {
+ @SuppressWarnings("unchecked")
+ public Constructor<T>[] run() {
+ try {
+ return (Constructor<T>[])cls.getDeclaredConstructors();
+ } catch (SecurityException e) {
+ return null;
+ }
+ }
+ });
+ }
+
private static String getPackageName(String clzName) {
if (clzName.indexOf("/") == -1) {
return null;
Modified: thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java 2013-12-13 12:26:19 UTC (rev 18177)
+++ thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java 2013-12-13 19:06:32 UTC (rev 18178)
@@ -21,6 +21,7 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Array;
+import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.Method;
@@ -30,6 +31,7 @@
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
import java.util.Collection;
+import java.util.Map;
import java.util.Set;
import javax.xml.bind.annotation.XmlAccessType;
@@ -43,6 +45,8 @@
import javax.xml.namespace.QName;
import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.apache.cxf.common.util.ASMHelper;
+import org.apache.cxf.common.util.ReflectionUtil;
import org.apache.cxf.common.util.StringUtils;
import org.apache.cxf.service.ServiceModelVisitor;
import org.apache.cxf.service.model.MessageInfo;
@@ -51,6 +55,10 @@
import org.apache.cxf.service.model.ServiceInfo;
import org.apache.cxf.service.model.UnwrappedOperationInfo;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+
/**
* Walks the service model and sets up the classes for the context.
*/
@@ -58,13 +66,16 @@
private Set<Class<?>> classes;
private Collection<Object> typeReferences;
+ private Map<String, Object> unmarshallerProperties;
public JAXBContextInitializer(ServiceInfo serviceInfo,
Set<Class<?>> classes,
- Collection<Object> typeReferences) {
+ Collection<Object> typeReferences,
+ Map<String, Object> unmarshallerProperties) {
super(serviceInfo);
this.classes = classes;
this.typeReferences = typeReferences;
+ this.unmarshallerProperties = unmarshallerProperties;
}
@Override
@@ -263,16 +274,24 @@
}
}
-
- private void addClass(Class<?> cls) {
- if (Throwable.class.isAssignableFrom(cls)) {
- if (!Throwable.class.equals(cls)
- && !Exception.class.equals(cls)) {
- walkReferences(cls);
+ void addClass(Class<?> claz) {
+ if (Throwable.class.isAssignableFrom(claz)) {
+ if (!Throwable.class.equals(claz)
+ && !Exception.class.equals(claz)) {
+ walkReferences(claz);
}
addClass(String.class);
+ } else if (claz.getName().startsWith("java.")
+ || claz.getName().startsWith("javax.")) {
+ return;
} else {
- cls = JAXBUtils.getValidClass(cls);
+ Class<?> cls = JAXBUtils.getValidClass(claz);
+ if (cls == null && ReflectionUtil.getDeclaredConstructors(claz).length > 0) {
+ //there is no init(), but other constructors
+ Object factory = createFactory(claz, ReflectionUtil.getDeclaredConstructors(claz)[0]);
+ unmarshallerProperties.put("com.sun.xml.bind.ObjectFactory", factory);
+ cls = claz;
+ }
if (null != cls) {
if (cls.getSuperclass() != null) {
//JAXB should do this, but it doesn't always.
@@ -439,4 +458,54 @@
}
return false;
}
+
+ @SuppressWarnings("unused")
+ private Object createFactory(Class<?> cls, Constructor<?> contructor) {
+ String newClassName = cls.getName() + "Factory";
+ ASMHelper helper = new ASMHelper();
+ ClassWriter cw = helper.createClassWriter();
+ MethodVisitor mv;
+
+ cw.visit(Opcodes.V1_6, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER,
+ ASMHelper.periodToSlashes(newClassName), null, "java/lang/Object", null);
+
+ cw.visitSource(cls.getSimpleName() + "Factory" + ".java", null);
+
+ mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(Opcodes.ALOAD, 0);
+ mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
+ mv.visitInsn(Opcodes.RETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+
+ mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "create" + cls.getSimpleName(),
+ "()L" + ASMHelper.periodToSlashes(cls.getName()) + ";", null, null);
+ mv.visitCode();
+ String name = cls.getName().replace(".", "/");
+ mv.visitTypeInsn(Opcodes.NEW, name);
+ mv.visitInsn(Opcodes.DUP);
+ StringBuilder paraString = new StringBuilder("(");
+
+ for (Class<?> paraClass : contructor.getParameterTypes()) {
+ mv.visitInsn(Opcodes.ACONST_NULL);
+ paraString.append("Ljava/lang/Object;");
+ }
+ paraString.append(")V");
+
+ mv.visitMethodInsn(Opcodes.INVOKESPECIAL, name, "<init>", paraString.toString());
+
+ mv.visitInsn(Opcodes.ARETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+
+ cw.visitEnd();
+ Class<?> factoryClass = helper.loadClass(newClassName, cls, cw.toByteArray());
+ try {
+ return factoryClass.newInstance();
+ } catch (Exception e) {
+ //ignore
+ }
+ return null;
+ }
}
Modified: thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java 2013-12-13 12:26:19 UTC (rev 18177)
+++ thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java 2013-12-13 19:06:32 UTC (rev 18178)
@@ -304,9 +304,16 @@
contextClasses = new LinkedHashSet<Class<?>>();
+ Map<String, Object> unmarshallerProps = new HashMap<String, Object>();
+ this.setUnmarshallerProperties(unmarshallerProps);
for (ServiceInfo serviceInfo : service.getServiceInfos()) {
- JAXBContextInitializer initializer
- = new JAXBContextInitializer(serviceInfo, contextClasses, typeRefs);
+
+ JAXBContextInitializer initializer = new JAXBContextInitializer(
+ serviceInfo,
+ contextClasses,
+ typeRefs,
+ this.getUnmarshallerProperties()
+ );
initializer.walk();
if (serviceInfo.getProperty("extra.class") != null) {
Set<Class<?>> exClasses = serviceInfo.getProperty("extra.class", Set.class);
Modified: thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java 2013-12-13 12:26:19 UTC (rev 18177)
+++ thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java 2013-12-13 19:06:32 UTC (rev 18178)
@@ -26,8 +26,10 @@
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
@@ -50,6 +52,7 @@
import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.common.util.ReflectionInvokationHandler;
+import org.apache.cxf.common.util.StringUtils;
import org.apache.cxf.common.xmlschema.SchemaCollection;
import org.apache.cxf.common.xmlschema.XmlSchemaUtils;
import org.apache.cxf.interceptor.Fault;
@@ -578,9 +581,13 @@
if ((type == null) && (f.getGenericType() instanceof ParameterizedType)) {
type = f.getGenericType();
}
- JAXBBeanInfo beanInfo = getBeanInfo(type);
- if (beanInfo != null) {
- addElement(elementList, beanInfo, new QName(namespace, f.getName()), isArray(type));
+ if (generateGenericType(type)) {
+ buildGenericElements(schema, elementList, f);
+ } else {
+ JAXBBeanInfo beanInfo = getBeanInfo(type);
+ if (beanInfo != null) {
+ addElement(elementList, beanInfo, new QName(namespace, f.getName()), isArray(type));
+ }
}
}
for (Method m : Utils.getGetters(cls, accessType)) {
@@ -592,13 +599,18 @@
if ((type == null) && (m.getGenericReturnType() instanceof ParameterizedType)) {
type = m.getGenericReturnType();
}
- JAXBBeanInfo beanInfo = getBeanInfo(type);
- if (beanInfo != null) {
- int idx = m.getName().startsWith("get") ? 3 : 2;
- String name = m.getName().substring(idx);
- name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
- addElement(elementList, beanInfo, new QName(namespace, name), isArray(type));
- }
+
+ if (generateGenericType(type)) {
+ buildGenericElements(schema, elementList, m, type);
+ } else {
+ JAXBBeanInfo beanInfo = getBeanInfo(type);
+ if (beanInfo != null) {
+ int idx = m.getName().startsWith("get") ? 3 : 2;
+ String name = m.getName().substring(idx);
+ name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
+ addElement(elementList, beanInfo, new QName(namespace, name), isArray(type));
+ }
+ }
}
if (propertyOrder != null && propertyOrder.length == elementList.size()) {
@@ -620,11 +632,110 @@
part.setProperty(JAXBDataBinding.class.getName() + ".CUSTOM_EXCEPTION", Boolean.TRUE);
}
+ private boolean generateGenericType(Type type) {
+ if (type instanceof ParameterizedType) {
+ ParameterizedType paramType = (ParameterizedType)type;
+ if (paramType.getActualTypeArguments().length > 1) {
+ return true;
+
+ }
+ }
+ return false;
+ }
+
+ private void buildGenericElements(XmlSchema schema, List<XmlSchemaElement> elementList, Field f) {
+ XmlSchemaComplexType generics = new XmlSchemaComplexType(schema);
+ Type type = f.getGenericType();
+ String rawType = ((ParameterizedType)type).getRawType().toString();
+ String typeName = StringUtils.uncapitalize(rawType.substring(rawType.lastIndexOf(".") + 1));
+ generics.setName(typeName);
+
+ Class<?> genericsClass = f.getType();
+ buildGenericSeq(schema, generics, genericsClass);
+
+ String name = Character.toLowerCase(f.getName().charAt(0)) + f.getName().substring(1);
+ XmlSchemaElement newel = new XmlSchemaElement();
+ newel.setName(name);
+ newel.setSchemaTypeName(generics.getQName());
+ newel.setMinOccurs(0);
+ elementList.add(newel);
+ }
+
+ private void buildGenericElements(XmlSchema schema,
+ List<XmlSchemaElement> elementList, Method m, Type type) {
+ String rawType = ((ParameterizedType)type).getRawType().toString();
+ String typeName = StringUtils.uncapitalize(rawType.substring(rawType.lastIndexOf(".") + 1));
+
+ XmlSchemaComplexType generics = (XmlSchemaComplexType)schema.getTypeByName(typeName);
+ if (generics == null) {
+ generics = new XmlSchemaComplexType(schema);
+ generics.setName(typeName);
+ }
+
+ Class<?> genericsClass = m.getReturnType();
+ buildGenericSeq(schema, generics, genericsClass);
+
+ int idx = m.getName().startsWith("get") ? 3 : 2;
+ String name = m.getName().substring(idx);
+ name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
+ XmlSchemaElement newel = new XmlSchemaElement();
+ newel.setName(name);
+ newel.setSchemaTypeName(generics.getQName());
+ newel.setMinOccurs(0);
+ elementList.add(newel);
+ }
+
+ private void buildGenericSeq(XmlSchema schema, XmlSchemaComplexType generics, Class<?> genericsClass) {
+ XmlSchemaSequence genericsSeq = new XmlSchemaSequence();
+ generics.setParticle(genericsSeq);
+ XmlAccessType accessType = Utils.getXmlAccessType(genericsClass);
+
+ for (Field f : Utils.getFields(genericsClass, accessType)) {
+ if (f.getGenericType() instanceof TypeVariable) {
+ String genericName = Character.toLowerCase(f.getName().charAt(0)) + f.getName().substring(1);
+ XmlSchemaElement genericEle = new XmlSchemaElement();
+ genericEle.setName(genericName);
+ genericEle.setMinOccurs(0);
+ JAXBBeanInfo anyBean = getBeanInfo(context, f.getType());
+ Iterator<QName> itr = anyBean.getTypeNames().iterator();
+ if (!itr.hasNext()) {
+ return;
+ }
+ QName typeName = itr.next();
+ genericEle.setSchemaTypeName(typeName);
+ genericsSeq.getItems().add(genericEle);
+ }
+ }
+
+ for (Method genericMethod : Utils.getGetters(genericsClass, accessType)) {
+ if (genericMethod.getGenericReturnType() instanceof TypeVariable) {
+ int idx = genericMethod.getName().startsWith("get") ? 3 : 2;
+ String genericName = genericMethod.getName().substring(idx);
+ genericName = Character.toLowerCase(genericName.charAt(0)) + genericName.substring(1);
+ XmlSchemaElement genericEle = new XmlSchemaElement();
+ genericEle.setName(genericName);
+ genericEle.setMinOccurs(0);
+ JAXBBeanInfo anyBean = getBeanInfo(context, genericMethod.getReturnType());
+ Iterator<QName> itr = anyBean.getTypeNames().iterator();
+ if (!itr.hasNext()) {
+ return;
+ }
+ QName typeName = itr.next();
+ genericEle.setSchemaTypeName(typeName);
+ genericsSeq.getItems().add(genericEle);
+ }
+
+ }
+ }
+
static boolean isArray(Type cls) {
if (cls instanceof Class) {
return ((Class)cls).isArray();
} else if (cls instanceof ParameterizedType) {
- return true;
+ ParameterizedType pt = (ParameterizedType)cls;
+ return pt.getActualTypeArguments().length == 1
+ && pt.getRawType() instanceof Class
+ && Collection.class.isAssignableFrom((Class<?>)pt.getRawType());
} else if (cls instanceof GenericArrayType) {
return true;
}
Modified: thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java 2013-12-13 12:26:19 UTC (rev 18177)
+++ thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java 2013-12-13 19:06:32 UTC (rev 18178)
@@ -204,7 +204,8 @@
static Class<?> getFieldType(Field f) {
XmlJavaTypeAdapter adapter = getFieldXJTA(f);
- if (adapter == null && f.getGenericType() instanceof ParameterizedType) {
+ if (adapter == null && f.getGenericType() instanceof ParameterizedType
+ && ((ParameterizedType)f.getGenericType()).getActualTypeArguments().length == 1) {
return null;
}
Class<?> adapterType = getTypeFromXmlAdapter(adapter);
Modified: thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java 2013-12-13 12:26:19 UTC (rev 18177)
+++ thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java 2013-12-13 19:06:32 UTC (rev 18178)
@@ -22,7 +22,9 @@
import java.io.OutputStream;
import java.io.StringWriter;
+import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -229,4 +231,24 @@
String xml = stringWriter.toString();
assertTrue(xml, xml.contains("greenland=\"uri:ultima:thule"));
}
+
+ @Test
+ public void testResursiveType() throws Exception {
+ Set<Class<?>> classes = new HashSet<Class<?>>();
+ Collection<Object> typeReferences = new ArrayList<Object>();
+ Map<String, Object> props = new HashMap<String, Object>();
+ JAXBContextInitializer init = new JAXBContextInitializer(null, classes, typeReferences, props);
+ init.addClass(Type2.class);
+ assertEquals(2, classes.size());
+ }
+
+ public abstract static class Type2 extends AddressEntity<Type2> {
+ }
+
+ public abstract static class AddressEntity<T extends AddressEntity<T>> {
+ public abstract Addressable<T> getEntity();
+ }
+
+ public interface Addressable<T extends AddressEntity<T>> {
+ }
}
11 years
JBossWS SVN: r18177 - in stack/cxf/trunk: modules/dist and 12 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-13 07:26:19 -0500 (Fri, 13 Dec 2013)
New Revision: 18177
Removed:
stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss710/
stack/cxf/trunk/modules/testsuite/src/test/resources/jboss712/
stack/cxf/trunk/modules/testsuite/src/test/resources/jboss713/
Modified:
stack/cxf/trunk/build.xml
stack/cxf/trunk/modules/dist/pom.xml
stack/cxf/trunk/modules/dist/src/main/distro/Install.txt
stack/cxf/trunk/modules/dist/src/main/distro/ant.properties.example
stack/cxf/trunk/modules/dist/src/main/distro/build-deploy.xml
stack/cxf/trunk/modules/dist/src/main/distro/build-setup.xml
stack/cxf/trunk/modules/dist/src/main/distro/build-testsuite.xml
stack/cxf/trunk/modules/dist/src/main/distro/build.xml
stack/cxf/trunk/modules/resources/pom.xml
stack/cxf/trunk/modules/server/src/main/scripts/antrun-beans-config.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/DefaultSchemaValidationTestCaseForked.java
stack/cxf/trunk/modules/testsuite/pom.xml
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2241/JBWS2241TestCase.java
stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTest.java
stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
stack/cxf/trunk/pom.xml
Log:
[JBWS-3740] Drop AS 7.1.x support
Modified: stack/cxf/trunk/build.xml
===================================================================
--- stack/cxf/trunk/build.xml 2013-12-13 09:57:24 UTC (rev 18176)
+++ stack/cxf/trunk/build.xml 2013-12-13 12:26:19 UTC (rev 18177)
@@ -68,12 +68,6 @@
<arg line="${maven.opts} help:effective-settings"/>
</exec>
<xmlproperty file="${dist.output.dir}/effective-settings.xml" keeproot="false"/>
- <condition property="jboss712.home" value="${profiles.profile.properties.jboss712.home}">
- <isset property="profiles.profile.properties.jboss712.home"/>
- </condition>
- <condition property="jboss713.home" value="${profiles.profile.properties.jboss713.home}">
- <isset property="profiles.profile.properties.jboss713.home"/>
- </condition>
<condition property="jboss720.home" value="${profiles.profile.properties.jboss720.home}">
<isset property="profiles.profile.properties.jboss720.home"/>
</condition>
@@ -82,16 +76,10 @@
</condition>
- <fail message="Application server home not set, jboss712.home=value, jboss713.home=value, jboss720.home=value or wildfly800.home=value to set">
+ <fail message="Application server home not set, jboss720.home=value or wildfly800.home=value to set">
<condition>
<and>
<not>
- <isset property="jboss712.home"/>
- </not>
- <not>
- <isset property="jboss713.home"/>
- </not>
- <not>
<isset property="jboss720.home"/>
</not>
<not>
@@ -102,8 +90,6 @@
</fail>
<echo/>
- <echo message="jboss712.home=${jboss712.home}"/>
- <echo message="jboss713.home=${jboss713.home}"/>
<echo message="jboss720.home=${jboss720.home}"/>
<echo message="wildfly800.home=${wildfly800.home}"/>
</target>
Modified: stack/cxf/trunk/modules/dist/pom.xml
===================================================================
--- stack/cxf/trunk/modules/dist/pom.xml 2013-12-13 09:57:24 UTC (rev 18176)
+++ stack/cxf/trunk/modules/dist/pom.xml 2013-12-13 12:26:19 UTC (rev 18177)
@@ -38,20 +38,6 @@
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-resources</artifactId>
<version>${project.version}</version>
- <classifier>jboss712</classifier>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.ws.cxf</groupId>
- <artifactId>jbossws-cxf-resources</artifactId>
- <version>${project.version}</version>
- <classifier>jboss713</classifier>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.ws.cxf</groupId>
- <artifactId>jbossws-cxf-resources</artifactId>
- <version>${project.version}</version>
<classifier>jboss720</classifier>
</dependency>
@@ -126,16 +112,6 @@
<!-- container integration -->
<dependency>
<groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss712-server-integration</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss713-server-integration</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.ws</groupId>
<artifactId>jbossws-jboss720-server-integration</artifactId>
<scope>provided</scope>
</dependency>
@@ -198,12 +174,6 @@
<configuration>
<target>
<mkdir dir="${basedir}/target/exclude-file" />
- <xslt style="${basedir}/src/main/distro/test-exclude.xsl" in="../testsuite/pom.xml" out="${basedir}/target/exclude-file/test-excludes-jboss712.txt">
- <param name="targetName" expression="jboss712" />
- </xslt>
- <xslt style="${basedir}/src/main/distro/test-exclude.xsl" in="../testsuite/pom.xml" out="${basedir}/target/exclude-file/test-excludes-jboss713.txt">
- <param name="targetName" expression="jboss713" />
- </xslt>
<xslt style="${basedir}/src/main/distro/test-exclude.xsl" in="../testsuite/pom.xml" out="${basedir}/target/exclude-file/test-excludes-jboss720.txt">
<param name="targetName" expression="jboss720" />
</xslt>
@@ -238,16 +208,6 @@
<!-- Libraries required for running binary distro testsuite and not available on server-->
<dependency>
<groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss712-tests-integration</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss713-tests-integration</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.ws</groupId>
<artifactId>jbossws-jboss720-tests-integration</artifactId>
<scope>provided</scope>
</dependency>
Modified: stack/cxf/trunk/modules/dist/src/main/distro/Install.txt
===================================================================
--- stack/cxf/trunk/modules/dist/src/main/distro/Install.txt 2013-12-13 09:57:24 UTC (rev 18176)
+++ stack/cxf/trunk/modules/dist/src/main/distro/Install.txt 2013-12-13 12:26:19 UTC (rev 18177)
@@ -13,8 +13,6 @@
2.) Modify the target container location in ant.properties
3.) Execute one of the following
- ant deploy-jboss712
- ant deploy-jboss713
ant deploy-jboss720
ant deploy-wildfly800
@@ -22,7 +20,7 @@
server. In order to do that, please add the -Dspring=true property option when
running the ant script:
- ant -Dspring=true deploy-jboss713
+ ant -Dspring=true deploy-jboss720
Please note Spring is required for advanced configuration only, whenever users
want to provide their own jbossws-cxf.xml Spring configuration file.
Modified: stack/cxf/trunk/modules/dist/src/main/distro/ant.properties.example
===================================================================
--- stack/cxf/trunk/modules/dist/src/main/distro/ant.properties.example 2013-12-13 09:57:24 UTC (rev 18176)
+++ stack/cxf/trunk/modules/dist/src/main/distro/ant.properties.example 2013-12-13 12:26:19 UTC (rev 18177)
@@ -3,13 +3,11 @@
#
# Optional JBoss Home
-jboss712.home=(a)jboss712.home@
-jboss713.home=(a)jboss713.home@
jboss720.home=(a)jboss720.home@
wildfly800.home=(a)wildfly800.home@
# The JBoss server under test. This can be [jboss712|jboss713|jboss720|wildfly800]
-jbossws.integration.target=jboss713
+jbossws.integration.target=jboss720
# The JBoss settings
jboss.bind.address=localhost
Modified: stack/cxf/trunk/modules/dist/src/main/distro/build-deploy.xml
===================================================================
--- stack/cxf/trunk/modules/dist/src/main/distro/build-deploy.xml 2013-12-13 09:57:24 UTC (rev 18176)
+++ stack/cxf/trunk/modules/dist/src/main/distro/build-deploy.xml 2013-12-13 12:26:19 UTC (rev 18177)
@@ -25,98 +25,6 @@
<project>
<!-- ================================================================== -->
- <!-- Prepare Deployment Structure JBoss-7.1.x -->
- <!-- ================================================================== -->
-
- <target name="deploy-structure-jboss71x" depends="prepare-deploy">
- <delete dir="${deploy.structure}"/>
-
- <path id="jboss.ant.tasks.classpath">
- <fileset dir="${deploy.artifacts.dir}">
- <include name="**/jbossws-common-tools.jar"/>
- <include name="**/jandex.jar"/>
- </fileset>
- </path>
- <taskdef name="installModules" classname="org.jboss.ws.tools.ant.InstallModulesTask" classpathref="jboss.ant.tasks.classpath"/>
- <taskdef name="jandex" classname="org.jboss.jandex.JandexAntTask" classpathref="jboss.ant.tasks.classpath"/>
-
- <jandex run="true" verbose="false" newJar="true">
- <fileset dir="${deploy.artifacts.dir}/lib">
- <include name="cxf*security.jar"/>
- </fileset>
- </jandex>
- <antcall target="deploy-jbossws-cxf-modules-as7" inheritall="false">
- <param name="installserver" value="${deploy.structure}/modules"/>
- <param name="thirdpartydir" value="${deploy.artifacts.dir}"/>
- <param name="jbossid" value="${jbossws.integration.target}"/>
- <param name="modules-jbossid" value="jboss710"/>
- </antcall>
- <copy toDir="${deploy.structure}/modules">
- <fileset dir="${deploy.artifacts.dir}/modules/jboss710">
- <include name="**/jboss/as/webservices/**/module.xml"/>
- </fileset>
- </copy>
- </target>
-
- <!-- ================================================================== -->
- <!-- Deployment jboss712 -->
- <!-- ================================================================== -->
-
- <target name="target-jboss712">
- <property name="jbossws.integration.target" value="jboss712"/>
- <echo message="jbossws.integration.target=${jbossws.integration.target}" file="${target.properties.file}"/>
- </target>
-
- <target name="deploy-jboss712" depends="undeploy-jboss712,deploy-structure-jboss71x,check-spring,install-spring-module71x" description="Deploy jbossws to jboss712">
- <fail message="Not available: ${jboss712.available.file}" unless="jboss712.available"/>
- <copy todir="${jboss712.home}" overwrite="true" verbose="true">
- <fileset dir="${deploy.structure}">
- <exclude name="**/jboss/as/webservices/**/module.xml"/>
- </fileset>
- </copy>
- <!-- Install org/jboss/as/webservices module.xml separately since it needs to reference libs already on the AS -->
- <installModules targetDir="${jboss712.home}/modules">
- <fileset dir="${deploy.structure}/modules">
- <include name="**/jboss/as/webservices/**/module.xml"/>
- </fileset>
- </installModules>
- </target>
-
- <target name="undeploy-jboss712" depends="target-jboss712,init" description="Remove jbossws from jboss712">
- <fail message="Not available: ${jboss712.available.file}" unless="jboss712.available"/>
- <macro-undeploy-jbossws-modules targetdir="${jboss712.home}/modules" defaultmodulesconf="${jbossws.default.modules.conf}" modifyjbossintegration="true"/>
- </target>
-
- <!-- ================================================================== -->
- <!-- Deployment jboss713 -->
- <!-- ================================================================== -->
-
- <target name="target-jboss713">
- <property name="jbossws.integration.target" value="jboss713"/>
- <echo message="jbossws.integration.target=${jbossws.integration.target}" file="${target.properties.file}"/>
- </target>
-
- <target name="deploy-jboss713" depends="undeploy-jboss713,deploy-structure-jboss71x,check-spring,install-spring-module71x" description="Deploy jbossws to jboss713">
- <fail message="Not available: ${jboss713.available.file}" unless="jboss713.available"/>
- <copy todir="${jboss713.home}" overwrite="true" verbose="true">
- <fileset dir="${deploy.structure}">
- <exclude name="**/jboss/as/webservices/**/module.xml"/>
- </fileset>
- </copy>
- <!-- Install org/jboss/as/webservices module.xml separately since it needs to reference libs already on the AS -->
- <installModules targetDir="${jboss713.home}/modules">
- <fileset dir="${deploy.structure}/modules">
- <include name="**/jboss/as/webservices/**/module.xml"/>
- </fileset>
- </installModules>
- </target>
-
- <target name="undeploy-jboss713" depends="target-jboss713,init" description="Remove jbossws from jboss713">
- <fail message="Not available: ${jboss713.available.file}" unless="jboss713.available"/>
- <macro-undeploy-jbossws-modules targetdir="${jboss713.home}/modules" defaultmodulesconf="${jbossws.default.modules.conf}" modifyjbossintegration="true"/>
- </target>
-
- <!-- ================================================================== -->
<!-- Prepare Deployment Structure JBoss-7.2.x -->
<!-- ================================================================== -->
@@ -254,14 +162,6 @@
</condition>
</target>
- <target name="install-spring-module71x" if="spring-required">
- <antcall target="deploy-spring-module" inheritall="false">
- <param name="installserver" value="${deploy.structure}/modules"/>
- <param name="thirdpartydir" value="${deploy.artifacts.dir}"/>
- <param name="modules-jbossid" value="jboss710"/>
- </antcall>
- </target>
-
<target name="install-spring-module72x" if="spring-required">
<antcall target="deploy-spring-module" inheritall="false">
<param name="installserver" value="${deploy.structure}/modules/system/layers/base"/>
Modified: stack/cxf/trunk/modules/dist/src/main/distro/build-setup.xml
===================================================================
--- stack/cxf/trunk/modules/dist/src/main/distro/build-setup.xml 2013-12-13 09:57:24 UTC (rev 18176)
+++ stack/cxf/trunk/modules/dist/src/main/distro/build-setup.xml 2013-12-13 12:26:19 UTC (rev 18177)
@@ -33,13 +33,9 @@
<!-- Load jbossws.integration.target properties -->
<property file="${target.properties.file}"/>
- <property name="jboss712.available.file" value="${jboss712.home}/jboss-modules.jar"/>
- <property name="jboss713.available.file" value="${jboss713.home}/jboss-modules.jar"/>
<property name="jboss720.available.file" value="${jboss720.home}/jboss-modules.jar"/>
<property name="wildfly800.available.file" value="${wildfly800.home}/jboss-modules.jar"/>
- <available property="jboss712.available" file="${jboss712.available.file}"/>
- <available property="jboss713.available" file="${jboss713.available.file}"/>
<available property="jboss720.available" file="${jboss720.available.file}"/>
<available property="wildfly800.available" file="${wildfly800.available.file}"/>
Modified: stack/cxf/trunk/modules/dist/src/main/distro/build-testsuite.xml
===================================================================
--- stack/cxf/trunk/modules/dist/src/main/distro/build-testsuite.xml 2013-12-13 09:57:24 UTC (rev 18176)
+++ stack/cxf/trunk/modules/dist/src/main/distro/build-testsuite.xml 2013-12-13 12:26:19 UTC (rev 18177)
@@ -31,12 +31,6 @@
<target name="tests-prepare" depends="prepare">
<!-- Define jboss.home -->
- <condition property="jboss.home" value="${jboss712.home}">
- <equals arg1="${jbossws.integration.target}" arg2="jboss712"/>
- </condition>
- <condition property="jboss.home" value="${jboss713.home}">
- <equals arg1="${jbossws.integration.target}" arg2="jboss713"/>
- </condition>
<condition property="jboss.home" value="${jboss720.home}">
<equals arg1="${jbossws.integration.target}" arg2="jboss720"/>
</condition>
@@ -120,7 +114,7 @@
</tstamp>
</target>
- <target name="tests-classpath" depends="tests-classpath-jboss71x,tests-classpath-jboss72x,tests-classpath-wildfly80x">
+ <target name="tests-classpath" depends="tests-classpath-jboss72x,tests-classpath-wildfly80x">
<path id="tests.javac.classpath">
<path refid="ws.stack.classpath"/>
<path refid="integration.target.javac.classpath"/>
@@ -130,169 +124,6 @@
<path refid="integration.target.client.classpath"/>
</path>
</target>
-
- <target name="tests-classpath-jboss71x" depends="tests-prepare" if="jbossws.integration.jboss71x">
-
- <!-- Java Endorsed -->
- <condition property="endorsed.dirs" value="${jboss.home}/modules/javax/xml/ws/api/main/">
- <isset property="jboss.home"/>
- </condition>
-
- <path id="integration.target.javac.classpath">
- <fileset dir="${jboss.home}/modules/javax/activation/api/main/">
- <include name="activation-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/javax/mail/api/main/">
- <include name="mail-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/common-core/main/">
- <include name="jboss-common-core-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/logging/main/">
- <include name="jboss-logging-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/picketlink/main/">
- <include name="picketlink-core*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/javax/ejb/api/main/">
- <include name="jboss-ejb-api_3.1_spec-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/ejb3/main/">
- <include name="jboss-ejb3-ext-api-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/javax/servlet/api/main/">
- <include name="jboss-servlet-api_3.0_spec-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/javax/annotation/api/main/">
- <include name="jboss-annotations-api_1.1_spec-*.jar"/>
- </fileset>
- </path>
-
- <!--
- The 's.client.classpath' contains jars that are available in the target container's client directory.
- There jars apply to all supported stacks. It MUST NOT contains jars from a local thirdparty dir.
-
- The 'ws.stack.classpath' contains jars that come with a specific stack distribution.
- The 's.extra.classpath' contains stack specific jars that are needed to run the stack specific tests.
- -->
- <path id="integration.target.client.classpath">
- <!-- included from thirdparty local dir as it's not installed on AS - START -->
- <pathelement location="${thirdparty.dir}/jbossws-${jbossws.integration.target}-tests-integration.jar"/>
- <!-- included from thirdparty local dir as it's not installed on AS - END -->
- <pathelement location="${jboss.home}/jboss-modules.jar"/>
- <fileset dir="${jboss.home}/modules/org/jboss/logging/main/">
- <include name="jboss-logging-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/as/controller/main/">
- <include name="jboss-as-controller-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/as/controller-client/main/">
- <include name="jboss-as-controller-client-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/as/server/main/">
- <include name="jboss-as-server-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/as/protocol/main/">
- <include name="jboss-as-protocol-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/dmr/main/">
- <include name="jboss-dmr-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/marshalling/main/">
- <include name="jboss-marshalling-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/slf4j/main/">
- <include name="slf4j-api-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/slf4j/jcl-over-slf4j/main/">
- <include name="jcl-over-slf4j-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/slf4j/impl/main/">
- <include name="slf4j-jboss-logmanager-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/logmanager/main/">
- <include name="jboss-logmanager-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/apache/log4j/main/">
- <include name="log4j-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/javax/mail/api/main/">
- <include name="mail-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/javax/servlet/api/main/">
- <include name="jboss-servlet-api_3.0_spec-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/javax/transaction/api/main/">
- <include name="jboss-transaction-api_1.1_spec-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/threads/main/">
- <include name="jboss-threads-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/picketbox/main/">
- <include name="picketbox-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/picketlink/main/">
- <include name="picketlink-core*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/javax/ejb/api/main/">
- <include name="jboss-ejb-api_3.1_spec-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/ejb-client/main/">
- <include name="jboss-ejb-client-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/apache/xerces/main/">
- <include name="xercesImpl-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/common-core/main/">
- <include name="jboss-common-core-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/javassist/main/">
- <include name="javassist-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/javax/security/jacc/api/main/">
- <include name="jboss-jacc-api*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/remoting3/main/">
- <include name="jboss-remoting-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/marshalling/river/main/">
- <include name="jboss-marshalling-river-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/remoting3/remoting-jmx/main/">
- <include name="remoting-jmx-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/sasl/main/">
- <include name="jboss-sasl-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/netty/main/">
- <include name="netty-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/xb/main/">
- <include name="jbossxb-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/joda/time/main/">
- <include name="joda-time-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/apache/xalan/main/">
- <include name="serializer-*.jar"/>
- <include name="xalan-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/codehaus/woodstox/main/">
- <include name="woodstox-core-asl-*.jar"/>
- <include name="stax2-api-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/xnio/main/">
- <include name="xnio-api-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/xnio/nio/main/">
- <include name="xnio-nio-*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/modules/org/jboss/remote-naming/main/">
- <include name="jboss-remote-naming-*.jar"/>
- </fileset>
- <pathelement location="${tools.jar}"/>
- </path>
- </target>
<target name="tests-classpath-jboss72x" depends="tests-prepare" if="jbossws.integration.jboss72x">
Modified: stack/cxf/trunk/modules/dist/src/main/distro/build.xml
===================================================================
--- stack/cxf/trunk/modules/dist/src/main/distro/build.xml 2013-12-13 09:57:24 UTC (rev 18176)
+++ stack/cxf/trunk/modules/dist/src/main/distro/build.xml 2013-12-13 12:26:19 UTC (rev 18177)
@@ -57,13 +57,6 @@
<fail message="jbossws.integration.target not set" unless="jbossws.integration.target"/>
<echo message="integration.target=${jbossws.integration.target}"/>
- <condition property="jbossws.integration.jboss71x" value="true">
- <or>
- <equals arg1="${jbossws.integration.target}" arg2="jboss712"/>
- <equals arg1="${jbossws.integration.target}" arg2="jboss713"/>
- </or>
- </condition>
-
<condition property="jbossws.integration.jboss72x" value="true">
<or>
<equals arg1="${jbossws.integration.target}" arg2="jboss720"/>
Modified: stack/cxf/trunk/modules/resources/pom.xml
===================================================================
--- stack/cxf/trunk/modules/resources/pom.xml 2013-12-13 09:57:24 UTC (rev 18176)
+++ stack/cxf/trunk/modules/resources/pom.xml 2013-12-13 12:26:19 UTC (rev 18177)
@@ -51,24 +51,6 @@
<phase>package</phase>
</execution>
<execution>
- <id>jboss712</id>
- <goals><goal>jar</goal></goals>
- <phase>package</phase>
- <configuration>
- <classifier>jboss712</classifier>
- <classesDirectory>${project.build.directory}/classes/resources/jbossws-jboss712/jbossws.beans</classesDirectory>
- </configuration>
- </execution>
- <execution>
- <id>jboss713</id>
- <goals><goal>jar</goal></goals>
- <phase>package</phase>
- <configuration>
- <classifier>jboss713</classifier>
- <classesDirectory>${project.build.directory}/classes/resources/jbossws-jboss713/jbossws.beans</classesDirectory>
- </configuration>
- </execution>
- <execution>
<id>jboss720</id>
<goals><goal>jar</goal></goals>
<phase>package</phase>
Modified: stack/cxf/trunk/modules/server/src/main/scripts/antrun-beans-config.xml
===================================================================
--- stack/cxf/trunk/modules/server/src/main/scripts/antrun-beans-config.xml 2013-12-13 09:57:24 UTC (rev 18176)
+++ stack/cxf/trunk/modules/server/src/main/scripts/antrun-beans-config.xml 2013-12-13 12:26:19 UTC (rev 18177)
@@ -31,24 +31,6 @@
<copy
file="${src.dir}/jbossws-cxf-config-as7.xml"
- tofile="${dest.dir}/jbossws-jboss712/jbossws.beans/META-INF/stack-specific-deployment-aspects.xml"
- />
- <copy
- file="${src.dir}/jbossws-jaxrpc-config-as7.xml"
- tofile="${dest.dir}/jbossws-jboss712/jbossws.beans/META-INF/jaxrpc-deployment-aspects.xml"
- />
-
- <copy
- file="${src.dir}/jbossws-cxf-config-as7.xml"
- tofile="${dest.dir}/jbossws-jboss713/jbossws.beans/META-INF/stack-specific-deployment-aspects.xml"
- />
- <copy
- file="${src.dir}/jbossws-jaxrpc-config-as7.xml"
- tofile="${dest.dir}/jbossws-jboss713/jbossws.beans/META-INF/jaxrpc-deployment-aspects.xml"
- />
-
- <copy
- file="${src.dir}/jbossws-cxf-config-as7.xml"
tofile="${dest.dir}/jbossws-jboss720/jbossws.beans/META-INF/stack-specific-deployment-aspects.xml"
/>
<copy
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java 2013-12-13 09:57:24 UTC (rev 18176)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java 2013-12-13 12:26:19 UTC (rev 18177)
@@ -107,15 +107,11 @@
* @throws Exception
*/
public void testDefaultClientConfigurationInContainer() throws Exception {
- if (!isTargetJBoss71()) {
- assertEquals("1", runTestInContainer("testDefaultClientConfiguration"));
- }
+ assertEquals("1", runTestInContainer("testDefaultClientConfiguration"));
}
public void testDefaultClientConfigurationOnDispatchInContainer() throws Exception {
- if (!isTargetJBoss71()) {
- assertEquals("1", runTestInContainer("testDefaultClientConfigurationOnDispatch"));
- }
+ assertEquals("1", runTestInContainer("testDefaultClientConfigurationOnDispatch"));
}
/**
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/DefaultSchemaValidationTestCaseForked.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/DefaultSchemaValidationTestCaseForked.java 2013-12-13 09:57:24 UTC (rev 18176)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/DefaultSchemaValidationTestCaseForked.java 2013-12-13 12:26:19 UTC (rev 18177)
@@ -55,13 +55,11 @@
* @throws Exception
*/
public void testDefaultClientValidation() throws Exception {
- if (!isTargetJBoss71()) {
- try {
- JBossWSTestHelper.deploy("jaxws-samples-schemavalidation.war");
- assertEquals("1", runInContainer("testDefaultClientValidation"));
- } finally {
- JBossWSTestHelper.undeploy("jaxws-samples-schemavalidation.war");
- }
+ try {
+ JBossWSTestHelper.deploy("jaxws-samples-schemavalidation.war");
+ assertEquals("1", runInContainer("testDefaultClientValidation"));
+ } finally {
+ JBossWSTestHelper.undeploy("jaxws-samples-schemavalidation.war");
}
}
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2013-12-13 09:57:24 UTC (rev 18176)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2013-12-13 12:26:19 UTC (rev 18177)
@@ -614,146 +614,6 @@
</profile>
<!--
- Name: jboss712
- Descr: JBoss-7.1.2 specific options
- -->
- <profile>
- <id>jboss712</id>
- <properties>
- <jboss.version>${jboss712.version}</jboss.version>
- <jbossws.integration.target>jboss712</jbossws.integration.target>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss712-tests-integration</artifactId>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <compilerArguments>
- <endorseddirs>${project.build.directory}/endorsed</endorseddirs>
- </compilerArguments>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <argLine>${surefire.jvm.args} ${surefire.jvm.management.args} ${surefire.default-mgmt-serurity.args} -Djava.endorsed.dirs=${project.build.directory}/endorsed</argLine>
- <excludes>
- <!--# [CXF-1519] Explicitly set the namespace of a WebFault-->
- <exclude>org/jboss/test/ws/jaxws/jbws1904/**</exclude>
-
- <!--# [CXF-2006] RespectBinding feature and not understood required extensibility elements-->
- <exclude>org/jboss/test/ws/jaxws/jbws2449/**</exclude>
-
- <!--# [JBWS-2561] XOP request not properly inlined-->
- <exclude>org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.*</exclude>
-
- <!--# [JBWS-2480] Soap attachments are dropped on server response-->
- <exclude>org/jboss/test/ws/jaxws/jbws1283/**</exclude>
-
- <!-- # [JBWS-3493] WS-Trust tests w/ PicketLink STS require PL 2.1.2.Final or greater -->
- <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase*</exclude>
-
- <!-- # Tests migrated from JBossWS-Native specific testsuite which are meant to pass with JBossWS-CXF too, but are still to be fixed -->
- <exclude>org/jboss/test/ws/jaxws/jbws2978/**</exclude>
-
- <!--# [JBWS-3441] Support CDI interceptors for POJO JAX-WS services -->
- <exclude>org/jboss/test/ws/jaxws/jbws3441/**</exclude>
-
- <!--# [AS7-537] Fixed on AS 8 or greater -->
- <exclude>org/jboss/test/ws/jaxws/cxf/noIntegration/AS7537TestCase**</exclude>
-
- <!--# [JBWS-3560] fastinfoset module is required in as712 -->
- <exclude>org/jboss/test/ws/jaxws/cxf/fastinfoset/FastInfosetTestCase*</exclude>
-
- <!--# [WFLY-308] Provide facility for running ejb3 ws endpoints authorization independently -->
- <exclude>org/jboss/test/ws/jaxws/handlerauth/HandlerAuthTestCase*</exclude>
-
- <!-- Manually setup KDC before run this test-->
- <exclude>org/jboss/test/ws/jaxws/samples/wsse/kerberos/*TestCase*</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <!--
- Name: jboss713
- Descr: JBoss-7.1.3 specific options
- -->
- <profile>
- <id>jboss713</id>
- <properties>
- <jboss.version>${jboss713.version}</jboss.version>
- <jbossws.integration.target>jboss713</jbossws.integration.target>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss713-tests-integration</artifactId>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <compilerArguments>
- <endorseddirs>${project.build.directory}/endorsed</endorseddirs>
- </compilerArguments>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <argLine>${surefire.jvm.args} ${surefire.jvm.management.args} ${surefire.default-mgmt-serurity.args} -Djava.endorsed.dirs=${project.build.directory}/endorsed</argLine>
- <excludes>
- <!--# [CXF-1519] Explicitly set the namespace of a WebFault-->
- <exclude>org/jboss/test/ws/jaxws/jbws1904/**</exclude>
-
- <!--# [CXF-2006] RespectBinding feature and not understood required extensibility elements-->
- <exclude>org/jboss/test/ws/jaxws/jbws2449/**</exclude>
-
- <!--# [JBWS-2561] XOP request not properly inlined-->
- <exclude>org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.*</exclude>
-
- <!--# [JBWS-2480] Soap attachments are dropped on server response-->
- <exclude>org/jboss/test/ws/jaxws/jbws1283/**</exclude>
-
- <!-- # [JBWS-3493] WS-Trust tests w/ PicketLink STS require PL 2.1.2.Final or greater -->
- <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase*</exclude>
-
- <!-- # Tests migrated from JBossWS-Native specific testsuite which are meant to pass with JBossWS-CXF too, but are still to be fixed -->
- <exclude>org/jboss/test/ws/jaxws/jbws2978/**</exclude>
-
- <!--# [JBWS-3441] Support CDI interceptors for POJO JAX-WS services -->
- <exclude>org/jboss/test/ws/jaxws/jbws3441/**</exclude>
-
- <!--# [AS7-537] Fixed on AS 8 or greater -->
- <exclude>org/jboss/test/ws/jaxws/cxf/noIntegration/AS7537TestCase**</exclude>
-
- <!--# [JBWS-3560] fastinfoset module is required in as713 -->
- <exclude>org/jboss/test/ws/jaxws/cxf/fastinfoset/FastInfosetTestCase*</exclude>
-
- <!--# [WFLY-308] Provide facility for running ejb3 ws endpoints authorization independently -->
- <exclude>org/jboss/test/ws/jaxws/handlerauth/HandlerAuthTestCase*</exclude>
-
- <!-- Manually setup KDC before run this test-->
- <exclude>org/jboss/test/ws/jaxws/samples/wsse/kerberos/*TestCase*</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <!--
Name: jboss720
Descr: JBoss-7.2.0 specific options
-->
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml 2013-12-13 09:57:24 UTC (rev 18176)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml 2013-12-13 12:26:19 UTC (rev 18177)
@@ -777,19 +777,6 @@
<include name="jboss-webservices.xml" />
</metainf>
</jar>
- <jar jarfile="${tests.output.dir}/test-libs/jaxws-jbws2241-as71.jar">
- <fileset dir="${tests.output.dir}/test-classes">
- <include name="org/jboss/test/ws/jaxws/jbws2241/EJB3Bean.class" />
- <include name="org/jboss/test/ws/jaxws/jbws2241/EJB3RemoteInterface.class" />
- <include name="org/jboss/test/ws/jaxws/jbws2241/EndpointInterface.class" />
- <include name="org/jboss/test/ws/jaxws/jbws2241/EndpointService.class" />
- </fileset>
- <metainf dir="${tests.output.dir}/test-resources/jaxws/jbws2241/META-INF-as71">
- <include name="jboss.xml" />
- <include name="jboss-ejb3.xml" />
- <include name="jboss-webservices.xml" />
- </metainf>
- </jar>
<!-- jaxws-jbws2250 -->
<war warfile="${tests.output.dir}/test-libs/jaxws-jbws2250.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws2250/WEB-INF/web.xml">
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java 2013-12-13 09:57:24 UTC (rev 18176)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java 2013-12-13 12:26:19 UTC (rev 18177)
@@ -122,15 +122,11 @@
* @throws Exception
*/
public void testDefaultClientConfigurationInContainer() throws Exception {
- if (!isTargetJBoss71()) {
- assertEquals("1", runTestInContainer("testDefaultClientConfiguration"));
- }
+ assertEquals("1", runTestInContainer("testDefaultClientConfiguration"));
}
public void testDefaultClientConfigurationOnDispatchInContainer() throws Exception {
- if (!isTargetJBoss71()) {
- assertEquals("1", runTestInContainer("testDefaultClientConfigurationOnDispatch"));
- }
+ assertEquals("1", runTestInContainer("testDefaultClientConfigurationOnDispatch"));
}
/**
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2241/JBWS2241TestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2241/JBWS2241TestCase.java 2013-12-13 09:57:24 UTC (rev 18176)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2241/JBWS2241TestCase.java 2013-12-13 12:26:19 UTC (rev 18177)
@@ -43,7 +43,7 @@
{
public static Test suite()
{
- return new JBossWSTestSetup(JBWS2241TestCase.class, isTargetJBoss71() ? "jaxws-jbws2241-as71.jar" : "jaxws-jbws2241.jar", true);
+ return new JBossWSTestSetup(JBWS2241TestCase.class, "jaxws-jbws2241.jar", true);
}
private EndpointInterface getPort(String user, String pwd) throws MalformedURLException {
Modified: stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTest.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTest.java 2013-12-13 09:57:24 UTC (rev 18176)
+++ stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTest.java 2013-12-13 12:26:19 UTC (rev 18177)
@@ -207,11 +207,6 @@
return JBossWSTestHelper.isTargetJBoss7();
}
- public static boolean isTargetJBoss71()
- {
- return JBossWSTestHelper.isTargetJBoss71();
- }
-
public static boolean isTargetJBoss72()
{
return JBossWSTestHelper.isTargetJBoss72();
Modified: stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2013-12-13 09:57:24 UTC (rev 18176)
+++ stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2013-12-13 12:26:19 UTC (rev 18177)
@@ -151,36 +151,18 @@
return target.startsWith("jboss7");
}
- public static boolean isTargetJBoss71()
- {
- String target = getIntegrationTarget();
- return target.startsWith("jboss71");
- }
-
public static boolean isTargetJBoss72()
{
String target = getIntegrationTarget();
return target.startsWith("jboss72");
}
- @Deprecated
- public static boolean isTargetJBoss8()
- {
- return isTargetJBoss8();
- }
-
public static boolean isTargetWildFly8()
{
String target = getIntegrationTarget();
return target.startsWith("wildfly8");
}
- @Deprecated
- public static boolean isTargetJBoss80()
- {
- return isTargetWildFly80();
- }
-
public static boolean isTargetWildFly80()
{
String target = getIntegrationTarget();
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2013-12-13 09:57:24 UTC (rev 18176)
+++ stack/cxf/trunk/pom.xml 2013-12-13 12:26:19 UTC (rev 18177)
@@ -63,12 +63,8 @@
<jbossws.spi.version>2.3.0-SNAPSHOT</jbossws.spi.version>
<jbossws.common.version>2.3.0-SNAPSHOT</jbossws.common.version>
<jbossws.common.tools.version>1.2.0.Final</jbossws.common.tools.version>
- <jbossws.jboss712.version>4.2.1.Final</jbossws.jboss712.version>
- <jbossws.jboss713.version>4.2.1.Final</jbossws.jboss713.version>
<jbossws.jboss720.version>4.3.0-SNAPSHOT</jbossws.jboss720.version>
<jbossws.native.version>4.1.2.Final</jbossws.native.version>
- <jboss712.version>7.1.2.Final</jboss712.version>
- <jboss713.version>7.1.3.Final</jboss713.version>
<jboss720.version>7.2.0.Final</jboss720.version>
<wildfly800.version>8.0.0.Beta2-SNAPSHOT</wildfly800.version>
<ejb.api.version>1.0.2.Final</ejb.api.version>
@@ -138,26 +134,6 @@
</dependency>
<dependency>
<groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss712-server-integration</artifactId>
- <version>${jbossws.jboss712.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss712-tests-integration</artifactId>
- <version>${jbossws.jboss712.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss713-server-integration</artifactId>
- <version>${jbossws.jboss713.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss713-tests-integration</artifactId>
- <version>${jbossws.jboss713.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.ws</groupId>
<artifactId>jbossws-jboss720-server-integration</artifactId>
<version>${jbossws.jboss720.version}</version>
</dependency>
@@ -1358,34 +1334,10 @@
</profile>
<!--
- Name: jboss712
- Descr: JBoss-7.1.2 specific options
+ Name: jboss720
+ Descr: JBoss-7.2.0 specific options
-->
<profile>
- <id>jboss712</id>
- <properties>
- <jbossws.integration.target>jboss712</jbossws.integration.target>
- <jboss.home>${jboss712.home}</jboss.home>
- </properties>
- </profile>
-
- <!--
- Name: jboss713
- Descr: JBoss-7.1.3 specific options
- -->
- <profile>
- <id>jboss713</id>
- <properties>
- <jbossws.integration.target>jboss713</jbossws.integration.target>
- <jboss.home>${jboss713.home}</jboss.home>
- </properties>
- </profile>
-
- <!--
- Name: jboss711
- Descr: JBoss-7.1.1 specific options
- -->
- <profile>
<id>jboss720</id>
<properties>
<jbossws.integration.target>jboss720</jbossws.integration.target>
11 years