[wise-commits] wise SVN: r428 - in core/trunk: integration-testsuite and 4 other directories.

wise-commits at lists.jboss.org wise-commits at lists.jboss.org
Sun Jun 17 12:06:57 EDT 2012


Author: alessio.soldano at jboss.com
Date: 2012-06-17 12:06:57 -0400 (Sun, 17 Jun 2012)
New Revision: 428

Added:
   core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/wsdlResolver/jbossws-roles.properties
   core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/wsdlResolver/jbossws-users.properties
Modified:
   core/trunk/core/src/main/java/org/jboss/wise/core/test/WiseTest.java
   core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/basic/WiseIntegrationBasicTest.java
   core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/smooks/WiseIntegrationSmooksTest.java
   core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/wsdlResolver/WSDLResolverIntegrationTest.java
   core/trunk/integration-testsuite/cxf/src/test/java/org/jboss/wise/test/integration/wsaddressing/HelloImpl.java
   core/trunk/integration-testsuite/pom.xml
Log:
[WISE-174] Adding support for security domain creation on AS7 + fixing a bunch of test failures


Modified: core/trunk/core/src/main/java/org/jboss/wise/core/test/WiseTest.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/test/WiseTest.java	2012-06-17 14:49:11 UTC (rev 427)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/test/WiseTest.java	2012-06-17 16:06:57 UTC (rev 428)
@@ -28,6 +28,7 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.UnknownHostException;
+import java.util.Map;
 
 import org.jboss.wsf.spi.SPIProvider;
 import org.jboss.wsf.spi.SPIProviderResolver;
@@ -63,7 +64,7 @@
      * @param url url for webservice war 
      * @throws Exception if the deployment is failed
      */
-    public void deployWS(URL url) throws Exception {
+    public static void deployWS(URL url) throws Exception {
 	getDeployer().deploy(url);
     }
     
@@ -71,10 +72,18 @@
      * @param url url of webservice war 
      * @throws Exception if undeployment is failed
      */
-    public void undeployWS(URL url) throws Exception {
-	getDeployer().undeploy(url);       
+    public static void undeployWS(URL url) throws Exception {
+	getDeployer().undeploy(url);
     }
     
+    public static void addSecurityDomain(String domainName, Map<String, String> authenticationOptions) throws Exception {
+	getDeployer().addSecurityDomain(domainName, authenticationOptions);
+    }
+    
+    public static void removeSecurityDomain(String domainName) throws Exception {
+	getDeployer().removeSecurityDomain(domainName);
+    }
+    
     /**Get the URL path for a given webservice archive. It will find this war file under ${baseDir}/build/test-ws-archive
      * @param archiveName the webservice archive name
      * @return webservice war url

Modified: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/basic/WiseIntegrationBasicTest.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/basic/WiseIntegrationBasicTest.java	2012-06-17 14:49:11 UTC (rev 427)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/basic/WiseIntegrationBasicTest.java	2012-06-17 16:06:57 UTC (rev 428)
@@ -24,25 +24,25 @@
 
 import java.net.URL;
 import java.util.Map;
+
 import org.jboss.wise.core.client.InvocationResult;
 import org.jboss.wise.core.client.WSDynamicClient;
 import org.jboss.wise.core.client.WSMethod;
 import org.jboss.wise.core.client.builder.WSDynamicClientBuilder;
 import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
 import org.jboss.wise.core.test.WiseTest;
-import org.junit.After;
+import org.junit.AfterClass;
 import org.junit.Assert;
-import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class WiseIntegrationBasicTest extends WiseTest {
-    private URL warUrl = null;
+    private static URL warUrl = null;
 
-    @Before
-    public void setUp() throws Exception {
-	warUrl = this.getClass().getClassLoader().getResource("basic.war");
+    @BeforeClass
+    public static void setUp() throws Exception {
+	warUrl = WiseIntegrationBasicTest.class.getClassLoader().getResource("basic.war");
 	deployWS(warUrl);
-
     }
 
     @Test
@@ -63,8 +63,12 @@
 	Assert.assertEquals("from-wise-client", test.get("result"));
     }
 
-    @After
-    public void tearDown() throws Exception {
-	undeployWS(warUrl);
+    @AfterClass
+    public static void tearDown() throws Exception {
+	try {
+	    undeployWS(warUrl);
+	} finally {
+	    warUrl = null;
+	}
     }
 }

Modified: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/smooks/WiseIntegrationSmooksTest.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/smooks/WiseIntegrationSmooksTest.java	2012-06-17 14:49:11 UTC (rev 427)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/smooks/WiseIntegrationSmooksTest.java	2012-06-17 16:06:57 UTC (rev 428)
@@ -40,17 +40,17 @@
 import org.jboss.wise.core.test.WiseTest;
 import org.jboss.wise.test.integration.smooks.pojo.clientside.ExternalObject;
 import org.jboss.wise.test.integration.smooks.pojo.clientside.InternalObject;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class WiseIntegrationSmooksTest extends WiseTest {
 
-    private URL warUrl = null;
+    private static URL warUrl = null;
 
-    @Before
-    public void setUp() throws Exception {
-	warUrl = this.getClass().getClassLoader().getResource("smooks.war");
+    @BeforeClass
+    public static void setUp() throws Exception {
+	warUrl = WiseIntegrationSmooksTest.class.getClassLoader().getResource("smooks.war");
 	deployWS(warUrl);
 
     }
@@ -82,8 +82,12 @@
 	assertThat(((ExternalObject) resultMap.get("ExternalObject")).getDate(), notNullValue());
     }
 
-    @After
-    public void tearDown() throws Exception {
-	undeployWS(warUrl);
+    @AfterClass
+    public static void tearDown() throws Exception {
+	try {
+	    undeployWS(warUrl);
+	} finally {
+	    warUrl = null;
+	}
     }
 }

Modified: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/wsdlResolver/WSDLResolverIntegrationTest.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/wsdlResolver/WSDLResolverIntegrationTest.java	2012-06-17 14:49:11 UTC (rev 427)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/wsdlResolver/WSDLResolverIntegrationTest.java	2012-06-17 16:06:57 UTC (rev 428)
@@ -24,14 +24,17 @@
 import java.io.File;
 import java.io.IOException;
 import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
 
 import net.jcip.annotations.Immutable;
 
 import org.jboss.wise.core.client.impl.wsdlResolver.Connection;
 import org.jboss.wise.core.client.impl.wsdlResolver.WSDLResolver;
 import org.jboss.wise.core.test.WiseTest;
-import org.junit.After;
+import org.junit.AfterClass;
 import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
 import static org.junit.Assert.assertTrue;
 
@@ -43,7 +46,7 @@
 public class WSDLResolverIntegrationTest extends WiseTest {
     
     private static final File tmpDir = new File("target/temp/WSDLResolverTest");
-    private URL warUrl = null;
+    private static URL warUrl = null;
     
     @Test
     public void shouldSaveRemoteSimpleWsdl() throws Exception {
@@ -92,11 +95,16 @@
         assertTrue(wsdlFile.length() > 0);
     }
     
-    @Before
-    public void setUp() throws Exception {
-	warUrl = this.getClass().getClassLoader().getResource("wsdlResolver.war");
+    @BeforeClass
+    public static void setUp() throws Exception {
+	final ClassLoader classloader = WSDLResolverIntegrationTest.class.getClassLoader();
+	Map<String, String> authenticationOptions = new HashMap<String, String>();
+	authenticationOptions.put("usersProperties", classloader.getResource("org/jboss/wise/test/integration/wsdlResolver/jbossws-users.properties").toString());
+	authenticationOptions.put("rolesProperties", classloader.getResource("org/jboss/wise/test/integration/wsdlResolver/jbossws-roles.properties").toString());
+	authenticationOptions.put("unauthenticatedIdentity", "anonymous");
+	addSecurityDomain("JBossWS", authenticationOptions);
+	warUrl = classloader.getResource("wsdlResolver.war");
 	deployWS(warUrl);
-
     }
     
     @Before
@@ -109,9 +117,14 @@
 	tmpDir.mkdir();
     }
     
-    @After
-    public void tearDown() throws Exception {
-	undeployWS(warUrl);
+    @AfterClass
+    public static void tearDown() throws Exception {
+	try {
+	    undeployWS(warUrl);
+	    removeSecurityDomain("JBossWS");
+	} finally {
+	    warUrl = null;
+	}
     }
 
 }

Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/wsdlResolver/jbossws-roles.properties
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/wsdlResolver/jbossws-roles.properties	                        (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/wsdlResolver/jbossws-roles.properties	2012-06-17 16:06:57 UTC (rev 428)
@@ -0,0 +1,2 @@
+# A sample roles.properties file for use with the UsersRolesLoginModule
+kermit=friend
\ No newline at end of file

Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/wsdlResolver/jbossws-users.properties
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/wsdlResolver/jbossws-users.properties	                        (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/wsdlResolver/jbossws-users.properties	2012-06-17 16:06:57 UTC (rev 428)
@@ -0,0 +1,2 @@
+# A sample users.properties file for use with the UsersRolesLoginModule
+kermit=thefrog

Modified: core/trunk/integration-testsuite/cxf/src/test/java/org/jboss/wise/test/integration/wsaddressing/HelloImpl.java
===================================================================
--- core/trunk/integration-testsuite/cxf/src/test/java/org/jboss/wise/test/integration/wsaddressing/HelloImpl.java	2012-06-17 14:49:11 UTC (rev 427)
+++ core/trunk/integration-testsuite/cxf/src/test/java/org/jboss/wise/test/integration/wsaddressing/HelloImpl.java	2012-06-17 16:06:57 UTC (rev 428)
@@ -21,7 +21,6 @@
  */
 package org.jboss.wise.test.integration.wsaddressing;
 
-import javax.ejb.Stateless;
 import javax.jws.WebService;
 import javax.xml.ws.soap.Addressing;
 
@@ -37,7 +36,6 @@
              serviceName = "HelloService",
              wsdlLocation = "WEB-INF/test.wsdl" ) //this is added to force the server on publishing a WSDL without policies; this way we're sure WS-Addressing
              					  //on client side is controlled by features only, not by WS-Policy engine.
- at Stateless
 @Addressing(enabled = true, required = false)
 public class HelloImpl implements Hello {
     

Modified: core/trunk/integration-testsuite/pom.xml
===================================================================
--- core/trunk/integration-testsuite/pom.xml	2012-06-17 14:49:11 UTC (rev 427)
+++ core/trunk/integration-testsuite/pom.xml	2012-06-17 16:06:57 UTC (rev 428)
@@ -63,6 +63,17 @@
 	</dependencies>
 
 	<build>
+		<testResources>
+			<!-- copy handler definitions & property files -->
+			<testResource>
+				<targetPath>../test-classes</targetPath>
+				<directory>src/test/java</directory>
+				<includes>
+					<include>**/*.xml</include>
+					<include>**/*.properties</include>
+				</includes>
+			</testResource>
+		</testResources>
 		<plugins>
 			<plugin>
 				<artifactId>maven-surefire-plugin</artifactId>



More information about the wise-commits mailing list