Author: jim.ma
Date: 2013-11-21 05:06:14 -0500 (Thu, 21 Nov 2013)
New Revision: 18098
Added:
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/java/org/jboss/test/ws/jaxws/cxf/jaspi/Endpoint.java
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/EndpointImpl.java
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/JBWSJaspiTestCase.java
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/usernametoken-soapmessage.xml
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/WEB-INF/
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/WEB-INF/web.xml
Modified:
stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
stack/cxf/branches/jaspi/modules/resources/src/main/resources/modules/wildfly800/org/jboss/ws/cxf/jbossws-cxf-server/main/module.xml
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/JBossWSAuthConfigProvider.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/jaspi/module/SOAPServerAuthModule.java
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/validator/UsernameTokenValidator.java
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java
Log:
Clean up;add jaspi tests
Modified:
stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
===================================================================
---
stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2013-11-20
10:11:39 UTC (rev 18097)
+++
stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2013-11-21
10:06:14 UTC (rev 18098)
@@ -82,9 +82,6 @@
import org.jboss.wsf.stack.cxf.client.jaspi.JaspiClientAuthenticator;
import org.jboss.wsf.stack.cxf.client.jaspi.JaspiClientInInterceptor;
import org.jboss.wsf.stack.cxf.client.jaspi.JaspiClientOutInterceptor;
-import org.jboss.wsf.stack.cxf.jaspi.JaspiServerAuthenticator;
-import org.jboss.wsf.stack.cxf.jaspi.config.JBossWSAuthConfigProvider;
-import org.jboss.wsf.stack.cxf.jaspi.config.JBossWSAuthConstants;
import org.w3c.dom.Element;
/**
Modified:
stack/cxf/branches/jaspi/modules/resources/src/main/resources/modules/wildfly800/org/jboss/ws/cxf/jbossws-cxf-server/main/module.xml
===================================================================
---
stack/cxf/branches/jaspi/modules/resources/src/main/resources/modules/wildfly800/org/jboss/ws/cxf/jbossws-cxf-server/main/module.xml 2013-11-20
10:11:39 UTC (rev 18097)
+++
stack/cxf/branches/jaspi/modules/resources/src/main/resources/modules/wildfly800/org/jboss/ws/cxf/jbossws-cxf-server/main/module.xml 2013-11-21
10:06:14 UTC (rev 18098)
@@ -34,6 +34,7 @@
<dependencies>
<module name="javax.api" />
+ <module name="javax.security.auth.message.api"/>
<module name="javax.servlet.api" />
<module name="javax.jws.api" />
<module name="javax.wsdl4j.api" />
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-11-20
10:11:39 UTC (rev 18097)
+++
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2013-11-21
10:06:14 UTC (rev 18098)
@@ -182,7 +182,7 @@
}
catch (Exception e)
{
- //ignore
+ e.printStackTrace();
}
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-11-20
10:11:39 UTC (rev 18097)
+++
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/JaspiServerAuthenticator.java 2013-11-21
10:06:14 UTC (rev 18098)
@@ -75,6 +75,7 @@
try
{
ServerAuthContext sctx = serverConfig.getAuthContext(authContextID,
clientSubject, serverContextProperties);
+
authStatus = sctx.validateRequest(messageInfo, clientSubject, null);
}
catch (AuthException e)
Modified:
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSAuthConfigProvider.java
===================================================================
---
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSAuthConfigProvider.java 2013-11-20
10:11:39 UTC (rev 18097)
+++
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSAuthConfigProvider.java 2013-11-21
10:06:14 UTC (rev 18098)
@@ -39,7 +39,7 @@
public JBossWSAuthConfigProvider(Properties props, AuthConfigFactory factory) {
contextProperties = props;
if (factory != null) {
- factory.registerConfigProvider(this, "SOAP", null,"JBossWS
AuthConfigProvider");
+ factory.registerConfigProvider(this, "soap", null,"JBossWS
AuthConfigProvider");
}
}
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-11-20
10:11:39 UTC (rev 18097)
+++
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSServerAuthConfig.java 2013-11-21
10:06:14 UTC (rev 18098)
@@ -45,7 +45,7 @@
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
-import org.apache.commons.lang.StringUtils;
+import org.apache.cxf.common.util.StringUtils;
import org.jboss.security.auth.callback.JBossCallbackHandler;
import org.jboss.security.auth.container.config.AuthModuleEntry;
import org.jboss.security.auth.login.JASPIAuthenticationInfo;
@@ -180,7 +180,7 @@
if (soapActions != null && soapActions.length > 0)
{
authContext = soapActions[0];
- if (StringUtils.isNotEmpty(authContext))
+ if (!StringUtils.isEmpty(authContext))
{
return authContext;
}
Modified:
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-11-20
10:11:39 UTC (rev 18097)
+++
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/module/SOAPServerAuthModule.java 2013-11-21
10:06:14 UTC (rev 18098)
@@ -49,7 +49,8 @@
*/
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);
@@ -63,8 +64,7 @@
@Override
public AuthStatus validateRequest(MessageInfo messageInfo,
- Subject clientSubject, Subject serviceSubject) throws AuthException {
- //TODO:look at what we need to do with options
+ Subject clientSubject, Subject serviceSubject) throws AuthException {
return validate(clientSubject, messageInfo) ? AuthStatus.SUCCESS : AuthStatus.FAILURE;
}
@@ -93,11 +93,12 @@
cxfSoapMessage.setContent(SOAPMessage.class, soapMessage);
cxfSoapMessage.put(Message.HTTP_REQUEST_METHOD, "POST");
-
- WSSConfig wssConfig = WSSConfig.getNewInstance();
- setJASPICValidator(wssConfig, clientSubject);
+ 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);
@@ -105,8 +106,6 @@
cxfSoapMessage.put(e.getKey().toString(), e.getValue());
}
}
-
- WSS4JInInterceptor wss4jInterceptor = new WSS4JInInterceptor();
wss4jInterceptor.handleMessage(cxfSoapMessage);
return true;
@@ -119,7 +118,6 @@
}
protected void setJASPICValidator(WSSConfig wssconfig, Subject subject) {
- //TODO: add other validator
UsernameTokenValidator usernameTokenValidator = new UsernameTokenValidator(subject);
usernameTokenValidator.setContextName(getSecurityDomainName());
wssconfig.setValidator(WSSecurityEngine.USERNAME_TOKEN, usernameTokenValidator);
Modified:
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/validator/UsernameTokenValidator.java
===================================================================
---
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/validator/UsernameTokenValidator.java 2013-11-20
10:11:39 UTC (rev 18097)
+++
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/validator/UsernameTokenValidator.java 2013-11-21
10:06:14 UTC (rev 18098)
@@ -45,8 +45,8 @@
//wss4j's JAASUsernameTokenValidator only supports plain text password
//TODO: support other type password
- private static org.apache.commons.logging.Log log =
- org.apache.commons.logging.LogFactory.getLog(UsernameTokenValidator.class);
+/* private static org.apache.commons.logging.Log log =
+
org.apache.commons.logging.LogFactory.getLog(UsernameTokenValidator.class);*/
public Credential validate(Credential credential, RequestData data) throws
WSSecurityException {
if (credential == null || credential.getUsernametoken() == null) {
throw new WSSecurityException(WSSecurityException.FAILURE,
"noCredential");
@@ -59,25 +59,18 @@
user = usernameToken.getName();
String pwType = usernameToken.getPasswordType();
- if (log.isDebugEnabled()) {
- log.debug("UsernameToken user " + usernameToken.getName());
- log.debug("UsernameToken password type " + pwType);
- }
if (usernameToken.isHashed()) {
- log.warn("Authentication failed as hashed username token not
supported");
throw new WSSecurityException(WSSecurityException.FAILED_AUTHENTICATION);
}
password = usernameToken.getPassword();
if (!WSConstants.PASSWORD_TEXT.equals(pwType)) {
- log.warn("Password type " + pwType + " not supported");
throw new WSSecurityException(WSSecurityException.FAILED_AUTHENTICATION);
}
if (!(user != null && user.length() > 0 && password != null
&& password.length() > 0)) {
- log.warn("User or password empty");
throw new WSSecurityException(WSSecurityException.FAILED_AUTHENTICATION);
}
@@ -89,7 +82,6 @@
credential.setSubject(subject);
} catch (LoginException ex) {
- log.info("Authentication failed", ex);
throw new WSSecurityException(
WSSecurityException.FAILED_AUTHENTICATION, null, null, ex
);
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-11-20
10:11:39 UTC (rev 18097)
+++
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2013-11-21
10:06:14 UTC (rev 18098)
@@ -292,6 +292,16 @@
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-web.xml"/>
+ </webinf>
+ </war>
+
<!-- jaxws-cxf-jaxbintros -->
<jar
destfile="${tests.output.dir}/test-libs/jaxws-cxf-jaxbintros.jar">
<fileset dir="${tests.output.dir}/test-classes">
Added:
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/Endpoint.java
===================================================================
---
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/Endpoint.java
(rev 0)
+++
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/Endpoint.java 2013-11-21
10:06:14 UTC (rev 18098)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.cxf.jaspi;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(name = "JaspiEndpoint", targetNamespace =
"http://org.jboss.ws.jaxws.cxf/jaspi", serviceName = "JaspiService")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface Endpoint
+{
+ String echo(String input);
+}
Property changes on:
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/Endpoint.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/cxf/jaspi/EndpointImpl.java
===================================================================
---
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/EndpointImpl.java
(rev 0)
+++
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/EndpointImpl.java 2013-11-21
10:06:14 UTC (rev 18098)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, 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.cxf.jaspi;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(name = "JaspiEndpoint", targetNamespace =
"http://org.jboss.ws.jaxws.cxf/jaspi", serviceName = "JaspiService")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public class EndpointImpl
+{
+ @WebMethod
+ public String echo(String input)
+ {
+ return input;
+ }
+}
Property changes on:
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/EndpointImpl.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/cxf/jaspi/JBWSJaspiTestCase.java
===================================================================
---
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/JBWSJaspiTestCase.java
(rev 0)
+++
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/JBWSJaspiTestCase.java 2013-11-21
10:06:14 UTC (rev 18098)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, 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.cxf.jaspi;
+
+import java.io.ByteArrayInputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Date;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.apache.ws.security.util.XmlSchemaDateFormat;
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+
+public class JBWSJaspiTestCase extends JBossWSTest
+{
+ private String address = "http://" + getServerHost() +
":8080/jaxws-cxf-jaspi/JaspiEndpoint";
+ private String wsdlURl = address + "?wsdl";
+ private String targetNS = "http://org.jboss.ws.jaxws.cxf/jaspi";
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(JBWSJaspiTestCase.class,
"jaxws-cxf-jaspi.war");
+ }
+
+ public void testValidMessage() throws Exception
+ {
+
+ Service service = Service.create(new URL(wsdlURl), new QName(targetNS,
"JaspiService"));
+ Dispatch<SOAPMessage> dispatch = service.createDispatch(new QName(targetNS,
"JaspiEndpointPort"), SOAPMessage.class, Service.Mode.MESSAGE);
+ SOAPMessage response =
dispatch.invoke(prepareSOAPMessage("org/jboss/test/ws/jaxws/cxf/jaspi/usernametoken-soapmessage.xml"));
+ response.writeTo(System.out);
+ }
+
+ private SOAPMessage prepareSOAPMessage(String messageFile) throws Exception {
+ MessageFactory factory = MessageFactory.newInstance();
+ URL fileURl = Thread.currentThread().getContextClassLoader()
+ .getResource(messageFile);
+ FileInputStream fins = new FileInputStream(fileURl.getFile());
+ String content = readFile(fins);
+ XmlSchemaDateFormat formater = new XmlSchemaDateFormat();
+
+ String replaced = content.replaceAll("\\$NOW", formater.format(new
Date()));
+ ByteArrayInputStream bin = new ByteArrayInputStream(replaced.getBytes());
+ return factory.createMessage(null, bin);
+ }
+
+ private String readFile(FileInputStream in) throws IOException {
+ StringBuilder sb = new StringBuilder(1024);
+ for (int i = in.read(); i != -1; i = in.read()) {
+ sb.append((char) i);
+ }
+ in.close();
+ return sb.toString();
+ }
+
+
+}
Property changes on:
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/JBWSJaspiTestCase.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/cxf/jaspi/usernametoken-soapmessage.xml
===================================================================
---
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/usernametoken-soapmessage.xml
(rev 0)
+++
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/usernametoken-soapmessage.xml 2013-11-21
10:06:14 UTC (rev 18098)
@@ -0,0 +1,25 @@
+<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:jas="http://org.jboss.ws.jaxws.cxf/jaspi">
+ <soap:Header>
+ <wsse:Security
+
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-...
+
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
+ soap:mustUnderstand="0">
+ <wsu:Timestamp wsu:Id="TS-96d29305-8a68-42a9-84a7-3f30a2a04e11">
+ <wsu:Created>$NOW</wsu:Created>
+ <wsu:Expires>2113-10-16T08:58:19.763Z</wsu:Expires>
+ </wsu:Timestamp>
+ <wsse:UsernameToken
+ wsu:Id="UsernameToken-4313b55e-cbcd-438f-8408-c19f1016b208">
+ <wsse:Username>jbossws</wsse:Username>
+ <wsse:Password
+
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-userna...
+ </wsse:UsernameToken>
+ </wsse:Security>
+ </soap:Header>
+ <soap:Body>
+ <jas:echo>
+ <arg0>test</arg0>
+ </jas:echo>
+ </soap:Body>
+</soap:Envelope>
\ No newline at end of file
Property changes on:
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/usernametoken-soapmessage.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified:
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java
===================================================================
---
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java 2013-11-20
10:11:39 UTC (rev 18097)
+++
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java 2013-11-21
10:06:14 UTC (rev 18098)
@@ -63,7 +63,7 @@
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
- holder.configure(null, null, null, null);
+ holder.configure(null, null, null, null, null);
holder.close();
assertEquals("preShutdown method on listener should be called exactly once;
number of actual calls: "
+ listener.getCount(), 1, listener.getCount());
@@ -74,7 +74,7 @@
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
- holder.configure(null, null, null, null);
+ holder.configure(null, null, null, null, null);
bus.shutdown(true);
holder.close();
assertEquals("preShutdown method on listener should be called exactly once;
number of actual calls: "
@@ -86,7 +86,7 @@
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
- holder.configure(null, null, null, null);
+ holder.configure(null, null, null, null, null);
assertEquals("preShutdown method on listener shouldn't be called before
holder is closed: number of actual calls: "
+ listener.getCount(), 0, listener.getCount());
holder.close();
Added:
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/WEB-INF/web.xml
===================================================================
---
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/WEB-INF/web.xml
(rev 0)
+++
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/WEB-INF/web.xml 2013-11-21
10:06:14 UTC (rev 18098)
@@ -0,0 +1,16 @@
+<?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/j2ee/web-app_2_5.xsd">
+
+ <servlet>
+ <servlet-name>EpServlet</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.cxf.jaspi.EndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>EpServlet</servlet-name>
+ <url-pattern>/JaspiEndpoint</url-pattern>
+ </servlet-mapping>
+</web-app>
\ No newline at end of file
Property changes on:
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/WEB-INF/web.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native