Author: alessio.soldano(a)jboss.com
Date: 2010-05-14 11:17:30 -0400 (Fri, 14 May 2010)
New Revision: 12238
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationTestCase.java
Log:
[JBWS-2210] Adding another testcase
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationTestCase.java 2010-05-14
15:08:02 UTC (rev 12237)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationTestCase.java 2010-05-14
15:17:30 UTC (rev 12238)
@@ -62,6 +62,24 @@
setupWsse(proxy, "kermit");
assertEquals("Secure Hello World!", proxy.sayHello());
}
+
+ public void testUnauthenticated() throws Exception
+ {
+ QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/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 testUnauthorized() throws Exception
{