[webbeans-commits] Webbeans SVN: r2358 - in ri/trunk: tests/src/main/java/org/jboss/webbeans/test and 1 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Wed Apr 8 15:28:30 EDT 2009


Author: pete.muir at jboss.org
Date: 2009-04-08 15:28:30 -0400 (Wed, 08 Apr 2009)
New Revision: 2358

Added:
   ri/trunk/tests/src/main/java/org/jboss/webbeans/test/ServletLifecycleContainersImpl.java
Modified:
   ri/trunk/tests/pom.xml
   ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/test/StandaloneContainersImpl.java
   ri/trunk/version-matrix/pom.xml
Log:
better test classes

Modified: ri/trunk/tests/pom.xml
===================================================================
--- ri/trunk/tests/pom.xml	2009-04-08 19:09:28 UTC (rev 2357)
+++ ri/trunk/tests/pom.xml	2009-04-08 19:28:30 UTC (rev 2358)
@@ -12,16 +12,6 @@
    <dependencies>
 
       <dependency>
-         <groupId>org.jboss.webbeans</groupId>
-         <artifactId>webbeans-core</artifactId>
-      </dependency>
-      
-      <dependency>
-         <groupId>org.jboss.webbeans</groupId>
-         <artifactId>webbeans-spi</artifactId>
-      </dependency>
-
-      <dependency>
          <groupId>org.testng</groupId>
          <artifactId>testng</artifactId>
          <classifier>jdk15</classifier>
@@ -34,6 +24,11 @@
       </dependency>
       
       <dependency>
+         <groupId>org.jboss.webbeans.tomcat</groupId>
+         <artifactId>webbeans-tomcat</artifactId>
+      </dependency>
+      
+      <dependency>
          <groupId>org.jboss.test-harness</groupId>
          <artifactId>jboss-test-harness</artifactId>
       </dependency>
@@ -151,6 +146,12 @@
                                  <overWrite>true</overWrite>
                                  <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
                               </artifactItem>
+                              <artifactItem>
+                                 <groupId>org.jboss.webbeans.tomcat</groupId>
+                                 <artifactId>webbeans-tomcat</artifactId>
+                                 <overWrite>true</overWrite>
+                                 <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+                              </artifactItem>
                            </artifactItems>
                         </configuration>
                      </execution>

Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java	2009-04-08 19:09:28 UTC (rev 2357)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java	2009-04-08 19:28:30 UTC (rev 2358)
@@ -68,7 +68,6 @@
    {
       if (!isInContainer())
       {
-         getCurrentConfiguration().setStandaloneContainers(new StandaloneContainersImpl());
          getCurrentConfiguration().getExtraPackages().add(AbstractWebBeansTest.class.getPackage().getName());
       }
       super.beforeSuite(context);

Added: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/ServletLifecycleContainersImpl.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/ServletLifecycleContainersImpl.java	                        (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/ServletLifecycleContainersImpl.java	2009-04-08 19:28:30 UTC (rev 2358)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test;
+
+import org.jboss.webbeans.mock.MockServletLifecycle;
+
+public class ServletLifecycleContainersImpl extends AbstractStandaloneContainersImpl
+{
+   
+   @Override
+   protected MockServletLifecycle newLifecycle()
+   {
+      return new MockServletLifecycle();
+   }
+   
+}

Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/StandaloneContainersImpl.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/StandaloneContainersImpl.java	2009-04-08 19:09:28 UTC (rev 2357)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/StandaloneContainersImpl.java	2009-04-08 19:28:30 UTC (rev 2358)
@@ -1,76 +1,16 @@
 package org.jboss.webbeans.test;
 
-import java.net.URL;
-
-import org.jboss.testharness.api.DeploymentException;
 import org.jboss.testharness.spi.StandaloneContainers;
 import org.jboss.webbeans.mock.MockEELifecycle;
 import org.jboss.webbeans.mock.MockServletLifecycle;
-import org.jboss.webbeans.mock.MockWebBeanDiscovery;
 
-public class StandaloneContainersImpl implements StandaloneContainers
+public class StandaloneContainersImpl extends AbstractStandaloneContainersImpl implements StandaloneContainers
 {
    
-   // TODO this is a hack ;-)
-   public static Class<? extends MockServletLifecycle> lifecycleClass = MockEELifecycle.class;
-   
-   private MockServletLifecycle lifecycle;
-   
-   public void deploy(Iterable<Class<?>> classes, Iterable<URL> beansXml) throws DeploymentException
+   @Override
+   protected MockServletLifecycle newLifecycle()
    {
-      try
-      {
-         this.lifecycle = lifecycleClass.newInstance();
-      }
-      catch (InstantiationException e1)
-      {
-         throw new DeploymentException("Error instantiating lifeycle", e1);
-      }
-      catch (IllegalAccessException e1)
-      {
-         throw new DeploymentException("Error instantiating lifeycle", e1);
-      }
-      lifecycle.initialize();
-      try
-      {
-         MockWebBeanDiscovery discovery = lifecycle.getWebBeanDiscovery();
-         discovery.setWebBeanClasses(classes);
-         if (beansXml != null)
-         {
-            discovery.setWebBeansXmlFiles(beansXml);
-         }
-         lifecycle.beginApplication();
-      }
-      catch (Exception e) 
-      {
-         throw new DeploymentException("Error deploying beans", e);
-      }
-      lifecycle.beginSession();
-      lifecycle.beginRequest();
+      return new MockEELifecycle();
    }
    
-   public void deploy(Iterable<Class<?>> classes) throws DeploymentException
-   {
-      deploy(classes, null);
-   }
-
-   public void cleanup()
-   {
-      // Np-op
-      
-   }
-   
-   public void setup()
-   {
-      // No-op
-   }
-
-   public void undeploy()
-   {
-      lifecycle.endRequest();
-      lifecycle.endSession();
-      lifecycle.endApplication();
-      lifecycle = null;
-   }
-   
 }

Modified: ri/trunk/version-matrix/pom.xml
===================================================================
--- ri/trunk/version-matrix/pom.xml	2009-04-08 19:09:28 UTC (rev 2357)
+++ ri/trunk/version-matrix/pom.xml	2009-04-08 19:28:30 UTC (rev 2358)
@@ -300,6 +300,12 @@
             <version>1.0.0-SNAPSHOT</version>
          </dependency>
          
+         <dependency>
+            <groupId>org.jboss.test-harness</groupId>
+            <artifactId>jboss-test-harness-tomcat</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+         </dependency>
+         
 <!--         <dependency>-->
 <!--            <groupId>org.jboss.naming</groupId>-->
 <!--            <artifactId>jnp-client</artifactId>-->




More information about the weld-commits mailing list