Author: jim.ma
Date: 2015-03-13 06:10:15 -0400 (Fri, 13 Mar 2015)
New Revision: 19561
Modified:
stack/cxf/branches/management/modules/testsuite/shared-tests/src/test/etc/jbossws-roles.properties
stack/cxf/branches/management/modules/testsuite/shared-tests/src/test/etc/jbossws-users.properties
stack/cxf/branches/management/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java
Log:
[JBWS-3881]:Add test to get endpoint config info from management url
Modified:
stack/cxf/branches/management/modules/testsuite/shared-tests/src/test/etc/jbossws-roles.properties
===================================================================
---
stack/cxf/branches/management/modules/testsuite/shared-tests/src/test/etc/jbossws-roles.properties 2015-03-13
08:20:28 UTC (rev 19560)
+++
stack/cxf/branches/management/modules/testsuite/shared-tests/src/test/etc/jbossws-roles.properties 2015-03-13
10:10:15 UTC (rev 19561)
@@ -1,2 +1,3 @@
# A sample roles.properties file for use with the UsersRolesLoginModule
-kermit=friend
\ No newline at end of file
+kermit=friend
+jbossws=admin
\ No newline at end of file
Modified:
stack/cxf/branches/management/modules/testsuite/shared-tests/src/test/etc/jbossws-users.properties
===================================================================
---
stack/cxf/branches/management/modules/testsuite/shared-tests/src/test/etc/jbossws-users.properties 2015-03-13
08:20:28 UTC (rev 19560)
+++
stack/cxf/branches/management/modules/testsuite/shared-tests/src/test/etc/jbossws-users.properties 2015-03-13
10:10:15 UTC (rev 19561)
@@ -1,2 +1,3 @@
# A sample users.properties file for use with the UsersRolesLoginModule
-kermit=thefrog
\ No newline at end of file
+kermit=thefrog
+jbossws=jbossws
\ No newline at end of file
Modified:
stack/cxf/branches/management/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java
===================================================================
---
stack/cxf/branches/management/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java 2015-03-13
08:20:28 UTC (rev 19560)
+++
stack/cxf/branches/management/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java 2015-03-13
10:10:15 UTC (rev 19561)
@@ -21,13 +21,16 @@
*/
package org.jboss.test.ws.jaxws.samples.context;
+import java.io.ByteArrayOutputStream;
import java.io.File;
+import java.net.HttpURLConnection;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
+import org.apache.cxf.helpers.IOUtils;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
@@ -35,6 +38,7 @@
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.ws.common.utils.Base64;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
import org.junit.AfterClass;
@@ -118,4 +122,19 @@
{
assertTrue("kermit is my friend",
port.testIsUserInRole("friend"));
}
+
+ @Test
+ @RunAsClient
+ public void testManagementURL() throws Exception {
+ URL url = new URL(baseURL +
"/jaxws-samples-context-jse/management?config");
+ String encoding = Base64.encodeBytes("jbossws:jbossws".getBytes());
+ HttpURLConnection connenction = (HttpURLConnection)url.openConnection();
+ connenction.setRequestProperty("Authorization", "Basic " +
encoding);
+ connenction.connect();
+ assertEquals(200, connenction.getResponseCode());
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ IOUtils.copy(connenction.getInputStream(), bout);
+ assertTrue("Unexpected response",
bout.toString().contains("\"type\":\"JAXWS_JSE\",\"securityDomain\":\"JBossWS\""));
+
+ }
}
Show replies by date