cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jp...@apache.org
Subject svn commit: r1443247 - in /cxf/branches/2.7.x-fixes/systests/ws-security/src/test: java/org/apache/cxf/systest/ws/policy/ java/org/apache/cxf/systest/ws/policy/javafirst/ resources/java_first_policies/ resources/org/apache/cxf/systest/ws/policy/client/...
Date Wed, 06 Feb 2013 22:33:11 GMT
Author: jpell
Date: Wed Feb  6 22:33:11 2013
New Revision: 1443247

URL: http://svn.apache.org/viewvc?rev=1443247&view=rev
Log:
CXF-4813 - test cases to demonstrate issue with alternatives and policies linked to operations bingings rather than bindings. Two tests are disabled as they currently break due to the bug

Added:
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/BindingSimpleService.java
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/BindingSimpleServiceClient.java
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/BindingSimpleServiceImpl.java
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/NoAlternativesOperationSimpleService.java
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/NoAlternativesOperationSimpleServiceClient.java
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/NoAlternativesOperationSimpleServiceImpl.java
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/OperationSimpleService.java
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/OperationSimpleServiceClient.java
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/OperationSimpleServiceImpl.java
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/AlternativesPolicy.xml
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/UsernamePasswordPolicy.xml
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/UsernamePolicy.xml
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/sslcertclient.xml
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/sslnocertclient.xml
Modified:
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/javafirstclient.xml
    cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/server/javafirstserver.xml

Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java?rev=1443247&r1=1443246&r2=1443247&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java (original)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java Wed Feb  6 22:33:11 2013
@@ -26,6 +26,8 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.xml.ws.soap.SOAPFaultException;
+
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
@@ -35,25 +37,30 @@ import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.service.model.MessageInfo.Type;
 import org.apache.cxf.systest.ws.common.SecurityTestUtil;
+import org.apache.cxf.systest.ws.policy.javafirst.BindingSimpleServiceClient;
+import org.apache.cxf.systest.ws.policy.javafirst.NoAlternativesOperationSimpleServiceClient;
+import org.apache.cxf.systest.ws.policy.javafirst.OperationSimpleServiceClient;
 import org.apache.cxf.systest.ws.policy.server.JavaFirstPolicyServer;
 import org.apache.cxf.systest.ws.wssec11.client.UTPasswordCallback;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
-
 import org.apache.neethi.Constants;
-
 import org.apache.ws.security.WSConstants;
 import org.apache.ws.security.handler.WSHandlerConstants;
 
 import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
 
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 public class JavaFirstPolicyServiceTest extends AbstractBusClientServerTestBase {
     static final String PORT = allocatePort(JavaFirstPolicyServer.class);
     static final String PORT2 = allocatePort(JavaFirstPolicyServer.class, 2);
-    
+    static final String PORT3 = allocatePort(JavaFirstPolicyServer.class, 3);
+
     private static final String WSDL_NAMESPACE = "http://schemas.xmlsoap.org/wsdl/";
 
     @BeforeClass
@@ -69,26 +76,23 @@ public class JavaFirstPolicyServiceTest 
         SecurityTestUtil.cleanup();
         stopAllServers();
     }
-    
+
     @org.junit.Test
     public void testUsernameTokenInterceptorNoPasswordValidation() {
-        ClassPathXmlApplicationContext ctx = 
-            new ClassPathXmlApplicationContext("org/apache/cxf/systest/ws/policy/client/javafirstclient.xml");
-        
-        JavaFirstAttachmentPolicyService svc = 
-            (JavaFirstAttachmentPolicyService) ctx.getBean("JavaFirstAttachmentPolicyServiceClient");
-        
-        Client client = ClientProxy.getClient(svc);
-        client.getEndpoint().getEndpointInfo().setAddress(
-                                "http://localhost:" + PORT + "/JavaFirstAttachmentPolicyService");
-       
-        WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor();
-        client.getEndpoint().getOutInterceptors().add(wssOut);
-        
+        System.setProperty("testutil.ports.JavaFirstPolicyServer", PORT);
+
+        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
+            "org/apache/cxf/systest/ws/policy/client/javafirstclient.xml");
+
+        JavaFirstAttachmentPolicyService svc = ctx.getBean("JavaFirstAttachmentPolicyServiceClient",
+                                                           JavaFirstAttachmentPolicyService.class);
+
+        WSS4JOutInterceptor wssOut = addToClient(svc);
+
         // just some basic sanity tests first to make sure that auth is working where password is provided.
         wssOut.setProperties(getPasswordProperties("alice", "password"));
         svc.doInputMessagePolicy();
-        
+
         wssOut.setProperties(getPasswordProperties("alice", "passwordX"));
         try {
             svc.doInputMessagePolicy();
@@ -96,9 +100,9 @@ public class JavaFirstPolicyServiceTest 
         } catch (Exception e) {
             assertTrue(true);
         }
-        
+
         wssOut.setProperties(getNoPasswordProperties("alice"));
-        
+
         try {
             svc.doInputMessagePolicy();
             fail("Expected authentication failure");
@@ -106,26 +110,23 @@ public class JavaFirstPolicyServiceTest 
             assertTrue(true);
         }
     }
-    
+
     @org.junit.Test
     public void testUsernameTokenPolicyValidatorNoPasswordValidation() {
-        ClassPathXmlApplicationContext ctx = 
-            new ClassPathXmlApplicationContext("org/apache/cxf/systest/ws/policy/client/javafirstclient.xml");
-        
-        SslUsernamePasswordAttachmentService svc = 
-            (SslUsernamePasswordAttachmentService) ctx.getBean("SslUsernamePasswordAttachmentServiceClient");
-        
-        Client client = ClientProxy.getClient(svc);
-        client.getEndpoint().getEndpointInfo().setAddress(
-                                "https://localhost:" + PORT2 + "/SslUsernamePasswordAttachmentService");
-       
-        WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor();
-        client.getEndpoint().getOutInterceptors().add(wssOut);
-        
+        System.setProperty("testutil.ports.JavaFirstPolicyServer.2", PORT2);
+
+        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
+            "org/apache/cxf/systest/ws/policy/client/javafirstclient.xml");
+
+        SslUsernamePasswordAttachmentService svc = ctx.getBean("SslUsernamePasswordAttachmentServiceClient",
+                                                               SslUsernamePasswordAttachmentService.class);
+
+        WSS4JOutInterceptor wssOut = addToClient(svc);
+
         // just some basic sanity tests first to make sure that auth is working where password is provided.
         wssOut.setProperties(getPasswordProperties("alice", "password"));
         svc.doSslAndUsernamePasswordPolicy();
-        
+
         wssOut.setProperties(getPasswordProperties("alice", "passwordX"));
         try {
             svc.doSslAndUsernamePasswordPolicy();
@@ -133,9 +134,9 @@ public class JavaFirstPolicyServiceTest 
         } catch (Exception e) {
             assertTrue(true);
         }
-        
+
         wssOut.setProperties(getNoPasswordProperties("alice"));
-        
+
         try {
             svc.doSslAndUsernamePasswordPolicy();
             fail("Expected authentication failure");
@@ -143,11 +144,239 @@ public class JavaFirstPolicyServiceTest 
             assertTrue(true);
         }
     }
-    
+
+    @Test
+    public void testBindingNoClientCertAlternativePolicy() {
+        System.setProperty("testutil.ports.JavaFirstPolicyServer", PORT);
+
+        ClassPathXmlApplicationContext clientContext = new ClassPathXmlApplicationContext(new String[] {
+            "org/apache/cxf/systest/ws/policy/client/sslnocertclient.xml"
+        });
+
+        BindingSimpleServiceClient simpleService = clientContext.getBean("BindingSimpleServiceClient",
+                                                                         BindingSimpleServiceClient.class);
+
+        try {
+            simpleService.doStuff();
+            fail("Expected exception as no credentials");
+        } catch (SOAPFaultException e) {
+            assertTrue(true);
+        }
+
+        WSS4JOutInterceptor wssOut = addToClient(simpleService);
+
+        wssOut.setProperties(getNoPasswordProperties("alice"));
+        try {
+            simpleService.doStuff();
+            fail("Expected exception as no password and no client cert");
+        } catch (SOAPFaultException e) {
+            assertTrue(true);
+        }
+
+        wssOut.setProperties(getPasswordProperties("alice", "password"));
+        simpleService.doStuff();
+    }
+
+    @Test
+    public void testBindingClientCertAlternativePolicy() {
+        System.setProperty("testutil.ports.JavaFirstPolicyServer.3", PORT3);
+
+        ClassPathXmlApplicationContext clientContext = new ClassPathXmlApplicationContext(new String[] {
+            "org/apache/cxf/systest/ws/policy/client/sslcertclient.xml"
+        });
+
+        BindingSimpleServiceClient simpleService = clientContext.getBean("BindingSimpleServiceClient",
+                                                                         BindingSimpleServiceClient.class);
+
+        try {
+            simpleService.doStuff();
+            fail("Expected exception as no credentials");
+        } catch (SOAPFaultException e) {
+            assertTrue(true);
+        }
+
+        WSS4JOutInterceptor wssOut = addToClient(simpleService);
+
+        wssOut.setProperties(getNoPasswordProperties("alice"));
+        simpleService.doStuff();
+
+        wssOut.setProperties(getPasswordProperties("alice", "password"));
+
+        // this is successful because the alternative policy allows a password to be specified.
+        simpleService.doStuff();
+    }
+
+    @Test
+    public void testNoAltOperationNoClientCertAlternativePolicy() {
+        System.setProperty("testutil.ports.JavaFirstPolicyServer.3", PORT3);
+
+        ClassPathXmlApplicationContext clientContext = new ClassPathXmlApplicationContext(new String[] {
+            "org/apache/cxf/systest/ws/policy/client/sslnocertclient.xml"
+        });
+
+        NoAlternativesOperationSimpleServiceClient simpleService = clientContext
+            .getBean("NoAlternativesOperationSimpleServiceClient",
+                     NoAlternativesOperationSimpleServiceClient.class);
+
+        try {
+            simpleService.doStuff();
+            fail("Expected exception as no credentials");
+        } catch (SOAPFaultException e) {
+            assertTrue(true);
+        }
+
+        WSS4JOutInterceptor wssOut = addToClient(simpleService);
+
+        wssOut.setProperties(getNoPasswordProperties("alice"));
+        try {
+            simpleService.doStuff();
+            fail("Expected exception as no password and no client cert");
+        } catch (SOAPFaultException e) {
+            assertTrue(true);
+        }
+
+        wssOut.setProperties(getPasswordProperties("alice", "password"));
+        try {
+            simpleService.doStuff();
+            fail("Expected exception as no client cert and password not allowed");
+        } catch (SOAPFaultException e) {
+            assertTrue(true);
+        }
+
+        wssOut.setProperties(getNoPasswordProperties("alice"));
+        try {
+            simpleService.ping();
+            fail("Expected exception as no password");
+        } catch (SOAPFaultException e) {
+            assertTrue(true);
+        }
+
+        wssOut.setProperties(getPasswordProperties("alice", "password"));
+        simpleService.ping();
+    }
+
+    @Test
+    public void testNoAltOperationClientCertAlternativePolicy() {
+        System.setProperty("testutil.ports.JavaFirstPolicyServer.3", PORT3);
+
+        ClassPathXmlApplicationContext clientContext = new ClassPathXmlApplicationContext(new String[] {
+            "org/apache/cxf/systest/ws/policy/client/sslcertclient.xml"
+        });
+
+        NoAlternativesOperationSimpleServiceClient simpleService = clientContext
+            .getBean("NoAlternativesOperationSimpleServiceClient",
+                     NoAlternativesOperationSimpleServiceClient.class);
+
+        try {
+            simpleService.doStuff();
+            fail("Expected exception as no credentials");
+        } catch (SOAPFaultException e) {
+            assertTrue(true);
+        }
+
+        WSS4JOutInterceptor wssOut = addToClient(simpleService);
+
+        wssOut.setProperties(getNoPasswordProperties("alice"));
+        simpleService.doStuff();
+
+        wssOut.setProperties(getPasswordProperties("alice", "password"));
+        try {
+            simpleService.doStuff();
+            fail("Expected exception as password not allowed");
+        } catch (SOAPFaultException e) {
+            assertTrue(true);
+        }
+
+        wssOut.setProperties(getNoPasswordProperties("alice"));
+        try {
+            simpleService.ping();
+            fail("Expected exception as no password");
+        } catch (SOAPFaultException e) {
+            assertTrue(true);
+        }
+
+        wssOut.setProperties(getPasswordProperties("alice", "password"));
+        simpleService.ping();
+    }
+
+    @Test
+    @Ignore
+    public void testOperationNoClientCertAlternativePolicy() {
+        System.setProperty("testutil.ports.JavaFirstPolicyServer.3", PORT3);
+
+        ClassPathXmlApplicationContext clientContext = new ClassPathXmlApplicationContext(new String[] {
+            "org/apache/cxf/systest/ws/policy/client/sslnocertclient.xml"
+        });
+
+        OperationSimpleServiceClient simpleService = clientContext
+            .getBean("OperationSimpleServiceClient", OperationSimpleServiceClient.class);
+
+        try {
+            simpleService.doStuff();
+            fail("Expected exception as no credentials");
+        } catch (SOAPFaultException e) {
+            assertTrue(true);
+        }
+
+        WSS4JOutInterceptor wssOut = addToClient(simpleService);
+
+        wssOut.setProperties(getNoPasswordProperties("alice"));
+        try {
+            simpleService.doStuff();
+            fail("Expected exception as no password and no client cert");
+        } catch (SOAPFaultException e) {
+            assertTrue(true);
+        }
+
+        wssOut.setProperties(getPasswordProperties("alice", "password"));
+        simpleService.doStuff();
+    }
+
+    @Test
+    @Ignore
+    public void testOperationClientCertAlternativePolicy() {
+        System.setProperty("testutil.ports.JavaFirstPolicyServer.3", PORT3);
+
+        ClassPathXmlApplicationContext clientContext = new ClassPathXmlApplicationContext(new String[] {
+            "org/apache/cxf/systest/ws/policy/client/sslcertclient.xml"
+        });
+
+        OperationSimpleServiceClient simpleService = clientContext
+            .getBean("OperationSimpleServiceClient", OperationSimpleServiceClient.class);
+
+        try {
+            simpleService.doStuff();
+            fail("Expected exception as no credentials");
+        } catch (SOAPFaultException e) {
+            assertTrue(true);
+        }
+
+        WSS4JOutInterceptor wssOut = addToClient(simpleService);
+
+        wssOut.setProperties(getNoPasswordProperties("alice"));
+        simpleService.doStuff();
+
+        wssOut.setProperties(getPasswordProperties("alice", "password"));
+
+        try {
+            simpleService.doStuff();
+            fail("Expected exception password is not supported");
+        } catch (SOAPFaultException e) {
+            assertTrue(true);
+        }
+    }
+
+    private WSS4JOutInterceptor addToClient(Object svc) {
+        Client client = ClientProxy.getClient(svc);
+        WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor();
+        client.getEndpoint().getOutInterceptors().add(wssOut);
+        return wssOut;
+    }
+
     private Map<String, Object> getPasswordProperties(String username, String password) {
         UTPasswordCallback callback = new UTPasswordCallback();
         callback.setAliasPassword(username, password);
-        
+
         Map<String, Object> outProps = new HashMap<String, Object>();
         outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
         outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
@@ -155,7 +384,7 @@ public class JavaFirstPolicyServiceTest 
         outProps.put(WSHandlerConstants.USER, username);
         return outProps;
     }
-    
+
     private Map<String, Object> getNoPasswordProperties(String username) {
         Map<String, Object> outProps = new HashMap<String, Object>();
         outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
@@ -163,12 +392,12 @@ public class JavaFirstPolicyServiceTest 
         outProps.put(WSHandlerConstants.USER, username);
         return outProps;
     }
-    
+
     @org.junit.Test
     public void testJavaFirstAttachmentWsdl() throws Exception {
         Document doc = loadWsdl("JavaFirstAttachmentPolicyService");
         testJavaFirstAttachmentWsdl(doc);
-        
+
         // verify that the policy attachment not being defensively copied is working ok still!
         Document doc2 = loadWsdl("JavaFirstAttachmentPolicyService2");
         testJavaFirstAttachmentWsdl(doc2);
@@ -177,41 +406,41 @@ public class JavaFirstPolicyServiceTest 
     private void testJavaFirstAttachmentWsdl(Document doc) throws Exception {
         Element binding = DOMUtils.getFirstChildWithName(doc.getDocumentElement(), WSDL_NAMESPACE, "binding");
         assertNotNull(binding);
-        
+
         List<Element> operationMessages = DOMUtils.getChildrenWithName(binding, WSDL_NAMESPACE, "operation");
         assertEquals(4, operationMessages.size());
-        
+
         Element doOperationLevelPolicy = getOperationElement("doOperationLevelPolicy", operationMessages);
-        assertEquals("#UsernameToken", 
+        assertEquals("#UsernameToken",
                      getOperationPolicyReferenceId(doOperationLevelPolicy, Constants.URI_POLICY_13_NS));
-        
+
         Element doInputMessagePolicy = getOperationElement("doInputMessagePolicy", operationMessages);
-        assertEquals("#UsernameToken", 
+        assertEquals("#UsernameToken",
                      getMessagePolicyReferenceId(doInputMessagePolicy, Type.INPUT, Constants.URI_POLICY_13_NS));
-        assertNull(getMessagePolicyReferenceId(
-                                               doInputMessagePolicy, Type.OUTPUT, Constants.URI_POLICY_13_NS));
-        
+        assertNull(getMessagePolicyReferenceId(doInputMessagePolicy, Type.OUTPUT, Constants.URI_POLICY_13_NS));
+
         Element doOutputMessagePolicy = getOperationElement("doOutputMessagePolicy", operationMessages);
-        assertEquals("#UsernameToken", 
-                     getMessagePolicyReferenceId(doOutputMessagePolicy, Type.OUTPUT, Constants.URI_POLICY_13_NS));
-        assertNull(getMessagePolicyReferenceId(
-                                               doOutputMessagePolicy, Type.INPUT, Constants.URI_POLICY_13_NS));
-        
+        assertEquals("#UsernameToken",
+                     getMessagePolicyReferenceId(doOutputMessagePolicy, Type.OUTPUT,
+                                                 Constants.URI_POLICY_13_NS));
+        assertNull(getMessagePolicyReferenceId(doOutputMessagePolicy, Type.INPUT, Constants.URI_POLICY_13_NS));
+
         Element doNoPolicy = getOperationElement("doNoPolicy", operationMessages);
         assertNull(getMessagePolicyReferenceId(doNoPolicy, Type.INPUT, Constants.URI_POLICY_13_NS));
         assertNull(getMessagePolicyReferenceId(doNoPolicy, Type.OUTPUT, Constants.URI_POLICY_13_NS));
-        
+
         // ensure that the policies are attached to the wsdl:definitions
-        List<Element> policyMessages = DOMUtils.getChildrenWithName(doc.getDocumentElement(), 
+        List<Element> policyMessages = DOMUtils.getChildrenWithName(doc.getDocumentElement(),
                                                                     Constants.URI_POLICY_13_NS, "Policy");
         assertEquals(1, policyMessages.size());
-        
+
         assertEquals("UsernameToken", getPolicyId(policyMessages.get(0)));
-        
+
         Element exactlyOne = DOMUtils.getFirstChildWithName(policyMessages.get(0), "", "ExactlyOne");
         assertNull(exactlyOne);
-        
-        exactlyOne = DOMUtils.getFirstChildWithName(policyMessages.get(0), Constants.URI_POLICY_13_NS, "ExactlyOne");
+
+        exactlyOne = DOMUtils.getFirstChildWithName(policyMessages.get(0), Constants.URI_POLICY_13_NS,
+                                                    "ExactlyOne");
         assertNotNull(exactlyOne);
     }
 
@@ -219,52 +448,52 @@ public class JavaFirstPolicyServiceTest 
     public void testJavaFirstWsdl() throws Exception {
         Document doc = loadWsdl("JavaFirstPolicyService");
 
-        Element portType = DOMUtils.getFirstChildWithName(doc.getDocumentElement(), WSDL_NAMESPACE, "portType");
+        Element portType = DOMUtils.getFirstChildWithName(doc.getDocumentElement(), WSDL_NAMESPACE,
+                                                          "portType");
         assertNotNull(portType);
-        
+
         List<Element> operationMessages = DOMUtils.getChildrenWithName(portType, WSDL_NAMESPACE, "operation");
         assertEquals(5, operationMessages.size());
-        
+
         Element operationOne = getOperationElement("doOperationOne", operationMessages);
-        assertEquals("#InternalTransportAndUsernamePolicy", 
+        assertEquals("#InternalTransportAndUsernamePolicy",
                      getMessagePolicyReferenceId(operationOne, Type.INPUT, Constants.URI_POLICY_NS));
         Element operationTwo = getOperationElement("doOperationTwo", operationMessages);
-        assertEquals("#TransportAndUsernamePolicy", 
+        assertEquals("#TransportAndUsernamePolicy",
                      getMessagePolicyReferenceId(operationTwo, Type.INPUT, Constants.URI_POLICY_NS));
         Element operationThree = getOperationElement("doOperationThree", operationMessages);
-        assertEquals("#InternalTransportAndUsernamePolicy", 
+        assertEquals("#InternalTransportAndUsernamePolicy",
                      getMessagePolicyReferenceId(operationThree, Type.INPUT, Constants.URI_POLICY_NS));
         Element operationFour = getOperationElement("doOperationFour", operationMessages);
-        assertEquals("#TransportAndUsernamePolicy", 
+        assertEquals("#TransportAndUsernamePolicy",
                      getMessagePolicyReferenceId(operationFour, Type.INPUT, Constants.URI_POLICY_NS));
         Element operationPing = getOperationElement("doPing", operationMessages);
         assertNull(getMessagePolicyReferenceId(operationPing, Type.INPUT, Constants.URI_POLICY_NS));
-        
-        List<Element> policyMessages = DOMUtils.getChildrenWithName(doc.getDocumentElement(), 
+
+        List<Element> policyMessages = DOMUtils.getChildrenWithName(doc.getDocumentElement(),
                                                                     Constants.URI_POLICY_NS, "Policy");
-        
+
         assertEquals(2, policyMessages.size());
-        
+
         // validate that both the internal and external policies are included
         assertEquals("TransportAndUsernamePolicy", getPolicyId(policyMessages.get(0)));
         assertEquals("InternalTransportAndUsernamePolicy", getPolicyId(policyMessages.get(1)));
     }
 
     private Document loadWsdl(String serviceName) throws Exception {
-        HttpURLConnection connection = getHttpConnection("http://localhost:" + PORT
-                                                         + "/" + serviceName + "?wsdl");
+        HttpURLConnection connection = getHttpConnection("http://localhost:" + PORT + "/" + serviceName
+                                                         + "?wsdl");
         InputStream is = connection.getInputStream();
         String wsdlContents = IOUtils.toString(is);
-        
-        //System.out.println(wsdlContents);
+
+        // System.out.println(wsdlContents);
         return DOMUtils.readXml(new StringReader(wsdlContents));
     }
-    
+
     private String getPolicyId(Element element) {
-        return element.getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI,
-                                     PolicyConstants.WSU_ID_ATTR_NAME);
+        return element.getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI, PolicyConstants.WSU_ID_ATTR_NAME);
     }
-    
+
     private Element getOperationElement(String operationName, List<Element> operationMessages) {
         Element operationElement = null;
         for (Element operation : operationMessages) {
@@ -276,12 +505,12 @@ public class JavaFirstPolicyServiceTest 
         assertNotNull(operationElement);
         return operationElement;
     }
-    
+
     private String getMessagePolicyReferenceId(Element operationElement, Type type, String policyNamespace) {
-        Element messageElement = DOMUtils.getFirstChildWithName(operationElement, WSDL_NAMESPACE, 
-                                                              type.name().toLowerCase());
+        Element messageElement = DOMUtils.getFirstChildWithName(operationElement, WSDL_NAMESPACE, type.name()
+            .toLowerCase());
         assertNotNull(messageElement);
-        Element policyReference = DOMUtils.getFirstChildWithName(messageElement, policyNamespace, 
+        Element policyReference = DOMUtils.getFirstChildWithName(messageElement, policyNamespace,
                                                                  "PolicyReference");
         if (policyReference != null) {
             return policyReference.getAttribute("URI");
@@ -289,9 +518,9 @@ public class JavaFirstPolicyServiceTest 
             return null;
         }
     }
-    
+
     private String getOperationPolicyReferenceId(Element operationElement, String policyNamespace) {
-        Element policyReference = DOMUtils.getFirstChildWithName(operationElement, policyNamespace, 
+        Element policyReference = DOMUtils.getFirstChildWithName(operationElement, policyNamespace,
                                                                  "PolicyReference");
         if (policyReference != null) {
             return policyReference.getAttribute("URI");

Added: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/BindingSimpleService.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/BindingSimpleService.java?rev=1443247&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/BindingSimpleService.java (added)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/BindingSimpleService.java Wed Feb  6 22:33:11 2013
@@ -0,0 +1,36 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.policy.javafirst;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.Policy;
+import org.apache.cxf.annotations.Policy.Placement;
+
+@WebService(name = "BindingSimpleService", targetNamespace = "http://www.example.org/contract/BindingSimpleService")
+@Policy(uri = "classpath:/java_first_policies/AlternativesPolicy.xml", placement = Placement.BINDING)
+public interface BindingSimpleService {
+    @WebMethod(operationName = "doStuff")
+    void doStuff();
+
+    @WebMethod(operationName = "ping")
+    void ping();
+}

Added: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/BindingSimpleServiceClient.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/BindingSimpleServiceClient.java?rev=1443247&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/BindingSimpleServiceClient.java (added)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/BindingSimpleServiceClient.java Wed Feb  6 22:33:11 2013
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.policy.javafirst;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@WebService(name = "BindingSimpleService", targetNamespace = "http://www.example.org/contract/BindingSimpleService")
+public interface BindingSimpleServiceClient {
+    @WebMethod(operationName = "doStuff")
+    void doStuff();
+
+    @WebMethod(operationName = "ping")
+    void ping();
+}

Added: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/BindingSimpleServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/BindingSimpleServiceImpl.java?rev=1443247&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/BindingSimpleServiceImpl.java (added)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/BindingSimpleServiceImpl.java Wed Feb  6 22:33:11 2013
@@ -0,0 +1,36 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.policy.javafirst;
+
+import javax.jws.WebService;
+
+@WebService(name = "BindingSimpleService", 
+    endpointInterface = "org.apache.cxf.systest.ws.policy.javafirst.BindingSimpleService", 
+    serviceName = "BindingSimpleService", 
+    targetNamespace = "http://www.example.org/contract/BindingSimpleService")
+public class BindingSimpleServiceImpl implements BindingSimpleService {
+    @Override
+    public void doStuff() {
+    }
+
+    @Override
+    public void ping() {
+    }
+}

Added: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/NoAlternativesOperationSimpleService.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/NoAlternativesOperationSimpleService.java?rev=1443247&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/NoAlternativesOperationSimpleService.java (added)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/NoAlternativesOperationSimpleService.java Wed Feb  6 22:33:11 2013
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.policy.javafirst;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.Policy;
+import org.apache.cxf.annotations.Policy.Placement;
+
+@WebService(name = "NoAlternativesOperationSimpleService", 
+targetNamespace = "http://www.example.org/contract/NoAlternativesOperationSimpleService")
+public interface NoAlternativesOperationSimpleService {
+    @Policy(uri = "classpath:/java_first_policies/UsernamePolicy.xml", 
+        placement = Placement.BINDING_OPERATION)
+    @WebMethod(operationName = "doStuff")
+    void doStuff();
+
+    @Policy(uri = "classpath:/java_first_policies/UsernamePasswordPolicy.xml", 
+        placement = Placement.BINDING_OPERATION)
+    @WebMethod(operationName = "ping")
+    void ping();
+}

Added: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/NoAlternativesOperationSimpleServiceClient.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/NoAlternativesOperationSimpleServiceClient.java?rev=1443247&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/NoAlternativesOperationSimpleServiceClient.java (added)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/NoAlternativesOperationSimpleServiceClient.java Wed Feb  6 22:33:11 2013
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.policy.javafirst;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@WebService(name = "NoAlternativesOperationSimpleService", 
+targetNamespace = "http://www.example.org/contract/NoAlternativesOperationSimpleService")
+public interface NoAlternativesOperationSimpleServiceClient {
+    @WebMethod(operationName = "doStuff")
+    void doStuff();
+
+    @WebMethod(operationName = "ping")
+    void ping();
+}

Added: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/NoAlternativesOperationSimpleServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/NoAlternativesOperationSimpleServiceImpl.java?rev=1443247&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/NoAlternativesOperationSimpleServiceImpl.java (added)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/NoAlternativesOperationSimpleServiceImpl.java Wed Feb  6 22:33:11 2013
@@ -0,0 +1,36 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.policy.javafirst;
+
+import javax.jws.WebService;
+
+@WebService(name = "NoAlternativesOperationSimpleService", 
+endpointInterface = "org.apache.cxf.systest.ws.policy.javafirst.NoAlternativesOperationSimpleService", 
+serviceName = "NoAlternativesOperationSimpleService", 
+targetNamespace = "http://www.example.org/contract/NoAlternativesOperationSimpleService")
+public class NoAlternativesOperationSimpleServiceImpl implements NoAlternativesOperationSimpleService {
+    @Override
+    public void doStuff() {
+    }
+
+    @Override
+    public void ping() {
+    }
+}

Added: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/OperationSimpleService.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/OperationSimpleService.java?rev=1443247&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/OperationSimpleService.java (added)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/OperationSimpleService.java Wed Feb  6 22:33:11 2013
@@ -0,0 +1,37 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.policy.javafirst;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.Policy;
+import org.apache.cxf.annotations.Policy.Placement;
+
+@WebService(name = "OperationSimpleService", 
+targetNamespace = "http://www.example.org/contract/OperationSimpleService")
+public interface OperationSimpleService {
+    @Policy(uri = "classpath:/java_first_policies/AlternativesPolicy.xml", placement = Placement.BINDING_OPERATION)
+    @WebMethod(operationName = "doStuff")
+    void doStuff();
+
+    @WebMethod(operationName = "ping")
+    void ping();
+}

Added: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/OperationSimpleServiceClient.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/OperationSimpleServiceClient.java?rev=1443247&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/OperationSimpleServiceClient.java (added)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/OperationSimpleServiceClient.java Wed Feb  6 22:33:11 2013
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.policy.javafirst;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@WebService(name = "OperationSimpleService", 
+targetNamespace = "http://www.example.org/contract/OperationSimpleService")
+public interface OperationSimpleServiceClient {
+    @WebMethod(operationName = "doStuff")
+    void doStuff();
+
+    @WebMethod(operationName = "ping")
+    void ping();
+}

Added: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/OperationSimpleServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/OperationSimpleServiceImpl.java?rev=1443247&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/OperationSimpleServiceImpl.java (added)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/javafirst/OperationSimpleServiceImpl.java Wed Feb  6 22:33:11 2013
@@ -0,0 +1,35 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.policy.javafirst;
+
+import javax.jws.WebService;
+
+@WebService(name = "OperationSimpleService", 
+endpointInterface = "org.apache.cxf.systest.ws.policy.javafirst.OperationSimpleService", 
+serviceName = "OperationSimpleService", targetNamespace = "http://www.example.org/contract/OperationSimpleService")
+public class OperationSimpleServiceImpl implements OperationSimpleService {
+    @Override
+    public void doStuff() {
+    }
+
+    @Override
+    public void ping() {
+    }
+}

Added: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/AlternativesPolicy.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/AlternativesPolicy.xml?rev=1443247&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/AlternativesPolicy.xml (added)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/AlternativesPolicy.xml Wed Feb  6 22:33:11 2013
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<wsp:Policy wsu:Id="AlternativesPolicy" xmlns:wsp="http://www.w3.org/ns/ws-policy"
+	xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+	xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+	<wsp:ExactlyOne>
+		<wsp:All>
+			<sp:TransportBinding>
+				<wsp:Policy>
+					<sp:TransportToken>
+						<wsp:Policy>
+							<sp:HttpsToken>
+								<wsp:Policy>
+									<sp:RequireClientCertificate />
+								</wsp:Policy>
+							</sp:HttpsToken>
+						</wsp:Policy>
+					</sp:TransportToken>
+					<sp:AlgorithmSuite>
+						<wsp:Policy>
+							<sp:Basic256 />
+						</wsp:Policy>
+					</sp:AlgorithmSuite>
+				</wsp:Policy>
+			</sp:TransportBinding>
+
+			<sp:SupportingTokens>
+				<wsp:Policy>
+					<sp:UsernameToken>
+						<wsp:Policy>
+							<sp:NoPassword />
+						</wsp:Policy>
+					</sp:UsernameToken>
+				</wsp:Policy>
+			</sp:SupportingTokens>
+		</wsp:All>
+
+		<wsp:All>
+			<sp:TransportBinding>
+				<wsp:Policy>
+					<sp:TransportToken>
+						<wsp:Policy>
+							<sp:HttpsToken>
+								<wsp:Policy />
+							</sp:HttpsToken>
+						</wsp:Policy>
+					</sp:TransportToken>
+					<sp:AlgorithmSuite>
+						<wsp:Policy>
+							<sp:Basic256 />
+						</wsp:Policy>
+					</sp:AlgorithmSuite>
+				</wsp:Policy>
+			</sp:TransportBinding>
+
+			<sp:SupportingTokens>
+				<wsp:Policy>
+					<sp:UsernameToken>
+						<wsp:Policy>
+							<sp:WssUsernameToken11 />
+						</wsp:Policy>
+					</sp:UsernameToken>
+				</wsp:Policy>
+			</sp:SupportingTokens>
+		</wsp:All>
+	</wsp:ExactlyOne>
+</wsp:Policy>

Added: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/UsernamePasswordPolicy.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/UsernamePasswordPolicy.xml?rev=1443247&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/UsernamePasswordPolicy.xml (added)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/UsernamePasswordPolicy.xml Wed Feb  6 22:33:11 2013
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<wsp:Policy wsu:Id="UsernamePasswordPolicy"
+	xmlns:wsp="http://www.w3.org/ns/ws-policy"
+	xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+	xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+	<wsp:ExactlyOne>
+		<wsp:All>
+			<sp:TransportBinding>
+				<wsp:Policy>
+					<sp:TransportToken>
+						<wsp:Policy>
+							<sp:HttpsToken>
+								<wsp:Policy />
+							</sp:HttpsToken>
+						</wsp:Policy>
+					</sp:TransportToken>
+					<sp:AlgorithmSuite>
+						<wsp:Policy>
+							<sp:Basic256 />
+						</wsp:Policy>
+					</sp:AlgorithmSuite>
+				</wsp:Policy>
+			</sp:TransportBinding>
+
+			<sp:SupportingTokens>
+				<wsp:Policy>
+					<sp:UsernameToken>
+						<wsp:Policy>
+							<sp:WssUsernameToken11 />
+						</wsp:Policy>
+					</sp:UsernameToken>
+				</wsp:Policy>
+			</sp:SupportingTokens>
+		</wsp:All>
+	</wsp:ExactlyOne>
+</wsp:Policy>

Added: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/UsernamePolicy.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/UsernamePolicy.xml?rev=1443247&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/UsernamePolicy.xml (added)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/java_first_policies/UsernamePolicy.xml Wed Feb  6 22:33:11 2013
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<wsp:Policy wsu:Id="UsernamePolicy" 
+	xmlns:wsp="http://www.w3.org/ns/ws-policy"
+	xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+	xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+	<wsp:ExactlyOne>
+		<wsp:All>
+			<sp:TransportBinding>
+				<wsp:Policy>
+					<sp:TransportToken>
+						<wsp:Policy>
+							<sp:HttpsToken>
+								<wsp:Policy>
+									<sp:RequireClientCertificate />
+								</wsp:Policy>
+							</sp:HttpsToken>
+						</wsp:Policy>
+					</sp:TransportToken>
+					<sp:AlgorithmSuite>
+						<wsp:Policy>
+							<sp:Basic256 />
+						</wsp:Policy>
+					</sp:AlgorithmSuite>
+				</wsp:Policy>
+			</sp:TransportBinding>
+
+			<sp:SupportingTokens>
+				<wsp:Policy>
+					<sp:UsernameToken>
+						<wsp:Policy>
+							<sp:NoPassword />
+						</wsp:Policy>
+					</sp:UsernameToken>
+				</wsp:Policy>
+			</sp:SupportingTokens>
+		</wsp:All>
+	</wsp:ExactlyOne>
+</wsp:Policy>

Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/javafirstclient.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/javafirstclient.xml?rev=1443247&r1=1443246&r2=1443247&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/javafirstclient.xml (original)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/javafirstclient.xml Wed Feb  6 22:33:11 2013
@@ -33,35 +33,30 @@
           http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd
           http://www.w3.org/ns/ws-policy  http://www.w3.org/2007/02/ws-policy.xsd"
 >
+	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />
+	
     <cxf:bus>
         <cxf:features>
             <p:policies/>
             <cxf:logging/>
         </cxf:features>
     </cxf:bus>
-	
+        
 	<http:conduit name="https://localhost:.*">
         <http:tlsClientParameters disableCNCheck="true">
             <sec:trustManagers>
                 <sec:keyStore type="jks" password="password" resource="org/apache/cxf/systest/ws/security/Truststore.jks"/>
             </sec:trustManagers>
         </http:tlsClientParameters>
-    </http:conduit>  
-    
-    <jaxws:client 
-		id="JavaFirstAttachmentPolicyServiceClient" serviceClass="org.apache.cxf.systest.ws.policy.JavaFirstAttachmentPolicyService">
-		<jaxws:properties>
-			<entry key="ws-security.username" value="jason" />
-		</jaxws:properties>
+    </http:conduit>
+ 
+    <jaxws:client id="JavaFirstAttachmentPolicyServiceClient" 
+		serviceClass="org.apache.cxf.systest.ws.policy.JavaFirstAttachmentPolicyService"
+		address="http://localhost:${testutil.ports.JavaFirstPolicyServer}/JavaFirstAttachmentPolicyService">
 	</jaxws:client>
 	
-	<jaxws:client 
-		id="SslUsernamePasswordAttachmentServiceClient" serviceClass="org.apache.cxf.systest.ws.policy.SslUsernamePasswordAttachmentService">
-		<jaxws:properties>
-			<entry key="ws-security.username" value="jason" />
-		</jaxws:properties>
+	<jaxws:client id="SslUsernamePasswordAttachmentServiceClient" 
+		serviceClass="org.apache.cxf.systest.ws.policy.SslUsernamePasswordAttachmentService"
+		address="https://localhost:${testutil.ports.JavaFirstPolicyServer.2}/SslUsernamePasswordAttachmentService">
 	</jaxws:client>
-	
-	
-		
 </beans>

Added: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/sslcertclient.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/sslcertclient.xml?rev=1443247&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/sslcertclient.xml (added)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/sslcertclient.xml Wed Feb  6 22:33:11 2013
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+	license agreements. See the NOTICE file distributed with this work for additional 
+	information regarding copyright ownership. The ASF licenses this file to 
+	you under the Apache License, Version 2.0 (the "License"); you may not use 
+	this file except in compliance with the License. You may obtain a copy of 
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+	by applicable law or agreed to in writing, software distributed under the 
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+	OF ANY KIND, either express or implied. See the License for the specific 
+	language governing permissions and limitations under the License. -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:http="http://cxf.apache.org/transports/http/configuration"
+	xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:cxf="http://cxf.apache.org/core"
+	xmlns:p="http://cxf.apache.org/policy" xmlns:sec="http://cxf.apache.org/configuration/security"
+	xsi:schemaLocation="
+          http://www.springframework.org/schema/beans           http://www.springframework.org/schema/beans/spring-beans.xsd
+          http://cxf.apache.org/jaxws                           http://cxf.apache.org/schemas/jaxws.xsd
+          http://cxf.apache.org/transports/http/configuration   http://cxf.apache.org/schemas/configuration/http-conf.xsd
+          http://cxf.apache.org/configuration/security          http://cxf.apache.org/schemas/configuration/security.xsd
+          http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+          http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd
+          http://www.w3.org/ns/ws-policy  http://www.w3.org/2007/02/ws-policy.xsd">
+	
+	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />
+
+	<cxf:bus>
+		<cxf:features>
+			<p:policies />
+			<cxf:logging />
+		</cxf:features>
+	</cxf:bus>
+
+	<http:conduit name="https://localhost:.*">
+		<http:tlsClientParameters disableCNCheck="true">
+			<sec:trustManagers>
+				<sec:keyStore type="jks" password="password"
+					resource="org/apache/cxf/systest/ws/security/Truststore.jks" />
+			</sec:trustManagers>
+
+			<sec:keyManagers keyPassword="password">
+				<sec:keyStore type="jks" password="password"
+					resource="org/apache/cxf/systest/ws/security/Bethal.jks" />
+			</sec:keyManagers>
+		</http:tlsClientParameters>
+	</http:conduit>
+	
+	<jaxws:client id="BindingSimpleServiceClient" 
+		serviceClass="org.apache.cxf.systest.ws.policy.javafirst.BindingSimpleServiceClient"
+		address="https://localhost:${testutil.ports.JavaFirstPolicyServer.3}/BindingSimpleService">
+	</jaxws:client>
+	
+	<jaxws:client id="OperationSimpleServiceClient" 
+		serviceClass="org.apache.cxf.systest.ws.policy.javafirst.OperationSimpleServiceClient"
+		address="https://localhost:${testutil.ports.JavaFirstPolicyServer.3}/OperationSimpleService">
+	</jaxws:client>
+	
+	<jaxws:client id="NoAlternativesOperationSimpleServiceClient" 
+		serviceClass="org.apache.cxf.systest.ws.policy.javafirst.NoAlternativesOperationSimpleServiceClient"
+		address="https://localhost:${testutil.ports.JavaFirstPolicyServer.3}/NoAlternativesOperationSimpleService">
+	</jaxws:client>
+</beans>

Added: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/sslnocertclient.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/sslnocertclient.xml?rev=1443247&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/sslnocertclient.xml (added)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/client/sslnocertclient.xml Wed Feb  6 22:33:11 2013
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+	license agreements. See the NOTICE file distributed with this work for additional 
+	information regarding copyright ownership. The ASF licenses this file to 
+	you under the Apache License, Version 2.0 (the "License"); you may not use 
+	this file except in compliance with the License. You may obtain a copy of 
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+	by applicable law or agreed to in writing, software distributed under the 
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+	OF ANY KIND, either express or implied. See the License for the specific 
+	language governing permissions and limitations under the License. -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:http="http://cxf.apache.org/transports/http/configuration"
+	xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:cxf="http://cxf.apache.org/core"
+	xmlns:p="http://cxf.apache.org/policy" xmlns:sec="http://cxf.apache.org/configuration/security"
+	xsi:schemaLocation="
+          http://www.springframework.org/schema/beans           http://www.springframework.org/schema/beans/spring-beans.xsd
+          http://cxf.apache.org/jaxws                           http://cxf.apache.org/schemas/jaxws.xsd
+          http://cxf.apache.org/transports/http/configuration   http://cxf.apache.org/schemas/configuration/http-conf.xsd
+          http://cxf.apache.org/configuration/security          http://cxf.apache.org/schemas/configuration/security.xsd
+          http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+          http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd
+          http://www.w3.org/ns/ws-policy  http://www.w3.org/2007/02/ws-policy.xsd">
+	
+	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />
+
+	<cxf:bus>
+		<cxf:features>
+			<p:policies />
+			<cxf:logging />
+		</cxf:features>
+	</cxf:bus>
+
+	<http:conduit name="https://localhost:.*">
+		<http:tlsClientParameters disableCNCheck="true">
+			<sec:trustManagers>
+				<sec:keyStore type="jks" password="password"
+					resource="org/apache/cxf/systest/ws/security/Truststore.jks" />
+			</sec:trustManagers>
+		</http:tlsClientParameters>
+	</http:conduit>
+	
+	<jaxws:client id="BindingSimpleServiceClient" 
+		serviceClass="org.apache.cxf.systest.ws.policy.javafirst.BindingSimpleServiceClient"
+		address="https://localhost:${testutil.ports.JavaFirstPolicyServer.3}/BindingSimpleService">
+	</jaxws:client>
+	
+	<jaxws:client id="OperationSimpleServiceClient" 
+		serviceClass="org.apache.cxf.systest.ws.policy.javafirst.OperationSimpleServiceClient"
+		address="https://localhost:${testutil.ports.JavaFirstPolicyServer.3}/OperationSimpleService">
+	</jaxws:client>
+	
+	<jaxws:client id="NoAlternativesOperationSimpleServiceClient" 
+		serviceClass="org.apache.cxf.systest.ws.policy.javafirst.NoAlternativesOperationSimpleServiceClient"
+		address="https://localhost:${testutil.ports.JavaFirstPolicyServer.3}/NoAlternativesOperationSimpleService">
+	</jaxws:client>
+</beans>

Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/server/javafirstserver.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/server/javafirstserver.xml?rev=1443247&r1=1443246&r2=1443247&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/server/javafirstserver.xml (original)
+++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/policy/server/javafirstserver.xml Wed Feb  6 22:33:11 2013
@@ -10,10 +10,12 @@
 	OF ANY KIND, either express or implied. See the License for the specific 
 	language governing permissions and limitations under the License. -->
 <beans xmlns="http://www.springframework.org/schema/beans"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xmlns:jaxws="http://cxf.apache.org/jaxws"
 	xmlns:http="http://cxf.apache.org/transports/http/configuration"
 	xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
-	xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:cxf="http://cxf.apache.org/core"
+	xmlns:sec="http://cxf.apache.org/configuration/security" 
+	xmlns:cxf="http://cxf.apache.org/core"
 	xmlns:p="http://cxf.apache.org/policy"
 	xsi:schemaLocation="
         http://www.springframework.org/schema/beans                     http://www.springframework.org/schema/beans/spring-beans.xsd
@@ -25,8 +27,7 @@
         http://cxf.apache.org/configuration/security                    http://cxf.apache.org/schemas/configuration/security.xsd
         http://www.w3.org/ns/ws-policy                                  http://www.w3.org/2007/02/ws-policy.xsd
     ">
-	<bean
-		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />
+	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />
 
 	<cxf:bus>
 		<cxf:features>
@@ -41,6 +42,31 @@
                 <sec:keyManagers keyPassword="password">
                     <sec:keyStore type="jks" password="password" resource="org/apache/cxf/systest/ws/security/Bethal.jks"/>
                 </sec:keyManagers>
+            
+                <sec:cipherSuitesFilter>
+                    <sec:include>.*_EXPORT_.*</sec:include>
+                    <sec:include>.*_EXPORT1024_.*</sec:include>
+                    <sec:include>.*_WITH_DES_.*</sec:include>
+                    <sec:include>.*_WITH_AES_.*</sec:include>
+                    <sec:include>.*_WITH_NULL_.*</sec:include>
+                    <sec:exclude>.*_DH_anon_.*</sec:exclude>
+                </sec:cipherSuitesFilter>
+                <sec:clientAuthentication want="true" required="false"/>
+            </httpj:tlsServerParameters>
+        </httpj:engine>
+    </httpj:engine-factory>
+    
+    <httpj:engine-factory id="tls-settings2">
+        <httpj:engine port="${testutil.ports.JavaFirstPolicyServer.3}">
+            <httpj:tlsServerParameters>
+                <sec:keyManagers keyPassword="password">
+                    <sec:keyStore type="jks" password="password" resource="org/apache/cxf/systest/ws/security/Bethal.jks"/>
+                </sec:keyManagers>
+                
+                <sec:trustManagers>
+                	<sec:keyStore type="jks" password="password" resource="org/apache/cxf/systest/ws/security/Truststore.jks"/>
+            	</sec:trustManagers>
+            
                 <sec:cipherSuitesFilter>
                     <sec:include>.*_EXPORT_.*</sec:include>
                     <sec:include>.*_EXPORT1024_.*</sec:include>
@@ -125,6 +151,40 @@
 		</jaxws:features>
 	</jaxws:endpoint>
 
+	<bean id="org.apache.cxf.systest.ws.policy.javafirst.BindingSimpleService" 
+			class="org.apache.cxf.systest.ws.policy.javafirst.BindingSimpleServiceImpl" />
+	
+	<jaxws:endpoint id="BindingSimpleServiceEndpoint" implementor="#org.apache.cxf.systest.ws.policy.javafirst.BindingSimpleService"
+		address="https://localhost:${testutil.ports.JavaFirstPolicyServer.3}/BindingSimpleService">
+
+		<jaxws:properties>
+			<entry key="ws-security.callback-handler"
+				value="org.apache.cxf.systest.ws.wssec10.client.UTPasswordCallback" />
+		</jaxws:properties>
+	</jaxws:endpoint>
+
+	<bean id="org.apache.cxf.systest.ws.policy.javafirst.OperationSimpleService" class="org.apache.cxf.systest.ws.policy.javafirst.OperationSimpleServiceImpl" />
+	
+	<jaxws:endpoint id="OperationSimpleServiceEndpoint" implementor="#org.apache.cxf.systest.ws.policy.javafirst.OperationSimpleService"
+		address="https://localhost:${testutil.ports.JavaFirstPolicyServer.3}/OperationSimpleService">
+
+		<jaxws:properties>
+			<entry key="ws-security.callback-handler"
+				value="org.apache.cxf.systest.ws.wssec10.client.UTPasswordCallback" />
+		</jaxws:properties>
+	</jaxws:endpoint>
+
+	<bean id="org.apache.cxf.systest.ws.policy.javafirst.NoAlternativesOperationSimpleService" class="org.apache.cxf.systest.ws.policy.javafirst.NoAlternativesOperationSimpleServiceImpl" />
+	
+	<jaxws:endpoint id="NoAlternativesOperationSimpleServiceEndpoint" implementor="#org.apache.cxf.systest.ws.policy.javafirst.NoAlternativesOperationSimpleService"
+		address="https://localhost:${testutil.ports.JavaFirstPolicyServer.3}/NoAlternativesOperationSimpleService">
+
+		<jaxws:properties>
+			<entry key="ws-security.callback-handler"
+				value="org.apache.cxf.systest.ws.wssec10.client.UTPasswordCallback" />
+		</jaxws:properties>
+	</jaxws:endpoint>
+
 	<wsp:Policy wsu:Id="InternalTransportAndUsernamePolicy"
 		xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
 		xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
@@ -143,4 +203,136 @@
 			</wsp:All>
 		</wsp:ExactlyOne>
 	</wsp:Policy>
+	
+	<wsp:Policy wsu:Id="AlternativesPolicy"
+		xmlns:wsp="http://www.w3.org/ns/ws-policy"
+		xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+		xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+		<wsp:ExactlyOne>
+			<wsp:All>
+				<sp:TransportBinding>
+					<wsp:Policy>
+						<sp:TransportToken>
+							<wsp:Policy>
+								<sp:HttpsToken RequireClientCertificate="true" />
+							</wsp:Policy>
+						</sp:TransportToken>
+						<sp:AlgorithmSuite>
+							<wsp:Policy>
+								<sp:Basic256 />
+							</wsp:Policy>
+						</sp:AlgorithmSuite>
+					</wsp:Policy>
+				</sp:TransportBinding>
+ 
+				<sp:SupportingTokens>
+					<wsp:Policy>
+						<sp:UsernameToken>
+							<wsp:Policy>
+								<sp:NoPassword />
+							</wsp:Policy>
+						</sp:UsernameToken>
+					</wsp:Policy>
+				</sp:SupportingTokens>
+			</wsp:All>
+			
+			<wsp:All>
+				<sp:TransportBinding>
+					<wsp:Policy>
+						<sp:TransportToken>
+							<wsp:Policy>
+								<sp:HttpsToken>
+									<wsp:Policy />
+								</sp:HttpsToken>
+							</wsp:Policy>
+						</sp:TransportToken>
+						<sp:AlgorithmSuite>
+							<wsp:Policy>
+								<sp:Basic256 />
+							</wsp:Policy>
+						</sp:AlgorithmSuite>
+					</wsp:Policy>
+				</sp:TransportBinding>
+
+				<sp:SupportingTokens>
+					<wsp:Policy>
+						<sp:UsernameToken>
+							<wsp:Policy>
+								<sp:WssUsernameToken11 />
+							</wsp:Policy>
+						</sp:UsernameToken>
+					</wsp:Policy>
+				</sp:SupportingTokens>
+			</wsp:All>
+		</wsp:ExactlyOne>
+	</wsp:Policy>
+
+	<wsp:Policy wsu:Id="HttpsNoClientCertUsernamePasswordPolicy"
+		xmlns:wsp="http://www.w3.org/ns/ws-policy"
+		xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+		xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+		<wsp:ExactlyOne>
+			<wsp:All>
+				<sp:TransportBinding>
+					<wsp:Policy>
+						<sp:TransportToken>
+							<wsp:Policy>
+								<sp:HttpsToken RequireClientCertificate="false" />
+							</wsp:Policy>
+						</sp:TransportToken>
+						<sp:AlgorithmSuite>
+							<wsp:Policy>
+								<sp:Basic256 />
+							</wsp:Policy>
+						</sp:AlgorithmSuite>
+					</wsp:Policy>
+				</sp:TransportBinding>
+
+				<sp:SupportingTokens>
+					<wsp:Policy>
+						<sp:UsernameToken>
+							<wsp:Policy>
+								<sp:WssUsernameToken11 />
+							</wsp:Policy>
+						</sp:UsernameToken>
+					</wsp:Policy>
+				</sp:SupportingTokens>
+			</wsp:All>
+		</wsp:ExactlyOne>
+	</wsp:Policy>
+
+	<wsp:Policy wsu:Id="HttpsClientCertUsernameOnlyPolicy"
+		xmlns:wsp="http://www.w3.org/ns/ws-policy"
+		xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+		xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+		<wsp:ExactlyOne>
+			<wsp:All>
+				<sp:TransportBinding>
+					<wsp:Policy>
+						<sp:TransportToken>
+							<wsp:Policy>
+								<sp:HttpsToken RequireClientCertificate="true" />
+							</wsp:Policy>
+						</sp:TransportToken>
+						<sp:AlgorithmSuite>
+							<wsp:Policy>
+								<sp:Basic256 />
+							</wsp:Policy>
+						</sp:AlgorithmSuite>
+					</wsp:Policy>
+				</sp:TransportBinding>
+ 
+				<sp:SupportingTokens>
+					<wsp:Policy>
+						<sp:UsernameToken>
+							<wsp:Policy>
+								<sp:NoPassword />
+							</wsp:Policy>
+						</sp:UsernameToken>
+					</wsp:Policy>
+				</sp:SupportingTokens>
+			</wsp:All>
+		</wsp:ExactlyOne>
+	</wsp:Policy>
+	
 </beans>



Mime
View raw message