Author: asoldano
Date: 2014-10-21 05:22:22 -0400 (Tue, 21 Oct 2014)
New Revision: 19020
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint2Impl.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase.java
Log:
[WFLY-3988] Improving PermitAllTestCase to cover the requested scenario
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint.java 2014-10-21
02:42:59 UTC (rev 19019)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint.java 2014-10-21
09:22:22 UTC (rev 19020)
@@ -36,4 +36,8 @@
@WebMethod
@WebResult(targetNamespace = "http://org.jboss.ws/securityDomain", partName
= "return")
public String echo(@WebParam(name = "arg0", partName = "arg0")
String arg0);
+
+ @WebMethod
+ @WebResult(targetNamespace = "http://org.jboss.ws/securityDomain", partName
= "return")
+ public String echoForAll(@WebParam(name = "arg0", partName =
"arg0") String arg0);
}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint2Impl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint2Impl.java 2014-10-21
02:42:59 UTC (rev 19019)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint2Impl.java 2014-10-21
09:22:22 UTC (rev 19020)
@@ -65,4 +65,11 @@
log.info(input);
return input;
}
+
+ @WebMethod
+ public String echoForAll(String input)
+ {
+ log.info(input);
+ return input;
+ }
}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase.java 2014-10-21
02:42:59 UTC (rev 19019)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase.java 2014-10-21
09:22:22 UTC (rev 19020)
@@ -122,6 +122,14 @@
assertTrue(e.getMessage().contains("Could not send Message"));
assertTrue(e.getCause().getMessage().contains("401: Unauthorized"));
}
+ try {
+ port.echoForAll("Hi");
+ fail("Authentication exception expected!");
+ } catch (Exception e) {
+ //expected web layer exception
+ assertTrue(e.getMessage().contains("Could not send Message"));
+ assertTrue(e.getCause().getMessage().contains("401: Unauthorized"));
+ }
((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY,
"bob");
((BindingProvider)port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,
"foo");
@@ -132,9 +140,11 @@
//expected EJB3 layer authorization exception
assertTrue(e.getMessage().contains("not allowed"));
}
+ assertEquals("Hi", port.echoForAll("Hi"));
((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY,
"john");
((BindingProvider)port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,
"bar");
assertEquals("Hello", port.echo("Hello"));
+ assertEquals("Hi", port.echoForAll("Hi"));
}
}
Show replies by date