Author: alessio.soldano(a)jboss.com
Date: 2012-07-17 07:05:45 -0400 (Tue, 17 Jul 2012)
New Revision: 16479
Removed:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/CustomSubjectCreatingInterceptor.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationCustomFileTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/samples/wsse/username-authorize-custom/
Modified:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/scripts/cxf-samples-jaxws.xml
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3249] Removing testcase
Modified:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/scripts/cxf-samples-jaxws.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/scripts/cxf-samples-jaxws.xml 2012-07-17
10:36:06 UTC (rev 16478)
+++
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/scripts/cxf-samples-jaxws.xml 2012-07-17
11:05:45 UTC (rev 16479)
@@ -157,30 +157,6 @@
</webinf>
</war>
- <!-- jaxws-samples-wsse-username-authorize-custom -->
- <war
-
warfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-username-authorize-custom.war"
-
webxml="${tests.output.dir}/test-resources/jaxws/samples/wsse/username-authorize-custom/WEB-INF/web.xml">
- <classes dir="${tests.output.dir}/test-classes">
- <include
name="org/jboss/test/ws/jaxws/samples/wsse/Service*.class"/>
- <include
name="org/jboss/test/ws/jaxws/samples/wsse/CustomSubjectCreatingInterceptor.class"/>
- <include
name="org/jboss/test/ws/jaxws/samples/wsse/jaxws/*.class"/>
- </classes>
- <webinf
dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/username-authorize-custom/WEB-INF">
- <include name="jboss-web.xml"/>
- <include name="jbossws-cxf.xml"/>
- <include name="wsdl/*"/>
- </webinf>
- <zipfileset
dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/username-authorize-custom/WEB-INF"
prefix="WEB-INF/classes">
- <include name="login-config.xml"/>
- <include name="users.properties"/>
- <include name="roles.properties"/>
- </zipfileset>
- <manifest>
- <attribute name="Dependencies"
value="org.jboss.ws.cxf.jbossws-cxf-server"/>
- </manifest>
- </war>
-
<!-- jaxws-samples-wsse-username-digest -->
<war
warfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-username-digest.war"
Deleted:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/CustomSubjectCreatingInterceptor.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/CustomSubjectCreatingInterceptor.java 2012-07-17
10:36:06 UTC (rev 16478)
+++
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/CustomSubjectCreatingInterceptor.java 2012-07-17
11:05:45 UTC (rev 16479)
@@ -1,73 +0,0 @@
-/*
- * 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.samples.wsse;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.wsf.stack.cxf.security.authentication.SubjectCreatingInterceptor;
-import org.picketbox.config.PicketBoxConfiguration;
-import org.picketbox.exceptions.ConfigurationStreamNullException;
-import org.picketbox.factories.SecurityFactory;
-
-
-/**
- * Interceptor which authenticates a current principal and populates Subject
- *
- * @author Sergey Beryozkin
- *
- */
-public class CustomSubjectCreatingInterceptor extends SubjectCreatingInterceptor
-{
-
- public CustomSubjectCreatingInterceptor()
- {
- super(getInitMap());
- }
-
- public void setSecurityConfigFile(String configFilePath)
- {
- SecurityFactory.prepare();
- try
- {
- PicketBoxConfiguration idtrustConfig = new PicketBoxConfiguration();
- idtrustConfig.load(configFilePath);
- }
- catch (ConfigurationStreamNullException ex) {
- throw new SecurityException("Unable to load the configuration file " +
configFilePath);
- }
- catch (Exception ex) {
- throw new SecurityException("Unable to read the configuration file " +
configFilePath, ex);
- }
- finally
- {
- SecurityFactory.release();
- }
- }
-
- private static Map<String, Object> getInitMap()
- {
- Map<String, Object> map = new HashMap<String, Object>();
- map.put("action", "UsernameToken");
- return map;
- }
-}
Deleted:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationCustomFileTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationCustomFileTestCase.java 2012-07-17
10:36:06 UTC (rev 16478)
+++
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationCustomFileTestCase.java 2012-07-17
11:05:45 UTC (rev 16479)
@@ -1,127 +0,0 @@
-/*
- * 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.samples.wsse;
-
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-
-import junit.framework.Test;
-
-import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor;
-import org.apache.cxf.endpoint.Client;
-import org.apache.cxf.endpoint.Endpoint;
-import org.apache.cxf.frontend.ClientProxy;
-import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
-import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-
-/**
- * WS-Security username authorization test case
- *
- * @author Sergey Beryozkin
- *
- */
-public final class UsernameAuthorizationCustomFileTestCase extends JBossWSTest
-{
- private final String serviceURL = "http://" + getServerHost() +
":8080/jaxws-samples-wsse-username-authorize-custom";
- private final QName servicePort = new
QName("http://www.jboss.org/jbossws/ws-extensions/wssecurity",
"SecurityServicePort");
-
- public static Test suite()
- {
- return new JBossWSCXFTestSetup(UsernameAuthorizationCustomFileTestCase.class,
"jaxws-samples-wsse-username-authorize-custom.war");
- }
-
- public void testAuthorizedCustomConfig() throws Exception
- {
- doTestAuthorized(serviceURL, servicePort, "theKermit");
- }
-
-private void doTestAuthorized(String endpointAddress, QName portName, String userName)
throws Exception
- {
- QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/wssecurity",
"SecurityService");
- URL wsdlURL = new URL(endpointAddress + "?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
- ServiceIface proxy = (ServiceIface)service.getPort(portName, ServiceIface.class);
- setupWsse(proxy, userName);
- assertEquals("Secure Hello World!", proxy.sayHello());
- }
-
- public void testUnauthenticated() throws Exception
- {
- QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/wssecurity",
"SecurityService");
- URL wsdlURL = new URL(serviceURL + "?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
- ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
- setupWsse(proxy, "foo");
- try
- {
- proxy.sayHello();
- fail("User foo should not be authenticated.");
- }
- catch (Exception ex)
- {
- //expected
- }
- }
-
- public void testUnauthorizedCustomConfig() throws Exception
- {
- doTestUnauthorized(serviceURL, servicePort, "theKermit");
- }
-
-private void doTestUnauthorized(String endpointAddress, QName portName, String userName)
throws Exception
- {
- QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/wssecurity",
"SecurityService");
- URL wsdlURL = new URL(endpointAddress + "?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
- ServiceIface proxy = (ServiceIface)service.getPort(portName, ServiceIface.class);
- setupWsse(proxy, userName);
- try
- {
- proxy.greetMe();
- fail("User kermit should not be authorized to invoke greetMe.");
- }
- catch (Exception ex)
- {
- assertEquals("Unauthorized", ex.getMessage());
- }
- }
-
- private void setupWsse(ServiceIface proxy, String username)
- {
- Client client = ClientProxy.getClient(proxy);
- Endpoint cxfEndpoint = client.getEndpoint();
-
- Map<String, Object> outProps = new HashMap<String, Object>();
- outProps.put("action", "UsernameToken");
- outProps.put("user", username);
- outProps.put("passwordType", "PasswordText");
- outProps.put("passwordCallbackClass",
"org.jboss.test.ws.jaxws.samples.wsse.UsernamePasswordCallback");
- WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps); //request
- cxfEndpoint.getOutInterceptors().add(wssOut);
- cxfEndpoint.getOutInterceptors().add(new SAAJOutInterceptor());
- }
-}
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2012-07-17 10:36:06 UTC (rev 16478)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2012-07-17 11:05:45 UTC (rev 16479)
@@ -762,9 +762,6 @@
<!-- TODO: tests using org.jboss.ejb3.client.ClientLauncher // also
see compile exclude above -->
<exclude>org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefClientTestCase*</exclude>
- <!-- # [JBWS-3249] Restore UsernameAuthorizationCustomFileTestCase on
AS7 -->
-
<exclude>org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationCustomFileTestCase*</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>
<exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/PicketLinkSTService*</exclude>
@@ -970,9 +967,6 @@
<!--# [JBWS-2397] Fix jbws1797 testcase-->
<exclude>org/jboss/test/ws/jaxws/jbws1797/**</exclude>
- <!-- # [JBWS-3249] Restore UsernameAuthorizationCustomFileTestCase on
AS7 -->
-
<exclude>org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationCustomFileTestCase*</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>
<exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/PicketLinkSTService*</exclude>
@@ -1171,9 +1165,6 @@
<!--# [JBWS-2397] Fix jbws1797 testcase-->
<exclude>org/jboss/test/ws/jaxws/jbws1797/**</exclude>
- <!-- # [JBWS-3249] Restore UsernameAuthorizationCustomFileTestCase on
AS7 -->
-
<exclude>org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationCustomFileTestCase*</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>
@@ -1371,9 +1362,6 @@
<!--# [JBWS-2397] Fix jbws1797 testcase-->
<exclude>org/jboss/test/ws/jaxws/jbws1797/**</exclude>
- <!-- # [JBWS-3249] Restore UsernameAuthorizationCustomFileTestCase on
AS7 -->
-
<exclude>org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationCustomFileTestCase*</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>