[webbeans-commits] Webbeans SVN: r1568 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck and 1 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Wed Feb 18 09:22:39 EST 2009


Author: pete.muir at jboss.org
Date: 2009-02-18 09:22:39 -0500 (Wed, 18 Feb 2009)
New Revision: 1568

Modified:
   ri/trunk/jboss-tck-runner/src/main/java/org/jboss/webbeans/tck/integration/jbossas/ProfileServiceContainersImpl.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractDeclarativeTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/DisableIntegrationTestsMethodSelector.java
Log:
Fix standalone tests

Modified: ri/trunk/jboss-tck-runner/src/main/java/org/jboss/webbeans/tck/integration/jbossas/ProfileServiceContainersImpl.java
===================================================================
--- ri/trunk/jboss-tck-runner/src/main/java/org/jboss/webbeans/tck/integration/jbossas/ProfileServiceContainersImpl.java	2009-02-18 13:07:18 UTC (rev 1567)
+++ ri/trunk/jboss-tck-runner/src/main/java/org/jboss/webbeans/tck/integration/jbossas/ProfileServiceContainersImpl.java	2009-02-18 14:22:39 UTC (rev 1568)
@@ -54,6 +54,10 @@
    
    public void deploy(InputStream archiveStream, String name) throws DeploymentException, IOException
    {
+      if (deploymentManager == null)
+      {
+         throw new IllegalStateException("setup() has not been called!");
+      }
       Exception failure = null;
       try
       {

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractDeclarativeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractDeclarativeTest.java	2009-02-18 13:07:18 UTC (rev 1567)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractDeclarativeTest.java	2009-02-18 14:22:39 UTC (rev 1568)
@@ -73,7 +73,7 @@
        *  THEN
        *    we need to deploy 
        */
-      return !isInContainer() && artifact != null && ((getCurrentConfiguration().isStandalone() && !artifact.isUnit()) || !getCurrentConfiguration().isStandalone());
+      return !isInContainer() && artifact != null && ((getCurrentConfiguration().isStandalone() && !artifact.isUnit() && getCurrentConfiguration().isRunIntegrationTests()) || !getCurrentConfiguration().isStandalone());
    }
    
    private void deployArtifact()
@@ -84,7 +84,7 @@
          {
             getCurrentConfiguration().getContainers().deploy(artifact.getJarAsStream(), artifact.getDefaultName());
          }
-         else if (artifact != null)
+         else if (artifact != null && artifact.isUnit())
          {
             // Not a legacy test
             Set<Class<?>> classes = artifact.getClasses();
@@ -129,7 +129,7 @@
       {
          getCurrentConfiguration().getContainers().undeploy(artifact.getDefaultName());
       }
-      if (getCurrentConfiguration().isStandalone())
+      if (getCurrentConfiguration().isStandalone() && artifact != null && artifact.isUnit())
       {
          getCurrentConfiguration().getStandaloneContainers().undeploy();
       }
@@ -214,6 +214,11 @@
    @AfterMethod(alwaysRun=true)
    public void afterMethod()
    {
+      if (!isInContainer() && artifact == null) 
+      {
+         // This is a legacy test
+         getCurrentConfiguration().getStandaloneContainers().undeploy();
+      }
       setCurrentManager(null);
    }
 

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/DisableIntegrationTestsMethodSelector.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/DisableIntegrationTestsMethodSelector.java	2009-02-18 13:07:18 UTC (rev 1567)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/DisableIntegrationTestsMethodSelector.java	2009-02-18 14:22:39 UTC (rev 1568)
@@ -15,6 +15,7 @@
    {
       if (!ConfigurationImpl.get().isRunIntegrationTests() && method.getMethod().getDeclaringClass().isAnnotationPresent(IntegrationTest.class))
       {
+         context.setStopped(true);
          return false;
       }
       else




More information about the weld-commits mailing list