[jboss-cvs] JBossAS SVN: r101486 - in branches/vfs3-int/testsuite: src/main/org/jboss/test/profileservice/test and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Feb 25 11:44:11 EST 2010


Author: johnbailey
Date: 2010-02-25 11:44:11 -0500 (Thu, 25 Feb 2010)
New Revision: 101486

Modified:
   branches/vfs3-int/testsuite/build.sh
   branches/vfs3-int/testsuite/build.xml
   branches/vfs3-int/testsuite/src/main/org/jboss/test/profileservice/test/DeployUnitTestCase.java
   branches/vfs3-int/testsuite/src/main/org/jboss/test/profileservice/test/SecurityManagedObjectsTestCase.java
   branches/vfs3-int/testsuite/src/main/org/jboss/test/webservice/WebserviceTestBase.java
   branches/vfs3-int/testsuite/src/main/org/jboss/test/webservice/admindevel/ExampleTestCase.java
   branches/vfs3-int/testsuite/src/main/org/jboss/test/webservice/admindevel/ExplodedExampleTestCase.java
   branches/vfs3-int/testsuite/src/main/org/jboss/test/webservice/jbas5614/JBAS5614TestCase.java
Log:
Various testsuite updated for VFS3

Modified: branches/vfs3-int/testsuite/build.sh
===================================================================
--- branches/vfs3-int/testsuite/build.sh	2010-02-25 16:09:57 UTC (rev 101485)
+++ branches/vfs3-int/testsuite/build.sh	2010-02-25 16:44:11 UTC (rev 101486)
@@ -145,7 +145,7 @@
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="$ANT_OPTS -Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    #ANT_OPTS="$ANT_OPTS -Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
     ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"

Modified: branches/vfs3-int/testsuite/build.xml
===================================================================
--- branches/vfs3-int/testsuite/build.xml	2010-02-25 16:09:57 UTC (rev 101485)
+++ branches/vfs3-int/testsuite/build.xml	2010-02-25 16:44:11 UTC (rev 101486)
@@ -272,6 +272,7 @@
       <fileset refid="org.jboss.ejb3:jboss-ejb3-proxy-impl:jar"/>
       <fileset refid="org.jboss.ejb3:jboss-ejb3-proxy-impl:jar:client"/>
       <fileset refid="org.jboss.ejb3:jboss-ejb3-proxy-spi:jar:client"/>
+      <fileset refid="org.jboss.ejb3.vfs:jboss-ejb3-vfs-spi:jar"/>
       <fileset refid="org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar"/>
       <fileset refid="org.hibernate:hibernate-annotations:jar"/>
       <fileset refid="org.hibernate:hibernate-core:jar"/>
@@ -1646,7 +1647,6 @@
          <sysproperty key="jboss.dist" value="${jboss.dist}"/>
          <sysproperty key="jbosstest.deploy.dir" file="${build.lib}"/>
          <sysproperty key="build.testlog" value="${build.testlog}"/>
-      	 <sysproperty key="java.protocol.handler.pkgs" value="org.jboss.vfs.protocol"/>
          <sysproperty key="log4j.configuration" value="file:${build.resources}/log4j.xml"/>
          <sysproperty key="java.naming.provider.url" value="${node0.jndi.url}"/>
          <sysproperty key="jbosstest.server.host" value="${node0}"/>
@@ -1718,7 +1718,6 @@
          <sysproperty key="jboss.dist" value="${jboss.dist}"/>
          <sysproperty key="jbosstest.deploy.dir" file="${build.lib}"/>
          <sysproperty key="build.testlog" value="${build.testlog}"/>
-         <sysproperty key="java.protocol.handler.pkgs" value="org.jboss.vfs.protocol"/>
          <sysproperty key="log4j.configuration" value="file:${build.resources}/log4j.xml"/>
          <sysproperty key="java.naming.factory.initial" value="org.jboss.naming.HttpNamingContextFactory"/>
          <sysproperty key="java.naming.provider.url" value="${node0.jndi.http.url}"/>
@@ -1782,7 +1781,6 @@
          <sysproperty key="jboss.dist" value="${jboss.dist}"/>
          <sysproperty key="jbosstest.deploy.dir" file="${build.lib}"/>
          <sysproperty key="build.testlog" value="${build.testlog}"/>
-      	 <sysproperty key="java.protocol.handler.pkgs" value="org.jboss.vfs.protocol"/>
          <sysproperty key="log4j.configuration" value="file:${build.resources}/log4j.xml"/>
          <sysproperty key="java.naming.provider.url" value="${node0.jndi.url}"/>
          <sysproperty key="jbosstest.server.host" value="${node0}"/>
@@ -2767,7 +2765,7 @@
    </target>
 
     <!-- Run the Web Services Tests-->
-   <target name="tests-webservice"
+   <target name="tests-webservice" depends="init" 
       description="Execute Web Services Related Tests">
 
       <junit dir="${module.output}"
@@ -2788,7 +2786,6 @@
          <sysproperty key="java.security.auth.login.config" value="${build.resources}/security/auth.conf"/>
          <sysproperty key="java.naming.provider.url" value="${node0.jndi.url}"/>
          <!-- [JBAS-3969] IOException: unknown protocol: vfsfile -->
-         <sysproperty key="java.protocol.handler.pkgs" value="org.jboss.vfs.protocol"/>
          <sysproperty key="jbosstest.server.host" value="${node0}"/>
          <sysproperty key="build.testlog" value="${build.testlog}"/>
          <sysproperty key="log4j.configuration" value="file:${build.resources}/log4j.xml"/>
@@ -2848,8 +2845,6 @@
          <sysproperty key="java.security.policy" value="${build.resources}/security/tst.policy"/>
          <sysproperty key="java.security.auth.login.config" value="${build.resources}/security/auth.conf"/>
          <sysproperty key="java.naming.provider.url" value="${node0.jndi.url}"/>
-         <!-- [JBAS-3969] IOException: unknown protocol: vfsfile -->
-         <sysproperty key="java.protocol.handler.pkgs" value="org.jboss.vfs.protocol"/>
          <sysproperty key="jbosstest.server.host" value="${node0}"/>
          <sysproperty key="build.testlog" value="${build.testlog}"/>
          <sysproperty key="log4j.configuration" value="file:${build.resources}/log4j.xml"/>
@@ -3361,9 +3356,6 @@
          </syspropertyset>
          <sysproperty key="java.security.auth.login.config"
             value="${build.resources}/security/auth.conf"/>
-         <sysproperty key="java.protocol.handler.pkgs" value="org.jboss.vfs.protocol"/>
-         <sysproperty key="jboss.vfs.forceCopy" value="true"/>
-
          <classpath>
             <pathelement location="${build.classes}"/>
             <pathelement location="${build.resources}"/>
@@ -3504,8 +3496,6 @@
          <jvmarg value="-Dbind.address=${node0}"/>
          <sysproperty key="jboss.dist" value="${jboss.dist}"/>
          <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed"/>
-         <!-- [JBAS-3969] IOException: unknown protocol: vfsfile -->
-         <sysproperty key="java.protocol.handler.pkgs" value="org.jboss.vfs.protocol"/>
          <sysproperty key="jbosstest.deploy.dir" file="${build.lib}"/>
          <sysproperty key="build.testlog" value="${build.testlog}"/>
          <sysproperty key="log4j.configuration" value="file:${build.resources}/log4j.xml"/>

Modified: branches/vfs3-int/testsuite/src/main/org/jboss/test/profileservice/test/DeployUnitTestCase.java
===================================================================
--- branches/vfs3-int/testsuite/src/main/org/jboss/test/profileservice/test/DeployUnitTestCase.java	2010-02-25 16:09:57 UTC (rev 101485)
+++ branches/vfs3-int/testsuite/src/main/org/jboss/test/profileservice/test/DeployUnitTestCase.java	2010-02-25 16:44:11 UTC (rev 101486)
@@ -86,7 +86,7 @@
       // TODO - hack to get off JDK's url handling
       String urlString = contentURL.toExternalForm();
       int p = urlString.indexOf(":/");
-      contentURL = new URL("vfszip" + urlString.substring(p));
+      contentURL = new URL("file" + urlString.substring(p));
       getLog().debug(contentURL);
 
       DeploymentStatus status;

Modified: branches/vfs3-int/testsuite/src/main/org/jboss/test/profileservice/test/SecurityManagedObjectsTestCase.java
===================================================================
--- branches/vfs3-int/testsuite/src/main/org/jboss/test/profileservice/test/SecurityManagedObjectsTestCase.java	2010-02-25 16:09:57 UTC (rev 101485)
+++ branches/vfs3-int/testsuite/src/main/org/jboss/test/profileservice/test/SecurityManagedObjectsTestCase.java	2010-02-25 16:44:11 UTC (rev 101486)
@@ -407,7 +407,7 @@
       // create a URL for the resource.
       String contentURLString = super.getResourceURL(resourcePath);
       int index = contentURLString.indexOf(":/");
-      URL contentURL = new URL("vfsfile" + contentURLString.substring(index));
+      URL contentURL = new URL("file" + contentURLString.substring(index));
 
       // distribute the resource deployment.
       DeploymentManager manager = super.getDeploymentManager();

Modified: branches/vfs3-int/testsuite/src/main/org/jboss/test/webservice/WebserviceTestBase.java
===================================================================
--- branches/vfs3-int/testsuite/src/main/org/jboss/test/webservice/WebserviceTestBase.java	2010-02-25 16:09:57 UTC (rev 101485)
+++ branches/vfs3-int/testsuite/src/main/org/jboss/test/webservice/WebserviceTestBase.java	2010-02-25 16:44:11 UTC (rev 101486)
@@ -21,15 +21,22 @@
  */
 package org.jboss.test.webservice;
 
+import java.io.Closeable;
+import java.net.URL;
+import java.util.ArrayList;
 import java.util.Hashtable;
-
+import java.util.List;
+import java.io.File;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
-
 import junit.framework.Test;
 import junit.framework.TestSuite;
-
 import org.jboss.test.JBossTestCase;
+import org.jboss.vfs.VFS;
+import org.jboss.vfs.VirtualFile;
+import org.jboss.vfs.VFSUtils;
+import org.jboss.vfs.TempFileProvider;
 
 /** Common functionality for web services test cases.
  *
@@ -38,11 +45,28 @@
  */
 public class WebserviceTestBase extends JBossTestCase
 {
+   private final List<Closeable> handles = new ArrayList<Closeable>();	
+   private TempFileProvider provider;	
+	
    public WebserviceTestBase(String name)
    {
       super(name);
    }
 
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+      provider = TempFileProvider.create("test", new ScheduledThreadPoolExecutor(2));
+   }
+
+   protected void tearDown() throws Exception
+   {
+      VFSUtils.safeClose(handles);
+      VFSUtils.safeClose(provider);
+      handles.clear();
+      super.tearDown();
+   }
+
    /**
     * Get the client's env context, see tracker [840598] for details
     */
@@ -70,4 +94,26 @@
       suite.addTest(new TestSuite(clazz));
       return getDeploySetup(suite, jarName);
    }
+
+   public void mountJars(String... jarNames) throws Exception
+   {
+      for(String jarName : jarNames) 
+      {
+          URL jarUrl = getURL(jarName);
+	      VirtualFile jarFile = VFS.getChild(jarUrl);
+          handles.add(VFS.mountZip(jarFile.getPhysicalFile(), jarFile, provider));
+      }
+   }
+   // Hack version that supports getting URLs for non-existent files (VFS mounts)
+   private URL getURL(String jarName) throws Exception
+   {
+      String deployDir = System.getProperty("jbosstest.deploy.dir");
+	  if (deployDir == null)
+	  {
+	     deployDir = "output/lib";
+      }
+	  String url = deployDir + "/" + jarName;
+	  File file = new File(url);
+      return file.toURL();
+   }
 }

Modified: branches/vfs3-int/testsuite/src/main/org/jboss/test/webservice/admindevel/ExampleTestCase.java
===================================================================
--- branches/vfs3-int/testsuite/src/main/org/jboss/test/webservice/admindevel/ExampleTestCase.java	2010-02-25 16:09:57 UTC (rev 101485)
+++ branches/vfs3-int/testsuite/src/main/org/jboss/test/webservice/admindevel/ExampleTestCase.java	2010-02-25 16:44:11 UTC (rev 101486)
@@ -27,6 +27,8 @@
 import javax.naming.InitialContext;
 import javax.xml.rpc.Service;
 
+import org.jboss.vfs.VFS;
+
 /** A test for the examples from the JBoss Admin Devel book.
  *
  * @author Thomas.Diesler at jboss.org
@@ -52,6 +54,7 @@
       super.setUp();
       if (helloPort == null)
       {
+         mountJars("ws4ee-admindevel.jar", "ws4ee-admindevel-client.jar");
          InitialContext iniCtx = getClientContext();
          Service service = (Service)iniCtx.lookup("java:comp/env/service/HelloService");
          helloPort = (Hello)service.getPort(Hello.class);
@@ -60,7 +63,6 @@
 
    public void testHelloString() throws Exception
    {
-
       String retStr = helloPort.helloString("Kermit");
       assertEquals("Hello Kermit!", retStr);
    }

Modified: branches/vfs3-int/testsuite/src/main/org/jboss/test/webservice/admindevel/ExplodedExampleTestCase.java
===================================================================
--- branches/vfs3-int/testsuite/src/main/org/jboss/test/webservice/admindevel/ExplodedExampleTestCase.java	2010-02-25 16:09:57 UTC (rev 101485)
+++ branches/vfs3-int/testsuite/src/main/org/jboss/test/webservice/admindevel/ExplodedExampleTestCase.java	2010-02-25 16:44:11 UTC (rev 101486)
@@ -43,6 +43,7 @@
 
    public void testHelloString() throws Exception
    {
+      mountJars("ws4ee-admindevel.jar", "ws4ee-admindevel-client.jar");
       InitialContext iniCtx = getClientContext();
       Service service = (Service)iniCtx.lookup("java:comp/env/service/HelloService");
       Hello helloPort = (Hello)service.getPort(Hello.class);

Modified: branches/vfs3-int/testsuite/src/main/org/jboss/test/webservice/jbas5614/JBAS5614TestCase.java
===================================================================
--- branches/vfs3-int/testsuite/src/main/org/jboss/test/webservice/jbas5614/JBAS5614TestCase.java	2010-02-25 16:09:57 UTC (rev 101485)
+++ branches/vfs3-int/testsuite/src/main/org/jboss/test/webservice/jbas5614/JBAS5614TestCase.java	2010-02-25 16:44:11 UTC (rev 101486)
@@ -51,6 +51,7 @@
       super.setUp();
       if (port == null)
       {
+         mountJars("webservice-jbas5614.ear", "webservice-jbas5614.ear/webservice-jbas5614-client.jar");
          InitialContext iniCtx = getClientContext("jbossws-client");
          Object lookup = iniCtx.lookup("java:comp/env/service/HelloWorldService");
          log.info("Lookup: " + lookup + " [" + lookup.getClass() + "]");




More information about the jboss-cvs-commits mailing list