[webbeans-commits] Webbeans SVN: r1531 - tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi and 13 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Sun Feb 15 19:27:30 EST 2009


Author: pete.muir at jboss.org
Date: 2009-02-15 19:27:29 -0500 (Sun, 15 Feb 2009)
New Revision: 1531

Added:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/custom/
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/custom/AnotherDeploymentType.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/custom/CustomDeploymentTypeTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/custom/HornedAnimalDeploymentType.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/defaultDeploymentType/
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/defaultDeploymentType/DefaultDeploymentTypeTest.java
   tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/
   tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/definition/
   tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/definition/deployment/
   tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/definition/deployment/custom/
   tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/definition/deployment/custom/beans.xml
Removed:
   tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/helpers/
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/CustomDeploymentTypeTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/DefaultDeploymentTypeTest.java
Modified:
   ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java
   tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Managers.java
   tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/StandaloneContainers.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractDeclarativeTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ArtifactDescriptor.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ArtifactGenerator.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ResourceDescriptor.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/jsr299/JSR299ArtifactDescriptor.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/war/WarArtifactDescriptor.java
   tck/trunk/impl/src/test/java/org/jboss/jsr299/tck/test/impl/packaging/descriptors/war/WarArtifactTest.java
Log:
Support for reading deployment types from beans.xml

Modified: ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java
===================================================================
--- ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java	2009-02-15 23:00:58 UTC (rev 1530)
+++ ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java	2009-02-16 00:27:29 UTC (rev 1531)
@@ -1,11 +1,9 @@
 package org.jboss.webbeans.tck;
 
 import java.lang.annotation.Annotation;
-import java.util.Arrays;
+import java.net.URL;
 import java.util.List;
 
-import javax.inject.manager.Manager;
-
 import org.jboss.jsr299.tck.api.DeploymentException;
 import org.jboss.jsr299.tck.spi.StandaloneContainers;
 import org.jboss.webbeans.ManagerImpl;
@@ -15,8 +13,13 @@
 public class StandaloneContainersImpl implements StandaloneContainers
 {
    
-   public Manager deploy(List<Class<? extends Annotation>> enabledDeploymentTypes, Class<?>... classes) throws DeploymentException
+   public void deploy(List<Class<? extends Annotation>> enabledDeploymentTypes, Iterable<Class<?>> classes) throws DeploymentException
    {
+      deploy(enabledDeploymentTypes, classes, null);
+   }
+   
+   public void deploy(List<Class<? extends Annotation>> enabledDeploymentTypes, Iterable<Class<?>> classes, Iterable<URL> beansXml) throws DeploymentException
+   {
       try
       {
          MockBootstrap bootstrap = new MockBootstrap();
@@ -26,10 +29,13 @@
             manager.setEnabledDeploymentTypes(enabledDeploymentTypes);
          }
          MockWebBeanDiscovery discovery = new MockWebBeanDiscovery();
-         discovery.setWebBeanClasses(Arrays.asList(classes));
+         discovery.setWebBeanClasses(classes);
+         if (beansXml != null)
+         {
+            discovery.setWebBeansXmlFiles(beansXml);
+         }
          bootstrap.setWebBeanDiscovery(discovery);
          bootstrap.boot();
-         return manager;
       }
       catch (Exception e) 
       {
@@ -37,9 +43,14 @@
       }
    }
    
-   public Manager deploy(java.lang.Class<?>... classes) throws DeploymentException
+   public void deploy(Iterable<Class<?>> classes) throws DeploymentException
    {
-      return deploy(null, classes);
+      deploy(null, classes, null);
    }
    
+   public void deploy(Iterable<Class<?>> classes, Iterable<URL> beansXml) throws DeploymentException
+   {
+      deploy(null, classes, beansXml);
+   }
+   
 }

Modified: tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Managers.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Managers.java	2009-02-15 23:00:58 UTC (rev 1530)
+++ tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Managers.java	2009-02-16 00:27:29 UTC (rev 1531)
@@ -23,7 +23,7 @@
     * 
     * @return the Manager 
     */
-   Manager getManager();
+   public Manager getManager();
    
    /**
     * Returns a list of the enabled deployment types for the current manager
@@ -32,5 +32,4 @@
     */
    List<Class<? extends Annotation>> getEnabledDeploymentTypes();
    
-   public void setEnabledDeploymentTypes(List<Class<? extends Annotation>> enabledDeploymentTypes);
 }

Modified: tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/StandaloneContainers.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/StandaloneContainers.java	2009-02-15 23:00:58 UTC (rev 1530)
+++ tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/StandaloneContainers.java	2009-02-16 00:27:29 UTC (rev 1531)
@@ -1,10 +1,9 @@
 package org.jboss.jsr299.tck.spi;
 
 import java.lang.annotation.Annotation;
+import java.net.URL;
 import java.util.List;
 
-import javax.inject.manager.Manager;
-
 import org.jboss.jsr299.tck.api.DeploymentException;
 
 /**
@@ -42,7 +41,51 @@
     * @param classes the classes to deploy
     * @return the manager created as a result of initializing the container
     */
-   public Manager deploy(List<Class<? extends Annotation>> enabledDeploymentTypes, Class<?>...classes) throws DeploymentException;
+   @Deprecated
+   public void deploy(List<Class<? extends Annotation>> enabledDeploymentTypes, Iterable<Class<?>> classes) throws DeploymentException;
    
-   public Manager deploy(Class<?>...classes) throws DeploymentException;
+   /**
+    * <p>Bootstrap the container by registering Beans and Observers, raising 
+    * @Initialized event, validating the deployment, and raising the 
+    * @Deployed event.</p>
+    * 
+    * <p>Any classes passed in should be fully deployed. This includes:</p>
+    * 
+    * <ul>
+    * <li>Simple beans</li>
+    * <li>Session beans</li>
+    * <li>Producer methods and producer fields</li>
+    * <li>Observer methods</li>
+    * <li>support for Event and Instance injection points</li> 
+    * </ul>
+    * 
+    * The container should be in an fully initialized state when the
+    * method returns
+    * 
+    * @param classes the classes to deploy
+    */
+   public void deploy(Iterable<Class<?>> classes) throws DeploymentException;
+   
+   /**
+    * <p>Bootstrap the container by registering Beans and Observers, raising 
+    * @Initialized event, validating the deployment, and raising the 
+    * @Deployed event.</p>
+    * 
+    * <p>Any classes passed in should be fully deployed. This includes:</p>
+    * 
+    * <ul>
+    * <li>Simple beans</li>
+    * <li>Session beans</li>
+    * <li>Producer methods and producer fields</li>
+    * <li>Observer methods</li>
+    * <li>support for Event and Instance injection points</li> 
+    * </ul>
+    * 
+    * The container should be in an fully initialized state when the
+    * method returns
+    * 
+    * @param classes the classes to deploy
+    * @param beansXmls the beans.xml files to deploy
+    */
+   public void deploy(Iterable<Class<?>> classes, Iterable<URL> beansXmls) throws DeploymentException;
 }

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-15 23:00:58 UTC (rev 1530)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractDeclarativeTest.java	2009-02-16 00:27:29 UTC (rev 1531)
@@ -2,6 +2,7 @@
 
 import java.io.IOException;
 import java.lang.reflect.Method;
+import java.util.Arrays;
 import java.util.Set;
 
 import org.apache.log4j.Logger;
@@ -81,7 +82,7 @@
       {
          if (isDeployToContainerNeeded())
          {
-            getCurrentConfiguration().getContainers().deploy(artifact.getJar(), artifact.getDefaultName());
+            getCurrentConfiguration().getContainers().deploy(artifact.getJarAsStream(), artifact.getDefaultName());
          }
          else if (artifact != null)
          {
@@ -89,11 +90,11 @@
             Set<Class<?>> classes = artifact.getClasses();
             if (getEnabledDeploymentTypes().size() > 0)
             {
-               getCurrentConfiguration().getStandaloneContainers().deploy(getEnabledDeploymentTypes(), classes.toArray(EMPTY_CLASS_ARRAY));
+               getCurrentConfiguration().getStandaloneContainers().deploy(getEnabledDeploymentTypes(), classes);
             }
             else
             {
-               getCurrentConfiguration().getStandaloneContainers().deploy(classes.toArray(EMPTY_CLASS_ARRAY));
+               getCurrentConfiguration().getStandaloneContainers().deploy(classes, Arrays.asList(artifact.getBeansXml().getSource()));
             }
          }
       }

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractTest.java	2009-02-15 23:00:58 UTC (rev 1530)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractTest.java	2009-02-16 00:27:29 UTC (rev 1531)
@@ -110,7 +110,7 @@
       {
          try
          {
-            getCurrentConfiguration().getStandaloneContainers().deploy(getEnabledDeploymentTypes(), classes);
+            getCurrentConfiguration().getStandaloneContainers().deploy(getEnabledDeploymentTypes(), Arrays.asList(classes));
          }
          catch (DeploymentException e)
          {
@@ -128,7 +128,7 @@
       {
          try
          {
-            getCurrentConfiguration().getStandaloneContainers().deploy(classes);
+            getCurrentConfiguration().getStandaloneContainers().deploy(Arrays.asList(classes));
          }
          catch (DeploymentException e)
          {

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ArtifactDescriptor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ArtifactDescriptor.java	2009-02-15 23:00:58 UTC (rev 1530)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ArtifactDescriptor.java	2009-02-16 00:27:29 UTC (rev 1531)
@@ -221,7 +221,7 @@
       this.libraries = new HashSet<ResourceDescriptor>();
    }
    
-   public InputStream getJar() throws IOException
+   public InputStream getJarAsStream() throws IOException
    { 
       if (jar == null)
       {
@@ -230,6 +230,15 @@
       return jar;
    }
    
+   public URL getJar() throws IOException
+   {
+      InputStream is = getJarAsStream();
+      File file = File.createTempFile(ArtifactDescriptor.class.getCanonicalName(), ".jar");
+      file.deleteOnExit();
+      copy(is, file);
+      return file.toURI().toURL();
+   }
+   
    public File getExplodedJar() throws IOException
    {
       if (explodedJar == null)
@@ -289,7 +298,7 @@
       File file = new File(directory, fileName);
       file.createNewFile();
       file.deleteOnExit();
-      copy(resourceDescriptor.getSource(), file);
+      copy(resourceDescriptor.getSource().openStream(), file);
    }
    
    private static void copyClass(String className, File root) throws IOException
@@ -325,7 +334,7 @@
       File file = new File(outputDirectory, fileName + getExtension());
       file.createNewFile();
       OutputStream os = new BufferedOutputStream(new FileOutputStream(file));
-      InputStream jar = getJar();
+      InputStream jar = getJarAsStream();
       Files.copy(jar, os);
       jar.close();
       os.close();

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ArtifactGenerator.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ArtifactGenerator.java	2009-02-15 23:00:58 UTC (rev 1530)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ArtifactGenerator.java	2009-02-16 00:27:29 UTC (rev 1531)
@@ -5,8 +5,6 @@
 import static org.jboss.jsr299.tck.impl.packaging.PackagingType.WAR;
 
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.FilenameFilter;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -140,9 +138,9 @@
                {
                   try
                   {
-                     this.extraLibraries.add(new ResourceDescriptor(file.getName(), new FileInputStream(file)));
+                     this.extraLibraries.add(new ResourceDescriptor(file.getName(), file.toURI().toURL()));
                   }
-                  catch (FileNotFoundException e)
+                  catch (IOException e)
                   {
                      log.warn("Unable to load extra library", e);
                   }

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ResourceDescriptor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ResourceDescriptor.java	2009-02-15 23:00:58 UTC (rev 1530)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ResourceDescriptor.java	2009-02-16 00:27:29 UTC (rev 1531)
@@ -1,23 +1,30 @@
 package org.jboss.jsr299.tck.impl.packaging;
 
-import static org.jboss.jsr299.tck.impl.util.Reflections.loadResourceAsStream;
+import static org.jboss.jsr299.tck.impl.util.Reflections.loadResource;
 
+import java.io.File;
+import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.OutputStream;
 import java.net.URL;
 
 public class ResourceDescriptor
 {
    
-   private String name;
-   private InputStream source;
-   
-   public ResourceDescriptor(String name, URL source) throws IOException
+   private final String name;
+   private final URL source;
+
+   public ResourceDescriptor(String name, InputStream source) throws IOException
    {
-      this(name, source.openStream());
+      this.name = name;
+      File file = File.createTempFile(ResourceDescriptor.class.getName(), null);
+      file.deleteOnExit();
+      copy(source, file);
+      this.source = file.toURI().toURL(); 
    }
    
-   public ResourceDescriptor(String name, InputStream source)
+   public ResourceDescriptor(String name, URL source)
    {
       this.name = name;
       this.source = source;
@@ -30,7 +37,7 @@
       {
          throw new IllegalArgumentException("Unable to have a null resource");
       }
-      this.source = loadResourceAsStream(source);
+      this.source = loadResource(source);
       if (this.source == null)
       {
          throw new IllegalArgumentException("Unable to load file for " + source);
@@ -42,7 +49,7 @@
       return name;
    }
    
-   public InputStream getSource()
+   public URL getSource()
    {
       return source;
    }
@@ -73,4 +80,23 @@
       return name + " (" + source.toString() + ")";
    }
    
+   private static void copy(InputStream inputStream, File file) throws IOException
+   {
+      OutputStream os = new FileOutputStream(file);
+      try 
+      {
+         byte[] buf = new byte[1024];
+         int i = 0;
+         while ((i = inputStream.read(buf)) != -1) 
+         {
+             os.write(buf, 0, i);
+         }
+     } 
+     finally 
+     {
+         os.close();
+     }
+
+   }
+   
 }

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/jsr299/JSR299ArtifactDescriptor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/jsr299/JSR299ArtifactDescriptor.java	2009-02-15 23:00:58 UTC (rev 1530)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/jsr299/JSR299ArtifactDescriptor.java	2009-02-16 00:27:29 UTC (rev 1531)
@@ -11,6 +11,8 @@
    public static final String BEANS_XML_DESTINATION = "META-INF/web-beans.xml";
    public static final String STANDARD_BEANS_XML_FILE_NAME = "org/jboss/jsr299/tck/impl/packaging/jsr299/default/beans.xml";
    
+   private final ResourceDescriptor beansXml;
+   
    public JSR299ArtifactDescriptor(Class<?> declaringClass, String beansXmlSourceFileName)
    {
       super(declaringClass);
@@ -18,7 +20,8 @@
       {
          beansXmlSourceFileName = STANDARD_BEANS_XML_FILE_NAME;
       }
-      getResources().add(new ResourceDescriptor(getBeansDestination(), beansXmlSourceFileName));
+      this.beansXml = new ResourceDescriptor(getBeansDestination(), beansXmlSourceFileName);
+      getResources().add(beansXml);
    }
    
    public String getBeansDestination()
@@ -26,4 +29,9 @@
       return BEANS_XML_DESTINATION; 
    }
    
+   public ResourceDescriptor getBeansXml()
+   {
+      return beansXml;
+   }
+   
 }

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/war/WarArtifactDescriptor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/war/WarArtifactDescriptor.java	2009-02-15 23:00:58 UTC (rev 1530)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/war/WarArtifactDescriptor.java	2009-02-16 00:27:29 UTC (rev 1531)
@@ -1,8 +1,8 @@
 package org.jboss.jsr299.tck.impl.packaging.war;
-import static org.jboss.jsr299.tck.impl.util.Reflections.loadResourceAsStream;
+import static org.jboss.jsr299.tck.impl.util.Reflections.loadResource;
 
 import java.io.File;
-import java.io.InputStream;
+import java.net.URL;
 
 import org.jboss.jsr299.tck.impl.packaging.ResourceDescriptor;
 import org.jboss.jsr299.tck.impl.packaging.jsr299.TCKArtifactDescriptor;
@@ -20,10 +20,10 @@
    public WarArtifactDescriptor(Class<?> declaringClass, String beansXmlSourceFileName)
    {
       super(declaringClass, beansXmlSourceFileName);
-      InputStream webXml = loadResourceAsStream(CUSTOM_WEB_XML_FILE_NAME);
+      URL webXml = loadResource(CUSTOM_WEB_XML_FILE_NAME);
       if (webXml == null)
       {
-         webXml = loadResourceAsStream(STANDARD_WEB_XML_FILE_NAME);
+         webXml = loadResource(STANDARD_WEB_XML_FILE_NAME);
       }
       getResources().add(new ResourceDescriptor(WEB_XML_DESTINATION, webXml));
    }

Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/CustomDeploymentTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/CustomDeploymentTypeTest.java	2009-02-15 23:00:58 UTC (rev 1530)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/CustomDeploymentTypeTest.java	2009-02-16 00:27:29 UTC (rev 1531)
@@ -1,43 +0,0 @@
-package org.jboss.jsr299.tck.unit.definition.deployment;
-
-import java.lang.annotation.Annotation;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.inject.Standard;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.hibernate.tck.annotations.SpecAssertions;
-import org.jboss.jsr299.tck.AbstractDeclarativeTest;
-import org.testng.annotations.Test;
-
-/**
- * 
- * Spec version: PRD2
- *
- */
-public class CustomDeploymentTypeTest extends AbstractDeclarativeTest
-{
-   
-   @Override
-   protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
-   {
-      return Arrays.asList(Standard.class, AnotherDeploymentType.class, 
-            HornedAnimalDeploymentType.class);
-   }
-   
-   @SuppressWarnings("unchecked")
-   @Test 
-   @SpecAssertions({
-      @SpecAssertion(section = "2.5.6", id = "unknown"),
-      @SpecAssertion(section = "2.5.7", id = "unknown")
-   })
-   public void testCustomDeploymentTypes()
-   {
-      assert getCurrentConfiguration().getManagers().getEnabledDeploymentTypes().size() == 3;
-      assert getCurrentConfiguration().getManagers().getEnabledDeploymentTypes().get(0).equals(Standard.class);
-      assert getCurrentConfiguration().getManagers().getEnabledDeploymentTypes().get(1).equals(AnotherDeploymentType.class);
-      assert getCurrentConfiguration().getManagers().getEnabledDeploymentTypes().get(2).equals(HornedAnimalDeploymentType.class);
-   }
-   
-}

Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/DefaultDeploymentTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/DefaultDeploymentTypeTest.java	2009-02-15 23:00:58 UTC (rev 1530)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/DefaultDeploymentTypeTest.java	2009-02-16 00:27:29 UTC (rev 1531)
@@ -1,34 +0,0 @@
-package org.jboss.jsr299.tck.unit.definition.deployment;
-
-import javax.inject.Production;
-import javax.inject.Standard;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.hibernate.tck.annotations.SpecAssertions;
-import org.jboss.jsr299.tck.AbstractDeclarativeTest;
-import org.jboss.jsr299.tck.impl.packaging.Classes;
-import org.testng.annotations.Test;
-
-/**
- * 
- * Spec version: PRD2
- *
- */
-//@Artifact(addCurrentPackage=false)
- at Classes(DefaultDeploymentTypeTest.class)
-public class DefaultDeploymentTypeTest extends AbstractDeclarativeTest
-{
-   
-   @Test 
-   @SpecAssertions({
-      @SpecAssertion(section = "2.5.6", id = "unknown"),
-      @SpecAssertion(section = "2.5.7", id = "unknown")
-   })
-   public void testDefaultEnabledDeploymentTypes()
-   {
-      assert getCurrentConfiguration().getManagers().getEnabledDeploymentTypes().size() == 2;
-      assert getCurrentConfiguration().getManagers().getEnabledDeploymentTypes().get(0).equals(Standard.class);
-      assert getCurrentConfiguration().getManagers().getEnabledDeploymentTypes().get(1).equals(Production.class);
-   }
-   
-}

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/custom/AnotherDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/custom/AnotherDeploymentType.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/custom/AnotherDeploymentType.java	2009-02-16 00:27:29 UTC (rev 1531)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.unit.definition.deployment.custom;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.DeploymentType;
+
+ at Target( { TYPE, METHOD })
+ at Retention(RUNTIME)
+ at Documented
+ at DeploymentType
+ at Inherited
+ at interface AnotherDeploymentType
+{
+
+}
\ No newline at end of file


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/custom/AnotherDeploymentType.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/custom/CustomDeploymentTypeTest.java (from rev 1524, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/CustomDeploymentTypeTest.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/custom/CustomDeploymentTypeTest.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/custom/CustomDeploymentTypeTest.java	2009-02-16 00:27:29 UTC (rev 1531)
@@ -0,0 +1,36 @@
+package org.jboss.jsr299.tck.unit.definition.deployment.custom;
+
+import javax.inject.Standard;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractDeclarativeTest;
+import org.jboss.jsr299.tck.impl.packaging.Artifact;
+import org.jboss.jsr299.tck.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ * 
+ * Spec version: PRD2
+ *
+ */
+ at Artifact
+ at BeansXml("beans.xml")
+public class CustomDeploymentTypeTest extends AbstractDeclarativeTest
+{
+   
+   @SuppressWarnings("unchecked")
+   @Test 
+   @SpecAssertions({
+      @SpecAssertion(section = "2.5.6", id = "unknown"),
+      @SpecAssertion(section = "2.5.7", id = "unknown")
+   })
+   public void testCustomDeploymentTypes()
+   {
+      assert getCurrentConfiguration().getManagers().getEnabledDeploymentTypes().size() == 3;
+      assert getCurrentConfiguration().getManagers().getEnabledDeploymentTypes().get(0).equals(Standard.class);
+      assert getCurrentConfiguration().getManagers().getEnabledDeploymentTypes().get(1).equals(AnotherDeploymentType.class);
+      assert getCurrentConfiguration().getManagers().getEnabledDeploymentTypes().get(2).equals(HornedAnimalDeploymentType.class);
+   }
+   
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/custom/CustomDeploymentTypeTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/custom/HornedAnimalDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/custom/HornedAnimalDeploymentType.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/custom/HornedAnimalDeploymentType.java	2009-02-16 00:27:29 UTC (rev 1531)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.unit.definition.deployment.custom;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.DeploymentType;
+
+ at Target( { TYPE, METHOD })
+ at Retention(RUNTIME)
+ at Documented
+ at DeploymentType
+ at interface HornedAnimalDeploymentType
+{
+
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/custom/HornedAnimalDeploymentType.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/defaultDeploymentType/DefaultDeploymentTypeTest.java (from rev 1524, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/DefaultDeploymentTypeTest.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/defaultDeploymentType/DefaultDeploymentTypeTest.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/defaultDeploymentType/DefaultDeploymentTypeTest.java	2009-02-16 00:27:29 UTC (rev 1531)
@@ -0,0 +1,34 @@
+package org.jboss.jsr299.tck.unit.definition.deployment.defaultDeploymentType;
+
+import javax.inject.Production;
+import javax.inject.Standard;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractDeclarativeTest;
+import org.jboss.jsr299.tck.impl.packaging.Artifact;
+import org.jboss.jsr299.tck.impl.packaging.Classes;
+import org.testng.annotations.Test;
+
+/**
+ * 
+ * Spec version: PRD2
+ *
+ */
+ at Artifact
+public class DefaultDeploymentTypeTest extends AbstractDeclarativeTest
+{
+   
+   @Test 
+   @SpecAssertions({
+      @SpecAssertion(section = "2.5.6", id = "unknown"),
+      @SpecAssertion(section = "2.5.7", id = "unknown")
+   })
+   public void testDefaultEnabledDeploymentTypes()
+   {
+      assert getCurrentConfiguration().getManagers().getEnabledDeploymentTypes().size() == 2;
+      assert getCurrentConfiguration().getManagers().getEnabledDeploymentTypes().get(0).equals(Standard.class);
+      assert getCurrentConfiguration().getManagers().getEnabledDeploymentTypes().get(1).equals(Production.class);
+   }
+   
+}

Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/definition/deployment/custom/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/definition/deployment/custom/beans.xml	                        (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/definition/deployment/custom/beans.xml	2009-02-16 00:27:29 UTC (rev 1531)
@@ -0,0 +1,8 @@
+<Beans xmlns="urn:java:ee"
+       xmlns:test="urn:java:org.jboss.jsr299.tck.unit.definition.deployment.custom"> 
+   <Deploy>
+      <Standard />
+      <test:AnotherDeploymentType />
+      <test:HornedAnimalDeploymentType />
+   </Deploy>
+</Beans>


Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/definition/deployment/custom/beans.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: tck/trunk/impl/src/test/java/org/jboss/jsr299/tck/test/impl/packaging/descriptors/war/WarArtifactTest.java
===================================================================
--- tck/trunk/impl/src/test/java/org/jboss/jsr299/tck/test/impl/packaging/descriptors/war/WarArtifactTest.java	2009-02-15 23:00:58 UTC (rev 1530)
+++ tck/trunk/impl/src/test/java/org/jboss/jsr299/tck/test/impl/packaging/descriptors/war/WarArtifactTest.java	2009-02-16 00:27:29 UTC (rev 1531)
@@ -75,7 +75,7 @@
    {
       WarArtifactDescriptor war = new WarArtifactDescriptor(DummyTest.class, null);
       war.getClasses().add(Cow.class);
-      JarInputStream is = new JarInputStream(war.getJar());
+      JarInputStream is = new JarInputStream(war.getJarAsStream());
       JarEntry entry;
       List<String> fileNames = new ArrayList<String>();
       while ((entry = is.getNextJarEntry()) != null)




More information about the weld-commits mailing list