[webbeans-commits] Webbeans SVN: r1706 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise: newAndOtherBinding and 1 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Wed Feb 25 10:24:52 EST 2009


Author: pete.muir at jboss.org
Date: 2009-02-25 10:24:51 -0500 (Wed, 25 Feb 2009)
New Revision: 1706

Added:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newAndOtherBinding/
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newAndOtherBinding/NewAndOtherBindingTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newAndOtherBinding/NewAndOtherBindingType_Broken.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newAndOtherBinding/WrappedEnterpriseBean.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/GoldenRetriever.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/GoldenRetrieverLocal.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/Lion.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/LionLocal.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/NewEnterpriseBeanTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/Order.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/OrderLocal.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/Tame.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/WrappedEnterpriseBean.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/WrappedEnterpriseBeanLocal.java
Removed:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/NewAndOtherBindingType_Broken.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/NewEnterpriseBeanTest.java
Log:
Migrate more tests to @Artifact

Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/NewAndOtherBindingType_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/NewAndOtherBindingType_Broken.java	2009-02-25 15:22:09 UTC (rev 1705)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/NewAndOtherBindingType_Broken.java	2009-02-25 15:24:51 UTC (rev 1706)
@@ -1,9 +0,0 @@
-package org.jboss.jsr299.tck.unit.implementation.enterprise;
-
-import javax.inject.Current;
-import javax.inject.New;
-
-class NewAndOtherBindingType_Broken
-{
-   public @New @Current WrappedEnterpriseBean violation;
-}

Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/NewEnterpriseBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/NewEnterpriseBeanTest.java	2009-02-25 15:22:09 UTC (rev 1705)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/NewEnterpriseBeanTest.java	2009-02-25 15:24:51 UTC (rev 1706)
@@ -1,177 +0,0 @@
-package org.jboss.jsr299.tck.unit.implementation.enterprise;
-
-import java.lang.annotation.Annotation;
-import java.util.Set;
-
-import javax.context.Dependent;
-import javax.inject.AnnotationLiteral;
-import javax.inject.Current;
-import javax.inject.DefinitionException;
-import javax.inject.New;
-import javax.inject.Standard;
-import javax.inject.manager.Bean;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.jboss.jsr299.tck.AbstractDeclarativeTest;
-import org.jboss.jsr299.tck.literals.NewLiteral;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- * 
- * Spec version: PRD2
- *
- */
-public class NewEnterpriseBeanTest extends AbstractDeclarativeTest
-{
-   private Bean<WrappedEnterpriseBean> newEnterpriseBean;
-   
-   private static final Annotation TAME_LITERAL = new AnnotationLiteral<Tame>() {};
-   
-   @BeforeMethod
-   public void initNewBean() {
-      deployBeans(WrappedEnterpriseBean.class);
-      Set<Bean<WrappedEnterpriseBean>> beans = getCurrentManager().resolveByType(WrappedEnterpriseBean.class, new NewLiteral());
-      assert beans.size() == 1;
-      newEnterpriseBean = beans.iterator().next();
-   }
-   
-   @Test(groups = { "new" })
-   @SpecAssertion(section = "3.3.6", id = "d")
-   public void testNewBeanIsDependentScoped()
-   {
-      assert Dependent.class.equals(newEnterpriseBean.getScopeType());
-   }
-
-   @Test(groups = { "new" })
-   @SpecAssertion(section = "3.3.6", id = "e")
-   public void testNewBeanIsOfStandardDeploymentType()
-   {
-      assert Standard.class.equals(newEnterpriseBean.getDeploymentType());
-   }
-
-   @Test(groups = { "new" })
-   @SpecAssertion(section = "3.3.6", id = "f")
-   public void testNewBeanIsHasOnlyNewBinding()
-   {
-      assert newEnterpriseBean.getBindings().size() == 1;
-      assert newEnterpriseBean.getBindings().iterator().next().annotationType().equals(new NewLiteral().annotationType());
-   }
-
-   @Test(groups = { "new" })
-   @SpecAssertion(section = "3.3.6", id = "g")
-   public void testNewBeanHasNoWebBeanName()
-   {
-      assert newEnterpriseBean.getName() == null;
-   }
-
-   @Test(groups = { "stub", "new", "underInvestigation" })
-   @SpecAssertion(section = "3.3.6", id = "h")
-   public void testNewBeanHasNoStereotypes()
-   {
-      assert false;
-   }
-   
-   @Test(groups = {"new" })
-   @SpecAssertion(section = "3.3.6", id = "i")
-   public void testNewBeanHasNoObservers()
-   {
-      deployBeans(GoldenRetriever.class);
-      // Should just be 1 observer from bean, not new bean
-      assert getCurrentManager().resolveObservers("event").size() == 1;
-   }
-
-   @Test(groups = { "new", "stub", "underInvestigation" })
-   @SpecAssertion(section = "3.3.6", id = "k")
-   public void testNewBeanHasNoProducerFields()
-   {
-      assert false;
-   }
-
-   /**
-    * 
-    * TODO There really is no way to prove that a @New bean has no producers
-    */
-   @Test(groups = { "new", "stub", "underInvestigation" })
-   @SpecAssertion(section = "3.3.6", id = "j")
-   public void testNewBeanHasNoProducerMethods()
-   {
-      assert false;
-   }
-
-   @Test(groups = { "new", "stub", "disposal" })
-   @SpecAssertion(section = "3.3.6", id = "l")
-   public void testNewBeanHasNoDisposalMethods()
-   {
-      assert false;
-   }
-
-   @Test(groups = { "stub", "new", "interceptors" })
-   @SpecAssertion(section = "3.3.6", id = "c")
-   public void testNewBeanHasSameInterceptorMethodsAsWrappedBean()
-   {
-      assert false;
-   }
-
-   /**
-    * If the @New binding type appears in conjunction with some other binding
-    * type, or is specified for a field or parameter of a type which does not
-    * satisfy the definition of a simple Web Bean implementation class or
-    * enterprise Web Bean implementation class, a DefinitionException is thrown
-    * by the container at deployment time.
-    */
-   @Test(groups = { "new" }, expectedExceptions = DefinitionException.class)
-   @SpecAssertion(section = "review", id = "review")
-   public void testNewAnnotationCannotAppearInConjunctionWithOtherBindingType()
-   {
-      deployBeans(NewAndOtherBindingType_Broken.class);
-   }
-
-   /**
-    * If the @New binding type appears in conjunction with some other binding
-    * type, or is specified for a field or parameter of a type which does not
-    * satisfy the definition of a simple Web Bean implementation class or
-    * enterprise Web Bean implementation class, a DefinitionException is thrown
-    * by the container at deployment time.
-    */
-//   @Test(groups = { "stub", "new" }, expectedExceptions = DefinitionException.class)
-//   public void testNewAnnotationCannotBeAppliedToNonWebBeanImplementationClass()
-//   {
-//      assert false;
-//   }
-
-   /**
-    * No Web Bean defined using annotations or XML may explicitly declare @New
-    * as a binding type
-    */
-   @Test(groups = { "stub", "new", "webbeansxml" }, expectedExceptions = DefinitionException.class)
-   @SpecAssertion(section = "review", id = "review")
-   public void testNewAnnotationCannotBeExplicitlyDeclared()
-   {
-      // This only needs to be tested with XML since the annotation itself
-      // does not target types.
-      assert false;
-   }
-   
-   @Test @SpecAssertion(section="3.3.6", id = "aa")
-   public void testForEachEnterpriseBeanANewBeanExists()
-   {
-      deployBeans(Order.class, Lion.class);
-      assert getCurrentManager().resolveByType(Order.class).size() == 1;
-      assert getCurrentManager().resolveByType(Order.class).iterator().next().getBindings().size() == 1;
-      assert getCurrentManager().resolveByType(Order.class).iterator().next().getBindings().iterator().next().annotationType().equals(Current.class);
-      
-      assert getCurrentManager().resolveByType(Order.class, new NewLiteral()).size() == 1;
-      assert getCurrentManager().resolveByType(Order.class, new NewLiteral()).iterator().next().getBindings().size() == 1;
-      assert getCurrentManager().resolveByType(Order.class, new NewLiteral()).iterator().next().getBindings().iterator().next().annotationType().equals(New.class);
-      
-      assert getCurrentManager().resolveByType(Lion.class, TAME_LITERAL).size() == 1;
-      assert getCurrentManager().resolveByType(Lion.class, TAME_LITERAL).iterator().next().getBindings().size() == 1;
-      assert getCurrentManager().resolveByType(Lion.class, TAME_LITERAL).iterator().next().getBindings().iterator().next().annotationType().equals(Tame.class);
-      
-      assert getCurrentManager().resolveByType(Lion.class, new NewLiteral()).size() == 1;
-      assert getCurrentManager().resolveByType(Lion.class, new NewLiteral()).iterator().next().getBindings().size() == 1;
-      assert getCurrentManager().resolveByType(Lion.class, new NewLiteral()).iterator().next().getBindings().iterator().next().annotationType().equals(New.class);
-   }
-   
-}

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newAndOtherBinding/NewAndOtherBindingTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newAndOtherBinding/NewAndOtherBindingTest.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newAndOtherBinding/NewAndOtherBindingTest.java	2009-02-25 15:24:51 UTC (rev 1706)
@@ -0,0 +1,31 @@
+package org.jboss.jsr299.tck.unit.implementation.enterprise.newAndOtherBinding;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractDeclarativeTest;
+import org.jboss.jsr299.tck.impl.packaging.Artifact;
+import org.jboss.jsr299.tck.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+ at Artifact
+ at ExpectedDeploymentException(DefinitionException.class)
+public class NewAndOtherBindingTest extends AbstractDeclarativeTest
+{
+   
+
+   /**
+    * If the @New binding type appears in conjunction with some other binding
+    * type, or is specified for a field or parameter of a type which does not
+    * satisfy the definition of a simple Web Bean implementation class or
+    * enterprise Web Bean implementation class, a DefinitionException is thrown
+    * by the container at deployment time.
+    */
+   @Test(groups = { "new" })
+   @SpecAssertion(section = "review", id = "review")
+   public void testNewAnnotationCannotAppearInConjunctionWithOtherBindingType()
+   {
+      assert false;
+   }
+   
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newAndOtherBinding/NewAndOtherBindingTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newAndOtherBinding/NewAndOtherBindingType_Broken.java (from rev 1702, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/NewAndOtherBindingType_Broken.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newAndOtherBinding/NewAndOtherBindingType_Broken.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newAndOtherBinding/NewAndOtherBindingType_Broken.java	2009-02-25 15:24:51 UTC (rev 1706)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.unit.implementation.enterprise.newAndOtherBinding;
+
+import javax.inject.Current;
+import javax.inject.New;
+
+class NewAndOtherBindingType_Broken
+{
+   public @New @Current WrappedEnterpriseBean violation;
+}

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newAndOtherBinding/WrappedEnterpriseBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newAndOtherBinding/WrappedEnterpriseBean.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newAndOtherBinding/WrappedEnterpriseBean.java	2009-02-25 15:24:51 UTC (rev 1706)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.unit.implementation.enterprise.newAndOtherBinding;
+
+import javax.annotation.Named;
+import javax.context.SessionScoped;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+ at SessionScoped
+ at Stateful
+ at Named("John")
+class WrappedEnterpriseBean
+{
+   @Remove
+   public void bye() {
+   }
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newAndOtherBinding/WrappedEnterpriseBean.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/GoldenRetriever.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/GoldenRetriever.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/GoldenRetriever.java	2009-02-25 15:24:51 UTC (rev 1706)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.unit.implementation.enterprise.newBean;
+
+import javax.context.RequestScoped;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.event.Observes;
+import javax.inject.Disposes;
+
+ at Stateful
+ at RequestScoped
+class GoldenRetriever implements GoldenRetrieverLocal
+{
+   @Remove
+   public void bye(@Disposes Object something) {
+      
+   }
+
+   public void anObserverMethod(@Observes String event)
+   {
+      
+   }
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/GoldenRetriever.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/GoldenRetrieverLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/GoldenRetrieverLocal.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/GoldenRetrieverLocal.java	2009-02-25 15:24:51 UTC (rev 1706)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.unit.implementation.enterprise.newBean;
+
+import javax.ejb.Local;
+
+ at Local
+public interface GoldenRetrieverLocal
+{
+   
+   public void anObserverMethod(String event);
+   
+}
\ No newline at end of file


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/GoldenRetrieverLocal.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/Lion.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/Lion.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/Lion.java	2009-02-25 15:24:51 UTC (rev 1706)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.unit.implementation.enterprise.newBean;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+ at Tame
+ at Stateful
+class Lion implements LionLocal
+{
+   
+   @Remove
+   public void remove()
+   {
+      
+   }
+   
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/Lion.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/LionLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/LionLocal.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/LionLocal.java	2009-02-25 15:24:51 UTC (rev 1706)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.unit.implementation.enterprise.newBean;
+
+import javax.ejb.Local;
+
+ at Local
+public interface LionLocal
+{
+   
+}
\ No newline at end of file


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/LionLocal.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/NewEnterpriseBeanTest.java (from rev 1702, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/NewEnterpriseBeanTest.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/NewEnterpriseBeanTest.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/NewEnterpriseBeanTest.java	2009-02-25 15:24:51 UTC (rev 1706)
@@ -0,0 +1,172 @@
+package org.jboss.jsr299.tck.unit.implementation.enterprise.newBean;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+import javax.context.Dependent;
+import javax.inject.AnnotationLiteral;
+import javax.inject.Current;
+import javax.inject.DefinitionException;
+import javax.inject.New;
+import javax.inject.Standard;
+import javax.inject.manager.Bean;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractDeclarativeTest;
+import org.jboss.jsr299.tck.impl.packaging.Artifact;
+import org.jboss.jsr299.tck.impl.packaging.Packaging;
+import org.jboss.jsr299.tck.impl.packaging.PackagingType;
+import org.jboss.jsr299.tck.literals.NewLiteral;
+import org.testng.annotations.Test;
+
+/**
+ * 
+ * Spec version: PRD2
+ *
+ */
+ at Artifact
+ at Packaging(PackagingType.EAR)
+public class NewEnterpriseBeanTest extends AbstractDeclarativeTest
+{
+   private Bean<WrappedEnterpriseBeanLocal> newEnterpriseBean;
+   
+   private static final Annotation TAME_LITERAL = new AnnotationLiteral<Tame>() {};
+   
+   @Test(groups = { "new" })
+   @SpecAssertion(section = "3.3.6", id = "d")
+   public void testNewBeanIsDependentScoped()
+   {
+      Set<Bean<WrappedEnterpriseBeanLocal>> beans = getCurrentManager().resolveByType(WrappedEnterpriseBeanLocal.class, new NewLiteral());
+      assert beans.size() == 1;
+      newEnterpriseBean = beans.iterator().next();
+      assert Dependent.class.equals(newEnterpriseBean.getScopeType());
+   }
+
+   @Test(groups = { "new" })
+   @SpecAssertion(section = "3.3.6", id = "e")
+   public void testNewBeanIsOfStandardDeploymentType()
+   {
+      Set<Bean<WrappedEnterpriseBeanLocal>> beans = getCurrentManager().resolveByType(WrappedEnterpriseBeanLocal.class, new NewLiteral());
+      assert beans.size() == 1;
+      newEnterpriseBean = beans.iterator().next();
+      assert Standard.class.equals(newEnterpriseBean.getDeploymentType());
+   }
+
+   @Test(groups = { "new" })
+   @SpecAssertion(section = "3.3.6", id = "f")
+   public void testNewBeanIsHasOnlyNewBinding()
+   {
+      Set<Bean<WrappedEnterpriseBeanLocal>> beans = getCurrentManager().resolveByType(WrappedEnterpriseBeanLocal.class, new NewLiteral());
+      assert beans.size() == 1;
+      newEnterpriseBean = beans.iterator().next();
+      assert newEnterpriseBean.getBindings().size() == 1;
+      assert newEnterpriseBean.getBindings().iterator().next().annotationType().equals(new NewLiteral().annotationType());
+   }
+
+   @Test(groups = { "new" })
+   @SpecAssertion(section = "3.3.6", id = "g")
+   public void testNewBeanHasNoWebBeanName()
+   {
+      Set<Bean<WrappedEnterpriseBeanLocal>> beans = getCurrentManager().resolveByType(WrappedEnterpriseBeanLocal.class, new NewLiteral());
+      assert beans.size() == 1;
+      newEnterpriseBean = beans.iterator().next();
+      assert newEnterpriseBean.getName() == null;
+   }
+
+   @Test(groups = { "stub", "new"})
+   @SpecAssertion(section = "3.3.6", id = "h")
+   public void testNewBeanHasNoStereotypes()
+   {
+      assert false;
+   }
+   
+   @Test(groups = {"new" })
+   @SpecAssertion(section = "3.3.6", id = "i")
+   public void testNewBeanHasNoObservers()
+   {
+      // Should just be 1 observer from bean, not new bean
+      assert getCurrentManager().resolveObservers("event").size() == 1;
+   }
+
+   @Test(groups = { "new", "stub", "underInvestigation" })
+   @SpecAssertion(section = "3.3.6", id = "k")
+   public void testNewBeanHasNoProducerFields()
+   {
+      assert false;
+   }
+
+   /**
+    * 
+    * TODO There really is no way to prove that a @New bean has no producers
+    * 
+    * PLM - Make sure that there is no ambiguous dependency exception when resolving it - if the @New bean did have a producer method you would get one (I think?!) 
+    */
+   @Test(groups = { "new", "stub" })
+   @SpecAssertion(section = "3.3.6", id = "j")
+   public void testNewBeanHasNoProducerMethods()
+   {
+      assert false;
+   }
+
+   @Test(groups = { "new", "stub", "disposal" })
+   @SpecAssertion(section = "3.3.6", id = "l")
+   public void testNewBeanHasNoDisposalMethods()
+   {
+      assert false;
+   }
+
+   @Test(groups = { "stub", "new", "interceptors" })
+   @SpecAssertion(section = "3.3.6", id = "c")
+   public void testNewBeanHasSameInterceptorMethodsAsWrappedBean()
+   {
+      assert false;
+   }
+
+   /**
+    * If the @New binding type appears in conjunction with some other binding
+    * type, or is specified for a field or parameter of a type which does not
+    * satisfy the definition of a simple Web Bean implementation class or
+    * enterprise Web Bean implementation class, a DefinitionException is thrown
+    * by the container at deployment time.
+    */
+   @Test(groups = { "stub", "new" }, expectedExceptions = DefinitionException.class)
+   @SpecAssertion(section = "review", id = "review")
+   public void testNewAnnotationCannotBeAppliedToNonWebBeanImplementationClass()
+   {
+      assert false;
+   }
+
+   /**
+    * No Web Bean defined using annotations or XML may explicitly declare @New
+    * as a binding type
+    */
+   @Test(groups = { "stub", "new", "webbeansxml" }, expectedExceptions = DefinitionException.class)
+   @SpecAssertion(section = "review", id = "review")
+   public void testNewAnnotationCannotBeExplicitlyDeclared()
+   {
+      // This only needs to be tested with XML since the annotation itself
+      // does not target types.
+      assert false;
+   }
+   
+   @Test @SpecAssertion(section="3.3.6", id = "aa")
+   public void testForEachEnterpriseBeanANewBeanExists()
+   {
+      assert getCurrentManager().resolveByType(OrderLocal.class).size() == 1;
+      assert getCurrentManager().resolveByType(OrderLocal.class).iterator().next().getBindings().size() == 1;
+      assert getCurrentManager().resolveByType(OrderLocal.class).iterator().next().getBindings().iterator().next().annotationType().equals(Current.class);
+      
+      assert getCurrentManager().resolveByType(OrderLocal.class, new NewLiteral()).size() == 1;
+      assert getCurrentManager().resolveByType(OrderLocal.class, new NewLiteral()).iterator().next().getBindings().size() == 1;
+      assert getCurrentManager().resolveByType(OrderLocal.class, new NewLiteral()).iterator().next().getBindings().iterator().next().annotationType().equals(New.class);
+      
+      assert getCurrentManager().resolveByType(LionLocal.class, TAME_LITERAL).size() == 1;
+      assert getCurrentManager().resolveByType(LionLocal.class, TAME_LITERAL).iterator().next().getBindings().size() == 1;
+      assert getCurrentManager().resolveByType(LionLocal.class, TAME_LITERAL).iterator().next().getBindings().iterator().next().annotationType().equals(Tame.class);
+      
+      assert getCurrentManager().resolveByType(LionLocal.class, new NewLiteral()).size() == 1;
+      assert getCurrentManager().resolveByType(LionLocal.class, new NewLiteral()).iterator().next().getBindings().size() == 1;
+      assert getCurrentManager().resolveByType(LionLocal.class, new NewLiteral()).iterator().next().getBindings().iterator().next().annotationType().equals(New.class);
+   }
+   
+}

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/Order.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/Order.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/Order.java	2009-02-25 15:24:51 UTC (rev 1706)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.unit.implementation.enterprise.newBean;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.inject.Production;
+
+ at Production
+ at Stateful
+class Order implements OrderLocal
+{
+   
+   @Remove
+   public void remove()
+   {
+      
+   }
+
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/Order.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/OrderLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/OrderLocal.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/OrderLocal.java	2009-02-25 15:24:51 UTC (rev 1706)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.unit.implementation.enterprise.newBean;
+
+import javax.ejb.Local;
+
+ at Local
+public interface OrderLocal
+{
+   
+}
\ No newline at end of file


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/OrderLocal.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/Tame.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/Tame.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/Tame.java	2009-02-25 15:24:51 UTC (rev 1706)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.unit.implementation.enterprise.newBean;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+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.BindingType;
+
+ at Target( { TYPE, METHOD, PARAMETER, FIELD })
+ at Retention(RUNTIME)
+ at Documented
+ at BindingType
+ at interface Tame
+{
+
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/Tame.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/WrappedEnterpriseBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/WrappedEnterpriseBean.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/WrappedEnterpriseBean.java	2009-02-25 15:24:51 UTC (rev 1706)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.unit.implementation.enterprise.newBean;
+
+import javax.annotation.Named;
+import javax.context.SessionScoped;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+ at SessionScoped
+ at Stateful
+ at Named("John")
+class WrappedEnterpriseBean implements WrappedEnterpriseBeanLocal
+{
+   @Remove
+   public void bye() 
+   {
+   }
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/WrappedEnterpriseBean.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/WrappedEnterpriseBeanLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/WrappedEnterpriseBeanLocal.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/WrappedEnterpriseBeanLocal.java	2009-02-25 15:24:51 UTC (rev 1706)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.unit.implementation.enterprise.newBean;
+
+import javax.ejb.Local;
+
+ at Local
+public interface WrappedEnterpriseBeanLocal
+{
+   
+}
\ No newline at end of file


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/newBean/WrappedEnterpriseBeanLocal.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain




More information about the weld-commits mailing list