[webbeans-commits] Webbeans SVN: r2693 - in extensions/trunk/se: src/main/resources and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: peteroyle
Date: 2009-05-19 16:22:16 -0400 (Tue, 19 May 2009)
New Revision: 2693
Added:
extensions/trunk/se/src/main/resources/META-INF/
extensions/trunk/se/src/main/resources/META-INF/beans.xml
extensions/trunk/se/src/test/resources/META-INF/
extensions/trunk/se/src/test/resources/META-INF/beans.xml
Removed:
extensions/trunk/se/src/test/resources/beans.xml
Modified:
extensions/trunk/se/pom.xml
Log:
Moved beans.xml into META-INF directory, as per spec. Tracking SNAPSHOT parent POM again (was PREVIEW1)
Modified: extensions/trunk/se/pom.xml
===================================================================
--- extensions/trunk/se/pom.xml 2009-05-19 19:53:20 UTC (rev 2692)
+++ extensions/trunk/se/pom.xml 2009-05-19 20:22:16 UTC (rev 2693)
@@ -3,7 +3,7 @@
<parent>
<artifactId>webbeans-parent</artifactId>
<groupId>org.jboss.webbeans</groupId>
- <version>1.0.0.PREVIEW1</version>
+ <version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.webbeans</groupId>
Copied: extensions/trunk/se/src/main/resources/META-INF/beans.xml (from rev 2690, extensions/trunk/se/src/main/resources/beans.xml)
===================================================================
--- extensions/trunk/se/src/main/resources/META-INF/beans.xml (rev 0)
+++ extensions/trunk/se/src/main/resources/META-INF/beans.xml 2009-05-19 20:22:16 UTC (rev 2693)
@@ -0,0 +1,19 @@
+<!--
+
+ JBoss, Home of Professional Open Source
+ Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<beans></beans>
Added: extensions/trunk/se/src/test/resources/META-INF/beans.xml
===================================================================
--- extensions/trunk/se/src/test/resources/META-INF/beans.xml (rev 0)
+++ extensions/trunk/se/src/test/resources/META-INF/beans.xml 2009-05-19 20:22:16 UTC (rev 2693)
@@ -0,0 +1,19 @@
+<!--
+
+ JBoss, Home of Professional Open Source
+ Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<beans></beans>
Deleted: extensions/trunk/se/src/test/resources/beans.xml
===================================================================
--- extensions/trunk/se/src/test/resources/beans.xml 2009-05-19 19:53:20 UTC (rev 2692)
+++ extensions/trunk/se/src/test/resources/beans.xml 2009-05-19 20:22:16 UTC (rev 2693)
@@ -1,19 +0,0 @@
-<!--
-
- JBoss, Home of Professional Open Source
- Copyright 2008, Red Hat Middleware LLC, and individual contributors
- by the @authors tag. See the copyright.txt in the distribution for a
- full listing of individual contributors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<beans></beans>
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2692 - doc/trunk/reference/it-IT.
by webbeans-commits@lists.jboss.org
Author: nico.ben
Date: 2009-05-19 15:53:20 -0400 (Tue, 19 May 2009)
New Revision: 2692
Modified:
doc/trunk/reference/it-IT/ri-spi.po
Log:
Italian translation
Modified: doc/trunk/reference/it-IT/ri-spi.po
===================================================================
--- doc/trunk/reference/it-IT/ri-spi.po 2009-05-19 17:43:33 UTC (rev 2691)
+++ doc/trunk/reference/it-IT/ri-spi.po 2009-05-19 19:53:20 UTC (rev 2692)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-04-19 20:36+0000\n"
-"PO-Revision-Date: 2009-05-05 22:38+0100\n"
+"PO-Revision-Date: 2009-05-19 21:52+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -41,7 +41,7 @@
#: ri-spi.xml:24
#, no-c-format
msgid "All interfaces in the SPI support the decorator pattern and provide a <literal>Forwarding</literal> class located in the <literal>helpers</literal> sub package. Additional, commonly used, utility classes, and standard implementations are also located in the <literal>helpers</literal> sub package."
-msgstr ""
+msgstr "Tutte le interfacce in SPI supportano il pattern decorator e forniscono una classe <literal>Forwarding</literal> situata nel sottopacchetto <literal>helpers</literal>. Anche altre classi utility ed implementazioni standard sono collocate nel sottopacchetto <literal>helpers</literal>."
#. Tag: title
#: ri-spi.xml:33
@@ -99,7 +99,7 @@
#: ri-spi.xml:49
#, no-c-format
msgid "Web Beans will run without an EJB container; in this case you don't need to implement the EJB SPI."
-msgstr ""
+msgstr "Web Beans girerà senza EJB container; in questo caso non serve implementare EJB SPI."
#. Tag: para
#: ri-spi.xml:55
@@ -259,7 +259,7 @@
#: ri-spi.xml:87
#, no-c-format
msgid "When resolving local EJBs (used to back session beans) a wrapper (<literal>SessionObjectReference</literal>) around the EJB reference is returned. This wrapper allows Web Beans to request a reference that implements the given business interface, and, in the case of SFSBs, request the removal of the EJB from the container."
-msgstr ""
+msgstr "Risolvendo gli EJB locali (usati per mappare i session bean) viene restituito un wrapper (<literal>SessionObjectReference</literal>) attorno al riferimento EJB. Questo wrapper consente a Web Beans di richiedere un riferimento che implementi l'interfaccia di business data e, nel caso di SFSB, la richiesta di rimozione dell'EJB dal container."
#. Tag: title
#: ri-spi.xml:98
@@ -507,7 +507,7 @@
#: ri-spi.xml:298
#, no-c-format
msgid "Web Beans delegates all JNDI operations to the container through the SPI."
-msgstr ""
+msgstr "Web Beans delega tutte le operazioni JNDI al container attraverso SPI."
#. Tag: para
#: ri-spi.xml:304
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2691 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-05-19 13:43:33 -0400 (Tue, 19 May 2009)
New Revision: 2691
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/AnimalStereotype.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Den.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Fox.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/FoxLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/InitializerSimpleBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/InitializerSimpleBeanLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Litter.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Monkey.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/MonkeyLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java
Log:
A few more tests for section 3
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/AnimalStereotype.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/AnimalStereotype.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/AnimalStereotype.java 2009-05-19 17:43:33 UTC (rev 2691)
@@ -0,0 +1,23 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.newBean;
+
+import static java.lang.annotation.ElementType.FIELD;
+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.Retention;
+import java.lang.annotation.Target;
+
+import javax.annotation.Named;
+import javax.annotation.Stereotype;
+import javax.context.RequestScoped;
+
+@Stereotype
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@RequestScoped
+@Named
+@interface AnimalStereotype
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/AnimalStereotype.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Den.java (from rev 2689, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Den.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Den.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Den.java 2009-05-19 17:43:33 UTC (rev 2691)
@@ -0,0 +1,24 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.newBean;
+
+import java.io.Serializable;
+
+public class Den implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+ private String name;
+
+ public Den(String name)
+ {
+ this.name = name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Fox.java (from rev 2689, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Fox.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Fox.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Fox.java 2009-05-19 17:43:33 UTC (rev 2691)
@@ -0,0 +1,69 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.newBean;
+
+import javax.ejb.Stateful;
+import javax.event.Observes;
+import javax.inject.Disposes;
+import javax.inject.Produces;
+
+@Stateful
+@AnimalStereotype
+public class Fox implements FoxLocal
+{
+ @Produces
+ public Den den = new Den("FoxDen");
+
+ private int nextLitterSize;
+
+ private boolean litterDisposed = false;
+
+ /* (non-Javadoc)
+ * @see org.jboss.jsr299.tck.tests.implementation.enterprise.newBean.FoxLocal#getDen()
+ */
+ public Den getDen()
+ {
+ return den;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.jsr299.tck.tests.implementation.enterprise.newBean.FoxLocal#setDen(org.jboss.jsr299.tck.tests.implementation.enterprise.newBean.Den)
+ */
+ public void setDen(Den den)
+ {
+ this.den = den;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.jsr299.tck.tests.implementation.enterprise.newBean.FoxLocal#getNextLitterSize()
+ */
+ public int getNextLitterSize()
+ {
+ return nextLitterSize;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.jsr299.tck.tests.implementation.enterprise.newBean.FoxLocal#setNextLitterSize(int)
+ */
+ public void setNextLitterSize(int nextLitterSize)
+ {
+ this.nextLitterSize = nextLitterSize;
+ }
+
+ @Produces
+ public Litter produceLitter()
+ {
+ return new Litter(nextLitterSize);
+ }
+
+ public void disposeLitter(@Disposes Litter litter)
+ {
+ this.litterDisposed = true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.jsr299.tck.tests.implementation.enterprise.newBean.FoxLocal#isLitterDisposed()
+ */
+ public boolean isLitterDisposed()
+ {
+ return litterDisposed;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/FoxLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/FoxLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/FoxLocal.java 2009-05-19 17:43:33 UTC (rev 2691)
@@ -0,0 +1,23 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.newBean;
+
+import javax.ejb.Local;
+
+@Local
+public interface FoxLocal
+{
+
+ public abstract Den getDen();
+
+ public abstract void setDen(Den den);
+
+ public abstract int getNextLitterSize();
+
+ public abstract void setNextLitterSize(int nextLitterSize);
+
+ public abstract Litter produceLitter();
+
+ public abstract void disposeLitter(Litter litter);
+
+ public abstract boolean isLitterDisposed();
+
+}
\ No newline at end of file
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/FoxLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/InitializerSimpleBean.java (from rev 2689, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/InitializerSimpleBean.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/InitializerSimpleBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/InitializerSimpleBean.java 2009-05-19 17:43:33 UTC (rev 2691)
@@ -0,0 +1,38 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.newBean;
+
+import java.io.Serializable;
+
+import javax.annotation.Named;
+import javax.context.SessionScoped;
+import javax.ejb.Stateful;
+import javax.inject.Initializer;
+
+@Stateful
+@SessionScoped
+@Named("Charlie")
+public class InitializerSimpleBean implements Serializable, InitializerSimpleBeanLocal
+{
+ private static final long serialVersionUID = 1L;
+ private static int initializerCalls = 0;
+
+ @Initializer
+ public void initializer()
+ {
+ initializerCalls++;
+ }
+
+ public void businessMethod()
+ {
+
+ }
+
+ public int getInitializerCalls()
+ {
+ return initializerCalls;
+ }
+
+ public void setInitializerCalls(int initializerCalls)
+ {
+ InitializerSimpleBean.initializerCalls = initializerCalls;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/InitializerSimpleBeanLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/InitializerSimpleBeanLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/InitializerSimpleBeanLocal.java 2009-05-19 17:43:33 UTC (rev 2691)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.newBean;
+
+import javax.ejb.Local;
+
+@Local
+public interface InitializerSimpleBeanLocal
+{
+ public void initializer();
+ public void businessMethod();
+ public int getInitializerCalls();
+ public void setInitializerCalls(int initializerCalls);
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/InitializerSimpleBeanLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Litter.java (from rev 2689, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Litter.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Litter.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Litter.java 2009-05-19 17:43:33 UTC (rev 2691)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.newBean;
+
+class Litter
+{
+ private int quantity;
+
+ public Litter(int quantity)
+ {
+ this.quantity = quantity;
+ }
+
+ public int getQuantity()
+ {
+ return quantity;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Monkey.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Monkey.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Monkey.java 2009-05-19 17:43:33 UTC (rev 2691)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.newBean;
+
+import javax.ejb.Stateful;
+
+@Stateful
+@AnimalStereotype
+public class Monkey implements MonkeyLocal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Monkey.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/MonkeyLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/MonkeyLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/MonkeyLocal.java 2009-05-19 17:43:33 UTC (rev 2691)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.newBean;
+
+import javax.ejb.Local;
+
+@Local
+public interface MonkeyLocal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/MonkeyLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: 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 (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java 2009-05-19 17:43:33 UTC (rev 2691)
@@ -0,0 +1,99 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.newBean;
+
+import javax.inject.manager.Bean;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.NewLiteral;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Packaging(PackagingType.EAR)
+@IntegrationTest
+public class NewEnterpriseBeanICTest extends AbstractJSR299Test
+{
+
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.3.6", id = "b")
+ public void testNewBeanHasSameInitializers()
+ {
+ InitializerSimpleBeanLocal bean = getCurrentManager().getInstanceByType(InitializerSimpleBeanLocal.class);
+ InitializerSimpleBeanLocal newBean = getCurrentManager().getInstanceByType(InitializerSimpleBeanLocal.class, new NewLiteral());
+ assert bean != newBean;
+ assert bean.getInitializerCalls() == 2;
+ }
+
+ /**
+ * Sets up both the bean and the @New bean with different configurations
+ * so that the correct producer method used can be determined.
+ *
+ * @throws Exception
+ */
+ @Test(groups = { "new", "ri-broken" })
+ @SpecAssertion(section = "3.3.6", id = "j")
+ public void testNewBeanHasNoProducerMethods() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ FoxLocal fox = getCurrentManager().getInstanceByType(FoxLocal.class);
+ FoxLocal newFox = getCurrentManager().getInstanceByType(FoxLocal.class, new NewLiteral());
+ fox.setNextLitterSize(3);
+ newFox.setNextLitterSize(5);
+ Litter theOnlyLitter = getCurrentManager().getInstanceByType(Litter.class);
+ assert theOnlyLitter.getQuantity() == fox.getNextLitterSize();
+ }
+
+ }.run();
+ }
+
+ @Test(groups = { "new", "ri-broken" })
+ @SpecAssertion(section = "3.3.6", id = "k")
+ public void testNewBeanHasNoProducerFields() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ FoxLocal fox = getCurrentManager().getInstanceByType(FoxLocal.class);
+ FoxLocal newFox = getCurrentManager().getInstanceByType(FoxLocal.class, new NewLiteral());
+ newFox.setDen(new Den("NewFoxDen"));
+ Den theOnlyDen = getCurrentManager().getInstanceByType(Den.class);
+ assert theOnlyDen.getName().equals(fox.getDen().getName());
+ }
+
+ }.run();
+ }
+
+ @Test(groups = { "new", "ri-broken", "disposal" })
+ @SpecAssertion(section = "3.3.6", id = "l")
+ public void testNewBeanHasNoDisposalMethods() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ FoxLocal fox = getCurrentManager().getInstanceByType(FoxLocal.class);
+ FoxLocal newFox = getCurrentManager().getInstanceByType(FoxLocal.class, new NewLiteral());
+ Bean<Litter> litterBean = getCurrentManager().resolveByType(Litter.class).iterator().next();
+ Litter litter = getCurrentManager().getInstanceByType(Litter.class);
+ litterBean.destroy(litter);
+ assert fox.isLitterDisposed();
+ assert !newFox.isLitterDisposed();
+ }
+
+ }.run();
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java 2009-05-18 18:37:12 UTC (rev 2690)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java 2009-05-19 17:43:33 UTC (rev 2691)
@@ -4,14 +4,15 @@
import java.util.Set;
import javax.context.Dependent;
+import javax.context.RequestScoped;
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.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.literals.NewLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
@@ -73,11 +74,16 @@
assert newEnterpriseBean.getName() == null;
}
- @Test(groups = { "stub", "new"})
+ @Test(groups = { "new"})
@SpecAssertion(section = "3.3.6", id = "h")
public void testNewBeanHasNoStereotypes()
{
- assert false;
+ Bean<MonkeyLocal> monkeyBean = getCurrentManager().resolveByType(MonkeyLocal.class).iterator().next();
+ Bean<MonkeyLocal> newMonkeyBean = getCurrentManager().resolveByType(MonkeyLocal.class, new NewLiteral()).iterator().next();
+ assert monkeyBean.getScopeType().equals(RequestScoped.class);
+ assert newMonkeyBean.getScopeType().equals(Dependent.class);
+ assert monkeyBean.getName().equals("monkey");
+ assert newMonkeyBean.getName() == null;
}
@Test(groups = {"new" })
@@ -88,65 +94,34 @@
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;
- }
-
- /**
- * 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;
- }
-
- @Test @SpecAssertion(section="3.3.6", id = "aa")
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="3.3.6", id = "aa"),
+ @SpecAssertion(section="3.3.6", id="a")
+ })
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);
+ Bean<OrderLocal> orderBean = getCurrentManager().resolveByType(OrderLocal.class).iterator().next();
+ Bean<OrderLocal> newOrderBean = getCurrentManager().resolveByType(OrderLocal.class, new NewLiteral()).iterator().next();
+ assert orderBean.getBindings().size() == 1;
+ assert orderBean.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 newOrderBean.getBindings().size() == 1;
+ assert newOrderBean.getBindings().iterator().next().annotationType().equals(New.class);
+ assert orderBean.getTypes().equals(newOrderBean.getTypes());
+
+ Bean<LionLocal> lionBean = getCurrentManager().resolveByType(LionLocal.class, TAME_LITERAL).iterator().next();
+ Bean<LionLocal> newLionBean = getCurrentManager().resolveByType(LionLocal.class, new NewLiteral()).iterator().next();
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 lionBean.getBindings().size() == 1;
+ assert lionBean.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);
+ assert newLionBean.getBindings().size() == 1;
+ assert newLionBean.getBindings().iterator().next().annotationType().equals(New.class);
+
+ assert lionBean.getTypes().equals(newLionBean.getTypes());
}
-
}
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2690 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-05-18 14:37:12 -0400 (Mon, 18 May 2009)
New Revision: 2690
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Ape.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ApeLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Lion.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/LionLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Monkey.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/MonkeyLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Polar.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBear.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBearLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Tame.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/beans.xml
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodsByBindingTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionInterface.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/StateKeeper.java
Log:
Additional tests completed in sections 2 and 3
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/AnotherDeploymentType.java (from rev 2689, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/AnotherDeploymentType.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/AnotherDeploymentType.java 2009-05-18 18:37:12 UTC (rev 2690)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition;
+
+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;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface AnotherDeploymentType
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodsByBindingTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodsByBindingTest.java 2009-05-17 18:02:40 UTC (rev 2689)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodsByBindingTest.java 2009-05-18 18:37:12 UTC (rev 2690)
@@ -8,21 +8,34 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
@Artifact
+@BeansXml("beans.xml")
public class DisposalMethodsByBindingTest extends AbstractJSR299Test
{
private static final Annotation DEADLIEST_LITERAL = new AnnotationLiteral<Deadliest>() {};
- @Test(groups = { "broken" })
+ @Test
@SpecAssertion(section = "2.3.6", id = "c")
- public void testBindingTypesAppliedToDisposalMethodParameters()
+ public void testBindingTypesAppliedToDisposalMethodParameters() throws Exception
{
- //TODO Fix this test copied from proposal method tests which is not working here
- Bean<Tarantula> tarantula = getCurrentManager().resolveByType(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
- Tarantula instance = getCurrentManager().getInstance(tarantula);
- assert instance.getDeathsCaused() == 1;
+ SpiderProducer spiderProducer = getCurrentManager().getInstanceByType(SpiderProducer.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ Bean<Tarantula> tarantula = getCurrentManager().resolveByType(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
+ Tarantula instance = getCurrentManager().getInstance(tarantula);
+ tarantula.destroy(instance);
+ }
+
+ }.run();
+ assert spiderProducer.isTameSpiderDestroyed();
+ assert spiderProducer.isCurrentSpiderDestroyed();
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java 2009-05-17 18:02:40 UTC (rev 2689)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java 2009-05-18 18:37:12 UTC (rev 2690)
@@ -1,10 +1,19 @@
package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition;
import javax.inject.Current;
+import javax.inject.Disposes;
import javax.inject.Produces;
+@AnotherDeploymentType
class SpiderProducer
{
+ private static boolean tameSpiderDestroyed = false;
+ private static boolean currentSpiderDestroyed = false;
+
+ @Produces public Tarantula produceTarantula()
+ {
+ return new Tarantula();
+ }
@Produces @Tame public Tarantula produceTameTarantula()
{
@@ -18,8 +27,23 @@
tameTarantula : tarantula;
}
- @Produces public Tarantula produceTarantula()
+ public void destroyTameSpider(@Disposes @Tame Tarantula spider)
{
- return new Tarantula();
+ SpiderProducer.tameSpiderDestroyed = true;
}
+
+ public void destroyCurrentSpider(@Disposes @Current Tarantula spider)
+ {
+ SpiderProducer.currentSpiderDestroyed = true;
+ }
+
+ public boolean isTameSpiderDestroyed()
+ {
+ return tameSpiderDestroyed;
+ }
+
+ public boolean isCurrentSpiderDestroyed()
+ {
+ return currentSpiderDestroyed;
+ }
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/AnotherDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/AnotherDeploymentType.java 2009-05-18 18:37:12 UTC (rev 2690)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import static java.lang.annotation.ElementType.FIELD;
+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;
+
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface AnotherDeploymentType
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/AnotherDeploymentType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Ape.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Ape.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Ape.java 2009-05-18 18:37:12 UTC (rev 2690)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import javax.ejb.Stateless;
+
+@Stateless
+@Tame
+class Ape implements ApeLocal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Ape.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ApeLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ApeLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ApeLocal.java 2009-05-18 18:37:12 UTC (rev 2690)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import javax.ejb.Local;
+
+@Local
+interface ApeLocal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ApeLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java 2009-05-17 18:02:40 UTC (rev 2689)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java 2009-05-18 18:37:12 UTC (rev 2690)
@@ -1,5 +1,9 @@
package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+import java.lang.annotation.Annotation;
+
+import javax.context.RequestScoped;
+import javax.inject.AnnotationLiteral;
import javax.inject.manager.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -8,6 +12,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
/**
@@ -17,6 +22,7 @@
*/
@Artifact
@Packaging(PackagingType.EAR)
+@BeansXml("beans.xml")
public class EnterpriseBeanDefinitionTest extends AbstractJSR299Test
{
@Test(groups = { "enterpriseBeans" })
@@ -103,6 +109,49 @@
}
@Test(groups = "enterpriseBeans")
+ @SpecAssertion(section = "3.3.4", id = "ba")
+ public void testBeanWithScopeAnnotation()
+ {
+ Bean<LionLocal> lionBean = getCurrentManager().resolveByType(LionLocal.class).iterator().next();
+ assert lionBean.getScopeType().equals(RequestScoped.class);
+ }
+
+ @Test(groups = "enterpriseBeans")
+ @SpecAssertion(section = "3.3.4", id = "bb")
+ public void testBeanWithNamedAnnotation()
+ {
+ Bean<MonkeyLocal> monkeyBean = getCurrentManager().resolveByType(MonkeyLocal.class).iterator().next();
+ assert monkeyBean.getName().equals("Monkey");
+ }
+
+ @Test(groups = "enterpriseBeans")
+ @SpecAssertion(section = "3.3.4", id = "bc")
+ public void testBeanWithDeploymentType()
+ {
+ Bean<MonkeyLocal> monkeyBean = getCurrentManager().resolveByType(MonkeyLocal.class).iterator().next();
+ assert monkeyBean.getDeploymentType().equals(AnotherDeploymentType.class);
+ }
+
+ @Test(groups = "enterpriseBeans")
+ @SpecAssertion(section = "3.3.4", id = "bd")
+ public void testBeanWithStereotype()
+ {
+ Bean<PolarBearLocal> polarBearBean = getCurrentManager().resolveByType(PolarBearLocal.class).iterator().next();
+ assert polarBearBean.getDeploymentType().equals(AnotherDeploymentType.class);
+ assert polarBearBean.getScopeType().equals(RequestScoped.class);
+ assert polarBearBean.getName().equals("polarBear");
+ }
+
+ @Test(groups = "enterpriseBeans")
+ @SpecAssertion(section = "3.3.4", id = "be")
+ public void testBeanWithBindings()
+ {
+ Annotation tame = new AnnotationLiteral<Tame>(){};
+ Bean<ApeLocal> apeBean = getCurrentManager().resolveByType(ApeLocal.class, tame).iterator().next();
+ assert apeBean.getBindings().contains(tame);
+ }
+
+ @Test(groups = "enterpriseBeans")
@SpecAssertion(section = "3.3.8", id = "a")
public void testDefaultName()
{
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Lion.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Lion.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Lion.java 2009-05-18 18:37:12 UTC (rev 2690)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import javax.context.RequestScoped;
+import javax.ejb.Stateful;
+
+@Stateful
+@RequestScoped
+class Lion implements LionLocal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Lion.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/LionLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/LionLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/LionLocal.java 2009-05-18 18:37:12 UTC (rev 2690)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import javax.ejb.Local;
+
+@Local
+interface LionLocal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/LionLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Monkey.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Monkey.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Monkey.java 2009-05-18 18:37:12 UTC (rev 2690)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import javax.annotation.Named;
+import javax.ejb.Stateless;
+
+@Stateless
+@Named("Monkey")
+@AnotherDeploymentType
+class Monkey implements MonkeyLocal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Monkey.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/MonkeyLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/MonkeyLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/MonkeyLocal.java 2009-05-18 18:37:12 UTC (rev 2690)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import javax.ejb.Local;
+
+@Local
+interface MonkeyLocal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/MonkeyLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Polar.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Polar.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Polar.java 2009-05-18 18:37:12 UTC (rev 2690)
@@ -0,0 +1,24 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import static java.lang.annotation.ElementType.FIELD;
+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.Retention;
+import java.lang.annotation.Target;
+
+import javax.annotation.Named;
+import javax.annotation.Stereotype;
+import javax.context.RequestScoped;
+
+@Stereotype
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@AnotherDeploymentType
+@RequestScoped
+@Named
+@interface Polar
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Polar.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBear.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBear.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBear.java 2009-05-18 18:37:12 UTC (rev 2690)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import javax.ejb.Stateful;
+
+@Stateful
+@Polar
+class PolarBear implements PolarBearLocal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBear.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBearLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBearLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBearLocal.java 2009-05-18 18:37:12 UTC (rev 2690)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import javax.ejb.Local;
+
+@Local
+interface PolarBearLocal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBearLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Tame.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Tame.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Tame.java 2009-05-18 18:37:12 UTC (rev 2690)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+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;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Tame
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Tame.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionBean.java 2009-05-17 18:02:40 UTC (rev 2689)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionBean.java 2009-05-18 18:37:12 UTC (rev 2690)
@@ -1,5 +1,6 @@
package org.jboss.jsr299.tck.tests.implementation.enterprise.remove;
+import javax.annotation.PreDestroy;
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.inject.Current;
@@ -22,4 +23,13 @@
stateKeeper.setRemoveCalled(true);
}
+ @PreDestroy
+ public void markDestroyed()
+ {
+ stateKeeper.setBeanDestroyed(true);
+ }
+
+ public void businessMethod()
+ {
+ }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionInterface.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionInterface.java 2009-05-17 18:02:40 UTC (rev 2689)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionInterface.java 2009-05-18 18:37:12 UTC (rev 2690)
@@ -8,4 +8,6 @@
public void remove();
public void anotherRemoveWithParameters(String reason);
+
+ public void businessMethod();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java 2009-05-17 18:02:40 UTC (rev 2689)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java 2009-05-18 18:37:12 UTC (rev 2690)
@@ -3,6 +3,7 @@
import static org.jboss.testharness.impl.packaging.PackagingType.EAR;
import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.IntegrationTest;
@@ -58,7 +59,10 @@
}
@Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle", "ri-broken" }, expectedExceptions = UnsupportedOperationException.class)
- @SpecAssertion(section = "3.3.1", id = "c")
+ @SpecAssertions({
+ @SpecAssertion(section = "3.3.1", id = "b"),
+ @SpecAssertion(section = "3.3.1", id = "c")
+ })
public void applicationCannotCallRemoveMethodOnNonDependentScopedSessionEnterpriseBean()
{
SessionScopedSessionInterface sessionBean = getCurrentManager().getInstanceByType(SessionScopedSessionInterface.class);
@@ -66,18 +70,22 @@
assert false : "Should never reach this assertion";
}
- @Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle", "stub" })
+ @Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle" })
@SpecAssertion(section = "3.3.1", id = "db")
- public void applicationMayCallRemoveMethodOnDependentScopedSessionEnterpriseBeansButInstanceIsNotDestroyed()
+ public void applicationMayCallRemoveMethodOnDependentScopedSessionEnterpriseBeansButInstanceIsNotDestroyed() throws Exception
{
- assert false;
+ StateKeeper stateKeeper = getCurrentManager().getInstanceByType(StateKeeper.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ DependentSessionInterface sessionBean = getCurrentManager().getInstanceByType(DependentSessionInterface.class);
+ sessionBean.businessMethod();
+ }
+ }.run();
+ assert !stateKeeper.isBeanDestroyed();
}
- @Test(groups = { "enterprisebean", "removemethod", "lifecycle", "stub" })
- @SpecAssertion(section = "3.3.1", id = "b")
- public void testApplicationCalledRemoveMethodOfStatefulSessionBeanWithNonDependentScopeFails()
- {
- assert false;
- }
-
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/StateKeeper.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/StateKeeper.java 2009-05-17 18:02:40 UTC (rev 2689)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/StateKeeper.java 2009-05-18 18:37:12 UTC (rev 2690)
@@ -5,7 +5,8 @@
@ApplicationScoped
class StateKeeper
{
- private boolean removeCalled = false;
+ private boolean removeCalled = false;
+ private boolean beanDestroyed = false;
public boolean isRemoveCalled()
{
@@ -17,4 +18,14 @@
this.removeCalled = removeCalled;
}
+ public boolean isBeanDestroyed()
+ {
+ return beanDestroyed;
+ }
+
+ public void setBeanDestroyed(boolean beanDestroyed)
+ {
+ this.beanDestroyed = beanDestroyed;
+ }
+
}
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/beans.xml 2009-05-18 18:37:12 UTC (rev 2690)
@@ -0,0 +1,8 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.disposal.method.definition">
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/beans.xml 2009-05-18 18:37:12 UTC (rev 2690)
@@ -0,0 +1,8 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.enterprise.definition">
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2689 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken and 7 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-05-17 14:02:40 -0400 (Sun, 17 May 2009)
New Revision: 2689
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionInterface.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/SessionScopedSessionBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/SessionScopedSessionInterface.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/StateKeeper.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/Cow_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/Mammal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/SpecializingClassExtendsNonSimpleBean.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/beans.xml
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/names/SpecializingAndSpecializedBeanHasNameTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend1/SpecializingBeanImplementsInterfaceOnly.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend2/SpecializingBeanExtendsNothingTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/precedence/SpecializingBeanWithLowerPrecedenceTest.java
Log:
Added a few more bean implementation tests
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionBean.java 2009-05-17 18:02:40 UTC (rev 2689)
@@ -0,0 +1,25 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.remove;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.inject.Current;
+
+@Stateful
+public class DependentSessionBean implements DependentSessionInterface
+{
+ @Current
+ private StateKeeper stateKeeper;
+
+ @Remove
+ public void remove()
+ {
+ stateKeeper.setRemoveCalled(true);
+ }
+
+ @Remove
+ public void anotherRemoveWithParameters(String reason)
+ {
+ stateKeeper.setRemoveCalled(true);
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionInterface.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionInterface.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionInterface.java 2009-05-17 18:02:40 UTC (rev 2689)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.remove;
+
+import javax.ejb.Local;
+
+@Local
+public interface DependentSessionInterface
+{
+ public void remove();
+
+ public void anotherRemoveWithParameters(String reason);
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionInterface.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java 2009-05-17 14:36:17 UTC (rev 2688)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java 2009-05-17 18:02:40 UTC (rev 2689)
@@ -1,7 +1,12 @@
package org.jboss.jsr299.tck.tests.implementation.enterprise.remove;
+import static org.jboss.testharness.impl.packaging.PackagingType.EAR;
+
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Packaging;
import org.testng.annotations.Test;
/**
@@ -10,28 +15,55 @@
*
* Spec version: PRD2
*/
+@Artifact
+@Packaging(EAR)
+@IntegrationTest
public class EnterpriseBeanRemoveMethodTest extends AbstractJSR299Test
{
- @Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle", "stub" })
+ @Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle" })
@SpecAssertion(section = "3.3.1", id = "a")
- public void applicationMayCallAnyRemoveMethodOnDependentScopedSessionEnterpriseBeans()
+ public void applicationMayCallAnyRemoveMethodOnDependentScopedSessionEnterpriseBeans() throws Exception
{
- assert false;
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ DependentSessionInterface sessionBean = getCurrentManager().getInstanceByType(DependentSessionInterface.class);
+ sessionBean.remove();
+ StateKeeper stateKeeper = getCurrentManager().getInstanceByType(StateKeeper.class);
+ assert stateKeeper.isRemoveCalled();
+ }
+ }.run();
}
- @Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle", "stub" })
+ @Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle" })
@SpecAssertion(section = "3.3.1", id = "da")
- public void applicationMayCallRemoveMethodOnDependentScopedSessionEnterpriseBeansButNoParametersArePassed()
+ public void applicationMayCallRemoveMethodOnDependentScopedSessionEnterpriseBeansButNoParametersArePassed() throws Exception
{
- assert false;
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ DependentSessionInterface sessionBean = getCurrentManager().getInstanceByType(DependentSessionInterface.class);
+ sessionBean.anotherRemoveWithParameters("required");
+ StateKeeper stateKeeper = getCurrentManager().getInstanceByType(StateKeeper.class);
+ assert stateKeeper.isRemoveCalled();
+ }
+ }.run();
}
- @Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle", "stub" }, expectedExceptions = UnsupportedOperationException.class)
+ @Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle", "ri-broken" }, expectedExceptions = UnsupportedOperationException.class)
@SpecAssertion(section = "3.3.1", id = "c")
public void applicationCannotCallRemoveMethodOnNonDependentScopedSessionEnterpriseBean()
{
- assert false;
+ SessionScopedSessionInterface sessionBean = getCurrentManager().getInstanceByType(SessionScopedSessionInterface.class);
+ sessionBean.remove();
+ assert false : "Should never reach this assertion";
}
@Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle", "stub" })
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/SessionScopedSessionBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/SessionScopedSessionBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/SessionScopedSessionBean.java 2009-05-17 18:02:40 UTC (rev 2689)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.remove;
+
+import javax.context.SessionScoped;
+import javax.ejb.Stateful;
+
+@Stateful
+@SessionScoped
+public class SessionScopedSessionBean implements SessionScopedSessionInterface
+{
+
+ public void remove()
+ {
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/SessionScopedSessionBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/SessionScopedSessionInterface.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/SessionScopedSessionInterface.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/SessionScopedSessionInterface.java 2009-05-17 18:02:40 UTC (rev 2689)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.remove;
+
+import javax.ejb.Local;
+
+@Local
+public interface SessionScopedSessionInterface
+{
+ public void remove();
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/SessionScopedSessionInterface.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/StateKeeper.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/StateKeeper.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/StateKeeper.java 2009-05-17 18:02:40 UTC (rev 2689)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.remove;
+
+import javax.context.ApplicationScoped;
+
+@ApplicationScoped
+class StateKeeper
+{
+ private boolean removeCalled = false;
+
+ public boolean isRemoveCalled()
+ {
+ return removeCalled;
+ }
+
+ public void setRemoveCalled(boolean removeCalled)
+ {
+ this.removeCalled = removeCalled;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/StateKeeper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/names/SpecializingAndSpecializedBeanHasNameTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/names/SpecializingAndSpecializedBeanHasNameTest.java 2009-05-17 14:36:17 UTC (rev 2688)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/names/SpecializingAndSpecializedBeanHasNameTest.java 2009-05-17 18:02:40 UTC (rev 2689)
@@ -3,17 +3,19 @@
import javax.inject.DefinitionException;
import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
@Artifact
@ExpectedDeploymentException(DefinitionException.class)
-public class SpecializingAndSpecializedBeanHasNameTest
+public class SpecializingAndSpecializedBeanHasNameTest extends AbstractJSR299Test
{
@Test
@SpecAssertion(section = "4.3.1", id = "e")
public void testSpecializingAndSpecializedBeanHasName()
{
+ assert false;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend1/SpecializingBeanImplementsInterfaceOnly.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend1/SpecializingBeanImplementsInterfaceOnly.java 2009-05-17 14:36:17 UTC (rev 2688)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend1/SpecializingBeanImplementsInterfaceOnly.java 2009-05-17 18:02:40 UTC (rev 2689)
@@ -3,18 +3,20 @@
import javax.inject.DefinitionException;
import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
@Artifact
@ExpectedDeploymentException(DefinitionException.class)
-public class SpecializingBeanImplementsInterfaceOnly
+public class SpecializingBeanImplementsInterfaceOnly extends AbstractJSR299Test
{
@Test(groups = { "specialization" })
@SpecAssertion(section = "3.2.7", id = "a")
public void testSpecializingClassImplementsInterfaceAndExtendsNothing()
{
+ assert false;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend2/SpecializingBeanExtendsNothingTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend2/SpecializingBeanExtendsNothingTest.java 2009-05-17 14:36:17 UTC (rev 2688)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend2/SpecializingBeanExtendsNothingTest.java 2009-05-17 18:02:40 UTC (rev 2689)
@@ -3,18 +3,20 @@
import javax.inject.DefinitionException;
import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
@Artifact
@ExpectedDeploymentException(DefinitionException.class)
-public class SpecializingBeanExtendsNothingTest
+public class SpecializingBeanExtendsNothingTest extends AbstractJSR299Test
{
@Test(groups = { "specialization" })
@SpecAssertion(section = "3.2.7", id = "a")
public void testSpecializingClassDirectlyExtendsNothing()
{
+ assert false;
}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/AnotherDeploymentType.java (from rev 2687, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend2/AnotherDeploymentType.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/AnotherDeploymentType.java 2009-05-17 18:02:40 UTC (rev 2689)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.inheritance.specialization.simple.broken.noextend3;
+
+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;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface AnotherDeploymentType
+{
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/Cow_Broken.java (from rev 2687, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend2/Cow_Broken.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/Cow_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/Cow_Broken.java 2009-05-17 18:02:40 UTC (rev 2689)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.inheritance.specialization.simple.broken.noextend3;
+
+import javax.inject.Specializes;
+
+@Specializes
+@AnotherDeploymentType
+class Cow_Broken extends Mammal
+{
+ public Cow_Broken()
+ {
+ super("Herbivore");
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/Mammal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/Mammal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/Mammal.java 2009-05-17 18:02:40 UTC (rev 2689)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.inheritance.specialization.simple.broken.noextend3;
+
+class Mammal
+{
+ public Mammal(String type)
+ {
+
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/Mammal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/SpecializingClassExtendsNonSimpleBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/SpecializingClassExtendsNonSimpleBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/SpecializingClassExtendsNonSimpleBean.java 2009-05-17 18:02:40 UTC (rev 2689)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.inheritance.specialization.simple.broken.noextend3;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class SpecializingClassExtendsNonSimpleBean extends AbstractJSR299Test
+{
+ @Test(groups = { "specialization", "ri-broken" })
+ @SpecAssertion(section = "3.2.7", id = "d")
+ public void testSpecializingClassExtendsNonSimpleBean()
+ {
+ assert false;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/SpecializingClassExtendsNonSimpleBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/precedence/SpecializingBeanWithLowerPrecedenceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/precedence/SpecializingBeanWithLowerPrecedenceTest.java 2009-05-17 14:36:17 UTC (rev 2688)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/precedence/SpecializingBeanWithLowerPrecedenceTest.java 2009-05-17 18:02:40 UTC (rev 2689)
@@ -3,18 +3,20 @@
import javax.inject.InconsistentSpecializationException;
import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
@Artifact
@ExpectedDeploymentException(InconsistentSpecializationException.class)
-public class SpecializingBeanWithLowerPrecedenceTest
+public class SpecializingBeanWithLowerPrecedenceTest extends AbstractJSR299Test
{
@Test
@SpecAssertion(section="4.3.3", id="a")
public void testSpecializingBeanDoesNotHaveHigherPrecedenceThanSpecializedBean()
{
+ assert false;
}
}
Copied: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/beans.xml (from rev 2687, tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend2/beans.xml)
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/beans.xml 2009-05-17 18:02:40 UTC (rev 2689)
@@ -0,0 +1,7 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.tests.inheritance.specialization.simple.broken.noextend3">
+ <Deploy>
+ <Standard />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2688 - ri/trunk/impl/src/main/java/org/jboss/webbeans/util.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-05-17 10:36:17 -0400 (Sun, 17 May 2009)
New Revision: 2688
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Names.java
Log:
Made scopeTypeToString() behave better with non-initialized scopes
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Names.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Names.java 2009-05-15 19:58:11 UTC (rev 2687)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Names.java 2009-05-17 14:36:17 UTC (rev 2688)
@@ -48,19 +48,22 @@
*/
public static String scopeTypeToString(Class<? extends Annotation> scopeType)
{
- String scopeName = scopeType.getSimpleName();
- Matcher matcher = CAPITAL_LETTERS.matcher(scopeName);
StringBuilder result = new StringBuilder();
- int i = 0;
- while (matcher.find())
+ if (scopeType != null)
{
- String name = matcher.group();
- if (i > 0)
+ String scopeName = scopeType.getSimpleName();
+ Matcher matcher = CAPITAL_LETTERS.matcher(scopeName);
+ int i = 0;
+ while (matcher.find())
{
- name = name.toLowerCase();
+ String name = matcher.group();
+ if (i > 0)
+ {
+ name = name.toLowerCase();
+ }
+ result.append(name).append(" ");
+ i++;
}
- result.append(name).append(" ");
- i++;
}
return result.toString();
}
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2687 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple: definition/constructorHasObservesParameter and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-05-15 15:58:11 -0400 (Fri, 15 May 2009)
New Revision: 2687
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/AnimalStereotype.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Den.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Fox.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Litter.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/ConstructorHasDisposesParameterTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ConstructorHasObservesParameterTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
Log:
A few more new bean tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/ConstructorHasDisposesParameterTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/ConstructorHasDisposesParameterTest.java 2009-05-15 14:43:28 UTC (rev 2686)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/ConstructorHasDisposesParameterTest.java 2009-05-15 19:58:11 UTC (rev 2687)
@@ -13,7 +13,7 @@
public class ConstructorHasDisposesParameterTest extends AbstractJSR299Test
{
- @Test(groups = { "disposalMethod", "stub" })
+ @Test(groups = { "disposalMethod", "ri-broken" })
@SpecAssertion(section = "3.2.6.1", id = "d")
public void testConstructorHasDisposesParameter() throws Exception
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ConstructorHasObservesParameterTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ConstructorHasObservesParameterTest.java 2009-05-15 14:43:28 UTC (rev 2686)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ConstructorHasObservesParameterTest.java 2009-05-15 19:58:11 UTC (rev 2687)
@@ -13,7 +13,7 @@
public class ConstructorHasObservesParameterTest extends AbstractJSR299Test
{
- @Test(groups = { "stub", "observerMethod" })
+ @Test(groups = { "ri-broken", "observerMethod" })
@SpecAssertion(section = "3.2.6.1", id = "e")
public void testConstructorHasObservesParameter()
{
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/AnimalStereotype.java (from rev 2685, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/AnimalStereotype.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/AnimalStereotype.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/AnimalStereotype.java 2009-05-15 19:58:11 UTC (rev 2687)
@@ -0,0 +1,25 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.newSimpleBean;
+
+import static java.lang.annotation.ElementType.FIELD;
+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.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.annotation.Named;
+import javax.annotation.Stereotype;
+import javax.context.RequestScoped;
+
+@Stereotype
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@RequestScoped
+@Named
+@Inherited
+@interface AnimalStereotype
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Den.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Den.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Den.java 2009-05-15 19:58:11 UTC (rev 2687)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.newSimpleBean;
+
+public class Den
+{
+ private String name;
+
+ public Den(String name)
+ {
+ this.name = name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Den.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Fox.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Fox.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Fox.java 2009-05-15 19:58:11 UTC (rev 2687)
@@ -0,0 +1,57 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.newSimpleBean;
+
+import javax.event.Observes;
+import javax.inject.Disposes;
+import javax.inject.Produces;
+
+@AnimalStereotype
+class Fox
+{
+ @Produces
+ private Den den = new Den("FoxDen");
+
+ private int nextLitterSize;
+
+ private boolean litterDisposed = false;
+
+ public void observeEvent(@Observes String event)
+ {
+
+ }
+
+ public Den getDen()
+ {
+ return den;
+ }
+
+ public void setDen(Den den)
+ {
+ this.den = den;
+ }
+
+ public int getNextLitterSize()
+ {
+ return nextLitterSize;
+ }
+
+ public void setNextLitterSize(int nextLitterSize)
+ {
+ this.nextLitterSize = nextLitterSize;
+ }
+
+ @Produces
+ public Litter produceLitter()
+ {
+ return new Litter(nextLitterSize);
+ }
+
+ public void disposeLitter(@Disposes Litter litter)
+ {
+ this.litterDisposed = true;
+ }
+
+ public boolean isLitterDisposed()
+ {
+ return litterDisposed;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Fox.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Litter.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Litter.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Litter.java 2009-05-15 19:58:11 UTC (rev 2687)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.newSimpleBean;
+
+class Litter
+{
+ private int quantity;
+
+ public Litter(int quantity)
+ {
+ this.quantity = quantity;
+ }
+
+ public int getQuantity()
+ {
+ return quantity;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Litter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2009-05-15 14:43:28 UTC (rev 2686)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2009-05-15 19:58:11 UTC (rev 2687)
@@ -6,6 +6,7 @@
import java.util.Set;
import javax.context.Dependent;
+import javax.context.RequestScoped;
import javax.inject.AnnotationLiteral;
import javax.inject.Current;
import javax.inject.New;
@@ -72,39 +73,88 @@
assert newSimpleBean.getName() == null;
}
- @Test(groups = { "stub", "new" })
+ @Test(groups = { "new" })
@SpecAssertion(section = "3.2.5", id = "h")
public void testNewBeanHasNoStereotypes()
{
- assert false;
+ Bean<Fox> foxBean = getCurrentManager().resolveByType(Fox.class).iterator().next();
+ assert foxBean.getScopeType().equals(RequestScoped.class);
+ assert foxBean.getName().equals("fox");
+ Bean<Fox> newFoxBean = getCurrentManager().resolveByType(Fox.class, new NewLiteral()).iterator().next();
+ assert newFoxBean.getScopeType().equals(Dependent.class);
+ assert newFoxBean.getName() == null;
}
- @Test(groups = { "new", "stub" })
+ @Test(groups = { "new" })
@SpecAssertion(section = "3.2.5", id = "i")
public void testNewBeanHasNoObservers()
{
- assert false;
+ // As long as only one observer exists here, we know it is not from the @New bean
+ assert getCurrentManager().resolveObservers("event").size() == 1;
}
- @Test(groups = { "new", "stub" })
+ @Test(groups = { "new" })
@SpecAssertion(section = "3.2.5", id = "k")
- public void testNewBeanHasNoProducerFields()
+ public void testNewBeanHasNoProducerFields() throws Exception
{
- assert false;
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ Fox fox = getCurrentManager().getInstanceByType(Fox.class);
+ Fox newFox = getCurrentManager().getInstanceByType(Fox.class, new NewLiteral());
+ newFox.setDen(new Den("NewFoxDen"));
+ Den theOnlyDen = getCurrentManager().getInstanceByType(Den.class);
+ assert theOnlyDen.getName().equals(fox.getDen().getName());
+ }
+
+ }.run();
+
}
- @Test(groups = { "new", "stub" })
+ @Test(groups = { "new" })
@SpecAssertion(section = "3.2.5", id = "j")
- public void testNewBeanHasNoProducerMethods()
+ public void testNewBeanHasNoProducerMethods() throws Exception
{
- assert false;
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ Fox fox = getCurrentManager().getInstanceByType(Fox.class);
+ Fox newFox = getCurrentManager().getInstanceByType(Fox.class, new NewLiteral());
+ fox.setNextLitterSize(3);
+ newFox.setNextLitterSize(5);
+ Litter theOnlyLitter = getCurrentManager().getInstanceByType(Litter.class);
+ assert theOnlyLitter.getQuantity() == fox.getNextLitterSize();
+ }
+
+ }.run();
}
- @Test(groups = { "new", "stub" })
+ @Test(groups = { "new" })
@SpecAssertion(section = "3.2.5", id = "l")
- public void testNewBeanHasNoDisposalMethods()
+ public void testNewBeanHasNoDisposalMethods() throws Exception
{
- assert false;
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ Fox fox = getCurrentManager().getInstanceByType(Fox.class);
+ Fox newFox = getCurrentManager().getInstanceByType(Fox.class, new NewLiteral());
+ Bean<Litter> litterBean = getCurrentManager().resolveByType(Litter.class).iterator().next();
+ Litter litter = getCurrentManager().getInstanceByType(Litter.class);
+ litterBean.destroy(litter);
+ assert fox.isLitterDisposed();
+ assert !newFox.isLitterDisposed();
+ }
+
+ }.run();
}
@Test(groups = { "new" })
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2686 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-05-15 10:43:28 -0400 (Fri, 15 May 2009)
New Revision: 2686
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/ExplicitContructorSimpleBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/InitializerSimpleBean.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/WrappedSimpleBean.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Order.java
Log:
A few more bean impl tests
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/ExplicitContructorSimpleBean.java (from rev 2685, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/WrappedSimpleBean.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/ExplicitContructorSimpleBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/ExplicitContructorSimpleBean.java 2009-05-15 14:43:28 UTC (rev 2686)
@@ -0,0 +1,29 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.newSimpleBean;
+
+import java.io.Serializable;
+
+import javax.annotation.Named;
+import javax.context.SessionScoped;
+
+@SessionScoped
+@Named("Fred")
+class ExplicitContructorSimpleBean implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+ private static int constructorCalls = 0;
+
+ public ExplicitContructorSimpleBean() {
+ constructorCalls++;
+ }
+
+ public static int getConstructorCalls()
+ {
+ return constructorCalls;
+ }
+
+ public static void setConstructorCalls(int constructorCalls)
+ {
+ ExplicitContructorSimpleBean.constructorCalls = constructorCalls;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/ExplicitContructorSimpleBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/InitializerSimpleBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/InitializerSimpleBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/InitializerSimpleBean.java 2009-05-15 14:43:28 UTC (rev 2686)
@@ -0,0 +1,40 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.newSimpleBean;
+
+import java.io.Serializable;
+
+import javax.annotation.Named;
+import javax.context.SessionScoped;
+import javax.inject.Current;
+import javax.inject.Initializer;
+
+@SessionScoped
+@Named("Charlie")
+class InitializerSimpleBean implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+ private static int initializerCalls = 0;
+
+ @Current
+ protected Order order;
+
+ @Initializer
+ public void initializer()
+ {
+ initializerCalls++;
+ }
+
+ public void businessMethod()
+ {
+
+ }
+
+ public static int getInitializerCalls()
+ {
+ return initializerCalls;
+ }
+
+ public static void setInitializerCalls(int initializerCalls)
+ {
+ InitializerSimpleBean.initializerCalls = initializerCalls;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/InitializerSimpleBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2009-05-13 21:19:31 UTC (rev 2685)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2009-05-15 14:43:28 UTC (rev 2686)
@@ -35,9 +35,9 @@
@SpecAssertion(section = "3.2.5", id = "d")
public void testNewBeanIsDependentScoped()
{
- Set<Bean<WrappedSimpleBean>> beans = getCurrentManager().resolveByType(WrappedSimpleBean.class, new NewLiteral());
+ Set<Bean<ExplicitContructorSimpleBean>> beans = getCurrentManager().resolveByType(ExplicitContructorSimpleBean.class, new NewLiteral());
assert beans.size() == 1;
- Bean<WrappedSimpleBean> newSimpleBean = beans.iterator().next();
+ Bean<ExplicitContructorSimpleBean> newSimpleBean = beans.iterator().next();
assert Dependent.class.equals(newSimpleBean.getScopeType());
}
@@ -45,9 +45,9 @@
@SpecAssertion(section = "3.2.5", id = "e")
public void testNewBeanIsOfStandardDeploymentType()
{
- Set<Bean<WrappedSimpleBean>> beans = getCurrentManager().resolveByType(WrappedSimpleBean.class, new NewLiteral());
+ Set<Bean<ExplicitContructorSimpleBean>> beans = getCurrentManager().resolveByType(ExplicitContructorSimpleBean.class, new NewLiteral());
assert beans.size() == 1;
- Bean<WrappedSimpleBean> newSimpleBean = beans.iterator().next();
+ Bean<ExplicitContructorSimpleBean> newSimpleBean = beans.iterator().next();
assert Standard.class.equals(newSimpleBean.getDeploymentType());
}
@@ -55,9 +55,9 @@
@SpecAssertion(section = "3.2.5", id = "f")
public void testNewBeanHasOnlyNewBinding()
{
- Set<Bean<WrappedSimpleBean>> beans = getCurrentManager().resolveByType(WrappedSimpleBean.class, new NewLiteral());
+ Set<Bean<ExplicitContructorSimpleBean>> beans = getCurrentManager().resolveByType(ExplicitContructorSimpleBean.class, new NewLiteral());
assert beans.size() == 1;
- Bean<WrappedSimpleBean> newSimpleBean = beans.iterator().next();
+ Bean<ExplicitContructorSimpleBean> newSimpleBean = beans.iterator().next();
assert newSimpleBean.getBindings().size() == 1;
assert newSimpleBean.getBindings().iterator().next().annotationType().equals(new NewLiteral().annotationType());
}
@@ -66,9 +66,9 @@
@SpecAssertion(section = "3.2.5", id = "g")
public void testNewBeanHasNoWebBeanName()
{
- Set<Bean<WrappedSimpleBean>> beans = getCurrentManager().resolveByType(WrappedSimpleBean.class, new NewLiteral());
+ Set<Bean<ExplicitContructorSimpleBean>> beans = getCurrentManager().resolveByType(ExplicitContructorSimpleBean.class, new NewLiteral());
assert beans.size() == 1;
- Bean<WrappedSimpleBean> newSimpleBean = beans.iterator().next();
+ Bean<ExplicitContructorSimpleBean> newSimpleBean = beans.iterator().next();
assert newSimpleBean.getName() == null;
}
@@ -141,4 +141,36 @@
assert getCurrentManager().resolveByType(Lion.class, new NewLiteral()).iterator().next().getBindings().iterator().next().annotationType().equals(New.class);
}
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.2.5", id = "ba")
+ public void testNewBeanHasSameConstructor()
+ {
+ ExplicitContructorSimpleBean.setConstructorCalls(0);
+ ExplicitContructorSimpleBean bean = getCurrentManager().getInstanceByType(ExplicitContructorSimpleBean.class);
+ ExplicitContructorSimpleBean newBean = getCurrentManager().getInstanceByType(ExplicitContructorSimpleBean.class, new NewLiteral());
+ assert bean != newBean;
+ assert ExplicitContructorSimpleBean.getConstructorCalls() == 2;
+ }
+
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.2.5", id = "bb")
+ public void testNewBeanHasSameInitializers()
+ {
+ InitializerSimpleBean.setInitializerCalls(0);
+ InitializerSimpleBean bean = getCurrentManager().getInstanceByType(InitializerSimpleBean.class);
+ bean.businessMethod(); // Cause proxy to initialize the bean
+ InitializerSimpleBean newBean = getCurrentManager().getInstanceByType(InitializerSimpleBean.class, new NewLiteral());
+ assert bean != newBean;
+ assert InitializerSimpleBean.getInitializerCalls() == 2;
+ }
+
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.2.5", id = "bc")
+ public void testNewBeanHasSameInjectedFields()
+ {
+ Bean<InitializerSimpleBean> simpleBean = getCurrentManager().resolveByType(InitializerSimpleBean.class).iterator().next();
+ Bean<InitializerSimpleBean> newSimpleBean = getCurrentManager().resolveByType(InitializerSimpleBean.class, new NewLiteral()).iterator().next();
+ assert !newSimpleBean.getInjectionPoints().isEmpty();
+ assert simpleBean.getInjectionPoints().equals(newSimpleBean.getInjectionPoints());
+ }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Order.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Order.java 2009-05-13 21:19:31 UTC (rev 2685)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Order.java 2009-05-15 14:43:28 UTC (rev 2686)
@@ -1,11 +1,14 @@
package org.jboss.jsr299.tck.tests.implementation.simple.newSimpleBean;
+import java.io.Serializable;
+
import javax.inject.Production;
@Production
-class Order
+class Order implements Serializable
{
- public static boolean constructed = true;
-
+ private static final long serialVersionUID = 1L;
+ public static boolean constructed = true;
+
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/WrappedSimpleBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/WrappedSimpleBean.java 2009-05-13 21:19:31 UTC (rev 2685)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/WrappedSimpleBean.java 2009-05-15 14:43:28 UTC (rev 2686)
@@ -1,15 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.simple.newSimpleBean;
-
-import java.io.Serializable;
-
-import javax.annotation.Named;
-import javax.context.SessionScoped;
-
-@SessionScoped
-@Named("Fred")
-class WrappedSimpleBean implements Serializable
-{
- public WrappedSimpleBean() {
-
- }
-}
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2685 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests: implementation/disposal/method/definition and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-05-13 17:19:31 -0400 (Wed, 13 May 2009)
New Revision: 2685
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Animal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Deadliest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DeadlyAnimal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DeadlySpider.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DefangedTarantula.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodsByBindingTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Spider.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Tame.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Tarantula.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/ChickenInterface.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/Preferred.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/PreferredChicken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/PremiumChickenHutch.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/StandardChicken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/StandardChickenHutch.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/StandardVariety.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/AnnotationTypesTest.java
Log:
A couple more tests and minor changes.
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-05-11 22:09:53 UTC (rev 2684)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -177,7 +177,8 @@
@Test
@SpecAssertions({
@SpecAssertion(section="11.6", id="b"),
- @SpecAssertion(section="11.6", id="m")
+ @SpecAssertion(section="11.6", id="m"),
+ @SpecAssertion(section="11.6", id="d")
})
public void testBeanBelongingToParentActivityBelongsToChildActivity()
{
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Animal.java (from rev 2684, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/Animal.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Animal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Animal.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition;
+
+interface Animal
+{
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Deadliest.java (from rev 2684, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/Deadliest.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Deadliest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Deadliest.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition;
+
+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;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Deadliest
+{
+
+}
\ No newline at end of file
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DeadlyAnimal.java (from rev 2684, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/DeadlyAnimal.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DeadlyAnimal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DeadlyAnimal.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition;
+
+interface DeadlyAnimal
+{
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DeadlySpider.java (from rev 2684, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/DeadlySpider.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DeadlySpider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DeadlySpider.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition;
+
+interface DeadlySpider extends DeadlyAnimal
+{
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DefangedTarantula.java (from rev 2684, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/DefangedTarantula.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DefangedTarantula.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DefangedTarantula.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition;
+
+class DefangedTarantula extends Tarantula
+{
+ @Override public int getDeathsCaused() { return 0; }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodsByBindingTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodsByBindingTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodsByBindingTest.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition;
+
+import java.lang.annotation.Annotation;
+
+import javax.inject.AnnotationLiteral;
+import javax.inject.manager.Bean;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+@Artifact
+public class DisposalMethodsByBindingTest extends AbstractJSR299Test
+{
+ private static final Annotation DEADLIEST_LITERAL = new AnnotationLiteral<Deadliest>() {};
+
+ @Test(groups = { "broken" })
+ @SpecAssertion(section = "2.3.6", id = "c")
+ public void testBindingTypesAppliedToDisposalMethodParameters()
+ {
+ //TODO Fix this test copied from proposal method tests which is not working here
+ Bean<Tarantula> tarantula = getCurrentManager().resolveByType(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
+ Tarantula instance = getCurrentManager().getInstance(tarantula);
+ assert instance.getDeathsCaused() == 1;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodsByBindingTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Spider.java (from rev 2684, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/Spider.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Spider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Spider.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition;
+
+
+class Spider implements Animal
+{
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java (from rev 2684, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/SpiderProducer.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -0,0 +1,25 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition;
+
+import javax.inject.Current;
+import javax.inject.Produces;
+
+class SpiderProducer
+{
+
+ @Produces @Tame public Tarantula produceTameTarantula()
+ {
+ return new DefangedTarantula();
+ }
+
+ @Produces @Deadliest public Tarantula producesDeadliestTarantula(@Tame Tarantula tameTarantula,
+ @Current Tarantula tarantula)
+ {
+ return tameTarantula.getDeathsCaused() >= tarantula.getDeathsCaused() ?
+ tameTarantula : tarantula;
+ }
+
+ @Produces public Tarantula produceTarantula()
+ {
+ return new Tarantula();
+ }
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Tame.java (from rev 2684, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/Tame.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Tame.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Tame.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition;
+
+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;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Tame
+{
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Tarantula.java (from rev 2684, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/Tarantula.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Tarantula.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/Tarantula.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition;
+
+class Tarantula extends Spider implements DeadlySpider
+{
+ public int getDeathsCaused() { return 1; }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/ChickenInterface.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/ChickenInterface.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/ChickenInterface.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.initializer;
+
+interface ChickenInterface
+{
+ public String getName();
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/ChickenInterface.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java 2009-05-11 22:09:53 UTC (rev 2684)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -17,6 +17,19 @@
public class InitializerMethodTest extends AbstractJSR299Test
{
+ @Test(groups = { "initializerMethod" })
+ @SpecAssertions({
+ @SpecAssertion(section = "2.3.6", id = "b"),
+ @SpecAssertion(section = "3.9", id = "d")
+ })
+ public void testBindingTypeOnInitializerParameter()
+ {
+ PremiumChickenHutch hutch = getCurrentManager().getInstanceByType(PremiumChickenHutch.class);
+ assert hutch.getChicken().getName().equals("Preferred");
+ StandardChickenHutch anotherHutch = getCurrentManager().getInstanceByType(StandardChickenHutch.class);
+ assert anotherHutch.getChicken().getName().equals("Standard");
+ }
+
@Test(groups = { "stub", "initializerMethod", "servlet", "integration" })
@SpecAssertion(section = "3.9", id = "d")
public void testInitializerMethodCalledOnServlet()
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/Preferred.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/Preferred.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/Preferred.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.implementation.initializer;
+
+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.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.BindingType;
+
+@Retention(RUNTIME)
+@Target({TYPE, METHOD, FIELD, PARAMETER})
+@BindingType
+@interface Preferred
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/Preferred.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/PreferredChicken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/PreferredChicken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/PreferredChicken.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.implementation.initializer;
+
+@Preferred
+class PreferredChicken implements ChickenInterface
+{
+
+ public String getName()
+ {
+ return "Preferred";
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/PreferredChicken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/PremiumChickenHutch.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/PremiumChickenHutch.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/PremiumChickenHutch.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.implementation.initializer;
+
+import javax.inject.Initializer;
+
+class PremiumChickenHutch
+{
+ private ChickenInterface chicken;
+
+ @Initializer
+ public void setChicken(@Preferred ChickenInterface chicken)
+ {
+ this.chicken = chicken;
+ }
+
+ public ChickenInterface getChicken()
+ {
+ return chicken;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/PremiumChickenHutch.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/StandardChicken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/StandardChicken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/StandardChicken.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.implementation.initializer;
+
+@StandardVariety
+class StandardChicken implements ChickenInterface
+{
+
+ public String getName()
+ {
+ return "Standard";
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/StandardChicken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/StandardChickenHutch.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/StandardChickenHutch.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/StandardChickenHutch.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.implementation.initializer;
+
+import javax.inject.Initializer;
+
+class StandardChickenHutch
+{
+ private ChickenInterface chicken;
+
+ @Initializer
+ public void setChicken(@StandardVariety ChickenInterface chicken)
+ {
+ this.chicken = chicken;
+ }
+
+ public ChickenInterface getChicken()
+ {
+ return chicken;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/StandardChickenHutch.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/StandardVariety.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/StandardVariety.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/StandardVariety.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.implementation.initializer;
+
+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.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.BindingType;
+
+@Retention(RUNTIME)
+@Target({TYPE, METHOD, FIELD, PARAMETER})
+@BindingType
+@interface StandardVariety
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/StandardVariety.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/AnnotationTypesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/AnnotationTypesTest.java 2009-05-11 22:09:53 UTC (rev 2684)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/AnnotationTypesTest.java 2009-05-13 21:19:31 UTC (rev 2685)
@@ -17,6 +17,7 @@
{
@Test(groups = { "ri-broken", "xml" })
@SpecAssertions({
+ @SpecAssertion(section="2.3.2", id="c"),
@SpecAssertion(section="9.4", id="a")
})
public void testBindingTypeFromXML()
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2684 - extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/discovery.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-05-11 18:09:53 -0400 (Mon, 11 May 2009)
New Revision: 2684
Modified:
extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/discovery/ServletWebBeanDiscovery.java
Log:
WEB-INF/beans.xml should be added even if the WEB-INF/classes directory doesn't exist
Modified: extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/discovery/ServletWebBeanDiscovery.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/discovery/ServletWebBeanDiscovery.java 2009-05-11 20:03:08 UTC (rev 2683)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/discovery/ServletWebBeanDiscovery.java 2009-05-11 22:09:53 UTC (rev 2684)
@@ -84,12 +84,12 @@
URL beans = servletContext.getResource(WEB_INF_BEANS_XML);
if (beans != null)
{
+ wbUrls.add(beans); // this is consistent with how the JBoss webbeans.deployer works
File webInfClasses = Servlets.getRealFile(servletContext, WEB_INF_CLASSES);
if (webInfClasses != null)
{
File[] files = { webInfClasses };
scanner.scanDirectories(files);
- wbUrls.add(beans);
}
}
}
15 years, 6 months