[webbeans-commits] Webbeans SVN: r3520 - in tck/trunk/impl/src/main: resources and 1 other directory.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Sun Aug 16 07:35:54 EDT 2009
Author: dallen6
Date: 2009-08-16 07:35:54 -0400 (Sun, 16 Aug 2009)
New Revision: 3520
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/ExplicitConstructor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/ExplicitConstructorSessionBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/SimpleBean.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Added test for constructors on session beans and the corresponding new bean
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/ExplicitConstructor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/ExplicitConstructor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/ExplicitConstructor.java 2009-08-16 11:35:54 UTC (rev 3520)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.newBean;
+
+import javax.ejb.Local;
+
+ at Local
+public interface ExplicitConstructor
+{
+ public int getConstructorCalls();
+ public void setConstructorCalls(int numCalls);
+
+ public SimpleBean getInjectedSimpleBean();
+ public void setInjectedSimpleBean(SimpleBean injectedSimpleBean);
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/ExplicitConstructor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/ExplicitConstructorSessionBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/ExplicitConstructorSessionBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/ExplicitConstructorSessionBean.java 2009-08-16 11:35:54 UTC (rev 3520)
@@ -0,0 +1,51 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.newBean;
+
+import javax.ejb.Stateless;
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.New;
+
+import org.jboss.jsr299.tck.literals.NewLiteral;
+
+ at Stateless
+public class ExplicitConstructorSessionBean implements ExplicitConstructor
+{
+
+ private static int constructorCalls = 0;
+ private static SimpleBean injectedSimpleBean;
+
+ public static final New NEW = new NewLiteral()
+ {
+
+ public Class<?> value()
+ {
+ return ExplicitConstructorSessionBean.class;
+ }
+ };
+
+ public ExplicitConstructorSessionBean(@Current SimpleBean bean)
+ {
+ constructorCalls++;
+ injectedSimpleBean = bean;
+ }
+
+ public int getConstructorCalls()
+ {
+ return constructorCalls;
+ }
+
+ public void setConstructorCalls(int numCalls)
+ {
+ constructorCalls = numCalls;
+ }
+
+ public SimpleBean getInjectedSimpleBean()
+ {
+ return injectedSimpleBean;
+ }
+
+ public void setInjectedSimpleBean(SimpleBean injectedSimpleBean)
+ {
+ ExplicitConstructorSessionBean.injectedSimpleBean = injectedSimpleBean;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/ExplicitConstructorSessionBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java 2009-08-16 10:53:37 UTC (rev 3519)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java 2009-08-16 11:35:54 UTC (rev 3520)
@@ -22,6 +22,18 @@
public class NewEnterpriseBeanICTest extends AbstractJSR299Test
{
+ @Test(groups = { "new", "ri-broken" })
+ @SpecAssertion(section = "3.10", id = "l")
+ public void testNewBeanHasSameConstructor()
+ {
+ ExplicitConstructor bean = getInstanceByType(ExplicitConstructor.class);
+ bean.setConstructorCalls(0);
+ ExplicitConstructor newBean = getInstanceByType(ExplicitConstructor.class, ExplicitConstructorSessionBean.NEW);
+ assert bean != newBean;
+ assert bean.getConstructorCalls() == 1;
+ assert bean.getInjectedSimpleBean() != null;
+ }
+
@Test(groups = { "new" })
@SpecAssertion(section = "3.10", id = "m")
public void testNewBeanHasSameInitializers()
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/SimpleBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/SimpleBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/SimpleBean.java 2009-08-16 11:35:54 UTC (rev 3520)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.newBean;
+
+class SimpleBean
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/SimpleBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-16 10:53:37 UTC (rev 3519)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-16 11:35:54 UTC (rev 3520)
@@ -1325,9 +1325,8 @@
<text>For each session bean, a second bean exists which has the same bean types.</text>
</assertion>
- <assertion id="l" testable="false">
+ <assertion id="l">
<text>For each session bean, a second bean exists which has the same bean constructor.</text>
- <note>This is a by product of the English sentence structure, session beans don't have bean constructors</note>
</assertion>
<assertion id="m">
More information about the weld-commits
mailing list