[webbeans-commits] Webbeans SVN: r1543 - in tck/trunk/impl/src/main: resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-02-16 12:59:43 -0500 (Mon, 16 Feb 2009)
New Revision: 1543
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/beans.xml
Log:
Fixed broken test with specialization.
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/SimpleBeanSpecializationTest.java 2009-02-16 17:56:56 UTC (rev 1542)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/SimpleBeanSpecializationTest.java 2009-02-16 17:59:43 UTC (rev 1543)
@@ -65,7 +65,7 @@
}.run();
}
- @Test( groups = "broken" )
+ @Test
@SpecAssertion(section = "4.3.1", id = "g")
public void testProducerMethodOnSpecializedBeanCalledOnSpecializingBean() throws Exception
{
Modified: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/beans.xml 2009-02-16 17:56:56 UTC (rev 1542)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/beans.xml 2009-02-16 17:59:43 UTC (rev 1543)
@@ -2,6 +2,7 @@
xmlns:test="urn:java:org.jboss.jsr299.tck.unit.inheritance.specialization.simple">
<Deploy>
<Standard />
+ <Production />
<test:AnotherDeploymentType />
</Deploy>
</Beans>
17 years, 1 month
[webbeans-commits] Webbeans SVN: r1542 - ri/trunk/jboss-tck-runner.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-02-16 12:56:56 -0500 (Mon, 16 Feb 2009)
New Revision: 1542
Modified:
ri/trunk/jboss-tck-runner/pom.xml
Log:
oops
Modified: ri/trunk/jboss-tck-runner/pom.xml
===================================================================
--- ri/trunk/jboss-tck-runner/pom.xml 2009-02-16 17:36:45 UTC (rev 1541)
+++ ri/trunk/jboss-tck-runner/pom.xml 2009-02-16 17:56:56 UTC (rev 1542)
@@ -48,7 +48,6 @@
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-client</artifactId>
- <scope>test</scope>
<type>pom</type>
</dependency>
17 years, 1 month
[webbeans-commits] Webbeans SVN: r1541 - ri/trunk/jboss-tck-runner/src/main/resources/META-INF and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-02-16 12:36:45 -0500 (Mon, 16 Feb 2009)
New Revision: 1541
Added:
ri/trunk/jboss-tck-runner/src/main/java/org/jboss/webbeans/tck/integration/jbossas/ProfileServiceContainersImpl.java
Modified:
ri/trunk/jboss-tck-runner/src/main/resources/META-INF/web-beans-tck.properties
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractDeclarativeTest.java
Log:
Use profileservice to deploy tests
Added: ri/trunk/jboss-tck-runner/src/main/java/org/jboss/webbeans/tck/integration/jbossas/ProfileServiceContainersImpl.java
===================================================================
--- ri/trunk/jboss-tck-runner/src/main/java/org/jboss/webbeans/tck/integration/jbossas/ProfileServiceContainersImpl.java (rev 0)
+++ ri/trunk/jboss-tck-runner/src/main/java/org/jboss/webbeans/tck/integration/jbossas/ProfileServiceContainersImpl.java 2009-02-16 17:36:45 UTC (rev 1541)
@@ -0,0 +1,106 @@
+package org.jboss.webbeans.tck.integration.jbossas;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.naming.InitialContext;
+
+import org.apache.log4j.Logger;
+import org.jboss.deployers.spi.management.deploy.DeploymentManager;
+import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
+import org.jboss.jsr299.tck.api.DeploymentException;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.ProfileService;
+import org.jboss.test.JBossTestServices;
+import org.jboss.virtual.VFS;
+
+public class ProfileServiceContainersImpl extends AbstractContainersImpl
+{
+
+ private Logger log = Logger.getLogger(ProfileServiceContainersImpl.class);
+
+ private DeploymentManager deploymentManager;
+ private JBossTestServices testServices;
+ private final File tmpdir;
+
+
+ public ProfileServiceContainersImpl() throws Exception
+ {
+ this.testServices = new JBossTestServices(JBossTestServicesContainersImpl.class);
+ this.testServices.setUpLogging();
+ this.testServices.init();
+ tmpdir = new File(System.getProperty("java.io.tmpdir"), "org.jboss.webbeans.tck.integration.jbossas");
+ tmpdir.mkdir();
+ tmpdir.deleteOnExit();
+ }
+
+
+ @Override
+ public void setup() throws IOException
+ {
+ super.setup();
+
+ }
+
+ public void deploy(InputStream archiveStream, String name) throws DeploymentException, IOException
+ {
+ Exception failure = null;
+ try
+ {
+ File archive = new File(tmpdir, name);
+ archive.deleteOnExit();
+ copy(archiveStream, archive);
+ DeploymentProgress distribute = deploymentManager.distribute(name, DeploymentPhase.APPLICATION, archive.toURI().toURL(), true);
+ distribute.run();
+ DeploymentProgress progress = deploymentManager.start(DeploymentPhase.APPLICATION, name);
+ progress.run();
+ DeploymentStatus status = progress.getDeploymentStatus();
+ if (status.isFailed())
+ {
+ failure = status.getFailure();
+ undeploy(name);
+ }
+ }
+ catch (Exception e)
+ {
+ throw new IOException(e);
+ }
+ if (failure != null)
+ {
+ throw new DeploymentException(failure);
+ }
+ }
+
+ public void undeploy(String name) throws DeploymentException, IOException
+ {
+ try
+ {
+ deploymentManager.stop(DeploymentPhase.APPLICATION, name).run();
+ deploymentManager.undeploy(DeploymentPhase.APPLICATION, name).run();
+ }
+ catch (Exception e)
+ {
+ throw new IOException(e);
+ }
+ }
+
+ /**
+ * Obtain the Deployment Manager
+ * @throws Exception
+ */
+ protected void initDeploymentManager() throws Exception
+ {
+ String profileName = "default";
+ InitialContext ctx = testServices.getInitialContext();
+ ProfileService ps = (ProfileService) ctx.lookup("ProfileService");
+ deploymentManager = ps.getDeploymentManager();
+ ProfileKey defaultKey = new ProfileKey(profileName);
+ deploymentManager.loadProfile(defaultKey, false);
+ // Init the VFS to setup the vfs* protocol handlers
+ VFS.init();
+ }
+
+}
Property changes on: ri/trunk/jboss-tck-runner/src/main/java/org/jboss/webbeans/tck/integration/jbossas/ProfileServiceContainersImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/jboss-tck-runner/src/main/resources/META-INF/web-beans-tck.properties
===================================================================
--- ri/trunk/jboss-tck-runner/src/main/resources/META-INF/web-beans-tck.properties 2009-02-16 17:22:31 UTC (rev 1540)
+++ ri/trunk/jboss-tck-runner/src/main/resources/META-INF/web-beans-tck.properties 2009-02-16 17:36:45 UTC (rev 1541)
@@ -1,4 +1,4 @@
-org.jboss.jsr299.tck.spi.Containers=org.jboss.webbeans.tck.integration.jbossas.JBossTestServicesContainersImpl
+org.jboss.jsr299.tck.spi.Containers=org.jboss.webbeans.tck.integration.jbossas.ProfileServiceContainersImpl
org.jboss.jsr299.tck.api.TestLauncher=org.jboss.jsr299.tck.impl.runner.servlet.ServletTestLauncher
org.jboss.jsr299.tck.connectDelay=1500
org.jboss.jsr299.tck.connectRetries=8
\ No newline at end of file
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractDeclarativeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractDeclarativeTest.java 2009-02-16 17:22:31 UTC (rev 1540)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractDeclarativeTest.java 2009-02-16 17:36:45 UTC (rev 1541)
@@ -162,7 +162,10 @@
@AfterSuite(alwaysRun=true)
public void afterSuite() throws Exception
{
- log.info("Ran " + numberOfTestsRunInContainer + " tests in the container");
+ if (!isInContainer())
+ {
+ log.info("Ran " + numberOfTestsRunInContainer + " tests in the container");
+ }
if (isSuiteDeployingTestsToContainer())
{
getCurrentConfiguration().getContainers().cleanup();
17 years, 1 month
[webbeans-commits] Webbeans SVN: r1540 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken and 16 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-02-16 12:22:31 -0500 (Mon, 16 Feb 2009)
New Revision: 1540
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/extendejb/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/extendejb/FarmEquipment.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/extendejb/SpecializingBeanExtendsEnterpriseBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/extendejb/Tractor_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/FarmYard_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/SpecializingAndSpecializedBeanHasNameTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/Yard.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/Animal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/Donkey_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/SpecializingBeanImplementsInterfaceOnly.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/Cow_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/SpecializingBeanExtendsNothingTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/precedence/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/precedence/Farmer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/precedence/Landowner.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/precedence/OrganicFarmer_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/precedence/SpecializingBeanWithLowerPrecedenceTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/Farmer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/FishFarmer_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/Landowner.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/SheepFarmer_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/TwoSpecializingBeansForOneSpecializedTest.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/beans.xml
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Cow_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Donkey_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/FarmEquipment.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/FarmYard_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/FishFarmer_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/OrganicFarmer_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/SheepFarmer_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Tractor_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Yard.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Refactored the simple bean specialization tests.
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Cow_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Cow_Broken.java 2009-02-16 13:38:05 UTC (rev 1539)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Cow_Broken.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -1,10 +0,0 @@
-package org.jboss.jsr299.tck.unit.inheritance.specialization.simple;
-
-import javax.inject.Specializes;
-
-@Specializes
-@AnotherDeploymentType
-class Cow_Broken
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Donkey_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Donkey_Broken.java 2009-02-16 13:38:05 UTC (rev 1539)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Donkey_Broken.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -1,10 +0,0 @@
-package org.jboss.jsr299.tck.unit.inheritance.specialization.simple;
-
-import javax.inject.Specializes;
-
-@Specializes
-@AnotherDeploymentType
-class Donkey_Broken implements Animal
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/FarmEquipment.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/FarmEquipment.java 2009-02-16 13:38:05 UTC (rev 1539)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/FarmEquipment.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -1,12 +0,0 @@
-package org.jboss.jsr299.tck.unit.inheritance.specialization.simple;
-
-import javax.annotation.Named;
-import javax.ejb.Stateful;
-
-
-@Named("plough")
-@Stateful
-class FarmEquipment
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/FarmYard_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/FarmYard_Broken.java 2009-02-16 13:38:05 UTC (rev 1539)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/FarmYard_Broken.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -1,12 +0,0 @@
-package org.jboss.jsr299.tck.unit.inheritance.specialization.simple;
-
-import javax.annotation.Named;
-import javax.inject.Specializes;
-
-@Specializes
-@AnotherDeploymentType
-@Named
-class FarmYard_Broken extends Yard
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/FishFarmer_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/FishFarmer_Broken.java 2009-02-16 13:38:05 UTC (rev 1539)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/FishFarmer_Broken.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -1,10 +0,0 @@
-package org.jboss.jsr299.tck.unit.inheritance.specialization.simple;
-
-import javax.inject.Specializes;
-
-@Specializes
-@AnotherDeploymentType
-class FishFarmer_Broken extends Farmer
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/OrganicFarmer_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/OrganicFarmer_Broken.java 2009-02-16 13:38:05 UTC (rev 1539)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/OrganicFarmer_Broken.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -1,9 +0,0 @@
-package org.jboss.jsr299.tck.unit.inheritance.specialization.simple;
-
-import javax.inject.Specializes;
-
-@Specializes
-class OrganicFarmer_Broken extends Farmer
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/SheepFarmer_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/SheepFarmer_Broken.java 2009-02-16 13:38:05 UTC (rev 1539)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/SheepFarmer_Broken.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -1,9 +0,0 @@
-package org.jboss.jsr299.tck.unit.inheritance.specialization.simple;
-
-import javax.inject.Specializes;
-
-@Specializes @AnotherDeploymentType
-class SheepFarmer_Broken extends Farmer
-{
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/SimpleBeanSpecializationTest.java 2009-02-16 13:38:05 UTC (rev 1539)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/SimpleBeanSpecializationTest.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -3,14 +3,14 @@
import static org.jboss.jsr299.tck.impl.util.Reflections.annotationSetMatches;
import java.lang.annotation.Annotation;
-import java.util.ArrayList;
-import java.util.List;
import javax.inject.AnnotationLiteral;
import javax.inject.DefinitionException;
import javax.inject.InconsistentSpecializationException;
import org.jboss.jsr299.tck.AbstractDeclarativeTest;
+import org.jboss.jsr299.tck.impl.packaging.Artifact;
+import org.jboss.jsr299.tck.impl.packaging.jsr299.BeansXml;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.testng.annotations.Test;
@@ -19,125 +19,68 @@
* Spec version: PRD2
*
*/
+@Artifact
+@BeansXml("beans.xml")
public class SimpleBeanSpecializationTest extends AbstractDeclarativeTest
{
-
- @Override
- protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
+
+ private static Annotation LANDOWNER_LITERAL = new AnnotationLiteral<Landowner>()
{
- List<Class<? extends Annotation>> deploymentTypes = new ArrayList<Class<? extends Annotation>>();
- deploymentTypes.addAll(getStandardDeploymentTypes());
- deploymentTypes.add(AnotherDeploymentType.class);
- return deploymentTypes;
- }
-
- private static Annotation LANDOWNER_LITERAL = new AnnotationLiteral<Landowner>() {};
+ };
+ @SuppressWarnings("unchecked")
@Test
- @SpecAssertions({
- @SpecAssertion(section = "4.3.1", id = "unknown"),
- @SpecAssertion(section = "3.2.7", id = "unknown")
- })
+ @SpecAssertions( { @SpecAssertion(section = "4.3.1", id = "c"), @SpecAssertion(section = "3.2.7", id = "a") })
public void testSpecializingBeanHasBindingsOfSpecializedAndSpecializingBean()
{
- deployBeans(LazyFarmer.class);
assert getCurrentManager().resolveByType(Farmer.class, LANDOWNER_LITERAL).size() == 1;
assert getCurrentManager().resolveByType(Farmer.class, LANDOWNER_LITERAL).iterator().next().getTypes().contains(LazyFarmer.class);
assert getCurrentManager().resolveByType(Farmer.class, LANDOWNER_LITERAL).iterator().next().getBindings().size() == 2;
- assert annotationSetMatches( getCurrentManager().resolveByType(Farmer.class, LANDOWNER_LITERAL).iterator().next().getBindings(), Landowner.class, Lazy.class);
+ assert annotationSetMatches(getCurrentManager().resolveByType(Farmer.class, LANDOWNER_LITERAL).iterator().next().getBindings(), Landowner.class, Lazy.class);
}
-
+
@Test
- @SpecAssertions({
- @SpecAssertion(section = "4.3.1", id = "unknown"),
- @SpecAssertion(section = "3.2.7", id = "unknown")
- })
+ @SpecAssertions( { @SpecAssertion(section = "4.3.1", id = "d"), @SpecAssertion(section = "3.2.7", id = "a") })
public void testSpecializingBeanHasNameOfSpecializedBean()
{
- deployBeans(LazyFarmer.class);
assert getCurrentManager().resolveByType(Farmer.class, LANDOWNER_LITERAL).size() == 1;
assert getCurrentManager().resolveByType(Farmer.class, LANDOWNER_LITERAL).iterator().next().getTypes().contains(LazyFarmer.class);
assert getCurrentManager().resolveByType(Farmer.class, LANDOWNER_LITERAL).iterator().next().getName().equals("farmer");
}
-
- @Test(expectedExceptions=DefinitionException.class)
- @SpecAssertion(section = "4.3.1", id = "unknown")
- public void testSpecializingAndSpecializedBeanHasName()
- {
- deployBeans(FarmYard_Broken.class);
- }
-
+
@Test
- @SpecAssertions({
- @SpecAssertion(section = "4.3.1", id = "unknown"),
- @SpecAssertion(section = "3.2.7", id = "unknown")
- })
+ @SpecAssertions( { @SpecAssertion(section = "4.3.1", id = "f"), @SpecAssertion(section = "3.2.7", id = "b") })
public void testSpecializedBeanNotInstantiated() throws Exception
{
- deployBeans(LazyFarmer.class, Farmer.class);
new RunInDependentContext()
{
-
+
@Override
protected void execute() throws Exception
{
Farmer farmer = getCurrentManager().getInstanceByType(Farmer.class, LANDOWNER_LITERAL);
assert farmer.getClassName().equals(LazyFarmer.class.getName());
}
-
+
}.run();
}
-
- @Test(expectedExceptions=InconsistentSpecializationException.class)
- @SpecAssertion(section="4.3.1", id = "unknown")
- public void testSpecializingBeanDoesNotHaveHigherPrecedenceThanSpecializedBean()
- {
- deployBeans(OrganicFarmer_Broken.class);
- }
-
- @Test @SpecAssertion(section="4.3.1", id = "unknown")
+
+ @Test( groups = "broken" )
+ @SpecAssertion(section = "4.3.1", id = "g")
public void testProducerMethodOnSpecializedBeanCalledOnSpecializingBean() throws Exception
{
- deployBeans(Office.class, Building.class);
+// deployBeans(Office.class, Building.class);
new RunInDependentContext()
{
-
+
@Override
protected void execute() throws Exception
{
assert getCurrentManager().resolveByType(Waste.class).size() == 1;
assert getCurrentManager().getInstanceByType(Waste.class).getFrom().equals(Office.class.getName());
}
-
+
}.run();
}
-
- @Test(expectedExceptions=InconsistentSpecializationException.class)
- @SpecAssertion(section="4.3.1", id = "unknown")
- public void testTwoBeansSpecializeTheSameBean()
- {
- deployBeans(SheepFarmer_Broken.class, FishFarmer_Broken.class);
- }
-
- @Test(groups={"specialization"},expectedExceptions=DefinitionException.class)
- @SpecAssertion(section="3.2.7", id = "unknown")
- public void testSpecializingClassDirectlyExtendsEnterpriseBean()
- {
- deployBeans(FarmEquipment.class, Tractor_Broken.class);
- }
-
- @Test(groups={"specialization"},expectedExceptions=DefinitionException.class)
- @SpecAssertion(section="3.2.7", id = "unknown")
- public void testSpecializingClassDirectlyExtendsNothing()
- {
- deployBeans(Cow_Broken.class);
- }
-
- @Test(groups={"specialization"},expectedExceptions=DefinitionException.class)
- @SpecAssertion(section="3.2.7", id = "unknown")
- public void testSpecializingClassImplementsInterfaceAndExtendsNothing()
- {
- deployBeans(Donkey_Broken.class);
- }
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Tractor_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Tractor_Broken.java 2009-02-16 13:38:05 UTC (rev 1539)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Tractor_Broken.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -1,10 +0,0 @@
-package org.jboss.jsr299.tck.unit.inheritance.specialization.simple;
-
-import javax.inject.Specializes;
-
-@Specializes
-@AnotherDeploymentType
-class Tractor_Broken extends FarmEquipment
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Yard.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Yard.java 2009-02-16 13:38:05 UTC (rev 1539)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Yard.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -1,9 +0,0 @@
-package org.jboss.jsr299.tck.unit.inheritance.specialization.simple;
-
-import javax.annotation.Named;
-
-@Named("backyard")
-class Yard
-{
-
-}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/extendejb/FarmEquipment.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/extendejb/FarmEquipment.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/extendejb/FarmEquipment.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.extendejb;
+
+import javax.annotation.Named;
+import javax.ejb.Stateful;
+
+
+@Named("plough")
+@Stateful
+class FarmEquipment
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/extendejb/SpecializingBeanExtendsEnterpriseBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/extendejb/SpecializingBeanExtendsEnterpriseBeanTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/extendejb/SpecializingBeanExtendsEnterpriseBeanTest.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.extendejb;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.impl.packaging.Artifact;
+import org.jboss.jsr299.tck.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class SpecializingBeanExtendsEnterpriseBeanTest
+{
+ @Test(groups = { "specialization" })
+ @SpecAssertion(section = "3.2.7", id = "a")
+ public void testSpecializingClassDirectlyExtendsEnterpriseBean()
+ {
+ }
+
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/extendejb/Tractor_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/extendejb/Tractor_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/extendejb/Tractor_Broken.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.extendejb;
+
+import javax.inject.Specializes;
+
+import org.jboss.jsr299.tck.unit.implementation.producer.field.AnotherDeploymentType;
+
+@Specializes
+@AnotherDeploymentType
+class Tractor_Broken extends FarmEquipment
+{
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/AnotherDeploymentType.java (from rev 1539, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/AnotherDeploymentType.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/AnotherDeploymentType.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.names;
+
+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/unit/inheritance/specialization/simple/broken/names/FarmYard_Broken.java (from rev 1539, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/FarmYard_Broken.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/FarmYard_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/FarmYard_Broken.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.names;
+
+import javax.annotation.Named;
+import javax.inject.Specializes;
+
+@Specializes
+@AnotherDeploymentType
+@Named
+class FarmYard_Broken extends Yard
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/FarmYard_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/SpecializingAndSpecializedBeanHasNameTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/SpecializingAndSpecializedBeanHasNameTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/SpecializingAndSpecializedBeanHasNameTest.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.names;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.impl.packaging.Artifact;
+import org.jboss.jsr299.tck.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class SpecializingAndSpecializedBeanHasNameTest
+{
+ @Test
+ @SpecAssertion(section = "4.3.1", id = "e")
+ public void testSpecializingAndSpecializedBeanHasName()
+ {
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/SpecializingAndSpecializedBeanHasNameTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/Yard.java (from rev 1539, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Yard.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/Yard.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/Yard.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.names;
+
+import javax.annotation.Named;
+
+@Named("backyard")
+class Yard
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/Yard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/Animal.java (from rev 1539, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Animal.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/Animal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/Animal.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.noextend1;
+
+interface Animal
+{
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/AnotherDeploymentType.java (from rev 1539, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/AnotherDeploymentType.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/AnotherDeploymentType.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.noextend1;
+
+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/unit/inheritance/specialization/simple/broken/noextend1/Donkey_Broken.java (from rev 1539, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Donkey_Broken.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/Donkey_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/Donkey_Broken.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.noextend1;
+
+import javax.inject.Specializes;
+
+@Specializes
+@AnotherDeploymentType
+class Donkey_Broken implements Animal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/Donkey_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/SpecializingBeanImplementsInterfaceOnly.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/SpecializingBeanImplementsInterfaceOnly.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/SpecializingBeanImplementsInterfaceOnly.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.noextend1;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.impl.packaging.Artifact;
+import org.jboss.jsr299.tck.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class SpecializingBeanImplementsInterfaceOnly
+{
+ @Test(groups = { "specialization" })
+ @SpecAssertion(section = "3.2.7", id = "a")
+ public void testSpecializingClassImplementsInterfaceAndExtendsNothing()
+ {
+ }
+
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/SpecializingBeanImplementsInterfaceOnly.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/AnotherDeploymentType.java (from rev 1539, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/AnotherDeploymentType.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/AnotherDeploymentType.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.noextend2;
+
+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/unit/inheritance/specialization/simple/broken/noextend2/Cow_Broken.java (from rev 1539, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Cow_Broken.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/Cow_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/Cow_Broken.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.noextend2;
+
+import javax.inject.Specializes;
+
+@Specializes
+@AnotherDeploymentType
+class Cow_Broken
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/Cow_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/SpecializingBeanExtendsNothingTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/SpecializingBeanExtendsNothingTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/SpecializingBeanExtendsNothingTest.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.noextend2;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.impl.packaging.Artifact;
+import org.jboss.jsr299.tck.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class SpecializingBeanExtendsNothingTest
+{
+ @Test(groups = { "specialization" })
+ @SpecAssertion(section = "3.2.7", id = "a")
+ public void testSpecializingClassDirectlyExtendsNothing()
+ {
+ }
+
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/SpecializingBeanExtendsNothingTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/precedence/Farmer.java (from rev 1539, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Farmer.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/precedence/Farmer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/precedence/Farmer.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.precedence;
+
+import javax.annotation.Named;
+
+@Landowner
+@Named
+class Farmer
+{
+
+ public String getClassName()
+ {
+ return Farmer.class.getName();
+ }
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/precedence/Landowner.java (from rev 1539, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Landowner.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/precedence/Landowner.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/precedence/Landowner.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.precedence;
+
+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 Landowner
+{
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/precedence/OrganicFarmer_Broken.java (from rev 1539, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/OrganicFarmer_Broken.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/precedence/OrganicFarmer_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/precedence/OrganicFarmer_Broken.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.precedence;
+
+import javax.inject.Specializes;
+
+@Specializes
+class OrganicFarmer_Broken extends Farmer
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/precedence/SpecializingBeanWithLowerPrecedenceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/precedence/SpecializingBeanWithLowerPrecedenceTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/precedence/SpecializingBeanWithLowerPrecedenceTest.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.precedence;
+
+import javax.inject.InconsistentSpecializationException;
+
+import org.jboss.jsr299.tck.impl.packaging.Artifact;
+import org.jboss.jsr299.tck.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)ExpectedDeploymentException(InconsistentSpecializationException.class)
+public class SpecializingBeanWithLowerPrecedenceTest
+{
+ @Test
+ public void testSpecializingBeanDoesNotHaveHigherPrecedenceThanSpecializedBean()
+ {
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/precedence/SpecializingBeanWithLowerPrecedenceTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/AnotherDeploymentType.java (from rev 1539, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/AnotherDeploymentType.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/AnotherDeploymentType.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.two;
+
+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/unit/inheritance/specialization/simple/broken/two/Farmer.java (from rev 1539, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Farmer.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/Farmer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/Farmer.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.two;
+
+import javax.annotation.Named;
+
+
+@Landowner
+@Named
+class Farmer
+{
+
+ public String getClassName()
+ {
+ return Farmer.class.getName();
+ }
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/FishFarmer_Broken.java (from rev 1539, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/FishFarmer_Broken.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/FishFarmer_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/FishFarmer_Broken.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.two;
+
+import javax.inject.Specializes;
+
+import org.jboss.jsr299.tck.unit.implementation.producer.field.AnotherDeploymentType;
+
+@Specializes
+@AnotherDeploymentType
+class FishFarmer_Broken extends Farmer
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/FishFarmer_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/Landowner.java (from rev 1539, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/Landowner.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/Landowner.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/Landowner.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.two;
+
+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 Landowner
+{
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/SheepFarmer_Broken.java (from rev 1539, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/SheepFarmer_Broken.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/SheepFarmer_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/SheepFarmer_Broken.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.two;
+
+import javax.inject.Specializes;
+
+@Specializes @AnotherDeploymentType
+class SheepFarmer_Broken extends Farmer
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/SheepFarmer_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/TwoSpecializingBeansForOneSpecializedTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/TwoSpecializingBeansForOneSpecializedTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/TwoSpecializingBeansForOneSpecializedTest.java 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.two;
+
+import javax.inject.InconsistentSpecializationException;
+
+import org.jboss.jsr299.tck.impl.packaging.Artifact;
+import org.jboss.jsr299.tck.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)ExpectedDeploymentException(InconsistentSpecializationException.class)
+public class TwoSpecializingBeansForOneSpecializedTest
+{
+ @Test
+ public void testTwoBeansSpecializeTheSameBean()
+ {
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/TwoSpecializingBeansForOneSpecializedTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/beans.xml (from rev 1537, tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/definition/deployment/custom/beans.xml)
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/beans.xml 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,7 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.unit.inheritance.specialization.simple">
+ <Deploy>
+ <Standard />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/beans.xml 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,7 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.names">
+ <Deploy>
+ <Standard />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/names/beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/beans.xml 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,7 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.noextend1">
+ <Deploy>
+ <Standard />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend1/beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/beans.xml 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,7 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.noextend2">
+ <Deploy>
+ <Standard />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/noextend2/beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/beans.xml 2009-02-16 17:22:31 UTC (rev 1540)
@@ -0,0 +1,7 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.unit.inheritance.specialization.simple.broken.two">
+ <Deploy>
+ <Standard />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/unit/inheritance/specialization/simple/broken/two/beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-02-16 13:38:05 UTC (rev 1539)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-02-16 17:22:31 UTC (rev 1540)
@@ -1850,14 +1850,22 @@
</assertion>
<assertion id="d">
- <text>If a bean X specializes a lower-priority bean Y with a name, the name of X is the same as the name of Y. If X declares a name explicitly, a DefinitionException is thrown by the container at deployment time</text>
+ <text>If a bean X specializes a lower-priority bean Y with a name, the name of X is the same as the name of Y.</text>
</assertion>
<assertion id="e">
- <text>When an enabled bean specializes a lower-priority bean, we can be certain that the lower-priority bean is never instantiated or called by the container. Even if the lower-priority bean defines a producer method, the method will be called upon an instance of the first bean</text>
+ <text>If a bean X specializes a lower-priority bean Y with a name, and X declares a name explicitly, a DefinitionException is thrown by the container at deployment time</text>
</assertion>
<assertion id="f">
+ <text>When an enabled bean specializes a lower-priority bean, we can be certain that the lower-priority bean is never instantiated or called by the container.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Even if the lower-priority bean defines a producer method, the method will be called upon an instance of the specializing bean</text>
+ </assertion>
+
+ <assertion id="h">
<text>Specialization applies only to simple beans, as defined in Section 3.2.7, "Specializing a simple bean", session beans, as defined in Section 3.3.7, "Specializing a session bean" and producer methods, as defined in Section 3.4.5, "Specializing a producer method".</text>
</assertion>
</section>
17 years, 1 month
[webbeans-commits] Webbeans SVN: r1539 - in tck/trunk: impl and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-02-16 08:38:05 -0500 (Mon, 16 Feb 2009)
New Revision: 1539
Modified:
tck/trunk/api/pom.xml
tck/trunk/impl/pom.xml
Log:
minor
Modified: tck/trunk/api/pom.xml
===================================================================
--- tck/trunk/api/pom.xml 2009-02-16 11:54:02 UTC (rev 1538)
+++ tck/trunk/api/pom.xml 2009-02-16 13:38:05 UTC (rev 1539)
@@ -57,42 +57,4 @@
</plugins>
</build>
- <profiles>
- <profile>
- <id>write-artifacts-to-disk</id>
- <activation>
- <property>
- <name>dumpArtifacts</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <configuration>
- <tasks>
- <java classname="org.jboss.jsr299.tck.api.TCK" classpathref="maven.compile.classpath" failonerror="true" fork="true">
- <jvmarg line="-DdumpArtifacts=true"/>
- <jvmarg line="-Dorg.jboss.jsr299.tck.outputDirectory=${project.build.directory}/jsr299-artifacts" />
- <jvmarg line="-Dorg.jboss.jsr299.tck.libraryDirectory=${libraryDirectory}" />
- </java>
- <echo>Dumped artifacts to ${project.build.directory}/jsr299-artifacts</echo>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
</project>
Modified: tck/trunk/impl/pom.xml
===================================================================
--- tck/trunk/impl/pom.xml 2009-02-16 11:54:02 UTC (rev 1538)
+++ tck/trunk/impl/pom.xml 2009-02-16 13:38:05 UTC (rev 1539)
@@ -213,6 +213,41 @@
</plugins>
</build>
</profile>
+ <profile>
+ <id>write-artifacts-to-disk</id>
+ <activation>
+ <property>
+ <name>dumpArtifacts</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>package</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <java classname="org.jboss.jsr299.tck.api.TCK" classpathref="maven.compile.classpath" failonerror="true" fork="true">
+ <jvmarg line="-DdumpArtifacts=true"/>
+ <jvmarg line="-Dorg.jboss.jsr299.tck.outputDirectory=${project.build.directory}/jsr299-artifacts" />
+ <jvmarg line="-Dorg.jboss.jsr299.tck.libraryDirectory=${libraryDirectory}" />
+ </java>
+ <echo>Dumped artifacts to ${project.build.directory}/jsr299-artifacts</echo>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
17 years, 1 month
[webbeans-commits] Webbeans SVN: r1538 - in ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans: context/beanmap and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2009-02-16 06:54:02 -0500 (Mon, 16 Feb 2009)
New Revision: 1538
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/AbstractBeanMapContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanmap/AbstractBeanMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ConversationEntry.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ServletConversationManager.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/jsf/JSFHelper.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/jsf/WebBeansPhaseListener.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
Log:
Conversation stuff
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/AbstractBeanMapContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/AbstractBeanMapContext.java 2009-02-16 07:53:42 UTC (rev 1537)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/AbstractBeanMapContext.java 2009-02-16 11:54:02 UTC (rev 1538)
@@ -25,6 +25,9 @@
import javax.inject.manager.Bean;
import org.jboss.webbeans.context.beanmap.BeanMap;
+import org.jboss.webbeans.jsf.JSFHelper;
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
/**
* Base for the Context implementations. Delegates calls to the abstract
@@ -39,6 +42,8 @@
*/
public abstract class AbstractBeanMapContext extends AbstractContext
{
+ private static LogProvider log = Logging.getLogProvider(AbstractBeanMapContext.class);
+
/**
* Constructor
*
@@ -98,6 +103,7 @@
*/
private <T> void destroy(Contextual<T> bean)
{
+ log.trace("Destroying " + bean);
bean.destroy(getBeanMap().get(bean));
}
@@ -106,6 +112,7 @@
*/
public void destroy()
{
+ log.trace("Destroying context");
for (Contextual<? extends Object> bean : getBeanMap().keySet())
{
destroy(bean);
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanmap/AbstractBeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanmap/AbstractBeanMap.java 2009-02-16 07:53:42 UTC (rev 1537)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanmap/AbstractBeanMap.java 2009-02-16 11:54:02 UTC (rev 1538)
@@ -39,7 +39,7 @@
public abstract class AbstractBeanMap implements BeanMap
{
// The log provider
- private static LogProvider log = Logging.getLogProvider(ApplicationBeanMap.class);
+ private static LogProvider log = Logging.getLogProvider(AbstractBeanMap.class);
/**
* Gets a bean from the map
@@ -108,8 +108,10 @@
private List<String> getFilteredAttributeNames()
{
List<String> attributeNames = new ArrayList<String>();
- for (String attributeName : new EnumerationIterable<String>(getAttributeNames()))
+ Enumeration<String> e = getAttributeNames();
+ while (e.hasMoreElements())
{
+ String attributeName = e.nextElement();
if (attributeName.startsWith(getKeyPrefix()))
{
attributeNames.add(attributeName);
@@ -148,7 +150,8 @@
protected abstract void removeAttribute(String key);
/**
- * Gets an enumeration of the attribute names present in the underlying storage
+ * Gets an enumeration of the attribute names present in the underlying
+ * storage
*
* @return The attribute names
*/
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ConversationEntry.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ConversationEntry.java 2009-02-16 07:53:42 UTC (rev 1537)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ConversationEntry.java 2009-02-16 11:54:02 UTC (rev 1538)
@@ -103,6 +103,7 @@
ConversationContext terminationContext = new ConversationContext();
terminationContext.setBeanMap(new ConversationBeanMap(session, cid));
terminationContext.destroy();
+ log.trace("Conversation " + cid + " destroyed");
}
/**
@@ -133,7 +134,7 @@
{
if (concurrencyLock.isHeldByCurrentThread())
{
- log.debug("Unlocked conversation " + cid);
+ log.trace("Unlocked conversation " + cid);
concurrencyLock.unlock();
}
else
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java 2009-02-16 07:53:42 UTC (rev 1537)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java 2009-02-16 11:54:02 UTC (rev 1538)
@@ -24,6 +24,8 @@
import org.jboss.webbeans.WebBean;
import org.jboss.webbeans.conversation.bindings.ConversationInactivityTimeout;
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
/**
* The current conversation implementation
@@ -36,6 +38,9 @@
@WebBean
public class ConversationImpl implements Conversation
{
+
+ private static LogProvider log = Logging.getLogProvider(ConversationImpl.class);
+
// The conversation ID
private String cid;
// Is the conversation long-running?
@@ -61,21 +66,24 @@
{
this.cid = conversationIdGenerator.nextId();
this.timeoutInMilliseconds = timeoutInMilliseconds;
+ log.debug("Created a new conversation " + this);
}
public void begin()
{
+ log.debug("Promoted conversation " + cid + " to long-running");
longRunning = true;
}
public void begin(String id)
{
- longRunning = true;
cid = id;
+ begin();
}
public void end()
{
+ log.debug("Demoted conversation " + cid + " to transient");
longRunning = false;
}
@@ -96,6 +104,7 @@
public void setTimeout(long timeout)
{
+ log.debug("Set timeout of conversation " + cid + " to " + timeout);
this.timeoutInMilliseconds = timeout;
}
@@ -108,9 +117,11 @@
*/
public void switchTo(String cid, boolean longRunning, long timeoutInMilliseconds)
{
+ log.debug("Switched conversation from " + this);
this.cid = cid;
this.longRunning = longRunning;
this.timeoutInMilliseconds = timeoutInMilliseconds;
+ log.debug("to " + this);
}
@Override
@@ -121,6 +132,7 @@
public void setLongRunning(boolean longRunning)
{
+ log.debug("Set conversation " + cid + " to long-running: " + longRunning);
this.longRunning = longRunning;
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ServletConversationManager.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ServletConversationManager.java 2009-02-16 07:53:42 UTC (rev 1537)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ServletConversationManager.java 2009-02-16 11:54:02 UTC (rev 1538)
@@ -22,6 +22,7 @@
import java.util.concurrent.Future;
import javax.context.SessionScoped;
+import javax.faces.context.FacesContext;
import javax.inject.Current;
import javax.inject.Produces;
import javax.servlet.http.HttpSession;
@@ -46,9 +47,9 @@
{
private static LogProvider log = Logging.getLogProvider(ServletConversationManager.class);
- // FIXME short temp
- private static final long CONVERSATION_TIMEOUT_IN_MS = 10 * 30 * 1000;
+ private static final long CONVERSATION_TIMEOUT_IN_MS = 10 * 60 * 1000;
private static final long CONVERSATION_CONCURRENT_ACCESS_TIMEOUT_IN_MS = 1 * 1000;
+ private static final String CONVERSATION_ID_NAME = "cid";
// The conversation terminator
@Current
@@ -106,7 +107,8 @@
@WebBean
public static String getConversationIdName()
{
- return "cid";
+ log.trace("Produced conversation id name " + CONVERSATION_ID_NAME);
+ return CONVERSATION_ID_NAME;
}
public void beginOrRestoreConversation(String cid)
@@ -158,9 +160,11 @@
}
}
+ // TODO: check that stuff gets terminated when you flip between several long-running conversations
public void cleanupConversation()
{
String cid = currentConversation.getId();
+ log.trace("Cleaning up conversations for cid " + cid);
if (currentConversation.isLongRunning())
{
Future<?> terminationHandle = scheduleForTermination(cid);
@@ -180,7 +184,7 @@
ConversationEntry conversationEntry = ConversationEntry.of(cid, terminationHandle);
longRunningConversations.put(cid, conversationEntry);
}
- log.trace("Scheduled " + currentConversation + " for termination");
+ log.trace("Scheduled " + currentConversation + " for termination, there are now " + longRunningConversations.size() + " long-running conversations");
}
else
{
@@ -205,7 +209,7 @@
*/
private Future<?> scheduleForTermination(String cid)
{
- Runnable terminationTask = new TerminationTask(cid);
+ Runnable terminationTask = new TerminationTask(cid, (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true));
return conversationTerminator.scheduleForTermination(terminationTask, inactivityTimeout);
}
@@ -219,15 +223,17 @@
{
// The conversation ID to terminate
private String cid;
+ private HttpSession session;
/**
* Creates a new termination task
*
* @param cid The conversation ID
*/
- public TerminationTask(String cid)
+ public TerminationTask(String cid, HttpSession session)
{
this.cid = cid;
+ this.session = session;
}
/**
@@ -235,14 +241,15 @@
*/
public void run()
{
- log.trace("Conversation " + cid + " timed out. Destroying it");
+ log.debug("Conversation " + cid + " timed out. Destroying it");
longRunningConversations.remove(cid).destroy(session);
+ log.trace("There are now " + longRunningConversations.size() + " long-running conversations");
}
}
public void destroyAllConversations()
{
- log.trace("Destroying " + longRunningConversations.size() + " long-running conversations in session " + session.getId());
+ log.debug("Destroying " + longRunningConversations.size() + " long-running conversations in session " + session.getId());
for (ConversationEntry conversationEntry : longRunningConversations.values())
{
conversationEntry.destroy(session);
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/jsf/JSFHelper.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/jsf/JSFHelper.java 2009-02-16 07:53:42 UTC (rev 1537)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/jsf/JSFHelper.java 2009-02-16 11:54:02 UTC (rev 1538)
@@ -1,3 +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.
+ */
package org.jboss.webbeans.jsf;
import javax.faces.component.html.HtmlInputHidden;
@@ -4,47 +20,101 @@
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpSession;
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+
+/**
+ * Helper class for JSF related operations
+ *
+ * @author Nicklas Karlsson
+ *
+ */
public class JSFHelper
{
+ private static LogProvider log = Logging.getLogProvider(JSFHelper.class);
+
private static final String CONVERSATION_PROPAGATION_COMPONENT_ID = "webbeans_conversation_propagation";
private static final String CONVERSATION_ID_NAME = "cid";
+ /**
+ * Gets a FacesContext instance
+ *
+ * @return The current instance
+ */
+ private static FacesContext context()
+ {
+ return FacesContext.getCurrentInstance();
+ }
+
+ /**
+ * Checks if current request is a JSF postback
+ *
+ * @return True if postback, false otherwise
+ */
public static boolean isPostback()
{
- return FacesContext.getCurrentInstance().getRenderKit().getResponseStateManager().isPostback(FacesContext.getCurrentInstance());
+ return context().getRenderKit().getResponseStateManager().isPostback(context());
}
+ /**
+ * Removes the conversation propagation component from the ui view root
+ */
public static void removePropagationComponent()
{
+ log.debug("Removed propagation component");
HtmlInputHidden propagationComponent = getPropagationComponent();
if (propagationComponent != null)
{
- FacesContext.getCurrentInstance().getViewRoot().getChildren().remove(propagationComponent);
+ context().getViewRoot().getChildren().remove(propagationComponent);
}
}
+ /**
+ * Creates and/or updates the conversation propagation component in the UI view root
+ *
+ * @param cid The conversation id to propagate
+ */
public static void createOrUpdatePropagationComponent(String cid)
{
HtmlInputHidden propagationComponent = getPropagationComponent();
if (propagationComponent == null)
{
- propagationComponent = (HtmlInputHidden) FacesContext.getCurrentInstance().getApplication().createComponent(HtmlInputHidden.COMPONENT_TYPE);
+ log.trace("Created propagation component");
+ propagationComponent = (HtmlInputHidden) context().getApplication().createComponent(HtmlInputHidden.COMPONENT_TYPE);
propagationComponent.setId(CONVERSATION_PROPAGATION_COMPONENT_ID);
- FacesContext.getCurrentInstance().getViewRoot().getChildren().add(propagationComponent);
+ context().getViewRoot().getChildren().add(propagationComponent);
}
+ log.debug("Updated propagation component with cid " + cid);
propagationComponent.setValue(cid);
}
+ /**
+ * Gets the propagation component from the UI view root
+ *
+ * @return The component (or null if not found)
+ */
private static HtmlInputHidden getPropagationComponent()
{
- return (HtmlInputHidden) FacesContext.getCurrentInstance().getViewRoot().findComponent(CONVERSATION_PROPAGATION_COMPONENT_ID);
+ return (HtmlInputHidden) context().getViewRoot().findComponent(CONVERSATION_PROPAGATION_COMPONENT_ID);
}
- private static String getConversationIdFromRequest()
+ /**
+ * Gets the propagated conversation id parameter from the request
+ *
+ * @return The conversation id (or null if not found)
+ */
+ public static String getConversationIdFromRequest()
{
- return FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(CONVERSATION_ID_NAME);
+ String cid = context().getExternalContext().getRequestParameterMap().get(CONVERSATION_ID_NAME);
+ log.trace("Got cid " + cid + " from request");
+ return cid;
}
+ /**
+ * Gets the propagated conversation id from the propagation component
+ *
+ * @return The conversation id (or null if not found)
+ */
public static String getConversationIdFromPropagationComponent()
{
String cid = null;
@@ -53,19 +123,38 @@
{
cid = propagationComponent.getValue().toString();
}
+ log.trace("Got cid " + cid + " from propagation component");
return cid;
}
+ /**
+ * Gets the propagated conversation id
+ *
+ * @return The conversatio nid (or null if not found)
+ */
public static String getConversationId()
{
+ String cid = null;
if (isPostback())
{
- return getConversationIdFromPropagationComponent();
+ cid = getConversationIdFromPropagationComponent();
}
else
{
- return getConversationIdFromRequest();
+ cid = getConversationIdFromRequest();
}
+ log.debug("Resuming conversation " + cid);
+ return cid;
}
+ /**
+ * Gets the HTTP session
+ *
+ * @return The session
+ */
+ public static HttpSession getHttpSession()
+ {
+ return (HttpSession) context().getExternalContext().getSession(true);
+ }
+
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/jsf/WebBeansPhaseListener.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/jsf/WebBeansPhaseListener.java 2009-02-16 07:53:42 UTC (rev 1537)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/jsf/WebBeansPhaseListener.java 2009-02-16 11:54:02 UTC (rev 1538)
@@ -20,12 +20,15 @@
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
+import javax.servlet.http.HttpSession;
import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.context.ConversationContext;
import org.jboss.webbeans.conversation.ConversationManager;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.servlet.ConversationBeanMap;
+import org.jboss.webbeans.servlet.HttpSessionManager;
/**
* A phase listener for propagating conversation id over postbacks through a
@@ -36,11 +39,14 @@
*/
public class WebBeansPhaseListener implements PhaseListener
{
- // The ID/name of the conversation-propagating component
- private static final String CONVERSATION_PROPAGATION_COMPONENT = "webbeans_conversation_propagation";
-
+ // The logging provider
private static LogProvider log = Logging.getLogProvider(WebBeansPhaseListener.class);
+ /**
+ * Run before a given phase
+ *
+ * @param phaseEvent The phase event
+ */
public void beforePhase(PhaseEvent phaseEvent)
{
if (phaseEvent.getPhaseId().equals(PhaseId.RENDER_RESPONSE))
@@ -51,30 +57,39 @@
{
beforeApplyRequestValues();
}
- }
+ }
+ /**
+ * Run before the response is rendered
+ */
private void beforeRenderReponse()
{
- if (JSFHelper.isPostback())
+ log.trace("In before render response phase");
+ Conversation conversation = CurrentManager.rootManager().getInstanceByType(Conversation.class);
+ if (conversation.isLongRunning())
{
- Conversation conversation = CurrentManager.rootManager().getInstanceByType(Conversation.class);
- if (conversation.isLongRunning())
- {
- JSFHelper.createOrUpdatePropagationComponent(conversation.getId());
- }
- else
- {
- JSFHelper.removePropagationComponent();
- }
-
+ JSFHelper.createOrUpdatePropagationComponent(conversation.getId());
}
+ else
+ {
+ JSFHelper.removePropagationComponent();
+ }
}
-
+
+ /**
+ * Run before request values are applied
+ */
private void beforeApplyRequestValues()
{
+ log.trace("In before apply values phase");
ConversationContext.INSTANCE.setActive(true);
- }
-
+ }
+
+ /**
+ * Run after a given phase
+ *
+ * @param phaseEvent The phase event
+ */
public void afterPhase(PhaseEvent phaseEvent)
{
if (phaseEvent.getPhaseId().equals(PhaseId.RESTORE_VIEW))
@@ -85,18 +100,28 @@
{
afterRenderResponse();
}
- }
-
+ }
+
+ /**
+ * Run after the view is restored
+ */
private void afterRestoreView()
{
- if (JSFHelper.isPostback())
- {
- CurrentManager.rootManager().getInstanceByType(ConversationManager.class).beginOrRestoreConversation(JSFHelper.getConversationId());
- }
+ log.trace("In after restore view phase");
+ HttpSession session = JSFHelper.getHttpSession();
+ CurrentManager.rootManager().getInstanceByType(HttpSessionManager.class).setSession(session);
+ CurrentManager.rootManager().getInstanceByType(ConversationManager.class).beginOrRestoreConversation(JSFHelper.getConversationId());
+ String cid = CurrentManager.rootManager().getInstanceByType(Conversation.class).getId();
+ ConversationContext.INSTANCE.setBeanMap(new ConversationBeanMap(session, cid));
}
+ /**
+ * Run after the response is rendered
+ */
private void afterRenderResponse()
{
+ log.trace("In after render reponse phase");
+ CurrentManager.rootManager().getInstanceByType(ConversationManager.class).cleanupConversation();
ConversationContext.INSTANCE.setActive(false);
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java 2009-02-16 07:53:42 UTC (rev 1537)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java 2009-02-16 11:54:02 UTC (rev 1538)
@@ -101,20 +101,10 @@
public static void beginRequest(HttpServletRequest request)
{
log.trace("Processing HTTP request " + request.getRequestURI() + " begins");
- CurrentManager.rootManager().getInstanceByType(HttpSessionManager.class).setSession(request.getSession());
SessionContext.INSTANCE.setBeanMap(new HttpSessionBeanMap(request.getSession()));
- beginConversation(request);
DependentContext.INSTANCE.setActive(true);
}
- private static void beginConversation(HttpServletRequest request)
- {
- ConversationManager conversationManager = CurrentManager.rootManager().getInstanceByType(ConversationManager.class);
- conversationManager.beginOrRestoreConversation(request.getParameter("cid"));
- Conversation conversation = CurrentManager.rootManager().getInstanceByType(Conversation.class);
- ConversationContext.INSTANCE.setBeanMap(new ConversationBeanMap(request.getSession(), conversation.getId()));
- }
-
/**
* Ends a HTTP request
*
@@ -123,12 +113,9 @@
public static void endRequest(HttpServletRequest request)
{
log.trace("Processing HTTP request " + request.getRequestURI() + " ends");
- CurrentManager.rootManager().getInstanceByType(HttpSessionManager.class).setSession(null);
- CurrentManager.rootManager().getInstanceByType(ConversationManager.class).cleanupConversation();
DependentContext.INSTANCE.setActive(false);
RequestContext.INSTANCE.destroy();
SessionContext.INSTANCE.setBeanMap(null);
- ConversationContext.INSTANCE.setBeanMap(null);
}
}
17 years, 1 month
[webbeans-commits] Webbeans SVN: r1537 - in tck/trunk/impl/src/main: resources and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-02-16 02:53:42 -0500 (Mon, 16 Feb 2009)
New Revision: 1537
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/context/passivating/PassivatingContextTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
finer grained assertions for 8.4, mapped passivation tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/context/passivating/PassivatingContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/context/passivating/PassivatingContextTest.java 2009-02-16 06:17:50 UTC (rev 1536)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/context/passivating/PassivatingContextTest.java 2009-02-16 07:53:42 UTC (rev 1537)
@@ -23,28 +23,15 @@
*/
public class PassivatingContextTest extends AbstractDeclarativeTest
{
-
- /**
- * Simple Web Beans are not required to be serializable. If a simple Web Bean
- * declares a passivating scope, and the implementation class is not
- * serializable, a DefinitionException is thrown by the Web Bean manager at
- * initialization time.
- */
@Test(groups = { "contexts", "passivation" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "b")
public void testSimpleWebBeanWithNonSerializableImplementationClassFails()
{
deployBeans(Hamina_Broken.class);
}
- /**
- * Simple Web Beans are not required to be serializable. If a simple Web Bean
- * declares a passivating scope, and the implementation class is not
- * serializable, a DefinitionException is thrown by the Web Bean manager at
- * initialization time.
- */
@Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "b")
public void testSimpleWebBeanWithSerializableImplementationClassOK()
{
deployBeans(Jyvaskyla.class);
@@ -59,19 +46,15 @@
getCurrentManager().getInstanceByType(NumberConsumer.class).ping();
}
- @Test @SpecAssertion(section="8.4", id = "unknown")
+ @Test @SpecAssertion(section="8.4", id = "outdated")
public void testInjectionOfDependentPrimitiveProductIntoNormalBean()
{
deployBeans(Generator.class, FooConsumer.class);
getCurrentManager().getInstanceByType(FooConsumer.class).ping();
}
- /**
- * the Web Bean declares a passivating scope type, and context passivation
- * occurs, or
- */
@Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "f")
public void testSimpleWebBeanDeclaringPassivatingScopeIsSerializedWhenContextIsPassivated() throws IOException, ClassNotFoundException
{
deployBeans(Kajaani.class);
@@ -94,14 +77,8 @@
return resurrected.toString().equals(instance.toString());
}
- /**
- * On the other hand, dependent objects (including interceptors and
- * decorators with scope @Dependent) of a stateful session bean or of a Web
- * Bean with a passivating scope must be serialized and deserialized along
- * with their owner
- */
@Test(groups = { "contexts", "passivation", "stub" }, expectedExceptions = UnserializableDependencyException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "j")
public void testDependentInterceptorsOfStatefulEnterpriseBeanMustBeSerializable()
{
//deployBeans(Kaarina_Broken.class);
@@ -115,35 +92,23 @@
* with their owner
*/
@Test(groups = { "contexts", "passivation", "stub" }, expectedExceptions = UnserializableDependencyException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "j")
public void testDependentDecoratorsOfStatefulEnterpriseBeanMustBeSerializable()
{
//deployBeans(Porvoo_Broken.class);
assert false;
}
- /**
- * On the other hand, dependent objects (including interceptors and
- * decorators with scope @Dependent) of a stateful session bean or of a Web
- * Bean with a passivating scope must be serialized and deserialized along
- * with their owner
- */
@Test(groups = { "contexts", "passivation", "stub" }, expectedExceptions = UnserializableDependencyException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "k")
public void testDependentInterceptorsOfWebBeanWithPassivatingScopeMustBeSerializable()
{
//deployBeans(Kotka_Broken.class);
assert false;
}
- /**
- * On the other hand, dependent objects (including interceptors and
- * decorators with scope @Dependent) of a stateful session bean or of a Web
- * Bean with a passivating scope must be serialized and deserialized along
- * with their owner
- */
@Test(groups = { "contexts", "passivation", "stub" }, expectedExceptions = UnserializableDependencyException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "k")
public void testDependentDecoratorsOfWebBeansWithPassivatingScopeMustBeSerializable()
{
//deployBeans(Raisio_Broken.class);
@@ -151,14 +116,11 @@
}
/**
- * EJB local objects are serializable. Therefore, any reference to an
- * enterprise Web Bean of scope @Dependent is serializable.
- *
* @throws ClassNotFoundException
* @throws IOException
*/
@Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "j")
public void testDependentEJBsAreSerializable() throws IOException, ClassNotFoundException
{
deployBeans(Vaasa.class, Helsinki.class);
@@ -167,50 +129,23 @@
assert testSerialize(vaasaBeans.iterator().next());
}
- /**
- * If a simple Web Bean of scope @Dependent and a non-serializable
- * implementation class is injected into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * UnserializableDependencyException must be thrown by the Web Bean manager
- * at initialization time.
- */
@Test(groups = { "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "k")
public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoStatefulSessionBeanFails()
{
deployBeans(Violation.class, Espoo_Broken.class);
getCurrentManager().getInstanceByType(Espoo_Broken.class);
}
- /**
- * If a simple Web Bean of scope @Dependent and a non-serializable
- * implementation class is injected into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * UnserializableDependencyException must be thrown by the Web Bean manager
- * at initialization time.
- */
@Test(groups = { "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "l")
public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
{
deployBeans(Vantaa_Broken.class, Violation.class);
}
- /**
- * If a simple Web Bean of scope @Dependent and a non-serializable
- * implementation class is injected into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * UnserializableDependencyException must be thrown by the Web Bean manager
- * at initialization time.
- */
@Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "l")
public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoTransientFieldOK()
{
deployBeans(Joensuu.class, Violation.class);
@@ -218,80 +153,37 @@
assert !beans.isEmpty();
}
- /**
- * If a simple Web Bean of scope @Dependent and a non-serializable
- * implementation class is injected into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * UnserializableDependencyException must be thrown by the Web Bean manager
- * at initialization time.
- */
@Test(groups = { "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "m")
public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
{
deployBeans(Loviisa_Broken.class, Violation.class);
}
- /**
- * If a simple Web Bean of scope @Dependent and a non-serializable
- * implementation class is injected into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * UnserializableDependencyException must be thrown by the Web Bean manager
- * at initialization time.
- */
@Test(groups = { "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "n")
public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
{
deployBeans(Forssa_Broken.class, Violation.class);
}
- /**
- * If a simple Web Bean of scope @Dependent and a non-serializable
- * implementation class is injected into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * UnserializableDependencyException must be thrown by the Web Bean manager
- * at initialization time.
- */
@Test(groups = { "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "o")
public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoProducerMethodParameterWithPassivatingScopeFails()
{
deployBeans(Peraseinajoki.class, Violation.class, Violation2.class);
}
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
@Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "q")
public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
{
deployBeans(CityProducer2.class, Nokia_Broken.class);
getCurrentManager().getInstanceByType(Nokia_Broken.class).ping();
}
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
@Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "q")
public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoTransientFieldOfWebBeanWithPassivatingScopeOK()
{
deployBeans(CityProducer2.class, Hyvinkaa.class);
@@ -299,128 +191,64 @@
assert !beans.isEmpty();
}
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
@Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "r")
public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
{
deployBeans(CityProducer2.class, Loviisa_Broken.class);
getCurrentManager().getInstanceByType(Loviisa_Broken.class).ping();
}
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
@Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "s")
public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
{
deployBeans(CityProducer2.class, Kuopio_Broken.class);
getCurrentManager().getInstanceByType(Kuopio_Broken.class).ping();
}
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
@Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "t")
public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoProducerMethodParameterWithPassivatingScopeFails()
{
deployBeans(CityProducer2.class, Jamsa_Broken.class);
getCurrentManager().getInstanceByType(Jamsa_Broken.class).ping();
}
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
@Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "q")
public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
{
deployBeans(CityProducer.class, Uusikaupunki_Broken.class);
getCurrentManager().getInstanceByType(Uusikaupunki_Broken.class).ping();
}
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
@Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "q")
public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoTransientFieldOfWebBeanWithPassivatingScopeOK()
{
deployBeans(CityProducer.class, Salo_Broken.class);
getCurrentManager().getInstanceByType(Salo_Broken.class).ping();
}
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
@Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "r")
public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
{
deployBeans(CityProducer.class, Loviisa_Broken.class);
getCurrentManager().getInstanceByType(Loviisa_Broken.class).ping();
}
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
@Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "s")
public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
{
deployBeans(CityProducer.class, Mikkeli_Broken.class);
getCurrentManager().getInstanceByType(Mikkeli_Broken.class).ping();
}
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
@Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "t")
public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoProducerMethodParameterWithPassivatingScopeFails()
{
// TODO Not quite sure what this test is doing
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-02-16 06:17:50 UTC (rev 1536)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-02-16 07:53:42 UTC (rev 1537)
@@ -2222,23 +2222,54 @@
</assertion>
<assertion id="j">
- <text>Dependent objects (including interceptors and decorators with scope @Dependent) of a stateful session bean or of a bean with a passivating scope must be serialized and deserialized along with their owner - EJB local objects are serializable. Therefore, any reference to a session bean of scope @Dependent is serializable</text>
+ <text>EJB local objects are serializable, therefore, any reference to a session bean of scope @Dependent is serializable</text>
</assertion>
<assertion id="k">
- <text>Dependent objects (including interceptors and decorators with scope @Dependent) of a stateful session bean or of a bean with a passivating scope must be serialized and deserialized along with their owner - A simple bean of scope @Dependent may or may not be serializable. If a simple bean of scope @Dependent and a nonserializable bean class is injected into a stateful session bean, into a non-transient field, bean constructor parameter or initializer method parameter of a bean which declares a passivating scope, or into a parameter of a producer method
-which declares a passivating scope, an UnserializableDependencyException must be thrown by the container at deployment time</text>
+ <text>If a simple bean of scope @Dependent and a nonserializable bean class is injected into a stateful session bean an UnserializableDependencyException must be thrown by the container at deployment time</text>
</assertion>
<assertion id="l">
- <text>Dependent objects (including interceptors and decorators with scope @Dependent) of a stateful session bean or of a bean with a passivating scope must be serialized and deserialized along with their owner - If a producer method or field of scope @Dependent returns a non-serializable object for injection into a stateful session bean, into a non-transient field, bean constructor parameter or initializer method parameter of a bean which declares a passivating scope, or into a parameter of a producer method which declares a passivating scope, an IllegalProductException is thrown by the container</text>
+ <text>If a simple bean of scope @Dependent and a nonserializable bean class is injected into a non-transient field an UnserializableDependencyException must be thrown by the container at deployment time</text>
</assertion>
<assertion id="m">
- <text>Dependent objects (including interceptors and decorators with scope @Dependent) of a stateful session bean or of a bean with a passivating scope must be serialized and deserialized along with their owner - The container must guarantee that JMS resource proxy objects are serializable</text>
+ <text>If a simple bean of scope @Dependent and a nonserializable bean class is injected into a bean constructor parameter of a bean which declares a passivating scope, an UnserializableDependencyException must be thrown by the container at deployment time</text>
</assertion>
<assertion id="n">
+ <text>If a simple bean of scope @Dependent and a nonserializable bean class is injected into an initializer method parameter of a bean which declares a passivating scope, an UnserializableDependencyException must be thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>If a simple bean of scope @Dependent and a nonserializable bean class is injected into a parameter of a producer method which declares a passivating scope, an UnserializableDependencyException must be thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>If a producer method or field of scope @Dependent returns a non-serializable object for injection into a stateful session bean, an IllegalProductException is thrown by the container</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>If a producer method or field of scope @Dependent returns a non-serializable object for injection into a non-transient field an IllegalProductException is thrown by the container</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>If a producer method or field of scope @Dependent returns a non-serializable object for injection into a bean constructor parameter of a bean which declares a passivating scope, an IllegalProductException is thrown by the container</text>
+ </assertion>
+
+ <assertion id="s">
+ <text>If a producer method or field of scope @Dependent returns a non-serializable object for injection into an initializer method parameter of a bean which declares a passivating scope, an IllegalProductException is thrown by the container</text>
+ </assertion>
+
+ <assertion id="t">
+ <text>If a producer method or field of scope @Dependent returns a non-serializable object for injection into a parameter of a producer method which declares a passivating scope, an IllegalProductException is thrown by the container</text>
+ </assertion>
+
+ <assertion id="u">
+ <text>The container must guarantee that JMS resource proxy objects are serializable</text>
+ </assertion>
+
+ <assertion id="v">
<text>The method Bean.isSerializable() may be used to detect if a bean is serializable</text>
</assertion>
</section>
17 years, 1 month
[webbeans-commits] Webbeans SVN: r1536 - doc/trunk/reference/zh-CN.
by webbeans-commits@lists.jboss.org
Author: alartin
Date: 2009-02-16 01:17:50 -0500 (Mon, 16 Feb 2009)
New Revision: 1536
Modified:
doc/trunk/reference/zh-CN/extend.po
Log:
Modified: doc/trunk/reference/zh-CN/extend.po
===================================================================
--- doc/trunk/reference/zh-CN/extend.po 2009-02-16 03:18:18 UTC (rev 1535)
+++ doc/trunk/reference/zh-CN/extend.po 2009-02-16 06:17:50 UTC (rev 1536)
@@ -3,11 +3,11 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: master.xml \n"
+"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-12-19 20:26+0000\n"
-"PO-Revision-Date: 2008-12-19 20:26+0000\n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2009-02-16 14:16+0800\n"
+"Last-Translator: Sean Wu <alartin(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -17,60 +17,49 @@
#: extend.xml:4
#, no-c-format
msgid "Extending Web Beans"
-msgstr ""
+msgstr "扩展Web Bean"
#. Tag: para
#: extend.xml:6
#, no-c-format
-msgid ""
-"Web Beans is intended to be a platform for frameworks, extensions and "
-"integration with other technologies. Therefore, Web Beans exposes a set of "
-"SPIs for the use of developers of portable extensions to Web Beans. For "
-"example, the following kinds of extensions were envisaged by the designers "
-"of Web Beans:"
-msgstr ""
+msgid "Web Beans is intended to be a platform for frameworks, extensions and integration with other technologies. Therefore, Web Beans exposes a set of SPIs for the use of developers of portable extensions to Web Beans. For example, the following kinds of extensions were envisaged by the designers of Web Beans:"
+msgstr "Web Beans意图成为框架的平台,扩展的平台,和能够与其他技术整合的平台。因此,Web Bean将一套SPI暴露给开发者,从而能够让他们便于扩展Web Bean。例如,下面是Web Bean设计者设想的扩展类型:"
#. Tag: para
#: extend.xml:14
#, no-c-format
msgid "integration with Business Process Management engines,"
-msgstr ""
+msgstr "整合业务流程管理引擎,"
#. Tag: para
#: extend.xml:17
#, no-c-format
-msgid ""
-"integration with third-party frameworks such as Spring, Seam, GWT or Wicket, "
-"and"
-msgstr ""
+msgid "integration with third-party frameworks such as Spring, Seam, GWT or Wicket, and"
+msgstr "整合第三方框架,例如Spring, Seam, GWT或者Wicket,和"
#. Tag: para
#: extend.xml:21
#, no-c-format
msgid "new technology based upon the Web Beans programming model."
-msgstr ""
+msgstr "基于Web Bean编程模型的新技术。"
#. Tag: para
#: extend.xml:25
#, no-c-format
-msgid ""
-"The nerve center for extending Web Beans is the <literal>Manager</literal> "
-"object."
-msgstr ""
+msgid "The nerve center for extending Web Beans is the <literal>Manager</literal> object."
+msgstr "扩展Web Bean的神经中枢是 <literal>Manager</literal> 对象。"
#. Tag: title
#: extend.xml:29
#, no-c-format
msgid "The <literal>Manager</literal> object"
-msgstr ""
+msgstr " <literal>Manager</literal> 对象"
#. Tag: para
#: extend.xml:31
#, no-c-format
-msgid ""
-"The <literal>Manager</literal> interface lets us register and obtain Web "
-"Beans, interceptors, decorators, observers and contexts programatically."
-msgstr ""
+msgid "The <literal>Manager</literal> interface lets us register and obtain Web Beans, interceptors, decorators, observers and contexts programatically."
+msgstr " <literal>Manager</literal> 接口能够让我们通过编程来注册和获得Web Bean,拦截器,装饰器,观察者和上下文。"
#. Tag: programlisting
#: extend.xml:34
@@ -79,8 +68,7 @@
"<![CDATA[public interface Manager\n"
"{\n"
"\n"
-" public <T> Set<Bean<T>> resolveByType(Class<T> type, Annotation... "
-"bindings);\n"
+" public <T> Set<Bean<T>> resolveByType(Class<T> type, Annotation... bindings);\n"
"\n"
" public <T> Set<Bean<T>> resolveByType(TypeLiteral<T> apiType,\n"
" Annotation... bindings);\n"
@@ -111,19 +99,16 @@
" public <T> Manager addObserver(Observer<T> observer, Class<T> eventType,\n"
" Annotation... bindings);\n"
"\n"
-" public <T> Manager addObserver(Observer<T> observer, TypeLiteral<T> "
-"eventType,\n"
+" public <T> Manager addObserver(Observer<T> observer, TypeLiteral<T> eventType,\n"
" Annotation... bindings);\n"
"\n"
-" public <T> Manager removeObserver(Observer<T> observer, Class<T> "
-"eventType,\n"
+" public <T> Manager removeObserver(Observer<T> observer, Class<T> eventType,\n"
" Annotation... bindings);\n"
"\n"
" public <T> Manager removeObserver(Observer<T> observer,\n"
" TypeLiteral<T> eventType, Annotation... bindings);\n"
"\n"
-" public <T> Set<Observer<T>> resolveObservers(T event, Annotation... "
-"bindings);\n"
+" public <T> Set<Observer<T>> resolveObservers(T event, Annotation... bindings);\n"
"\n"
" public List<Interceptor> resolveInterceptors(InterceptionType type,\n"
" Annotation... interceptorBindings);\n"
@@ -133,33 +118,82 @@
"\n"
"}]]>"
msgstr ""
+"<![CDATA[public interface Manager\n"
+"{\n"
+"\n"
+" public <T> Set<Bean<T>> resolveByType(Class<T> type, Annotation... bindings);\n"
+"\n"
+" public <T> Set<Bean<T>> resolveByType(TypeLiteral<T> apiType,\n"
+" Annotation... bindings);\n"
+"\n"
+" public <T> T getInstanceByType(Class<T> type, Annotation... bindings);\n"
+"\n"
+" public <T> T getInstanceByType(TypeLiteral<T> type,\n"
+" Annotation... bindings);\n"
+"\n"
+" public Set<Bean<?>> resolveByName(String name);\n"
+"\n"
+" public Object getInstanceByName(String name);\n"
+"\n"
+" public <T> T getInstance(Bean<T> bean);\n"
+"\n"
+" public void fireEvent(Object event, Annotation... bindings);\n"
+"\n"
+" public Context getContext(Class<? extends Annotation> scopeType);\n"
+"\n"
+" public Manager addContext(Context context);\n"
+"\n"
+" public Manager addBean(Bean<?> bean);\n"
+"\n"
+" public Manager addInterceptor(Interceptor interceptor);\n"
+"\n"
+" public Manager addDecorator(Decorator decorator);\n"
+"\n"
+" public <T> Manager addObserver(Observer<T> observer, Class<T> eventType,\n"
+" Annotation... bindings);\n"
+"\n"
+" public <T> Manager addObserver(Observer<T> observer, TypeLiteral<T> eventType,\n"
+" Annotation... bindings);\n"
+"\n"
+" public <T> Manager removeObserver(Observer<T> observer, Class<T> eventType,\n"
+" Annotation... bindings);\n"
+"\n"
+" public <T> Manager removeObserver(Observer<T> observer,\n"
+" TypeLiteral<T> eventType, Annotation... bindings);\n"
+"\n"
+" public <T> Set<Observer<T>> resolveObservers(T event, Annotation... bindings);\n"
+"\n"
+" public List<Interceptor> resolveInterceptors(InterceptionType type,\n"
+" Annotation... interceptorBindings);\n"
+"\n"
+" public List<Decorator> resolveDecorators(Set<Class<?>> types,\n"
+" Annotation... bindings);\n"
+"\n"
+"}]]>"
#. Tag: para
#: extend.xml:36
#, no-c-format
msgid "We can obtain an instance of <literal>Manager</literal> via injection:"
-msgstr ""
+msgstr "我们可以通过注入来获得一个 <literal>Manager</literal> 实例:"
#. Tag: programlisting
#: extend.xml:38
#, no-c-format
msgid "@Current Manager manager"
-msgstr ""
+msgstr "@Current Manager manager"
#. Tag: title
#: extend.xml:43
#, no-c-format
msgid "The <literal>Bean</literal> class"
-msgstr ""
+msgstr " <literal>Bean</literal> 类"
#. Tag: para
#: extend.xml:45
#, no-c-format
-msgid ""
-"Instances of the abstract class <literal>Bean</literal> represent Web Beans. "
-"There is an instance of <literal>Bean</literal> registered with the "
-"<literal>Manager</literal> object for every Web Bean in the application."
-msgstr ""
+msgid "Instances of the abstract class <literal>Bean</literal> represent Web Beans. There is an instance of <literal>Bean</literal> registered with the <literal>Manager</literal> object for every Web Bean in the application."
+msgstr "抽象类 <literal>Bean</literal> 的实例代表Web Bean。应用中的每个Web Bean都有一个在 <literal>Manager</literal> 注册的 <literal>Bean</literal> 实例。"
#. Tag: programlisting
#: extend.xml:50
@@ -191,41 +225,55 @@
" \n"
"}"
msgstr ""
+"public abstract class Bean<T> {\n"
+" \n"
+" private final Manager manager;\n"
+" \n"
+" protected Bean(Manager manager) {\n"
+" this.manager=manager;\n"
+" }\n"
+" \n"
+" protected Manager getManager() {\n"
+" return manager;\n"
+" }\n"
+" \n"
+" public abstract Set<Class> getTypes();\n"
+" public abstract Set<Annotation> getBindingTypes();\n"
+" public abstract Class<? extends Annotation> getScopeType();\n"
+" public abstract Class<? extends Annotation> getDeploymentType(); \n"
+" public abstract String getName();\n"
+" \n"
+" public abstract boolean isSerializable();\n"
+" public abstract boolean isNullable();\n"
+"\n"
+" public abstract T create();\n"
+" public abstract void destroy(T instance);\n"
+" \n"
+"}"
#. Tag: para
#: extend.xml:52
#, no-c-format
-msgid ""
-"It's possible to extend the <literal>Bean</literal> class and register "
-"instances by calling <literal>Manager.addBean()</literal> to provide support "
-"for new kinds of Web Beans, beyond those defined by the Web Beans "
-"specification (simple and enterprise Web Beans, producer methods and JMS "
-"endpoints). For example, we could use the <literal>Bean</literal> class to "
-"allow objects managed by another framework to be injected into Web Beans."
-msgstr ""
+msgid "It's possible to extend the <literal>Bean</literal> class and register instances by calling <literal>Manager.addBean()</literal> to provide support for new kinds of Web Beans, beyond those defined by the Web Beans specification (simple and enterprise Web Beans, producer methods and JMS endpoints). For example, we could use the <literal>Bean</literal> class to allow objects managed by another framework to be injected into Web Beans."
+msgstr "我们可以继承 <literal>Bean</literal> 类,通过调用 <literal>Manager.addBean()</literal> 方法注册实例,从而提供超出Web Bean规范之外(简单Web Bean, 企业WebBean, 生产者方法和JMS端点)的新的Web Bean类型。例如,我们可以使用 <literal>Bean</literal> 类来允许其他框架管理的对象能够注入到Web Bean中。"
#. Tag: para
#: extend.xml:60
#, no-c-format
-msgid ""
-"There are two subclasses of <literal>Bean</literal> defined by the Web Beans "
-"specification: <literal>Interceptor</literal> and <literal>Decorator</"
-"literal>."
-msgstr ""
+msgid "There are two subclasses of <literal>Bean</literal> defined by the Web Beans specification: <literal>Interceptor</literal> and <literal>Decorator</literal>."
+msgstr "Web Bean规范定义了两种 <literal>Bean</literal> 的子类:<literal>拦截器</literal> 和 <literal>装饰器</literal>。"
#. Tag: title
#: extend.xml:67
#, no-c-format
msgid "The <literal>Context</literal> interface"
-msgstr ""
+msgstr " <literal>Context</literal> 接口"
#. Tag: para
#: extend.xml:69
#, no-c-format
-msgid ""
-"The <literal>Context</literal> interface supports addition of new scopes to "
-"Web Beans, or extension of the built-in scopes to new environments."
-msgstr ""
+msgid "The <literal>Context</literal> interface supports addition of new scopes to Web Beans, or extension of the built-in scopes to new environments."
+msgstr " <literal>Context</literal> 接口支持向Web Bean中添加新的范围,或者在新的环境中扩展内置的范围。"
#. Tag: programlisting
#: extend.xml:72
@@ -241,12 +289,19 @@
" \n"
"}"
msgstr ""
+"public interface Context {\n"
+" \n"
+" public Class<? extends Annotation> getScopeType();\n"
+" \n"
+" public <T> T get(Bean<T> bean, boolean create);\n"
+" \n"
+" boolean isActive();\n"
+" \n"
+"}"
#. Tag: para
#: extend.xml:74
#, no-c-format
-msgid ""
-"For example, we might implement <literal>Context</literal> to add a business "
-"process scope to Web Beans, or to add support for the conversation scope to "
-"an application that uses Wicket."
-msgstr ""
+msgid "For example, we might implement <literal>Context</literal> to add a business process scope to Web Beans, or to add support for the conversation scope to an application that uses Wicket."
+msgstr "例如,我们可以实现 <literal>Context</literal> ,向Web Bean添加一个业务流程范围,或者向使用Wicket框架的应用添加对对话的支持。"
+
17 years, 1 month
[webbeans-commits] Webbeans SVN: r1535 - doc/trunk/reference/zh-CN.
by webbeans-commits@lists.jboss.org
Author: alartin
Date: 2009-02-15 22:18:18 -0500 (Sun, 15 Feb 2009)
New Revision: 1535
Modified:
doc/trunk/reference/zh-CN/events.po
Log:
Modified: doc/trunk/reference/zh-CN/events.po
===================================================================
--- doc/trunk/reference/zh-CN/events.po 2009-02-16 03:14:56 UTC (rev 1534)
+++ doc/trunk/reference/zh-CN/events.po 2009-02-16 03:18:18 UTC (rev 1535)
@@ -3,11 +3,11 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: master.xml \n"
+"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-12-19 20:26+0000\n"
-"PO-Revision-Date: 2008-12-19 20:26+0000\n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2009-02-16 11:17+0800\n"
+"Last-Translator: Sean Wu <alartin(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -17,75 +17,55 @@
#: events.xml:4
#, no-c-format
msgid "Events"
-msgstr ""
+msgstr "事件"
#. Tag: para
#: events.xml:6
#, no-c-format
-msgid ""
-"The Web Beans event notification facility allows Web Beans to interact in a "
-"totally decoupled manner. Event <emphasis>producers</emphasis> raise events "
-"that are then delivered to event <emphasis>observers</emphasis> by the Web "
-"Bean manager. This basic schema might sound like the familiar observer/"
-"observable pattern, but there are a couple of twists:"
-msgstr ""
+msgid "The Web Beans event notification facility allows Web Beans to interact in a totally decoupled manner. Event <emphasis>producers</emphasis> raise events that are then delivered to event <emphasis>observers</emphasis> by the Web Bean manager. This basic schema might sound like the familiar observer/observable pattern, but there are a couple of twists:"
+msgstr "Web Beans事件通知机制能够让Web Beans以完全解耦的方式交互。事件<emphasis>产生者(producers)</emphasis>触发事件,然后由Web Bean管理器发送给事件 <emphasis>观察者(observers)</emphasis> 。基本的模式和我们常见的观察者设计模式类似,但也有一些曲解:"
#. Tag: para
#: events.xml:14
#, no-c-format
-msgid ""
-"not only are event producers decoupled from observers; observers are "
-"completely decoupled from producers,"
-msgstr ""
+msgid "not only are event producers decoupled from observers; observers are completely decoupled from producers,"
+msgstr "不仅是事件产生者和观察者解耦;观察者和产生者也完全解耦,"
#. Tag: para
#: events.xml:18
#, no-c-format
-msgid ""
-"observers can specify a combination of \"selectors\" to narrow the set of "
-"event notifications they will receive, and"
-msgstr ""
+msgid "observers can specify a combination of \"selectors\" to narrow the set of event notifications they will receive, and"
+msgstr "观察者可以指定一个\"选择器\"组合来限定接受的事件通知,并且"
#. Tag: para
#: events.xml:22
#, no-c-format
-msgid ""
-"observers can be notified immediately, or can specify that delivery of the "
-"event should be delayed until the end of the current transaction"
-msgstr ""
+msgid "observers can be notified immediately, or can specify that delivery of the event should be delayed until the end of the current transaction"
+msgstr "观察者可以即刻被通知,也可以指定只有当前事务结束后再发送事件通知。"
#. Tag: title
#: events.xml:28
#, no-c-format
msgid "Event observers"
-msgstr ""
+msgstr "事件观察者"
#. Tag: para
#: events.xml:30
#, no-c-format
-msgid ""
-"An <emphasis>observer method</emphasis> is a method of a Web Bean with a "
-"parameter annotated <literal>@Observes</literal>."
-msgstr ""
+msgid "An <emphasis>observer method</emphasis> is a method of a Web Bean with a parameter annotated <literal>@Observes</literal>."
+msgstr "一个 <emphasis>观察者方法</emphasis>是一个在Web Bean中的方法,该方法有一个用<literal>@Observes</literal>注释的参数。 "
#. Tag: programlisting
#: events.xml:33
#, no-c-format
-msgid ""
-"<![CDATA[public void onAnyDocumentEvent(@Observes Document document) "
-"{ ... }]]>"
-msgstr ""
+msgid "<![CDATA[public void onAnyDocumentEvent(@Observes Document document) { ... }]]>"
+msgstr "<![CDATA[public void onAnyDocumentEvent(@Observes Document document) { ... }]]>"
#. Tag: para
#: events.xml:35
#, no-c-format
-msgid ""
-"The annotated parameter is called the <emphasis>event parameter</emphasis>. "
-"The type of the event parameter is the observed <emphasis>event type</"
-"emphasis>. Observer methods may also specify \"selectors\", which are just "
-"instances of Web Beans binding types. When a binding type is used as an "
-"event selector, it is called an <emphasis>event binding type</emphasis>."
-msgstr ""
+msgid "The annotated parameter is called the <emphasis>event parameter</emphasis>. The type of the event parameter is the observed <emphasis>event type</emphasis>. Observer methods may also specify \"selectors\", which are just instances of Web Beans binding types. When a binding type is used as an event selector, it is called an <emphasis>event binding type</emphasis>."
+msgstr "这个使用注释的参数被称为<emphasis>事件参数</emphasis>。事件参数的类型是被观察的<emphasis>事件类型</emphasis>。观察者方法也可以指定\"选择器\",选择器其实就是Web Beans绑定类型的实例。当一个绑定类型作为事件选择器时,它也被称为一个<emphasis>事件绑定类型</emphasis>。"
#. Tag: programlisting
#: events.xml:41
@@ -96,250 +76,203 @@
"@Retention(RUNTIME)\n"
"public @interface Updated { ... }]]>"
msgstr ""
+"<![CDATA[@BindingType\n"
+"@Target({PARAMETER, FIELD})\n"
+"@Retention(RUNTIME)\n"
+"public @interface Updated { ... }]]>"
#. Tag: para
#: events.xml:43
#, no-c-format
-msgid ""
-"We specify the event bindings of the observer method by annotating the event "
-"parameter:"
-msgstr ""
+msgid "We specify the event bindings of the observer method by annotating the event parameter:"
+msgstr "我们通过注释事件参数来指定观察者方法的事件绑定。"
#. Tag: programlisting
-#: events.xml:46 events.xml:190
+#: events.xml:46
+#: events.xml:190
#, no-c-format
-msgid ""
-"<![CDATA[public void afterDocumentUpdate(@Observes @Updated Document "
-"document) { ... }]]>"
-msgstr ""
+msgid "<![CDATA[public void afterDocumentUpdate(@Observes @Updated Document document) { ... }]]>"
+msgstr "<![CDATA[public void afterDocumentUpdate(@Observes @Updated Document document) { ... }]]>"
#. Tag: para
#: events.xml:48
#, no-c-format
-msgid ""
-"An observer method need not specify any event bindings — in this case it "
-"is interested in <emphasis>all</emphasis> events of a particular type. If it "
-"does specify event bindings, it is only interested in events which also have "
-"those event bindings."
-msgstr ""
+msgid "An observer method need not specify any event bindings — in this case it is interested in <emphasis>all</emphasis> events of a particular type. If it does specify event bindings, it is only interested in events which also have those event bindings."
+msgstr "一个观察者方法无须指定一个事件绑定 — 在这种情况下,它对一个特定类型的 <emphasis>所有</emphasis> 事件都感兴趣(观察)。如果它没有指定事件绑定,那么它只对那些有事件绑定的事件感兴趣(观察)。"
#. Tag: para
#: events.xml:53
#, no-c-format
-msgid ""
-"The observer method may have additional parameters, which are injected "
-"according to the usual Web Beans method parameter injection semantics:"
-msgstr ""
+msgid "The observer method may have additional parameters, which are injected according to the usual Web Beans method parameter injection semantics:"
+msgstr "观察者方法可以有其他的参数,它们可以按照普通的Web Beans方法参数注入语法注入:"
#. Tag: programlisting
#: events.xml:56
#, no-c-format
-msgid ""
-"<![CDATA[public void afterDocumentUpdate(@Observes @Updated Document "
-"document, User user) { ... }]]>"
-msgstr ""
+msgid "<![CDATA[public void afterDocumentUpdate(@Observes @Updated Document document, User user) { ... }]]>"
+msgstr "<![CDATA[public void afterDocumentUpdate(@Observes @Updated Document document, User user) { ... }]]>"
#. Tag: title
#: events.xml:61
#, no-c-format
msgid "Event producers"
-msgstr ""
+msgstr "事件生产者"
#. Tag: para
#: events.xml:63
#, no-c-format
-msgid ""
-"The event producer may obtain an <emphasis>event notifier</emphasis> object "
-"by injection:"
-msgstr ""
+msgid "The event producer may obtain an <emphasis>event notifier</emphasis> object by injection:"
+msgstr "事件生产者可以通过注入获得一个 <emphasis>事件通知者</emphasis>对象:"
#. Tag: programlisting
#: events.xml:66
#, no-c-format
msgid "<![CDATA[@Observable Event<Document> documentEvent]]>"
-msgstr ""
+msgstr "<![CDATA[@Observable Event<Document> documentEvent]]>"
#. Tag: para
#: events.xml:68
#, no-c-format
-msgid ""
-"The <literal>@Observable</literal> annotation implicitly defines a Web Bean "
-"with scope <literal>@Dependent</literal> and deployment type "
-"<literal>@Standard</literal>, with an implementation provided by the Web "
-"Bean manager."
-msgstr ""
+msgid "The <literal>@Observable</literal> annotation implicitly defines a Web Bean with scope <literal>@Dependent</literal> and deployment type <literal>@Standard</literal>, with an implementation provided by the Web Bean manager."
+msgstr "<literal>@Observable</literal>注释隐式指定了一个 <literal>@Dependent</literal> 范围的,部署类型为<literal>@Standard</literal> 的Web Bean。其实现由Web Bean管理器提供。"
#. Tag: para
#: events.xml:72
#, no-c-format
-msgid ""
-"A producer raises events by calling the <literal>fire()</literal> method of "
-"the <literal>Event</literal> interface, passing an <emphasis>event object</"
-"emphasis>:"
-msgstr ""
+msgid "A producer raises events by calling the <literal>fire()</literal> method of the <literal>Event</literal> interface, passing an <emphasis>event object</emphasis>:"
+msgstr "一个生产者通过调用 <literal>Event</literal> 接口的 <literal>fire()</literal> 方法来触发事件,传递一个 <emphasis>事件对象</emphasis> :"
#. Tag: programlisting
#: events.xml:75
#, no-c-format
msgid "<![CDATA[documentEvent.fire(document);]]>"
-msgstr ""
+msgstr "<![CDATA[documentEvent.fire(document);]]>"
#. Tag: para
#: events.xml:77
#, no-c-format
-msgid ""
-"An event object may be an instance of any Java class that has no type "
-"variables or wildcard type parameters. The event will be delivered to every "
-"observer method that:"
-msgstr ""
+msgid "An event object may be an instance of any Java class that has no type variables or wildcard type parameters. The event will be delivered to every observer method that:"
+msgstr "一个事件对象可以是没有任何类型变量或者通配类型参数的任何Java类的实例。事件可以通过符合下面条件的观察者方法传送:"
#. Tag: para
-#: events.xml:83 events.xml:107 events.xml:126
+#: events.xml:83
+#: events.xml:107
+#: events.xml:126
#, no-c-format
msgid "has an event parameter to which the event object is assignable, and"
-msgstr ""
+msgstr "有一个事件参数可以赋给事件对象,并且"
#. Tag: para
#: events.xml:86
#, no-c-format
msgid "specifies no event bindings."
-msgstr ""
+msgstr "没有指定事件绑定"
#. Tag: para
#: events.xml:90
#, no-c-format
-msgid ""
-"The Web Bean manager simply calls all the observer methods, passing the "
-"event object as the value of the event parameter. If any observer method "
-"throws an exception, the Web Bean manager stops calling observer methods, "
-"and the exception is rethrown by the <literal>fire()</literal> method."
-msgstr ""
+msgid "The Web Bean manager simply calls all the observer methods, passing the event object as the value of the event parameter. If any observer method throws an exception, the Web Bean manager stops calling observer methods, and the exception is rethrown by the <literal>fire()</literal> method."
+msgstr "Web Bean管理器简单地调用所有观察者方法,以事件参数值来传递事件对象。如果任何观察者方法抛出一个异常,Web Bean管理器将停止调用观察者方法,<literal>fire()</literal> 方法再次抛出这个异常。"
#. Tag: para
#: events.xml:95
#, no-c-format
-msgid ""
-"To specify a \"selector\", the event producer may pass an instance of the "
-"event binding type to the <literal>fire()</literal> method:"
-msgstr ""
+msgid "To specify a \"selector\", the event producer may pass an instance of the event binding type to the <literal>fire()</literal> method:"
+msgstr " 要指定\"选择器\",事件生产者可以将一个事件绑定类型的实例传递给 <literal>fire()</literal> 方法:"
#. Tag: programlisting
#: events.xml:98
#, no-c-format
-msgid ""
-"<![CDATA[documentEvent.fire( document, new AnnotationLiteral<Updated>()"
-"{} );]]>"
-msgstr ""
+msgid "<![CDATA[documentEvent.fire( document, new AnnotationLiteral<Updated>(){} );]]>"
+msgstr "<![CDATA[documentEvent.fire( document, new AnnotationLiteral<Updated>(){} );]]>"
#. Tag: para
#: events.xml:100
#, no-c-format
-msgid ""
-"The helper class <literal>AnnotationLiteral</literal> makes it possible to "
-"instantiate binding types inline, since this is otherwise difficult to do in "
-"Java."
-msgstr ""
+msgid "The helper class <literal>AnnotationLiteral</literal> makes it possible to instantiate binding types inline, since this is otherwise difficult to do in Java."
+msgstr " <literal>AnnotationLiteral</literal> 帮助类能够让我们内部实例化绑定类型,这在Java里很难这么做。"
#. Tag: para
#: events.xml:103
#, no-c-format
msgid "The event will be delivered to every observer method that:"
-msgstr ""
+msgstr "事件将被发送给每个符合下面条件的观察者方法:"
#. Tag: para
#: events.xml:110
#, no-c-format
-msgid ""
-"does not specify any event binding <emphasis>except</emphasis> for the event "
-"bindings passed to <literal>fire()</literal>."
-msgstr ""
+msgid "does not specify any event binding <emphasis>except</emphasis> for the event bindings passed to <literal>fire()</literal>."
+msgstr "除了传递给<literal>fire()</literal>方法的事件绑定之外,没有指定任何事件绑定。"
#. Tag: para
#: events.xml:115
#, no-c-format
-msgid ""
-"Alternatively, event bindings may be specified by annotating the event "
-"notifier injection point:"
-msgstr ""
+msgid "Alternatively, event bindings may be specified by annotating the event notifier injection point:"
+msgstr "或者,通过注释事件通知者注入点来指定事件绑定:"
#. Tag: programlisting
#: events.xml:118
#, no-c-format
msgid "<![CDATA[@Observable @Updated Event<Document> documentUpdatedEvent]]>"
-msgstr ""
+msgstr "<![CDATA[@Observable @Updated Event<Document> documentUpdatedEvent]]>"
#. Tag: para
#: events.xml:120
#, no-c-format
-msgid ""
-"Then every event fired via this instance of <literal>Event</literal> has the "
-"annotated event binding. The event will be delivered to every observer "
-"method that:"
-msgstr ""
+msgid "Then every event fired via this instance of <literal>Event</literal> has the annotated event binding. The event will be delivered to every observer method that:"
+msgstr "然后,每个通过 <literal>Event</literal> 实例触发的事件都有注释的事件绑定。事件将被发送给每个符合下面条件的观察者方法:"
#. Tag: para
#: events.xml:129
#, no-c-format
-msgid ""
-"does not specify any event binding <emphasis>except</emphasis> for the event "
-"bindings passed to <literal>fire()</literal> or the annotated event bindings "
-"of the event notifier injection point."
-msgstr ""
+msgid "does not specify any event binding <emphasis>except</emphasis> for the event bindings passed to <literal>fire()</literal> or the annotated event bindings of the event notifier injection point."
+msgstr "<emphasis>除了</emphasis>传递给 <literal>fire()</literal> 方法或者是事件通知者注入点的事件绑定。"
#. Tag: title
#: events.xml:138
#, no-c-format
msgid "Registering observers dynamically"
-msgstr ""
+msgstr "动态注册观察者"
#. Tag: para
#: events.xml:140
#, no-c-format
-msgid ""
-"It's often useful to register an event observer dynamically. The application "
-"may implement the <literal>Observer</literal> interface and register an "
-"instance with an event notifier by calling the <literal>observe()</literal> "
-"method."
-msgstr ""
+msgid "It's often useful to register an event observer dynamically. The application may implement the <literal>Observer</literal> interface and register an instance with an event notifier by calling the <literal>observe()</literal> method."
+msgstr "动态地注册一个事件观察者相当有用。应用可以实现 <literal>Observer</literal> 接口,通过调用 <literal>observe()</literal> 方法注册一个事件通知者的观察者实例。"
#. Tag: programlisting
#: events.xml:144
#, no-c-format
-msgid ""
-"<![CDATA[documentEvent.observe( new Observer<Document>() { public void notify"
-"(Document doc) { ... } } );]]>"
-msgstr ""
+msgid "<![CDATA[documentEvent.observe( new Observer<Document>() { public void notify(Document doc) { ... } } );]]>"
+msgstr "<![CDATA[documentEvent.observe( new Observer<Document>() { public void notify(Document doc) { ... } } );]]>"
#. Tag: para
#: events.xml:146
#, no-c-format
-msgid ""
-"Event binding types may be specified by the event notifier injection point "
-"or by passing event binding type instances to the <literal>observe()</"
-"literal> method:"
-msgstr ""
+msgid "Event binding types may be specified by the event notifier injection point or by passing event binding type instances to the <literal>observe()</literal> method:"
+msgstr "事件绑定类型可以通过事件通知者注入点指定,或者将一个事件绑定类型实例传递给 <literal>observe()</literal> 方法:"
#. Tag: programlisting
#: events.xml:149
#, no-c-format
msgid ""
-"<![CDATA[documentEvent.observe( new Observer<Document>() { public void notify"
-"(Document doc) { ... } }, \n"
-" new "
-"AnnotationLiteral<Updated>(){} );]]>"
+"<![CDATA[documentEvent.observe( new Observer<Document>() { public void notify(Document doc) { ... } }, \n"
+" new AnnotationLiteral<Updated>(){} );]]>"
msgstr ""
+"<![CDATA[documentEvent.observe( new Observer<Document>() { public void notify(Document doc) { ... } }, \n"
+" new AnnotationLiteral<Updated>(){} );]]>"
#. Tag: title
#: events.xml:154
#, no-c-format
msgid "Event bindings with members"
-msgstr ""
+msgstr "事件绑定成员"
#. Tag: para
#: events.xml:156
#, no-c-format
msgid "An event binding type may have annotation members:"
-msgstr ""
+msgstr "一个事件绑定类型可以有注释成员:"
#. Tag: programlisting
#: events.xml:158
@@ -352,44 +285,42 @@
" RoleType value();\n"
"}]]>"
msgstr ""
+"<![CDATA[@BindingType\n"
+"@Target({PARAMETER, FIELD})\n"
+"@Retention(RUNTIME)\n"
+"public @interface Role {\n"
+" RoleType value();\n"
+"}]]>"
#. Tag: para
#: events.xml:160
#, no-c-format
-msgid ""
-"The member value is used to narrow the messages delivered to the observer:"
-msgstr ""
+msgid "The member value is used to narrow the messages delivered to the observer:"
+msgstr "成员值用来限制发送给观察者的消息:"
#. Tag: programlisting
#: events.xml:162
#, no-c-format
-msgid ""
-"<![CDATA[public void adminLoggedIn(@Observes @Role(ADMIN) LoggedIn event) "
-"{ ... }]]>"
-msgstr ""
+msgid "<![CDATA[public void adminLoggedIn(@Observes @Role(ADMIN) LoggedIn event) { ... }]]>"
+msgstr "<![CDATA[public void adminLoggedIn(@Observes @Role(ADMIN) LoggedIn event) { ... }]]>"
#. Tag: para
#: events.xml:164
#, no-c-format
-msgid ""
-"Event binding type members may be specified statically by the event "
-"producer, via annotations at the event notifier injection point:"
-msgstr ""
+msgid "Event binding type members may be specified statically by the event producer, via annotations at the event notifier injection point:"
+msgstr "事件绑定类型成员可以通过事件产生者静态地指定,通过在事件通知者注入点使用注释:"
#. Tag: programlisting
#: events.xml:167
#, no-c-format
msgid "<![CDATA[@Observable @Role(ADMIN) Event<LoggedIn> LoggedInEvent;}}]]>"
-msgstr ""
+msgstr "<![CDATA[@Observable @Role(ADMIN) Event<LoggedIn> LoggedInEvent;}}]]>"
#. Tag: para
#: events.xml:169
#, no-c-format
-msgid ""
-"Alternatively, the value of the event binding type member may be determined "
-"dynamically by the event producer. We start by writing an abstract subclass "
-"of <literal>AnnotationLiteral</literal>:"
-msgstr ""
+msgid "Alternatively, the value of the event binding type member may be determined dynamically by the event producer. We start by writing an abstract subclass of <literal>AnnotationLiteral</literal>:"
+msgstr "或者事件绑定类型成员的值也可以由事件产生者动态地决定。我们先写一个 <literal>AnnotationLiteral</literal> 的抽象子类:"
#. Tag: programlisting
#: events.xml:172
@@ -399,34 +330,33 @@
" extends AnnotationLiteral<Role> \n"
" implements Role {}]]>"
msgstr ""
+"<![CDATA[abstract class RoleBinding \n"
+" extends AnnotationLiteral<Role> \n"
+" implements Role {}]]>"
#. Tag: para
#: events.xml:174
#, no-c-format
-msgid ""
-"The event producer passes an instance of this class to <literal>fire()</"
-"literal>:"
-msgstr ""
+msgid "The event producer passes an instance of this class to <literal>fire()</literal>:"
+msgstr "事件产生者将一个这个类的实例传递给 <literal>fire()</literal> :"
#. Tag: programlisting
#: events.xml:176
#, no-c-format
-msgid ""
-"<![CDATA[documentEvent.fire( document, new RoleBinding() { public void value"
-"() { return user.getRole(); } } );]]>"
-msgstr ""
+msgid "<![CDATA[documentEvent.fire( document, new RoleBinding() { public void value() { return user.getRole(); } } );]]>"
+msgstr "<![CDATA[documentEvent.fire( document, new RoleBinding() { public void value() { return user.getRole(); } } );]]>"
#. Tag: title
#: events.xml:181
#, no-c-format
msgid "Multiple event bindings"
-msgstr ""
+msgstr "多个事件绑定"
#. Tag: para
#: events.xml:183
#, no-c-format
msgid "Event binding types may be combined, for example:"
-msgstr ""
+msgstr "事件绑定类型可以组合,例如:"
#. Tag: programlisting
#: events.xml:185
@@ -434,122 +364,95 @@
msgid ""
"<![CDATA[@Observable @Blog Event<Document> blogEvent;\n"
"...\n"
-"if (document.isBlog()) blogEvent.fire(document, new "
-"AnnotationLiteral<Updated>(){});]]>"
+"if (document.isBlog()) blogEvent.fire(document, new AnnotationLiteral<Updated>(){});]]>"
msgstr ""
+"<![CDATA[@Observable @Blog Event<Document> blogEvent;\n"
+"...\n"
+"if (document.isBlog()) blogEvent.fire(document, new AnnotationLiteral<Updated>(){});]]>"
#. Tag: para
#: events.xml:187
#, no-c-format
-msgid ""
-"When this event occurs, all of the following observer methods will be "
-"notified:"
-msgstr ""
+msgid "When this event occurs, all of the following observer methods will be notified:"
+msgstr "当这个事件发生时,下列所有观察者方法都会被通知:"
#. Tag: programlisting
#: events.xml:189
#, no-c-format
-msgid ""
-"<![CDATA[public void afterBlogUpdate(@Observes @Updated @Blog Document "
-"document) { ... }]]>"
-msgstr ""
+msgid "<![CDATA[public void afterBlogUpdate(@Observes @Updated @Blog Document document) { ... }]]>"
+msgstr "<![CDATA[public void afterBlogUpdate(@Observes @Updated @Blog Document document) { ... }]]>"
#. Tag: programlisting
#: events.xml:191
#, no-c-format
-msgid ""
-"<![CDATA[public void onAnyBlogEvent(@Observes @Blog Document document) "
-"{ ... }]]>"
-msgstr ""
+msgid "<![CDATA[public void onAnyBlogEvent(@Observes @Blog Document document) { ... }]]>"
+msgstr "<![CDATA[public void onAnyBlogEvent(@Observes @Blog Document document) { ... }]]>"
#. Tag: programlisting
#: events.xml:192
#, no-c-format
-msgid ""
-"<![CDATA[public void onAnyDocumentEvent(@Observes Document document) "
-"{ ... }}}]]>"
-msgstr ""
+msgid "<![CDATA[public void onAnyDocumentEvent(@Observes Document document) { ... }}}]]>"
+msgstr "<![CDATA[public void onAnyDocumentEvent(@Observes Document document) { ... }}}]]>"
#. Tag: title
#: events.xml:197
#, no-c-format
msgid "Transactional observers"
-msgstr ""
+msgstr "事务性的观察者"
#. Tag: para
#: events.xml:199
#, no-c-format
-msgid ""
-"Transactional observers receive their event notifications during the before "
-"or after completion phase of the transaction in which the event was raised. "
-"For example, the following observer method needs to refresh a query result "
-"set that is cached in the application context, but only when transactions "
-"that update the <literal>Category</literal> tree succeed:"
-msgstr ""
+msgid "Transactional observers receive their event notifications during the before or after completion phase of the transaction in which the event was raised. For example, the following observer method needs to refresh a query result set that is cached in the application context, but only when transactions that update the <literal>Category</literal> tree succeed:"
+msgstr "事务性的观察者在事件触发的事务完成阶段之前或者之后接收到事件通知。例如下面的观察者方法需要刷新在应用上下文中缓存的查询结果集,但只有在事务成果地更新了 <literal>Category</literal> 树之后才能发生:"
#. Tag: programlisting
#: events.xml:205
#, no-c-format
-msgid ""
-"<![CDATA[public void refreshCategoryTree(@AfterTransactionSuccess @Observes "
-"CategoryUpdateEvent event) { ... }]]>"
-msgstr ""
+msgid "<![CDATA[public void refreshCategoryTree(@AfterTransactionSuccess @Observes CategoryUpdateEvent event) { ... }]]>"
+msgstr "<![CDATA[public void refreshCategoryTree(@AfterTransactionSuccess @Observes CategoryUpdateEvent event) { ... }]]>"
#. Tag: para
#: events.xml:207
#, no-c-format
msgid "There are three kinds of transactional observers:"
-msgstr ""
+msgstr "我们有三种事务性观察者:"
#. Tag: para
#: events.xml:211
#, no-c-format
-msgid ""
-"<literal>@AfterTransactionSuccess</literal> observers are called during the "
-"after completion phase of the transaction, but only if the transaction "
-"completes successfully"
-msgstr ""
+msgid "<literal>@AfterTransactionSuccess</literal> observers are called during the after completion phase of the transaction, but only if the transaction completes successfully"
+msgstr "<literal>@AfterTransactionSuccess</literal> 观察者仅仅在事务成功完成之后被调用。"
#. Tag: para
#: events.xml:216
#, no-c-format
-msgid ""
-"<literal>@AfterTransactionFailure</literal> observers are called during the "
-"after completion phase of the transaction, but only if the transaction fails "
-"to complete successfully"
-msgstr ""
+msgid "<literal>@AfterTransactionFailure</literal> observers are called during the after completion phase of the transaction, but only if the transaction fails to complete successfully"
+msgstr "<literal>@AfterTransactionFailure</literal> 观察者仅仅在事务失败之后被调用。"
#. Tag: para
#: events.xml:221
#, no-c-format
-msgid ""
-"<literal>@AfterTransactionCompletion</literal> observers are called during "
-"the after completion phase of the transaction"
-msgstr ""
+msgid "<literal>@AfterTransactionCompletion</literal> observers are called during the after completion phase of the transaction"
+msgstr "<literal>@AfterTransactionCompletion</literal> 观察者在事务完成阶段之后被调用。"
#. Tag: para
#: events.xml:225
#, no-c-format
-msgid ""
-"<literal>@BeforeTransactionCompletion</literal> observers are called during "
-"the before completion phase of the transaction"
-msgstr ""
+msgid "<literal>@BeforeTransactionCompletion</literal> observers are called during the before completion phase of the transaction"
+msgstr "<literal>@BeforeTransactionCompletion</literal> 观察者在事务完成阶段之前被调用。"
#. Tag: para
#: events.xml:230
#, no-c-format
-msgid ""
-"Transactional observers are very important in a stateful object model like "
-"Web Beans, because state is often held for longer than a single atomic "
-"transaction."
-msgstr ""
+msgid "Transactional observers are very important in a stateful object model like Web Beans, because state is often held for longer than a single atomic transaction."
+msgstr "事务性的观察者在诸如Web Beans这类具有状态的对象模型中非常重要,因为状态通常比一个单一的原子事务所保留的时间更长。"
#. Tag: para
#: events.xml:233
#, no-c-format
-msgid ""
-"Imagine that we have cached a JPA query result set in the application scope:"
-msgstr ""
+msgid "Imagine that we have cached a JPA query result set in the application scope:"
+msgstr "设想一下我们已经在应用范围内缓存了一个JPA的查询结果集:"
#. Tag: programlisting
#: events.xml:235
@@ -565,8 +468,7 @@
" @Produces @Catalog \n"
" List<Product> getCatalog() {\n"
" if (products==null) {\n"
-" products = em.createQuery(\"select p from Product p where p."
-"deleted = false\")\n"
+" products = em.createQuery(\"select p from Product p where p.deleted = false\")\n"
" .getResultList();\n"
" }\n"
" return products;\n"
@@ -574,24 +476,35 @@
" \n"
"}]]>"
msgstr ""
+"<![CDATA[@ApplicationScoped @Singleton\n"
+"public class Catalog {\n"
+"\n"
+" @PersistenceContext EntityManager em;\n"
+" \n"
+" List<Product> products;\n"
+"\n"
+" @Produces @Catalog \n"
+" List<Product> getCatalog() {\n"
+" if (products==null) {\n"
+" products = em.createQuery(\"select p from Product p where p.deleted = false\")\n"
+" .getResultList();\n"
+" }\n"
+" return products;\n"
+" }\n"
+" \n"
+"}]]>"
#. Tag: para
#: events.xml:237
#, no-c-format
-msgid ""
-"From time to time, a <literal>Product</literal> is created or deleted. When "
-"this occurs, we need to refresh the <literal>Product</literal> catalog. But "
-"we should wait until <emphasis>after</emphasis> the transaction completes "
-"successfully before performing this refresh!"
-msgstr ""
+msgid "From time to time, a <literal>Product</literal> is created or deleted. When this occurs, we need to refresh the <literal>Product</literal> catalog. But we should wait until <emphasis>after</emphasis> the transaction completes successfully before performing this refresh!"
+msgstr "一个 <literal>Product</literal>时常会被创建或者删除。当这个动作发生后,我们需要刷新 <literal>Product</literal> 分类。但是我们需要在事务完全成功<emphasis>之后</emphasis>才能处理刷新。"
#. Tag: para
#: events.xml:242
#, no-c-format
-msgid ""
-"The Web Bean that creates and deletes <literal>Product</literal>s could "
-"raise events, for example:"
-msgstr ""
+msgid "The Web Bean that creates and deletes <literal>Product</literal>s could raise events, for example:"
+msgstr "创建或者删除 <literal>Product</literal> 的Web Bean应该触发事件,例如:"
#. Tag: programlisting
#: events.xml:245
@@ -617,14 +530,31 @@
" \n"
"}]]>"
msgstr ""
+"<![CDATA[@Stateless\n"
+"public class ProductManager {\n"
+"\n"
+" @PersistenceContext EntityManager em;\n"
+" @Observable Event<Product> productEvent;\n"
+"\n"
+" public void delete(Product product) {\n"
+" em.delete(product);\n"
+" productEvent.fire(product, new AnnotationLiteral<Deleted>(){});\n"
+" }\n"
+" \n"
+" public void persist(Product product) {\n"
+" em.persist(product);\n"
+" productEvent.fire(product, new AnnotationLiteral<Created>(){});\n"
+" }\n"
+" \n"
+" ...\n"
+" \n"
+"}]]>"
#. Tag: para
#: events.xml:247
#, no-c-format
-msgid ""
-"And now <literal>Catalog</literal> can observe the events after successful "
-"completion of the transaction:"
-msgstr ""
+msgid "And now <literal>Catalog</literal> can observe the events after successful completion of the transaction:"
+msgstr "现在 <literal>Catalog</literal> 能够观察到事务成功完成之后触发的事件:"
#. Tag: programlisting
#: events.xml:250
@@ -635,15 +565,28 @@
"\n"
" ...\n"
" \n"
-" void addProduct(@AfterTransactionSuccess @Observes @Created Product "
-"product) {\n"
+" void addProduct(@AfterTransactionSuccess @Observes @Created Product product) {\n"
" products.add(product);\n"
" }\n"
" \n"
-" void addProduct(@AfterTransactionSuccess @Observes @Deleted Product "
-"product) {\n"
+" void addProduct(@AfterTransactionSuccess @Observes @Deleted Product product) {\n"
" products.remove(product);\n"
" }\n"
" \n"
"}]]>"
msgstr ""
+"<![CDATA[@ApplicationScoped @Singleton\n"
+"public class Catalog {\n"
+"\n"
+" ...\n"
+" \n"
+" void addProduct(@AfterTransactionSuccess @Observes @Created Product product) {\n"
+" products.add(product);\n"
+" }\n"
+" \n"
+" void addProduct(@AfterTransactionSuccess @Observes @Deleted Product product) {\n"
+" products.remove(product);\n"
+" }\n"
+" \n"
+"}]]>"
+
17 years, 1 month
[webbeans-commits] Webbeans SVN: r1534 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-02-15 22:14:56 -0500 (Sun, 15 Feb 2009)
New Revision: 1534
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
completed chapter 8 assertions
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-02-16 02:53:34 UTC (rev 1533)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-02-16 03:14:56 UTC (rev 1534)
@@ -2184,8 +2184,326 @@
</section>
<section id="8.4" title="Passivating scopes and serialization">
+ <assertion id="a">
+ <text>The container must validate that every bean declared with a passivating scope truly is serializable - EJB local objects are serializable. Therefore, a session bean may declare any passivating scope</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Simple beans are not required to be serializable. If a simple bean declares a passivating scope, and the bean class is not serializable, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a producer method or field declares a passivating scope and returns a non-serializable object at runtime, an IllegalProductException is thrown by the container</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The built-in session and conversation scopes are passivating</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>No other built-in scope besides session and conversation scopes are passivating</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A contextual instance of a bean may be serialized when the bean declares a passivating scope, and context passivation occurs</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A contextual instance of a bean may be serialized when the bean is an EJB stateful session bean, and it is passivated by the EJB container</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>In either case of assertion f or g above, any non-transient field that holds a reference to another bean must be serialized along with the bean that is
+being serialized. Therefore, the reference must be to a serializable type</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>Any reference to a bean which declares a normal scope is serializable</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>Dependent objects (including interceptors and decorators with scope @Dependent) of a stateful session bean or of a bean with a passivating scope must be serialized and deserialized along with their owner - EJB local objects are serializable. Therefore, any reference to a session bean of scope @Dependent is serializable</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>Dependent objects (including interceptors and decorators with scope @Dependent) of a stateful session bean or of a bean with a passivating scope must be serialized and deserialized along with their owner - A simple bean of scope @Dependent may or may not be serializable. If a simple bean of scope @Dependent and a nonserializable bean class is injected into a stateful session bean, into a non-transient field, bean constructor parameter or initializer method parameter of a bean which declares a passivating scope, or into a parameter of a producer method
+which declares a passivating scope, an UnserializableDependencyException must be thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>Dependent objects (including interceptors and decorators with scope @Dependent) of a stateful session bean or of a bean with a passivating scope must be serialized and deserialized along with their owner - If a producer method or field of scope @Dependent returns a non-serializable object for injection into a stateful session bean, into a non-transient field, bean constructor parameter or initializer method parameter of a bean which declares a passivating scope, or into a parameter of a producer method which declares a passivating scope, an IllegalProductException is thrown by the container</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>Dependent objects (including interceptors and decorators with scope @Dependent) of a stateful session bean or of a bean with a passivating scope must be serialized and deserialized along with their owner - The container must guarantee that JMS resource proxy objects are serializable</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>The method Bean.isSerializable() may be used to detect if a bean is serializable</text>
+ </assertion>
+ </section>
+ <section id="8.5" title="Context management for built-in scopes">
+
+ <assertion id="a">
+ <text>The container provides an implementation of the Context interface for each of the built-in scopes</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For each of the built-in normal scopes, contexts propagate across any Java method call, including invocation of EJB local business methods</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The built-in contexts do not propagate across remote method invocations or to asynchronous processes such as JMS message listeners or EJB timer service timeouts</text>
+ </assertion>
+
</section>
+ <section id="8.5.1" title="Request context lifecycle">
+
+ <assertion id="a">
+ <text>The request scope is active during the service() method of any servlet in the web application</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The request scope is active during the doFilter() method of any servlet filter</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The request context is destroyed at the end of the servlet request, after the service() method and all doFilter() methods return</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The request scope is active during any Java EE web service invocation</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The request context is destroyed after a web service invocation completes</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The request scope is active during any asynchronous observer method notification</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The request context is destroyed after a asynchronous observer method notification completes</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The request scope is active during any remote method invocation of any EJB</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The request scope is active during any call to an EJB timeout method</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The request scope is active during message delivery to any EJB message-driven bean</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>The request context is destroyed after the remote EJB method invocation completes</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The request context is destroyed after the invocation of an EJB timeout method</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>The request context is destroyed after message delivery to an EJB message-drive bean completes</text>
+ </assertion>
+ </section>
+
+ <section id="8.5.2" title="Session context lifecycle">
+
+ <assertion id="a">
+ <text>The session scope is active during the service() method of any servlet in the web application</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The session scope is active during the doFilter() method of any servlet filter</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The session context is shared between all servlet requests that occur in the same HTTP servlet session</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The session context is destroyed when the HTTPSession is invalidated</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The session context is destroyed when the HTTPSession times out</text>
+ </assertion>
+ </section>
+
+ <section id="8.5.3" title="Application context lifecycle">
+
+ <assertion id="a">
+ <text>The application scope is active during the service() method of any servlet in the web application</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The application scope is active during the doFilter() method of any servlet filter</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The application scope is active during any Java EE web service invocation</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The application scope is active during any asynchronous observer method notification</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The application scope is active during any remote method invocation of any EJB</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The application scope is active during any call to an EJB timeout method</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The application scope is active during message delivery to any EJB message-driven bean</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The application context is shared between all servlet requests that execute within the same application</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The application context is shared between all asynchronous observer method notifications that execute within the same application</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The application context is shared between all web service invocations that execute within the same application</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>The application context is shared between all EJB remote method invocations that execute within the same application</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The application context is shared between all EJB timeouts that execute
+within the same application</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>The application context is shared between all message deliveries to message driven beans that execute within the same application</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>The application context is destroyed when the application is undeployed</text>
+ </assertion>
+ </section>
+
+ <section id="8.5.4" title="Conversation context lifecycle">
+
+ <assertion id="a">
+ <text>For a JSF faces request, the conversation context is active from the beginning of the apply request values phase, until the response is complete</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For a JSF non-faces request, the context is active during the render response phase</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Any JSF request has exactly one associated conversation</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The conversation associated with a JSF request is determined at the end of the restore view phase and does not change during the request</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>By default, a conversation is transient</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A transient conversation may be marked long-running by calling Conversation.begin()</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A long-running conversation may be marked transient by calling Conversation.end()</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>All long-running conversations have a string-valued unique identifier, which may be set by the application when the conversation is marked long-running, or generated by the container</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The container provides a built-in bean with bean type javax.context.Conversation, scope @RequestScoped, deployment type @Standard and binding @Current, named javax.context.conversation</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If the conversation associated with the current JSF request is in the transient state at the end of a JSF request, it is destroyed, and the conversation context is also destroyed</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If the conversation associated with the current JSF request is in the long-running state at the end of a JSF request, it is not destroyed</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The long-running conversation context associated with a request that renders a JSF view is automatically propagated to any faces request (JSF form submission) that originates from that rendered page</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>The long-running conversation context associated with a request that renders a JSF view is automatically propagated to any faces request (JSF form submission) that originates from that rendered page</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>The long-running conversation associated with a request may be propagated to any non-faces request via use of a GET request parameter named cid containing the unique identifier of the conversation. In this case, the application must manage this request parameter</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>When no conversation is propagated to a JSF request, the request is associated with a new transient conversation</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>All long-running conversations are scoped to a particular HTTP servlet session and may not cross session boundaries</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>When the HTTP servlet session is invalidated, all long-running conversation contexts created during the current session are destroyed</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>The container is permitted to arbitrarily destroy any long-running conversation that is associated with no current JSF request, in order to conserve resources</text>
+ </assertion>
+
+ <assertion id="s">
+ <text>If the propagated conversation cannot be restored, the request is associated with a new transient conversation</text>
+ </assertion>
+
+ <assertion id="t">
+ <text>The method Conversation.setTimeout() is a hint to the container that a conversation should not be destroyed if it has been active within the last given interval in milliseconds</text>
+ </assertion>
+
+ <assertion id="u">
+ <text>The container ensures that a long-running conversation may be associated with at most one request at a time, by blocking or rejecting concurrent requests</text>
+ </assertion>
+ </section>
+
+ <section id="8.6" title="Context management for custom scopes">
+
+ <assertion id="a">
+ <text>A custom implementation of Context may be associated with any scope type at any point in the execution of the application, by calling Manager.addContext()</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Every time Manager.getInstance() is called, for example, during instance or EL name resolution, the container must call Manager.getContext() to retrieve an active context object associated with the bean scope</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If no active context object exists for the given scope type,
+Manager.getContext() must throw a ContextNotActiveException</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If more than one active context object exists for the given
+scope type, Manager.getContext() must throw an IllegalStateException</text>
+ </assertion>
+ </section>
+
</specification>
17 years, 1 month