[webbeans-commits] Webbeans SVN: r2437 - in tck/trunk: xml and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-16 11:19:53 -0400 (Thu, 16 Apr 2009)
New Revision: 2437
Modified:
tck/trunk/interceptor/
tck/trunk/xml/
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
Log:
minor
Property changes on: tck/trunk/interceptor
___________________________________________________________________
Name: svn:ignore
+
> .classpath
> .project
> .settings
> target
Property changes on: tck/trunk/xml
___________________________________________________________________
Name: svn:ignore
+
.classpath
.project
.settings
target
Modified: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-04-16 15:17:44 UTC (rev 2436)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-04-16 15:19:53 UTC (rev 2437)
@@ -43,5 +43,340 @@
FishPond fishPond = getCurrentManager().getInstanceByType(FishPond.class);
assert fishPond.goldfish != null;
}
+
+ @Test
+ @SpecAssertion(section = "3.2.6.3", id = "a")
+ public void testBindingTypeAnnotatedConstructor() throws Exception
+ {
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ getCurrentManager().getInstanceByType(Duck.class);
+ assert Duck.constructedCorrectly;
+ }
+ }.run();
+ }
+ @Test(groups = { "specialization" })
+ @SpecAssertion(section = "3.2.7", id = "c")
+ public void testSpecializedBeanAlwaysUsed() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ assert getCurrentManager().getInstanceByType(Lion.class, TAME_LITERAL) instanceof MountainLion;
+ }
+
+ }.run();
+ }
+
+ @Test(groups = "beanLifecycle")
+ @SpecAssertions({
+ @SpecAssertion(section = "6.1", id = "b"),
+ @SpecAssertion(section = "6.2", id = "d")
+ })
+ public void testCreateReturnsSameBeanPushed() throws Exception
+ {
+ final CreationalContext<Farm> farmCreationalContext = new MyCreationalContext<Farm>();
+ final Contextual<Farm> farmBean = getCurrentManager().resolveByType(Farm.class).iterator().next();
+ MyCreationalContext.setLastBeanPushed(null);
+ MyCreationalContext.setPushCalled(false);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ Farm farmInstance = getCurrentManager().getContext(Dependent.class).get(farmBean, farmCreationalContext);
+ if (MyCreationalContext.isPushCalled())
+ {
+ assert farmInstance.equals(MyCreationalContext.getLastBeanPushed());
+ }
+ assert farmInstance.farmOffice != null : "FarmOffice should be injected by Contextual.create()";
+ }
+
+ }.run();
+ }
+
+ @Test(groups = { "ri-broken", "beanLifecycle" })
+ @SpecAssertions({
+ @SpecAssertion(section = "6.2", id = "e")
+ })
+ public void testCreateSetsInitialValuesFromXml() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ Farm farmInstance = getCurrentManager().getInstanceByType(Farm.class);
+ assert farmInstance.location != null;
+ assert farmInstance.location.equals("Indiana");
+ }
+
+ }.run();
+ }
+
+ @Test(groups = "beanLifecycle")
+ @SpecAssertions({
+ @SpecAssertion(section = "6.2", id = "a"),
+ @SpecAssertion(section="2", id="g"),
+ @SpecAssertion(section="2.2", id="f"),
+ @SpecAssertion(section="3.2.6", id="a"),
+ @SpecAssertion(section = "6", id = "d")
+ })
+ public void testCreateReturnsInstanceOfBean()
+ {
+ assert getCurrentManager().resolveByType(RedSnapper.class).size() == 1;
+ assert getCurrentManager().getInstanceByType(RedSnapper.class) instanceof RedSnapper;
+ }
+
+ @Test(groups = { "stub", "beanLifecycle", "interceptors" })
+ @SpecAssertion(section = "6.2", id = "b")
+ public void testCreateBindsInterceptorStack()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "beanLifecycle", "decorators" })
+ @SpecAssertion(section = "6.2", id = "c")
+ public void testCreateBindsDecoratorStack()
+ {
+ assert false;
+ }
+
+ @Test(groups = "injection")
+ @SpecAssertions({
+ @SpecAssertion(section = "6.4", id = "e"),
+ @SpecAssertion(section = "3.8.1", id = "a")
+ })
+ public void testCreateInjectsFieldsDeclaredInJava()
+ {
+ assert getCurrentManager().resolveByType(TunaFarm.class).size() == 1;
+ TunaFarm tunaFarm = getCurrentManager().getInstanceByType(TunaFarm.class);
+ assert tunaFarm.tuna != null;
+ }
+
+ @Test(groups = "beanLifecycle")
+ @SpecAssertions({
+ @SpecAssertion(section = "6", id = "g")
+ })
+ public void testContextCreatesNewInstanceForInjection()
+ {
+ Context requestContext = getCurrentManager().getContext(RequestScoped.class);
+ Bean<Tuna> tunaBean = getCurrentManager().resolveByType(Tuna.class).iterator().next();
+ assert requestContext.get(tunaBean) == null;
+ TunaFarm tunaFarm = getCurrentManager().getInstanceByType(TunaFarm.class);
+ assert tunaFarm.tuna != null;
+ }
+
+ @Test(groups = { "beanLifecycle", "lifecycleCallbacks" })
+ @SpecAssertions({
+ @SpecAssertion(section = "6.2", id = "f"),
+ @SpecAssertion(section = "6.3", id = "b"),
+ @SpecAssertion(section = "6.4", id = "j"),
+ @SpecAssertion(section = "6.4", id = "k")
+ })
+ public void testPostConstructPreDestroy() throws Exception
+ {
+ assert getCurrentManager().resolveByType(Farm.class).size() == 1;
+ Bean<Farm> farmBean = getCurrentManager().resolveByType(Farm.class).iterator().next();
+ Farm farm = getCurrentManager().getInstanceByType(Farm.class);
+ assert farm.founded != null;
+ assert farm.initialStaff == 20;
+ assert farm.closed == null;
+ farmBean.destroy(farm);
+ assert farm.closed != null;
+ }
+
+ @Test(groups = { "beanLifecycle", "lifecycleCallbacks" })
+ @SpecAssertions({
+ @SpecAssertion(section = "6.3", id = "a"),
+ @SpecAssertion(section = "6.3", id = "c")
+ })
+ public void testContextualDestroyDisposesWhenNecessary() throws Exception
+ {
+ final Contextual<Goose> gooseBean = getCurrentManager().resolveByType(Goose.class).iterator().next();
+ final Goose goose = getCurrentManager().getInstanceByType(Goose.class);
+
+ assert !EggProducer.isEggDisposed();
+ assert !Egg.isEggDestroyed();
+ gooseBean.destroy(goose);
+ assert EggProducer.isEggDisposed();
+ //TODO Apparently Dependent scoped injected objects do not have their PreDestroy method called
+ //assert Egg.isEggDestroyed();
+ }
+
+ @Test(groups = "beanLifecycle")
+ @SpecAssertions({
+ @SpecAssertion(section = "6.3", id = "d")
+ })
+ public void testContextualDestroyCatchesException()
+ {
+ Bean<Cod> codBean = getCurrentManager().resolveByType(Cod.class).iterator().next();
+ Cod codInstance = getCurrentManager().getInstanceByType(Cod.class);
+ codBean.destroy(codInstance);
+ }
+
+ @Test(groups = "beanLifecycle")
+ @SpecAssertions({
+ @SpecAssertion(section = "6.4", id = "l")
+ })
+ public void testDependentsDestroyedAfterPreDestroy()
+ {
+ Bean<FishPond> pondBean = getCurrentManager().resolveByType(FishPond.class).iterator().next();
+ FishPond fishPond = getCurrentManager().getInstanceByType(FishPond.class);
+ pondBean.destroy(fishPond);
+ assert Salmon.isBeanDestroyed();
+ }
+
+ @Test
+ @SpecAssertion(section = "4.2", id = "baa")
+ public void testSubClassInheritsPostConstructOnSuperclass() throws Exception
+ {
+ OrderProcessor.postConstructCalled = false;
+ assert getCurrentManager().resolveByType(CdOrderProcessor.class).size() == 1;
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ getCurrentManager().getInstanceByType(CdOrderProcessor.class).order();
+ }
+ }.run();
+ assert OrderProcessor.postConstructCalled;
+ }
+
+ @Test
+ @SpecAssertion(section = "4.2", id = "bac")
+ public void testIndirectSubClassInheritsPostConstructOnSuperclass() throws Exception
+ {
+ OrderProcessor.postConstructCalled = false;
+ assert getCurrentManager().resolveByType(IndirectOrderProcessor.class).size() == 1;
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ getCurrentManager().getInstanceByType(IndirectOrderProcessor.class).order();
+ }
+ }.run();
+ assert OrderProcessor.postConstructCalled;
+ }
+
+ @Test
+ @SpecAssertion(section = "4.2", id = "bba")
+ public void testSubClassInheritsPreDestroyOnSuperclass() throws Exception
+ {
+ OrderProcessor.preDestroyCalled = false;
+ assert getCurrentManager().resolveByType(CdOrderProcessor.class).size() == 1;
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ Bean<CdOrderProcessor> bean = getCurrentManager().resolveByType(CdOrderProcessor.class).iterator().next();
+ CdOrderProcessor instance = getCurrentManager().getInstanceByType(CdOrderProcessor.class);
+ bean.destroy(instance);
+ }
+ }.run();
+ assert OrderProcessor.preDestroyCalled;
+ }
+
+ @Test
+ @SpecAssertion(section = "4.2", id = "bbc")
+ public void testIndirectSubClassInheritsPreDestroyOnSuperclass() throws Exception
+ {
+ OrderProcessor.preDestroyCalled = false;
+ assert getCurrentManager().resolveByType(IndirectOrderProcessor.class).size() == 1;
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ Bean<IndirectOrderProcessor> bean = getCurrentManager().resolveByType(IndirectOrderProcessor.class).iterator().next();
+ IndirectOrderProcessor instance = getCurrentManager().getInstanceByType(IndirectOrderProcessor.class);
+ bean.destroy(instance);
+ }
+ }.run();
+ assert OrderProcessor.preDestroyCalled;
+ }
+
+ @Test
+ @SpecAssertion(section = "4.2", id = "baa")
+ public void testSubClassDoesNotInheritPostConstructOnSuperclassBlockedByIntermediateClass() throws Exception
+ {
+ assert getCurrentManager().resolveByType(NovelOrderProcessor.class).size() == 1;
+ OrderProcessor.postConstructCalled = false;
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ getCurrentManager().getInstanceByType(NovelOrderProcessor.class).order();
+ }
+ }.run();
+ assert !OrderProcessor.postConstructCalled;
+ }
+
+ @Test
+ @SpecAssertion(section = "4.2", id = "bba")
+ public void testSubClassDoesNotInheritPreDestroyConstructOnSuperclassBlockedByIntermediateClass() throws Exception
+ {
+ OrderProcessor.preDestroyCalled = false;
+ assert getCurrentManager().resolveByType(NovelOrderProcessor.class).size() == 1;
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ Bean<NovelOrderProcessor> bean = getCurrentManager().resolveByType(NovelOrderProcessor.class).iterator().next();
+ NovelOrderProcessor instance = getCurrentManager().getInstanceByType(NovelOrderProcessor.class);
+ bean.destroy(instance);
+ }
+ }.run();
+ assert !OrderProcessor.preDestroyCalled;
+
+ }
+
+ @Test(expectedExceptions = CreationException.class)
+ @SpecAssertion(section = "6.2", id = "h")
+ public void testCreationExceptionWrapsCheckedExceptionThrownFromCreate() throws Exception
+ {
+ assert getCurrentManager().resolveByType(Lorry_Broken.class).size() == 1;
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ getCurrentManager().getInstanceByType(Lorry_Broken.class);
+ }
+
+ }.run();
+ }
+
+ @Test(expectedExceptions = FooException.class)
+ @SpecAssertion(section = "6.2", id = "g")
+ public void testUncheckedExceptionThrownFromCreateNotWrapped() throws Exception
+ {
+ assert getCurrentManager().resolveByType(Van_Broken.class).size() == 1;
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ getCurrentManager().getInstanceByType(Van_Broken.class);
+ }
+
+ }.run();
+ }
+
}
17 years
[webbeans-commits] Webbeans SVN: r2436 - doc/trunk/reference/en-US.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-16 11:17:44 -0400 (Thu, 16 Apr 2009)
New Revision: 2436
Modified:
doc/trunk/reference/en-US/ri-spi.xml
Log:
Add docs for binding manager into JNDI
Modified: doc/trunk/reference/en-US/ri-spi.xml
===================================================================
--- doc/trunk/reference/en-US/ri-spi.xml 2009-04-16 15:14:19 UTC (rev 2435)
+++ doc/trunk/reference/en-US/ri-spi.xml 2009-04-16 15:17:44 UTC (rev 2436)
@@ -592,6 +592,21 @@
</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>
+ Binding the manager in JNDI
+ </term>
+ <listitem>
+ <para>
+ You should bind a <literal>Reference</literal> to the Manager
+ <literal>ObjectFactory</literal> into JNDI at
+ <literal>java:app/Manager</literal>. The type should be
+ <literal>javax.inject.manager.Manager</literal> and the
+ factory class is
+ <literal>org.jboss.webbeans.resources.ManagerObjectFactory</literal>
+ </para>
+ </listitem>
+ </varlistentry>
</variablelist>
</section>
17 years
[webbeans-commits] Webbeans SVN: r2435 - in tck/trunk: impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding and 116 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-16 11:14:19 -0400 (Thu, 16 Apr 2009)
New Revision: 2435
Added:
tck/trunk/interceptor/
tck/trunk/interceptor/pom.xml
tck/trunk/interceptor/src/
tck/trunk/interceptor/src/main/
tck/trunk/interceptor/src/main/java/
tck/trunk/interceptor/src/main/java/org/
tck/trunk/interceptor/src/main/java/org/jboss/
tck/trunk/interceptor/src/main/java/org/jboss/jsr299/
tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/
tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java
tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/impl/
tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/impl/JSR299ConfigurationImpl.java
tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/impl/JSR299PropertiesBasedConfigurationBuilder.java
tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/literals/
tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/literals/CurrentLiteral.java
tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/literals/NewLiteral.java
tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/tests/
tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/tests/xml/
tck/trunk/interceptor/src/main/resources/
tck/trunk/interceptor/src/main/resources/META-INF/
tck/trunk/interceptor/src/main/resources/META-INF/jboss-test-harness.properties
tck/trunk/interceptor/src/main/resources/META-INF/tck-unit.properties
tck/trunk/interceptor/src/main/resources/org/
tck/trunk/interceptor/src/main/resources/org/jboss/
tck/trunk/interceptor/src/main/resources/org/jboss/jsr299/
tck/trunk/interceptor/src/main/resources/org/jboss/jsr299/tck/
tck/trunk/interceptor/src/main/resources/org/jboss/jsr299/tck/impl/
tck/trunk/interceptor/src/main/resources/org/jboss/jsr299/tck/impl/packaging/
tck/trunk/interceptor/src/main/resources/org/jboss/jsr299/tck/impl/packaging/jsr299/
tck/trunk/interceptor/src/main/resources/org/jboss/jsr299/tck/tests/
tck/trunk/interceptor/src/main/resources/org/jboss/jsr299/tck/tests/xml/
tck/trunk/interceptor/src/main/resources/org/jboss/jsr299/tck/tests/xml/declaration/
tck/trunk/interceptor/src/main/resources/org/jboss/jsr299/tck/unit/
tck/trunk/interceptor/src/main/resources/org/jboss/testharness/
tck/trunk/interceptor/src/main/resources/org/jboss/testharness/impl/
tck/trunk/interceptor/src/main/resources/org/jboss/testharness/impl/packaging/
tck/trunk/interceptor/src/main/resources/org/jboss/testharness/impl/packaging/ear/
tck/trunk/interceptor/src/main/resources/org/jboss/testharness/impl/packaging/ear/ejb-jar.xml
tck/trunk/interceptor/src/main/resources/org/jboss/testharness/impl/packaging/jsr299/
tck/trunk/interceptor/src/main/resources/org/jboss/testharness/impl/packaging/jsr299/default/
tck/trunk/interceptor/src/main/resources/org/jboss/testharness/impl/packaging/jsr299/default/beans.xml
tck/trunk/interceptor/src/main/resources/tck-audit.xml
tck/trunk/interceptor/src/main/resources/tck-tests.xml
tck/trunk/interceptor/src/test/
tck/trunk/interceptor/src/test/java/
tck/trunk/interceptor/src/test/java/org/
tck/trunk/interceptor/src/test/java/org/jboss/
tck/trunk/interceptor/src/test/java/org/jboss/jsr299/
tck/trunk/interceptor/src/test/java/org/jboss/jsr299/tck/
tck/trunk/interceptor/src/test/java/org/jboss/jsr299/tck/test/
tck/trunk/interceptor/src/test/java/org/jboss/jsr299/tck/test/impl/
tck/trunk/interceptor/src/test/java/org/jboss/jsr299/tck/test/impl/packaging/
tck/trunk/interceptor/src/test/java/org/jboss/jsr299/tck/test/impl/packaging/declarative/
tck/trunk/interceptor/src/test/java/org/jboss/jsr299/tck/test/impl/packaging/declarative/standalone/
tck/trunk/interceptor/src/test/java/org/jboss/jsr299/tck/test/impl/packaging/descriptors/
tck/trunk/interceptor/src/test/java/org/jboss/jsr299/tck/test/impl/packaging/descriptors/subpackages/
tck/trunk/interceptor/src/test/java/org/jboss/jsr299/tck/test/impl/packaging/scanner/
tck/trunk/interceptor/src/test/resources/
tck/trunk/interceptor/src/test/resources/org/
tck/trunk/interceptor/src/test/resources/org/jboss/
tck/trunk/interceptor/src/test/resources/org/jboss/jsr299/
tck/trunk/interceptor/src/test/resources/org/jboss/jsr299/tck/
tck/trunk/interceptor/src/test/resources/org/jboss/jsr299/tck/test/
tck/trunk/interceptor/src/test/resources/org/jboss/jsr299/tck/test/impl/
tck/trunk/interceptor/src/test/resources/org/jboss/jsr299/tck/test/impl/packaging/
tck/trunk/interceptor/src/test/resources/org/jboss/jsr299/tck/test/impl/packaging/declarative/
tck/trunk/interceptor/src/test/resources/org/jboss/jsr299/tck/test/impl/packaging/declarative/standalone/
tck/trunk/xml/
tck/trunk/xml/pom.xml
tck/trunk/xml/src/
tck/trunk/xml/src/main/
tck/trunk/xml/src/main/java/
tck/trunk/xml/src/main/java/org/
tck/trunk/xml/src/main/java/org/jboss/
tck/trunk/xml/src/main/java/org/jboss/jsr299/
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/impl/
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/impl/JSR299ConfigurationImpl.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/impl/JSR299PropertiesBasedConfigurationBuilder.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/literals/
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/literals/CurrentLiteral.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/literals/NewLiteral.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Animal.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/AnotherDeploymentType.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/BookOrderProcessor.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/CdOrderProcessor.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Cod.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Duck.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Egg.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/EggProducer.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Farm.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FarmOffice.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FishPond.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FishStereotype.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FooException.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Goldfish.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Goose.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/IndirectOrderProcessor.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/IntermediateOrderProcessor.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Lion.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Lorry_Broken.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/MountainLion.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/MyCreationalContext.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/NovelOrderProcessor.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/OrderProcessor.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/RedSnapper.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/RequestScopedAnimalStereotype.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Salmon.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Synchronous.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Tame.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Tuna.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/TunaFarm.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Van_Broken.java
tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/xml/
tck/trunk/xml/src/main/resources/
tck/trunk/xml/src/main/resources/META-INF/
tck/trunk/xml/src/main/resources/META-INF/jboss-test-harness.properties
tck/trunk/xml/src/main/resources/META-INF/tck-unit.properties
tck/trunk/xml/src/main/resources/README.TXT
tck/trunk/xml/src/main/resources/images/
tck/trunk/xml/src/main/resources/images/4.1.aa.png
tck/trunk/xml/src/main/resources/org/
tck/trunk/xml/src/main/resources/org/jboss/
tck/trunk/xml/src/main/resources/org/jboss/jsr299/
tck/trunk/xml/src/main/resources/org/jboss/jsr299/tck/
tck/trunk/xml/src/main/resources/org/jboss/jsr299/tck/impl/
tck/trunk/xml/src/main/resources/org/jboss/jsr299/tck/impl/packaging/
tck/trunk/xml/src/main/resources/org/jboss/jsr299/tck/impl/packaging/jsr299/
tck/trunk/xml/src/main/resources/org/jboss/jsr299/tck/tests/
tck/trunk/xml/src/main/resources/org/jboss/jsr299/tck/tests/implementation/
tck/trunk/xml/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/
tck/trunk/xml/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/
tck/trunk/xml/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/beans.xml
tck/trunk/xml/src/main/resources/org/jboss/jsr299/tck/tests/xml/
tck/trunk/xml/src/main/resources/org/jboss/jsr299/tck/tests/xml/declaration/
tck/trunk/xml/src/main/resources/org/jboss/jsr299/tck/unit/
tck/trunk/xml/src/main/resources/tck-audit.xml
tck/trunk/xml/src/main/resources/tck-tests.xml
tck/trunk/xml/src/test/
tck/trunk/xml/src/test/java/
tck/trunk/xml/src/test/java/org/
tck/trunk/xml/src/test/java/org/jboss/
tck/trunk/xml/src/test/java/org/jboss/jsr299/
tck/trunk/xml/src/test/java/org/jboss/jsr299/tck/
tck/trunk/xml/src/test/java/org/jboss/jsr299/tck/test/
tck/trunk/xml/src/test/java/org/jboss/jsr299/tck/test/impl/
tck/trunk/xml/src/test/java/org/jboss/jsr299/tck/test/impl/packaging/
tck/trunk/xml/src/test/java/org/jboss/jsr299/tck/test/impl/packaging/declarative/
tck/trunk/xml/src/test/java/org/jboss/jsr299/tck/test/impl/packaging/declarative/standalone/
tck/trunk/xml/src/test/java/org/jboss/jsr299/tck/test/impl/packaging/descriptors/
tck/trunk/xml/src/test/java/org/jboss/jsr299/tck/test/impl/packaging/descriptors/subpackages/
tck/trunk/xml/src/test/java/org/jboss/jsr299/tck/test/impl/packaging/scanner/
tck/trunk/xml/src/test/resources/
tck/trunk/xml/src/test/resources/org/
tck/trunk/xml/src/test/resources/org/jboss/
tck/trunk/xml/src/test/resources/org/jboss/jsr299/
tck/trunk/xml/src/test/resources/org/jboss/jsr299/tck/
tck/trunk/xml/src/test/resources/org/jboss/jsr299/tck/test/
tck/trunk/xml/src/test/resources/org/jboss/jsr299/tck/test/impl/
tck/trunk/xml/src/test/resources/org/jboss/jsr299/tck/test/impl/packaging/
tck/trunk/xml/src/test/resources/org/jboss/jsr299/tck/test/impl/packaging/declarative/
tck/trunk/xml/src/test/resources/org/jboss/jsr299/tck/test/impl/packaging/declarative/standalone/
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/decorator/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/statelessDecorator/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/statelessInterceptor/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/interceptor/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/declaration/bean/BeanDeclarationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/declaration/bean/child/
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/name/NameDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/ScopeDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/commonAnnotations/ResourceInjectionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/DisposalMethodDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
split out interceptors and xml tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -12,7 +12,6 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -68,71 +67,6 @@
assert model.getBindings().size() == 2;
}
- @Test(groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "2.3.4", id = "a")
- public void testBindingsDeclaredInXml()
- {
- // Map<Class<? extends Annotation>, Annotation> annotations = new
- // HashMap<Class<? extends Annotation>, Annotation>();
- // annotations.put(Asynchronous.class, new
- // AsynchronousAnnotationLiteral());
- // AnnotatedClass annotatedItem = new SimpleAnnotatedClass(Antelope.class,
- // annotations);
-
- // SimpleBean<Antelope> antelope = createSimpleBean(Antelope.class,
- // annotatedItem, manager);
- // assert Reflections.annotationSetMatches(antelope.getBindingTypes(),
- // Asynchronous.class);
- assert false;
- }
-
- @Test(groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "2.3.5", id = "d")
- public void testXmlBindingOverridesAndIgnoresJava()
- {
- // Map<Class<? extends Annotation>, Annotation> annotations = new
- // HashMap<Class<? extends Annotation>, Annotation>();
- // annotations.put(Asynchronous.class, new
- // AsynchronousAnnotationLiteral());
- // AnnotatedClass<Cat> annotatedItem = new
- // SimpleAnnotatedClass<Cat>(Cat.class, annotations);
-
- // SimpleBean<Cat> cat = createSimpleBean(Cat.class, annotatedItem,
- // manager);
- // assert cat.getBindingTypes().size() == 1;
- // assert cat.getBindingTypes().contains(new
- // AnnotationLiteral<Asynchronous>() {});
- assert false;
- }
-
- @Test(groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "2.3.4", id = "a")
- public void testNoBindingsDeclaredInXml()
- {
- // Map<Class<? extends Annotation>, Annotation> annotations = new
- // HashMap<Class<? extends Annotation>, Annotation>();
- // AnnotatedClass<Cat> annotatedItem = new
- // SimpleAnnotatedClass<Cat>(Cat.class, annotations);
-
- // SimpleBean<Cat> cat = createSimpleBean(Cat.class, annotatedItem,
- // manager);
- // assert cat.getBindingTypes().size() == 1;
- // assert cat.getBindingTypes().contains(new
- // AnnotationLiteral<Synchronous>() {});
- assert false;
- }
-
- @Test(groups = { "stub", "webbeansxml" })
- @SpecAssertions( { @SpecAssertion(section = "2.3.4", id = "a"),
- @SpecAssertion(section = "2.3.5", id = "c") })
- public void testDefaultBindingDeclaredInXml()
- {
- Bean<?> model = getCurrentManager().resolveByType(Tuna.class).iterator().next();
- assert model.getBindings().size() == 1;
- assert model.getBindings().contains(new CurrentLiteral());
- assert false;
- }
-
@Test(groups = { "injection", "producerMethod" })
@SpecAssertion(section = "2.3.5", id = "a")
public void testFieldInjectedFromProducerMethod() throws Exception
@@ -142,20 +76,6 @@
assert barn.petSpider instanceof DefangedTarantula;
}
- @Test(groups = { "stub", "injection", "webbeansxml" })
- @SpecAssertion(section = "2.3.6", id = "b")
- public void testFieldWithBindingInXml()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "injection", "webbeansxml" })
- @SpecAssertion(section = "2.3.6", id = "c")
- public void testFieldWithBindingInXmlIgnoresAnnotations()
- {
- assert false;
- }
-
@Test(groups = { "injection", "producerMethod" })
@SpecAssertion(section = "unknown", id = "unknown")
public void testMethodWithBindingAnnotationsOnParametersAreInjected() throws Exception
@@ -176,20 +96,6 @@
}
- @Test(groups = { "stub", "injection", "webbeansxml" })
- @SpecAssertion(section = "2.3.6", id = "e")
- public void testMethodWithBindingAnnotationsOnParametersDeclaredInXml()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "injection", "webbeansxml" })
- @SpecAssertion(section = "2.3.6", id = "f")
- public void testMethodWithBindingAnnotationsOnParametersDeclaredInXmlIgnoresAnnotations()
- {
- assert false;
- }
-
@Test
@SpecAssertion(section = "4.1", id = "aa")
public void testBindingDeclaredInheritedIsInherited() throws Exception
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -5,7 +5,6 @@
import java.util.Arrays;
import java.util.List;
-import javax.inject.DeploymentException;
import javax.inject.DeploymentType;
import javax.inject.Production;
import javax.inject.UnsatisfiedDependencyException;
@@ -63,18 +62,6 @@
assert blackWidowSpiderModel.getDeploymentType().equals(AnotherDeploymentType.class);
}
- /**
- *
- * TODO Section 2.5.4 does not claim that XML overrides Java for deployment
- * types
- */
- @Test(groups = { "stub", "webbeansxml", "deploymentType" })
- @SpecAssertion(section = "2.5.4", id = "a")
- public void testXmlDeploymentTypeElement()
- {
- assert false;
- }
-
@Test(groups = { "webbeansxml", "deploymentType" })
@SpecAssertion(section = "2.5.5", id = "a")
public void testDefaultDeploymentType()
@@ -100,13 +87,6 @@
getCurrentManager().getInstanceByType(RedSnapper.class);
}
- @Test(groups = { "stub", "webbeansxml", "deploymentType" }, expectedExceptions = DeploymentException.class)
- @SpecAssertion(section = "2.5.4", id = "b")
- public void testMultipleDeployElementsCannotBeDefined()
- {
- assert false;
- }
-
@Test(groups = { "deploymentType" })
@SpecAssertions( {
@SpecAssertion(section = "2.5.5", id = "c"),
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/name/NameDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/name/NameDefinitionTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/name/NameDefinitionTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -38,23 +38,6 @@
assert moose.getName().equals("aMoose");
}
- @Test(groups={"stub", "webbeansxml"})
- @SpecAssertion(section="2.6.2", id = "a")
- public void testNonDefaultXmlNamed()
- {
- assert false;
- }
-
- @Test(groups={"stub", "webbeansxml"})
- @SpecAssertions({
- @SpecAssertion(section="2.6.2", id = "b"),
- @SpecAssertion(section = "2.6.3",id = "b")
- })
- public void testJavaNamedUsedWhenNoXmlSpecified()
- {
- assert false;
- }
-
@Test
@SpecAssertions({
@SpecAssertion(section= "2.6.3", id = "a"),
@@ -69,13 +52,6 @@
assert haddock.getName().equals("haddock");
}
- @Test(groups={"stub", "webbeansxml"})
- @SpecAssertion(section="2.6.3", id = "b")
- public void testDefaultXmlNamed()
- {
- assert false;
- }
-
@Test
@SpecAssertions({
@SpecAssertion(section = "2.6.3", id = "c"),
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/ScopeDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/ScopeDefinitionTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/ScopeDefinitionTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -4,7 +4,6 @@
import java.lang.annotation.Target;
import java.util.Arrays;
import java.util.List;
-import java.util.Set;
import javax.context.ApplicationScoped;
import javax.context.Dependent;
@@ -65,13 +64,6 @@
assert bean.getScopeType().equals(RequestScoped.class);
}
- @Test(groups={"stub", "webbeansxml"})
- @SpecAssertion(section="2.4.4", id = "a")
- public void testScopeDeclaredInXml()
- {
- assert false;
- }
-
@Test @SpecAssertion(section="2.4.5", id = "a")
public void testDefaultScope()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -57,27 +57,6 @@
assert getCurrentManager().resolveByType(Reindeer.class).size() == 1;
assert getCurrentManager().resolveByType(Reindeer.class).iterator().next().getScopeType().equals(Dependent.class);
}
-
- @Test(groups = "stub")
- @SpecAssertion(section = "2.7.1.2", id = "a")
- public void testStereotypeWithoutInterceptors()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "interceptors" })
- @SpecAssertion(section = "2.7.1.2", id = "b")
- public void testStereotypeWithOneInterceptor()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "interceptors" })
- @SpecAssertion(section = "2.7.1.2", id = "c")
- public void testStereotypeWithMultipleInterceptors()
- {
- assert false;
- }
@Test
@SpecAssertion(section = "2.7", id = "c")
@@ -112,21 +91,6 @@
assert getCurrentManager().resolveByType(Springbok.class).iterator().next().getScopeType().equals(ApplicationScoped.class);
}
- @Test(groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "2.7.3", id = "a")
- public void testStereotypeDeclaredInXmlIgnoresJavaStereotypes()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "2.7.3", id = "a")
- public void testStereotypeDeclaredInXmlIgnoresJavaBindingTypes()
- {
- assert false;
-
- }
-
@Test
@SpecAssertions( { @SpecAssertion(section = "2.7.1.4", id = "b"),
@SpecAssertion(section = "2.7.4", id = "a") })
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -309,23 +309,6 @@
assert resolvedObservers.size() == 2;
}
- @Test(groups = { "stub", "events", "webbeansxml" })
- @SpecAssertions( {
- @SpecAssertion(section = "7.5.3", id = "a"),
- @SpecAssertion(section = "7.5.3", id = "b")
- } )
- public void testXMLDefinedObserverMethodIgnoresBindingAnnotations()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "events", "webbeansxml" })
- @SpecAssertion(section = "7.5.3", id = "c")
- public void testXMLDefinedObserverNotFindingImplementationMethodFails()
- {
- assert false;
- }
-
/**
* In addition to the event parameter, observer methods may declare
* additional parameters, which may declare bindings. The container calls the
@@ -377,16 +360,9 @@
}.run();
}
-
- @Test(groups = { "events", "stub" })
- @SpecAssertions( { @SpecAssertion(section = "7.5.5", id = "c") } )
- public void testConditionalObserverDefinedByXML()
- {
- assert false;
- }
@Test(groups = { "events" })
- @SpecAssertions( { @SpecAssertion(section = "7.5.7", id = "a"), @SpecAssertion(section = "7.5.8", id = "c"), @SpecAssertion(section = "7.5.8", id = "g")} )
+ @SpecAssertions( { @SpecAssertion(section = "7.5.8", id = "c"), @SpecAssertion(section = "7.5.8", id = "g")} )
public void testAsynchronousObserverIsAsynchronous() throws Exception
{
new RunInDependentContext()
@@ -403,13 +379,6 @@
}.run();
}
- @Test(groups = { "stub", "events", "webbeansxml" })
- @SpecAssertion(section = "7.5.7", id = "b")
- public void testAsynchronousObserverDeclaredByXML()
- {
- assert false;
- }
-
@Test(groups = { "events" })
@SpecAssertion(section = "7.5.8", id = "a")
public void testObserverMethodRegistration()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -86,7 +86,7 @@
}
@Test(groups = { "events", "integration" })
- @SpecAssertions( { @SpecAssertion(section = "7.5.6", id = "c"), @SpecAssertion(section = "7.5.6", id = "f"), @SpecAssertion(section = "7.5.6", id = "i"), @SpecAssertion(section = "7.5.8", id = "d"), @SpecAssertion(section = "7.5.8", id = "f") })
+ @SpecAssertions( { @SpecAssertion(section = "7.5.6", id = "c"), @SpecAssertion(section = "7.5.6", id = "i"), @SpecAssertion(section = "7.5.8", id = "d"), @SpecAssertion(section = "7.5.8", id = "f") })
public void testAfterTransactionCompletionObserver() throws InterruptedException
{
dog.setCorrectContext(false);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/commonAnnotations/ResourceInjectionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/commonAnnotations/ResourceInjectionTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/commonAnnotations/ResourceInjectionTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -60,13 +60,6 @@
}
@Test(groups = "stub")
- @SpecAssertion(section = "3.10", id = "g")
- public void testStandardInterceptor()
- {
- assert false;
- }
-
- @Test(groups = "stub")
@SpecAssertion(section = "3.10", id = "h")
public void testExtendedPersistenceContextNotSupported()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -40,13 +40,6 @@
assert getCurrentManager().resolveByType(Laika.class).size() == 1;
}
- @Test(groups = { "webbeansxml", "enterpriseBeans", "stub" })
- @SpecAssertion(section = "3.3", id = "e")
- public void testMultipleXMLDefinedEnterpriseBeansWithSameImplementationClassNotOK()
- {
- assert false;
- }
-
@Test(groups = { "enterpriseBeans" })
@SpecAssertion(section = "3.3.2", id = "a")
public void testAnnotatedEnterpriseBean()
@@ -54,14 +47,6 @@
assert getCurrentManager().resolveByType(GiraffeLocal.class).size() > 0;
}
- @Test(groups = { "enterpriseBeans", "webbeansxml", "stub" })
- @SpecAssertion(section = "3.3.2", id = "a")
- public void testAnnotatedEnterpriseBeanComplementedWithXML()
- {
- // TODO dupe?
- assert false;
- }
-
@Test(groups = { "enterpriseBeans", "ejbjarxml", "stub" })
@SpecAssertion(section = "3.3.2", id = "b")
public void testEJBJARDefinedEnterpriseBean()
@@ -70,14 +55,6 @@
assert false;
}
- @Test(groups = { "enterpriseBeans", "ejbjarxml", "webbeansxml", "stub" })
- @SpecAssertion(section = "3.3.2", id = "b")
- public void testEJBJARDefinedEnterpriseBeanComplementedWithXML()
- {
- // TODO dupe?
- assert false;
- }
-
@Test(groups = { "enterpriseBeans" })
@SpecAssertions( {
@SpecAssertion(section = "3.2.1", id = "f"),
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -133,13 +133,6 @@
assert alteStadt.getPlaceOfInterest().equals(RoemerPassage.name);
}
- @Test(groups = { "enterpriseBeans", "lifecycle", "integration", "stub" })
- @SpecAssertion(section = "6.11", id = "b")
- public void testInitXMLDefinedValuesOnWebWeanEnterpriseBeans()
- {
- assert false;
- }
-
@Test(groups = { "enterpriseBeans", "lifecycle", "integration" })
@SpecAssertion(section = "6.11", id = "c")
public void testInitializerMethodsCalledWithCurrentParameterValues()
@@ -149,20 +142,6 @@
assert alteStadt.getAnotherPlaceOfInterest() != null;
}
- @Test(groups = { "enterpriseBeans", "lifecycle", "interceptors", "stub" })
- @SpecAssertion(section = "6.11", id = "d")
- public void testInterceptorStackIsBuilt()
- {
- assert false;
- }
-
- @Test(groups = { "enterpriseBeans", "lifecycle", "decorators", "stub" })
- @SpecAssertion(section = "6.11", id = "e")
- public void testDecoratorStackIsBuilt()
- {
- assert false;
- }
-
@Test(groups = { "enterpriseBeans", "lifecycle", "ri-broken" })
@SpecAssertion(section = "6.11", id = "f")
public void testDependentObjectsDestroyed()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -115,13 +115,6 @@
assert false;
}
- @Test(groups = { "stub", "new", "interceptors" })
- @SpecAssertion(section = "3.3.6", id = "c")
- public void testNewBeanHasSameInterceptorMethodsAsWrappedBean()
- {
- assert false;
- }
-
/**
* If the @New binding type appears in conjunction with some other binding
* type, or is specified for a field or parameter of a type which does not
@@ -135,19 +128,6 @@
{
assert false;
}
-
- /**
- * No Web Bean defined using annotations or XML may explicitly declare @New
- * as a binding type
- */
- @Test(groups = { "stub", "new", "webbeansxml" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "review", id = "review")
- public void testNewAnnotationCannotBeExplicitlyDeclared()
- {
- // This only needs to be tested with XML since the annotation itself
- // does not target types.
- assert false;
- }
@Test @SpecAssertion(section="3.3.6", id = "aa")
public void testForEachEnterpriseBeanANewBeanExists()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -1,7 +1,5 @@
package org.jboss.jsr299.tck.tests.implementation.initializer;
-import javax.inject.DefinitionException;
-
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -68,32 +66,4 @@
assert chickenHutch.chicken != null;
}
- @Test(groups = { "stub", "initializerMethod", "webbeansxml" })
- @SpecAssertion(section = "3.9.2", id = "a")
- public void testInitializerMethodDeclaredInXml()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "initializerMethod", "webbeansxml" })
- @SpecAssertion(section = "3.9.2", id = "b")
- public void testInitializerMethodDeclaredInXmlIgnoresBindingAnnotationsInJava()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "initializerMethod", "webbeansxml" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.9.2", id = "c")
- public void testInitializerMethodDeclaredInXmlDoesNotExist()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "initializerMethod", "webbeansxml" })
- @SpecAssertion(section = "3.9", id = "g")
- public void testBeanHasAllInitializerMethodsDeclaredInJavaAndXml()
- {
- assert false;
- }
-
}
\ No newline at end of file
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/DisposalMethodDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/DisposalMethodDefinitionTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/DisposalMethodDefinitionTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -155,41 +155,6 @@
}
/**
- * For a bean defined in XML, a disposal method may be declared using the
- * method name, the <Disposes> element, and the parameter types of the
- * method
- */
- @Test(groups = { "stub", "disposalMethod", "webbeansxml" })
- @SpecAssertion(section = "3.4.9", id = "a")
- public void testDisposalMethodDeclaredByXML()
- {
- assert false;
- }
-
- /**
- * When a disposal method is declared in XML, the container ignores binding
- * annotations applied to the Java method parameter
- */
- @Test(groups = { "stub", "disposalMethod", "webbeansxml" })
- @SpecAssertion(section = "3.4.9", id = "b")
- public void testDisposalMethodDeclaredByXMLIgnoresAnnotatedBindings()
- {
- assert false;
- }
-
- /**
- * If the bean class of a bean declared in XML does not have a method with
- * the name and parameter types declared in XML, a DefinitionException is
- * thrown by the container at deployment time
- */
- @Test(groups = { "stub", "disposalMethod", "webbeansxml" }, expectedExceptions = { DefinitionException.class })
- @SpecAssertion(section = "3.4.9", id = "c")
- public void testDisposalMethodDeclaredByXMLDoesNotMatchJava()
- {
- assert false;
- }
-
- /**
* In addition to the disposed parameter, a disposal method may declare
* additional parameters, which may also specify bindings. The container
* calls Manager.getInstanceToInject() to determine a value for each
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -1,7 +1,5 @@
package org.jboss.jsr299.tck.tests.implementation.simple.definition;
-import javax.inject.DefinitionException;
-
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -119,55 +117,6 @@
assert !getCurrentManager().resolveByType(Sheep.class).isEmpty();
}
- @Test(groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "3.2.1", id = "r")
- public void testAdditionalSimpleBeansFromSameClassViaXml()
- {
- assert false;
- }
-
- @Test(expectedExceptions = DefinitionException.class, groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "3.2.4", id = "e")
- public void testAbstractClassDeclaredInXmlIsNotAllowed()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "innerClass", "webbeansxml" })
- @SpecAssertion(section = "3.2.4", id = "da")
- public void testStaticInnerClassDeclaredInXmlAllowed()
- {
- assert false;
- }
-
- @Test(expectedExceptions = DefinitionException.class, groups = { "stub", "innerClass", "webbeansxml" })
- @SpecAssertion(section = "3.2.4", id = "d")
- public void testNonStaticInnerClassDeclaredInXmlNotAllowed()
- {
- assert false;
- }
-
- @Test(expectedExceptions = DefinitionException.class, groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "3.2.4", id = "c")
- public void testParameterizedClassDeclaredInXmlIsNotAllowed()
- {
- assert false;
- }
-
- @Test(expectedExceptions = DefinitionException.class, groups = { "stub", "interceptors", "webbeansxml" })
- @SpecAssertion(section = "3.2.4", id = "f")
- public void testClassHasInterceptorInJavaMustHaveInterceptorInXml()
- {
- assert false;
- }
-
- @Test(expectedExceptions = DefinitionException.class, groups = { "stub", "interceptors", "webbeansxml" })
- @SpecAssertion(section = "3.2.4", id = "g")
- public void testClassHasDecoratorInJavaMustHaveDecoratorInXml()
- {
- assert false;
- }
-
@Test
@SpecAssertion(section = "3.2.6.1", id = "a")
public void testInitializerAnnotatedConstructor() throws Exception
@@ -215,34 +164,6 @@
}.run();
}
- @Test(groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "3.2.6.2", id = "b")
- public void testImplicitConstructorDeclaredInXmlUsed()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "3.2.6.2", id = "b")
- public void testEmptyConstructorDeclaredInXmlUsed()
- {
- assert false;
- }
-
- @Test(expectedExceptions = DefinitionException.class, groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "3.2.6.2", id = "c")
- public void testConstructorDeclaredInXmlDoesNotExist()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "3.2.6.2", id = "d")
- public void testConstructorDeclaredInXmlIgnoresBindingTypesDeclaredInJava()
- {
- assert false;
- }
-
@Test
@SpecAssertion(section = "3.2", id = "fa")
public void testDependentScopedBeanCanHavePublicField() throws Exception
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -34,8 +34,7 @@
@Test(groups = "beanConstruction")
@SpecAssertions({
@SpecAssertion(section = "3.2.6.3", id = "a"),
- @SpecAssertion(section = "2.3.6", id = "d"),
- @SpecAssertion(section = "6.4", id = "a")
+ @SpecAssertion(section = "2.3.6", id = "d")
})
public void testInjectionOfParametersIntoBeanConstructor()
{
@@ -102,26 +101,6 @@
}.run();
}
-
- @Test(groups = { "ri-broken", "beanLifecycle" })
- @SpecAssertions({
- @SpecAssertion(section = "6.2", id = "e")
- })
- public void testCreateSetsInitialValuesFromXml() throws Exception
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- Farm farmInstance = getCurrentManager().getInstanceByType(Farm.class);
- assert farmInstance.location != null;
- assert farmInstance.location.equals("Indiana");
- }
-
- }.run();
- }
@Test(groups = "beanLifecycle")
@SpecAssertions({
@@ -137,20 +116,6 @@
assert getCurrentManager().getInstanceByType(RedSnapper.class) instanceof RedSnapper;
}
- @Test(groups = { "stub", "beanLifecycle", "interceptors" })
- @SpecAssertion(section = "6.2", id = "b")
- public void testCreateBindsInterceptorStack()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "beanLifecycle", "decorators" })
- @SpecAssertion(section = "6.2", id = "c")
- public void testCreateBindsDecoratorStack()
- {
- assert false;
- }
-
@Test(groups = "injection")
@SpecAssertions({
@SpecAssertion(section = "6.4", id = "e"),
@@ -180,7 +145,6 @@
@SpecAssertions({
@SpecAssertion(section = "6.2", id = "f"),
@SpecAssertion(section = "6.3", id = "b"),
- @SpecAssertion(section = "6.4", id = "j"),
@SpecAssertion(section = "6.4", id = "k")
})
public void testPostConstructPreDestroy() throws Exception
@@ -353,6 +317,7 @@
new RunInDependentContext()
{
+ @Override
protected void execute() throws Exception
{
getCurrentManager().getInstanceByType(Lorry_Broken.class);
@@ -369,6 +334,7 @@
new RunInDependentContext()
{
+ @Override
protected void execute() throws Exception
{
getCurrentManager().getInstanceByType(Van_Broken.class);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -107,13 +107,6 @@
assert false;
}
- @Test(groups = { "stub", "new" })
- @SpecAssertion(section = "3.2.5", id = "c")
- public void testNewBeanHasSameInterceptorMethodsAsWrappedBean()
- {
- assert false;
- }
-
@Test(groups = { "new" })
@SpecAssertion(section = "review", id = "review")
public void testNewAnnotationCannotBeExplicitlyDeclared()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -71,13 +71,6 @@
assert getCurrentManager().resolveByType(Dog.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
- @Test(groups = "stub")
- @SpecAssertion(section = "4.4.1", id = "ca")
- public void testRealizedBeanWithProducerMethodHasSameInterceptorBindings()
- {
- assert false;
- }
-
@Test
@SpecAssertion(section = "4.4.1", id = "cb")
public void testRealizedBeanWithProducerFieldHasSameScope()
@@ -122,13 +115,6 @@
}
@Test(groups = "stub")
- @SpecAssertion(section = "4.4.1", id = "cb")
- public void testRealizedBeanWithProducerFieldHasSameInterceptorBindings()
- {
- assert false;
- }
-
- @Test(groups = "stub")
@SpecAssertion(section = "4.4.1", id = "d")
public void testDisposalMethodInherited()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -1,7 +1,6 @@
package org.jboss.jsr299.tck.tests.lookup.injection;
import javax.context.ContextNotActiveException;
-import javax.inject.DefinitionException;
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -79,44 +78,8 @@
assert henHouse.fox.getName().equals("gavin");
}
}.run();
- }
-
- @Test(groups = { "stub", "injection", "webbeansxml" })
- @SpecAssertion(section = "3.8.2", id = "a")
- public void testInjectFieldsDeclaredInXml()
- {
- assert false;
}
- @Test(groups = { "stub", "injection", "webbeansxml" })
- @SpecAssertion(section = "3.8.2", id = "b")
- public void testInjectedFieldDeclaredInXmlIgnoresJavaAnnotations()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "injection", "webbeansxml" })
- @SpecAssertion(section = "3.8.2", id = "c")
- public void testInjectedFieldDeclaredInXmlAssumesCurrent()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "injection", "webbeansxml" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.8.2", id = "d")
- public void testNonexistentFieldDefinedInXml()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "injection", "webbeansxml" })
- @SpecAssertion(section = "3.8.2", id = "e")
- public void testInjectFieldsDeclaredInXmlAndJava()
- {
- assert false;
- }
-
-
@Test(groups = {"injection", "underInvestigation"})
@SpecAssertion(section = "3.8", id = "aa")
public void testInjectingStaticField()
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/declaration/bean/BeanDeclarationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/declaration/bean/BeanDeclarationTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/declaration/bean/BeanDeclarationTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -1,68 +0,0 @@
-package org.jboss.jsr299.tck.tests.xml.declaration.bean;
-
-import javax.inject.DefinitionException;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.testng.annotations.Test;
-
-@Artifact
-public class BeanDeclarationTest extends AbstractJSR299Test
-{
- @Test(groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "9.5", id = "a")
- public void testDirectRootChildren()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "9.5", id = "b")
- public void testDeclaredJavaType()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "9.5", id = "c")
- public void testIsElementJmsResource()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "9.5", id = "d")
- public void testIsElementResource()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "9.5", id = "e")
- public void testIsElementSessionBean()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "9.5", id = "f")
- public void testIsElementSimpleBean()
- {
- assert false;
- }
-
- @Test(expectedExceptions = DefinitionException.class, groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "9.5", id = "g")
- public void testDefinitionErrorInWebbeansXml()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "9.5", id = "h")
- public void testInlineBeanDeclaration()
- {
- assert false;
- }
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -27,7 +27,6 @@
{
@Test
@SpecAssertions({
- @SpecAssertion(section="9", id="a"),
@SpecAssertion(section="9", id="b"),
@SpecAssertion(section="9", id="c"),
@SpecAssertion(section="9", id="d"),
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-04-16 15:09:21 UTC (rev 2434)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-04-16 15:14:19 UTC (rev 2435)
@@ -27,10 +27,6 @@
<text>A bean comprises of an optional bean name</text>
</assertion>
- <assertion id="f">
- <text>A bean comprises of a set of interceptor bindings</text>
- </assertion>
-
<assertion id="g">
<text>A bean comprises of a bean implementation</text>
</assertion>
@@ -156,10 +152,6 @@
<section id="2.3.4" title="Declaring the bindings of a bean using XML">
- <assertion id="a">
- <text>If a bean is declared in beans.xml, bindings may be specified using the binding type names</text>
- </assertion>
-
</section>
<section id="2.3.5" title="Specifying bindings of an injected field">
@@ -172,13 +164,6 @@
<text>A bean may only be injected to an injection point if it has all the bindings of the injection point</text>
</assertion>
- <assertion id="c">
- <text>For a bean defined in XML, the bindings of a field may be specified using XML</text>
- </assertion>
-
- <assertion id="d">
- <text>When the bindings of a field are specified using XML, any binding annotations of the field are ignored</text>
- </assertion>
</section>
<section id="2.3.6" title="Specifying bindings of a method or constructor parameter">
@@ -197,14 +182,7 @@
<assertion id="d">
<text>Binding types may be applied to parameters of bean constructors (see Chapter 3, Bean implementation) to determine the bean instance that is passed when the method is called by the container</text>
</assertion>
-
- <assertion id="e">
- <text>For a bean defined in XML, the bindings of a method parameter may be specified using XML</text>
- </assertion>
-
- <assertion id="f">
- <text>When the bindings of a parameter are specified using XML, any binding annotations of the parameter are ignored</text>
- </assertion>
+
</section>
<section id="2.4" title="Scopes">
@@ -274,22 +252,12 @@
</section>
<section id="2.4.4" title="Declaring the bean scope using XML">
- <assertion id="a">
- <text>If the bean is declared in beans.xml, the scope may be specified using the scope annotation type name</text>
- </assertion>
- <assertion id="b">
- <text>If more than one scope type is specified in XML, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="c">
- <text>A scope type may be specified using a stereotype declared in XML, as defined in Section 2.7.3, "Declaring the stereotypes for a bean using XML"</text>
- </assertion>
</section>
<section id="2.4.5" title="Default scope">
<assertion id="a">
- <text>When no scope is explicitly declared by annotating the bean class or producer method or field, or by using XML, the scope of a bean is defaulted</text>
+ <text>When no scope is explicitly declared by annotating the bean class or producer method or field, ~or by using XML~, the scope of a bean is defaulted</text>
</assertion>
<assertion id="b">
@@ -396,17 +364,7 @@
</section>
<section id="2.5.4" title="Declaring the deployment type of a bean using XML">
- <assertion id="a">
- <text>When a bean is declared in beans.xml, the deployment type may be specified using a tag with the annotation type name</text>
- </assertion>
-
- <assertion id="b">
- <text>If more than one deployment type is specified in XML, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="c">
- <text>A deployment type may be specified using a stereotype declared in XML, as defined in Section 2.7.3, "Declaring the stereotypes for a bean using XML".</text>
- </assertion>
+
</section>
<section id="2.5.5" title="Default deployment type">
@@ -477,13 +435,6 @@
<section id="2.6.2" title="Declaring the bean name using XML">
- <assertion id="a">
- <text>If the bean is declared in beans.xml, the name may be specified using |<Named>|</text>
- </assertion>
-
- <assertion id="b">
- <text>If the |<Named>| element is empty, the default name is assumed</text>
- </assertion>
</section>
<section id="2.6.3" title="Default bean names">
@@ -500,10 +451,6 @@
<text>A default name must be assigned by the container when a producer field of a bean defined using annotations declares a |@Named| annotation and no name is explicitly specified by the value member</text>
</assertion>
- <assertion id="d">
- <text>A default name must be assigned by the container when an empty |<Named>| element is specified by a bean defined in XML</text>
- </assertion>
-
<assertion id="e">
<text>A default name must be assigned by the container when a bean declares a stereotype that declares an empty |@Named| annotation, and the bean does not explicitly specify a name.</text>
</assertion>
@@ -512,7 +459,7 @@
<section id="2.6.4" title="Beans with no name">
<assertion id="a">
- <text>If neither |<Named>| nor |@Named| is specified, by the bean or its stereotypes, a bean has no name</text>
+ <text>If ~neither |<Named>| nor~ |@Named| is specified, by the bean or its stereotypes, a bean has no name</text>
</assertion>
</section>
@@ -584,18 +531,6 @@
<section id="2.7.1.2" title="Specifying interceptor bindings for a stereotype">
- <assertion id="a">
- <text>A stereotype may declare zero interceptor bindings</text>
- </assertion>
-
- <assertion id="b">
- <text>A stereotype may declare one interceptor binding</text>
- </assertion>
-
- <assertion id="c">
- <text>A stereotype may declare multiple interceptor bindings</text>
- </assertion>
-
</section>
<section id="2.7.1.3" title="Specifying name defaulting for a stereotype">
@@ -676,9 +611,7 @@
</section>
<section id="2.7.3" title="Declaring the stereotypes for a bean using XML">
- <assertion id="a">
- <text>If the bean is declared in beans.xml, stereotypes may be declared using the stereotype annotation type name</text>
- </assertion>
+
</section>
<section id="2.7.4" title="Stereotype restrictions">
@@ -730,18 +663,6 @@
<text>The bean class of a simple bean may not be an abstract class, ~unless the simple bean is a decorator~</text>
</assertion>
- <assertion id="cb">
- <text>The bean class of a simple bean may not be an abstract class, _unless the simple bean is a decorator_</text>
- </assertion>
-
- <assertion id="d">
- <text>If the bean class of a simple bean is annotated with both the |@Interceptor| and |@Decorator| stereotypes, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="e">
- <text>Multiple simple beans may share the same bean class. This occurs when beans are defined using XML. Only one simple bean per bean class may be defined using annotations.</text>
- </assertion>
-
<assertion id="fa">
<text>If a simple bean has a public field, it must have scope |@Dependent|.</text>
<note>Check that a dependent scoped bean with a public field does work</note>
@@ -772,9 +693,6 @@
<assertion id="cc">
<text>A top-level Java class can be a simple bean if it is static inner class</text>
</assertion>
- <assertion id="da">
- <text>A top-level abstract Java class is a simple bean if it is annotated |@Decorator|.</text>
- </assertion>
<assertion id="e">
<text>A top-level Java class is not a simple bean if it is annotated with the JPA |@Entity| annotation</text>
</assertion>
@@ -814,9 +732,6 @@
<assertion id="q">
<text>A top-level Java class is only a simple bean if it has an appropriate constructor - a constructor annotated |@Initializer|</text>
</assertion>
- <assertion id="r">
- <text>Additional simple beans with the same bean class may be defined using XML, by specifying the class in |beans.xml|.</text>
- </assertion>
</section>
@@ -857,40 +772,7 @@
</section>
<section id="3.2.4" title="Declaring a simple bean using XML">
- <assertion id="a">
- <text>Simple beans may be declared in |beans.xml| using the bean class name</text>
- </assertion>
-
- <assertion id="b">
- <text>A simple bean may even be declared at any injection point declared in XML, as defined in Section 9.9, "Inline bean declarations", in which case no bindings are specified.</text>
- </assertion>
-
- <assertion id="c">
- <text>If the bean class of a simple bean defined in XML is a parameterized type , a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="d">
- <text>If the bean class of a simple bean defined in XML is a non-static inner class, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="da">
- <text>If the bean class of a simple bean defined in XML is a static inner class, a |DefinitionException| is not thrown.</text>
- </assertion>
-
- <assertion id="e">
- <text>If the bean class of a simple bean defined in XML is an abstract class, and the simple bean is not a decorator, a |DefinitionException|
-is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="f">
- <text>If the bean class of a simple bean defined in XML is annotated @Interceptor, then the bean must be explicitly declared as an interceptor in XML, as defined in Section A.3.5.2, "Declaring an interceptor using XML". If a simple bean defined in XML has a bean class annotated |@Interceptor| and is not declared as an interceptor in XML, a |DefinitionException| is
-thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="g">
- <text>If the bean class of a simple bean defined in XML is annotated @Interceptor, then the bean must be explicitly declared as an interceptor in XML, as defined in Section A.3.5.2, "Declaring an interceptor using XML". If a simple bean defined in XML has a bean class annotated |@Interceptor| and is not declared as an interceptor in XML, a |DefinitionException| is
-thrown by the container at deployment time.</text>
- </assertion>
+
</section>
<section id="3.2.5" title="Simple beans with the @New binding">
@@ -906,9 +788,6 @@
<assertion id="bc">
<text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such simple bean, a second simple bean exists which has _the same injected fields defined by annotations_.</text>
</assertion>
- <assertion id="c">
- <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such simple bean, a second simple bean exists which has _the same interceptor bindings defined by annotations_.</text>
- </assertion>
<assertion id="d">
<text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such simple bean, a second simple bean exists which has _scope @Dependent_.</text>
</assertion>
@@ -973,22 +852,6 @@
<section id="3.2.6.2" title="Declaring a bean constructor using XML">
- <assertion id="a">
- <text>For a simple bean defined using XML, the bean constructor may be specified by listing the parameter types of the constructer, in order, as direct children of the element that declares the bean</text>
- </assertion>
-
- <assertion id="b">
- <text>If a simple bean defined using XML does not explicitly declare constructor parameters in XML, the constructor that accepts no parameters is the bean constructor</text>
- </assertion>
-
- <assertion id="c">
- <text>If a simple bean declared in XML does not have a constructor with the parameter types declared in XML, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>When a bean constructor is declared in XML, the container ignores binding annotations applied to Java constructor parameters</text>
- </assertion>
-
</section>
<section id="3.2.6.3" title="Bean constructor parameters">
@@ -1015,10 +878,7 @@
<assertion id="d">
<text>If the bean class of X does not directly extend the bean class of another simple bean, a |DefinitionException| is thrown by the container at deployment time.</text>
</assertion>
-
- <assertion id="e">
- <text>If a simple bean X defined in XML declares the |<Specializes>| element, then the bean class of X must be the bean class of another simple bean Y defined using annotations. Then X inherits all bindings of Y, and if Y has a name, X has the same name as Y</text>
- </assertion>
+
</section>
<section id="3.2.8" title="Default name for a simple bean">
@@ -1045,17 +905,6 @@
<text>If a session bean specifies an illegal scope, a |DefinitionException| is thrown by the container at deployment time</text>
</assertion>
- <assertion id="e">
- <text>Note that multiple session beans may share the same bean class. This occurs when beans are defined using XML</text>
- </assertion>
-
- <assertion id="f">
- <text>If the bean class of a session bean is annotated |@Interceptor|, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="g">
- <text>If the bean class of a session bean is annotated |@Decorator|, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
</section>
<section id="3.3.1" title="EJB remove methods of session beans">
@@ -1142,21 +991,7 @@
</section>
<section id="3.3.5" title="Declaring a session bean using XML">
- <assertion id="a">
- <text>Session beans may be declared in |beans.xml| using the bean class name (for EJBs defined using a component-defining annotation) or bean class and EJB name (for EJBs defined in |ejb-jar.xml|)</text>
- </assertion>
-
- <assertion id="b">
- <text>The ejbName attribute declares the EJB name of an EJB defined in |ejb-jar.xml|</text>
- </assertion>
-
- <assertion id="c">
- <text>If an entity bean class is declared in XML, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>If a message-driven bean class is declared in XML, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
+
</section>
<section id="3.3.6" title="Session beans with the @New binding">
@@ -1174,10 +1009,6 @@
<text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such session bean, a second bean exists which has the initializer methods and injected fields defined by annotations</text>
</assertion>
- <assertion id="c">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such session bean, a second bean exists which has the same interceptor bindings defined by annotations</text>
- </assertion>
-
<assertion id="d">
<text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such session bean, a second bean exists which has scope |@Dependent|.</text>
</assertion>
@@ -1232,10 +1063,7 @@
<assertion id="d">
<text>If the bean class of X does not directly extend the bean class of another session bean, a |DefinitionException| is thrown by the container at deployment time</text>
</assertion>
-
- <assertion id="e">
- <text>If a session bean X defined in XML declares the |<Specializes>| element, then the bean class of X must be the bean class of another session bean Y defined using annotations. Then X inherits all bindings of Y, and if Y has a name, X has the same name as Y.</text>
- </assertion>
+
</section>
<section id="3.3.8" title="Default name for a session bean">
@@ -1359,18 +1187,7 @@
</section>
<section id="3.4.3" title="Declaring a producer method using XML">
-
- <assertion id="a">
- <text>For a bean defined in XML, a producer method may be declared using the method name, the |<Produces>| element, the return type, and the parameter types of the method</text>
- </assertion>
-
- <assertion id="b">
- <text>When a producer method is declared in XML, the container ignores binding annotations applied to the Java method or method parameters</text>
- </assertion>
-
- <assertion id="c">
- <text>If the bean class of a bean declared in XML does not have a method with the name and parameter types declared in XML, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
+
</section>
<section id="3.4.4" title="Producer method parameters">
@@ -1465,17 +1282,6 @@
<section id="3.4.9" title="Declaring a disposal method using XML">
- <assertion id="a">
- <text>For a bean defined in XML, a disposal method may be declared using the method name, the <Disposes> element, and the parameter types of the method</text>
- </assertion>
-
- <assertion id="b">
- <text>When a disposal method is declared in XML, the container ignores binding annotations applied to the Java method parameter</text>
- </assertion>
-
- <assertion id="c">
- <text>If the bean class of a bean declared in XML does not have a method with the name and parameter types declared in XML, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
</section>
<section id="3.4.10" title="Disposal method parameters">
@@ -1591,18 +1397,6 @@
<section id="3.5.3" title="Declaring a producer field using XML">
- <assertion id="a">
- <text>For a bean defined in XML, a producer field may be declared using the field name, the |<Produces>| element, and the type</text>
- </assertion>
-
- <assertion id="b">
- <text>When a producer field is declared in XML, the container ignores binding annotations applied to the Java field</text>
- </assertion>
-
- <assertion id="c">
- <text>If the bean class of a bean declared in XML does not have a field with the name and type declared in XML, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
</section>
<section id="3.5.4" title="Default name for a producer field">
@@ -1945,10 +1739,7 @@
<assertion id="h">
<text>If a field is a producer field, it is not an injected field</text>
</assertion>
-
- <assertion id="i">
- <text>If a field is a decorator delegate attribute, it is not an injected field</text>
- </assertion>
+
</section>
<section id="3.8.1" title="Declaring an injected field using annotations">
@@ -1959,26 +1750,7 @@
</section>
<section id="3.8.2" title="Declaring an injected field using XML">
- <assertion id="a">
- <text>For bean defined in XML, an injected field may be declared using the field name and a child element representing the type of the field</text>
- </assertion>
-
- <assertion id="b">
- <text>When an injected field is declared in XML, the container ignores binding annotations applied to the Java field</text>
- </assertion>
-
- <assertion id="c">
- <text>If the type element does not declare any binding, the default binding |@Current| is assumed</text>
- </assertion>
-
- <assertion id="d">
- <text>If the bean class of a bean declared in XML does not have a field with the name and type declared in XML, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="e">
- <text>Check fields declared in XML and Java injected</text>
- <note>Sanity check</note>
- </assertion>
+
</section>
<section id="3.9" title="Initializer methods">
@@ -2049,17 +1821,6 @@
<section id="3.9.2" title="Declaring an initializer method using XML">
- <assertion id="a">
- <text>For a bean defined in XML, an initializer method may be declared using the method name, the |<Initializer>| element and the parameter types of the method</text>
- </assertion>
-
- <assertion id="b">
- <text>When an initializer method is declared in XML, the container ignores binding annotations applied to the Java method parameters</text>
- </assertion>
-
- <assertion id="c">
- <text>If the bean class of a bean declared in XML does not have a method with the name and parameter types declared in XML, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
</section>
<section id="3.9.3" title="Initializer method parameters">
@@ -2093,10 +1854,6 @@
<text>|@PreDestroy| callbacks are provided by the container when annotations are applied to the bean class of a simple bean</text>
</assertion>
- <assertion id="g">
- <text>Interception, as defined in |javax.interceptor| is provided by the container when annotations are applied to the bean class of a simple bean</text>
- </assertion>
-
<assertion id="h">
<text>|@PersistenceContext(type=EXTENDED)| is not supported for simple beans</text>
</assertion>
@@ -2131,34 +1888,22 @@
<text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
</assertion>
- <assertion id="ac">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X is annotated with a _interceptor binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
- </assertion>
-
<assertion id="ad">
<text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
</assertion>
<assertion id="ae">
<text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
- </assertion>
+ </assertion>
- <assertion id="af">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _interceptor binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
- </assertion>
-
<assertion id="ag">
<text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
</assertion>
<assertion id="ah">
<text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
- </assertion>
+ </assertion>
- <assertion id="ai">
- <text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, if X is annotated with a _interceptor binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
- </assertion>
-
<assertion id="aj">
<text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
</assertion>
@@ -2166,11 +1911,7 @@
<assertion id="ak">
<text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
</assertion>
-
- <assertion id="al">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X is annotated with a _interceptor binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
- </assertion>
-
+
<assertion id="ba">
<text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X is annotated with a _scope type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare a scope type.</text>
</assertion>
@@ -2233,56 +1974,8 @@
<assertion id="ddb">
<text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, the _deployment types_ explicitly declared by and inherited from the class X take precedence over _deployment types_ declared by stereotypes.</text>
- </assertion>
+ </assertion>
- <assertion id="ea">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare an annotation of type Z using XML.</text>
- </assertion>
-
- <assertion id="eb">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare an annotation of type Z using XML.</text>
- </assertion>
-
- <assertion id="ec">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X is annotated with an _interceptor binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare an annotation of type Z using XML.</text>
- </assertion>
-
- <assertion id="ed">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare an annotation of type Z using XML.</text>
- </assertion>
-
- <assertion id="ee">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare an annotation of type Z using XML.</text>
- </assertion>
-
- <assertion id="ef">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X is annotated with an _interceptor binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare an annotation of type Z using XML.</text>
- </assertion>
-
- <assertion id="fa">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X is annotated with a scope type Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare a scope type using XML.</text>
- </assertion>
-
- <assertion id="fb">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X is annotated with a scope type Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare a scope type using XML.</text>
- </assertion>
-
- <assertion id="ga">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X is annotated with a deployment type Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare a deployment type using XML.</text>
- </assertion>
-
- <assertion id="gb">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X is annotated with a deployment type Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare a deployment type using XML.</text>
- </assertion>
-
- <assertion id="ha">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, the scope types and deployment types explicitly declared by and inherited from the class X take precedence over default scope and deployment types declared by stereotypes.</text>
- </assertion>
-
- <assertion id="hb">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, the scope types and deployment types explicitly declared by and inherited from the class X take precedence over default scope and deployment types declared by stereotypes.</text>
- </assertion>
-
<assertion id="i" testable="false">
<text>For annotations defined by the bean specification, all built-in _scope types_ are declared |@Inherited|</text>
<note>sigtest</note>
@@ -2359,23 +2052,7 @@
<assertion id="bbd">
<text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _|@PreDestroy|_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
</assertion>
-
- <assertion id="ca">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X declares a _non-static method_ x() annotated with an interceptor binding type Z then Y inherits the binding if and only if Y does not override the method x().</text>
- </assertion>
- <assertion id="cb">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static method_ x() annotated with an interceptor binding type Z then Y inherits the binding if and only if Y does not override the method x().</text>
- </assertion>
-
- <assertion id="cc">
- <text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, if X declares a _non-static method_ x() annotated with an interceptor binding type Z then Y inherits the binding if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x().</text>
- </assertion>
-
- <assertion id="cd">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static method_ x() annotated with an interceptor binding type Z then Y inherits the binding if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x().</text>
- </assertion>
-
<assertion id="da">
<text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize or realize X</text>
</assertion>
@@ -2440,133 +2117,6 @@
<text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit this field unless Y is explicitly declared to specialize or realize X.</text>
</assertion>
- <assertion id="fa">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if Y is a decorator and X declares a delegate attribute x then Y inherits x if and only if Y does not define a delegate attribute</text>
- </assertion>
-
- <assertion id="fb">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if Y is a decorator and X declares a delegate attribute x then Y inherits x if and only if neither Y does not define a delegate attribute</text>
- </assertion>
-
- <assertion id="fc">
- <text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, if Y is a decorator and X declares a delegate attribute x then Y inherits x if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y defines a delegate attribute</text>
- </assertion>
-
- <assertion id="fd">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if Y is a decorator and X declares a delegate attribute x then Y inherits x if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y defines a delegate attribute</text>
- </assertion>
-
- <assertion id="ga">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares an injected field x then Y inherits x, unless Y explicitly declares x using XML.</text>
- </assertion>
-
- <assertion id="gb">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares an injected field x then Y inherits x, unless Y explicitly declares x using XML.</text>
- </assertion>
-
- <assertion id="ha">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares an _initializer method_ x() then Y inherits x(), unless Y explicitly declares x() using XML</text>
- </assertion>
-
- <assertion id="hb">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a _@PostConstruct method_ x() then Y inherits x(), unless Y explicitly declares x() using XML</text>
- </assertion>
-
- <assertion id="hc">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a _@PreDestroy method_ x() then Y inherits x(), unless Y explicitly declares x() using XML</text>
- </assertion>
-
- <assertion id="hd">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares an _initializer method_ x() then Y inherits x(), unless Y explicitly declares x() using XML</text>
- </assertion>
-
- <assertion id="he">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a _@PostConstruct method_ x() then Y inherits x(), unless Y explicitly declares x() using XML</text>
- </assertion>
-
- <assertion id="hf">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a _@PreDestroy method_ x() then Y inherits x(), unless Y explicitly declares x() using XML</text>
- </assertion>
-
- <assertion id="ia">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a non-static method x() annotated with an interceptor binding type Z then Y inherits the binding, unless Y explicitly declares x() using XML.</text>
- </assertion>
-
- <assertion id="ib">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a non-static method x() annotated with an interceptor binding type Z then Y inherits the binding, unless Y explicitly declares x() using XML.</text>
- </assertion>
-
- <assertion id="ja">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a non-static _producer method_ x() then Y does not inherit this method, unless Y is explicitly declared to _specialize_ X.</text>
- </assertion>
-
- <assertion id="jb">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a non-static _producer method_ x() then Y does not inherit this method, unless Y is explicitly declared to _realize_ X.</text>
- </assertion>
-
- <assertion id="jc">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a non-static _disposal method_ x() then Y does not inherit this method, unless Y is explicitly declared to _specialize_ X.</text>
- </assertion>
-
- <assertion id="jd">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a non-static _disposal method_ x() then Y does not inherit this method, unless Y is explicitly declared to _realize_ X.</text>
- </assertion>
-
- <assertion id="je">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a non-static _observer method_ x() then Y does not inherit this method, unless Y is explicitly declared to _specialize_ X.</text>
- </assertion>
-
- <assertion id="jf">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a non-static _observer method_ x() then Y does not inherit this method, unless Y is explicitly declared to _realize_ X.</text>
- </assertion>
-
- <assertion id="jg">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a non-static _producer method_ x() then Y does not inherit this method, unless Y is explicitly declared to _specialize_ X.</text>
- </assertion>
-
- <assertion id="jh">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a non-static _producer method_ x() then Y does not inherit this method, unless Y is explicitly declared to _realize_ X.</text>
- </assertion>
-
- <assertion id="ji">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a non-static _disposal method_ x() then Y does not inherit this method, unless Y is explicitly declared to _specialize_ X.</text>
- </assertion>
-
- <assertion id="jj">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a non-static _disposal method_ x() then Y does not inherit this method, unless Y is explicitly declared to _realize_ X.</text>
- </assertion>
-
- <assertion id="jk">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a non-static _observer method_ x() then Y does not inherit this method, unless Y is explicitly declared to _specialize_ X.</text>
- </assertion>
-
- <assertion id="jl">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a non-static _observer method_ x() then Y does not inherit this method, unless Y is explicitly declared to _realize_ X.</text>
- </assertion>
-
- <assertion id="ka">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a non-static producer field x then Y does not inherit this field, unless Y is explicitly declared to _specialize_ X.</text>
- </assertion>
-
- <assertion id="kb">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a non-static producer field x then Y does not inherit this field, unless Y is explicitly declared to _realize_ X.</text>
- </assertion>
-
- <assertion id="kc">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a non-static producer field x then Y does not inherit this field, unless Y is explicitly declared to _specialize_ X.</text>
- </assertion>
-
- <assertion id="kd">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a non-static producer field x then Y does not inherit this field, unless Y is explicitly declared to _realize_ X.</text>
- </assertion>
-
- <assertion id="la">
- <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if Y is a decorator and X declares a delegate attribute x then Y inherits x, unless Y explicitly declares a delegate attribute using XML.</text>
- </assertion>
-
- <assertion id="lb">
- <text>For class X which is the bean class of a _session_ bean Y declared using XML, if Y is a decorator and X declares a delegate attribute x then Y inherits x, unless Y explicitly declares a delegate attribute using XML.</text>
- </assertion>
</section>
<section id="4.3" title="Specialization">
@@ -2591,10 +2141,6 @@
<text>A bean declared using annotations may declare that it specializes a lower-priority bean using the |@Specializes| annotation</text>
</assertion>
- <assertion id="b">
- <text>A bean declared using XML may declare that it specializes a lower-priority bean using the |<Specializes>| element</text>
- </assertion>
-
<assertion id="c">
<text>The bindings of a bean X that specializes a lower-priority bean Y include all bindings of Y, together with all bindings declared explicitly by X.</text>
</assertion>
@@ -2623,7 +2169,7 @@
<section id="4.3.2" title="Direct and indirect specialization">
<assertion id="a" testable="false">
- <text>The |(a)javax.inject.Specializes| annotation or |<Specializes>| XML element is used to indicate that one bean directly specializes another bean</text>
+ <text>The |(a)javax.inject.Specializes| annotation ~or |<Specializes>| XML element~ is used to indicate that one bean directly specializes another bean</text>
<note>A statement of intent</note>
</assertion>
@@ -2660,11 +2206,6 @@
<text>Any bean that extends a generic class may directly extend the generic class, in the case of a bean declared using annotations and then explicitly declare that it realizes the generic class</text>
<note>A statement of intent</note>
</assertion>
-
- <assertion id="b" testable="false">
- <text>Any bean that extends a generic class may declare that the generic class is the bean class, in the case of a bean declared using XML and then explicitly declare that it realizes the generic class.</text>
- <note>A statement of intent</note>
- </assertion>
</section>
@@ -2674,11 +2215,6 @@
<note>A statement of intent</note>
</assertion>
- <assertion id="b" testable="false">
- <text>A bean declared using XML may declare that it realizes a generic class using the |<Realizes>| element.</text>
- <note>A statement of intent</note>
- </assertion>
-
<assertion id="ca">
<text>If a generic class Y declares a non-static _producer method_ with a certain combination of scope, stereotypes, bindings and interceptor bindings, then every bean X that realizes Y also has a _producer method_ with the same scope, stereotypes and interceptor bindings. The bindings for this inherited _producer method_ consist of all bindings declared by the _producer method_ of Y, excluding all bindings of Y, together with the bindings declared explicitly by X. The deployment type of the inherited _producer method_ is the deployment type of X</text>
</assertion>
@@ -2824,10 +2360,6 @@
<text>The |javax.inject.manager.InjectionPoint.getBindings()| method returns the declared bindings of the injection point.</text>
</assertion>
- <assertion id="bd">
- <text>An injection point declared in XML has it's bindings determined according to Section 9.10, "Specifying bean types and bindings"</text>
- </assertion>
-
<assertion id="ca">
<text>The |javax.inject.manager.InjectionPoint.getMember()| method returns the |Field| object in the case of field injection</text>
</assertion>
@@ -3323,72 +2855,17 @@
<text>The container is required to perform dependency injection for session bean instances created by the container to receive timeouts</text>
</assertion>
- <assertion id="f">
- <text>The container is required to create interceptor stacks for session bean instances obtained directly from JNDI</text>
- </assertion>
-
- <assertion id="g">
- <text>The container is required to create interceptor stacks for session bean instances injected using |@EJB|</text>
- </assertion>
-
- <assertion id="h">
- <text>The container is required to create interceptor stacks for session bean instances injected using |@Resource|</text>
- </assertion>
-
- <assertion id="i">
- <text>The container is required to create interceptor stacks for session bean instances created by the container to receive remote method calls</text>
- </assertion>
-
- <assertion id="j">
- <text>The container is required to create interceptor stacks for session bean instances created by the container to receive timeouts</text>
- </assertion>
-
- <assertion id="k">
- <text>The container is required to create decorator stacks for session bean instances obtained directly from JNDI</text>
- </assertion>
-
- <assertion id="l">
- <text>The container is required to create decorator stacks for session bean instances injected using |@EJB|</text>
- </assertion>
-
- <assertion id="m">
- <text>The container is required to create decorator stacks for session bean instances injected using |@Resource|</text>
- </assertion>
-
- <assertion id="n">
- <text>The container is required to create decorator stacks for session bean instances created by the container to receive remote method calls</text>
- </assertion>
-
- <assertion id="o">
- <text>The container is required to create decorator stacks for session bean instances created by the container to receive timeouts</text>
- </assertion>
-
<assertion id="p">
<text>For the purposes of dependency injection, the container must treat non-contextual instances of session beans as instances of the most specialized bean that specializes the bean with binding |@New| and deployment type |@Standard| defined in Section 3.3.6, "Session beans with the |@New| binding"</text>
</assertion>
- <assertion id="q">
- <text>For the purposes of interceptor stack creation, the container must treat non-contextual instances of session beans as instances of the most specialized bean that specializes the bean with binding |@New| and deployment type |@Standard| defined in Section 3.3.6, "Session beans with the |@New| binding"</text>
- </assertion>
-
- <assertion id="r">
- <text>For the purposes of decorator stack creation, the container must treat non-contextual instances of session beans as instances of the most specialized bean that specializes the bean with binding |@New| and deployment type |@Standard| defined in Section 3.3.6, "Session beans with the |@New| binding"</text>
- </assertion>
-
</section>
<section id="5.12.2" title="Message-driven beans">
- <assertion id="a">
+
+ <assertion id="a">
<text>The container performs dependency injection for message-driven bean instances according to the bean class annotations</text>
</assertion>
-
- <assertion id="b">
- <text>The container creates interceptor stacks for message-driven bean instances according to the bean class annotations</text>
- </assertion>
-
- <assertion id="c">
- <text>The container creates decorator stacks for message-driven bean instances according to the bean class annotations</text>
- </assertion>
</section>
<section id="5.12.3" title="Servlets">
@@ -3460,22 +2937,11 @@
<text>The |Contextual.create()| method obtains an instance of the bean</text>
</assertion>
- <assertion id="b">
- <text>The |Contextual.create()| method creates the interceptor stacks and binds them to the instance</text>
- </assertion>
-
- <assertion id="c">
- <text>The |Contextual.create()| method creates the decorator stacks and binds them to the instance</text>
- </assertion>
-
<assertion id="d">
<text>The |Contextual.create()| method injects any dependencies</text>
</assertion>
+
- <assertion id="e">
- <text>The |Contextual.create()| method sets any initial field values defined in XML</text>
- </assertion>
-
<assertion id="f">
<text>The |Contextual.create()| method calls the |@PostConstruct| method, if necessary</text>
</assertion>
@@ -3513,9 +2979,6 @@
</section>
<section id="6.4" title="Lifecycle of simple beans">
- <assertion id="a">
- <text>When the |create()| method of the |Bean| object that represents a simple bean is called, the container first calls the bean constructor to obtain an instance of the bean. For each constructor parameter, the container passes the object returned by |Manager.getInstanceToInject()|. The container is permitted to return an instance of a container-generated subclass of the bean class, allowing interceptor and decorator bindings</text>
- </assertion>
<assertion id="b">
<text>When the |create()| method of the |Bean| object that represents a simple bean is called, after the bean constructor is called the container next initializes the values of any attributes annotated |@EJB|</text>
@@ -3533,27 +2996,6 @@
<text>When the |create()| method of the |Bean| object that represents a simple bean is called, after the |@EJB|, |@PersistenceContext| and |@Resource| attributes are initialized the container initializes the values of all injected fields. For each injected field, the container sets the value to the object returned by |Manager.getInstanceToInject()|.</text>
</assertion>
- <assertion id="f">
- <text>When the |create()| method of the |Bean| object that represents a simple bean is called, after injected fields are initialized the container initializes the values of any fields with initial values specified in XML, as defined in Section 9.5.5, "Field initial value declarations".</text>
- </assertion>
-
- <assertion id="g">
- <text>When the |create()| method of the |Bean| object that represents a simple bean is called, after the values of fields with initial values specified in XML are initialized the container calls all initializer methods. For each initializer method parameter, the container passes the object
-returned by |Manager.getInstanceToInject()|</text>
- </assertion>
-
- <assertion id="h">
- <text>When the |create()| method of the |Bean| object that represents a simple bean is called, after all initializer methods are called the container builds the interceptor stacks for the instance as defined in Section A.3.10 "Interceptor stack creation"</text>
- </assertion>
-
- <assertion id="i">
- <text>When the |create()| method of the |Bean| object that represents a simple bean is called, after all initializer methods are called the container builds the decorator stacks for the instance as defined in Section A.5.8 "Decorator stack creation"</text>
- </assertion>
-
- <assertion id="j">
- <text>When the |create()| method of the |Bean| object that represents a simple bean is called, after the interceptor and decorator stacks are built the container calls the |@PostConstruct| method, if any</text>
- </assertion>
-
<assertion id="k">
<text>When the |destroy()| method of a |Bean| object is called, the container calls the |@PreDestroy| method, if any</text>
</assertion>
@@ -3857,22 +3299,10 @@
<text>When the EJB container creates a new instance of an EJB, after Java EE injection has been performed and before the |@PostConstruct| callback occurs the container must initialize the values of all injected fields . For each injected field, the container sets the value to the object returned by |Manager.getInstanceToInject()|</text>
</assertion>
- <assertion id="b">
- <text>When the EJB container creates a new instance of an EJB, after Java EE injection has been performed and before the |@PostConstruct| callback occurs the container must initialize the values of any fields with initial values specified in XML, as defined in Section 9.5.5, "Field initial value declarations"</text>
- </assertion>
-
<assertion id="c">
<text>When the EJB container creates a new instance of an EJB, after Java EE injection has been performed and before the |@PostConstruct| callback occurs the container calls all initializer methods. For each initializer method parameter, the container passes the object returned by |Manager.getInstanceToInject()|</text>
</assertion>
- <assertion id="d">
- <text>When the EJB container creates a new instance of an EJB, after Java EE injection has been performed and before the |@PostConstruct| callback occurs the container builds the interceptor stacks for the instance as defined in Section A.3.10, "Interceptor stack creation" and Section A.5.8, "Decorator stack creation" and binds them to the instance</text>
- </assertion>
-
- <assertion id="e">
- <text>When the EJB container creates a new instance of an EJB, after Java EE injection has been performed and before the |@PostConstruct| callback occurs the container builds the decorator stacks for the instance as defined in Section A.3.10, "Interceptor stack creation" and Section A.5.8, "Decorator stack creation" and binds them to the instance</text>
- </assertion>
-
<assertion id="f">
<text>When the EJB container removes an instance of an EJB, the container destroys all dependent objects, after the |@PreDestroy| callback completes</text>
</assertion>
@@ -4115,17 +3545,7 @@
</section>
<section id="7.5.3" title="Declaring an observer method using XML">
- <assertion id="a">
- <text>For a beans defined in XML, an observer method may be declared using the method name, the |<Observes>| element, and the parameter types of the method</text>
- </assertion>
- <assertion id="b">
- <text>When an observer method is declared in XML, the container ignores binding annotations applied to the Java method parameters</text>
- </assertion>
-
- <assertion id="c">
- <text>If the bean class of a bean declared in XML does not have a method with parameters that match those declared in XML, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
</section>
<section id="7.5.4" title="Observer method parameters">
@@ -4142,10 +3562,7 @@
<assertion id="b">
<text>A conditional observer methods may be declared by annotating the event parameter with the |(a)javax.event.IfExists| annotation</text>
</assertion>
-
- <assertion id="c">
- <text>Conditional observer methods may be declared in XML by adding a child |<IfExists>| element to the |<Observes>| element</text>
- </assertion>
+
</section>
<section id="7.5.6" title="Transactional observer methods">
@@ -4169,10 +3586,6 @@
<text>An after failure observer method is called during the after completion phase of the transaction, only when the transaction fails</text>
</assertion>
- <assertion id="f">
- <text>A transactional observer method may be declared by ~annotating the event parameter of the observer method~ or in XML by a child element of the <Observes> element</text>
- </assertion>
-
<assertion id="g">
<text>A transactional observer method may be declared by annotating the event parameter of the observer method or ~in XML by a child element of the |<Observes>| element~</text>
</assertion>
@@ -4199,9 +3612,6 @@
</section>
<section id="7.5.7" title="Asynchronous observer methods">
- <assertion id="a">
- <text>An asynchronous observer method may be declared by ~annotating the event parameter of the observer method |(a)javax.event.Asynchronously|~ or in XML by a child |<Asynchronously>| element of the |<Observes>| element</text>
- </assertion>
<assertion id="b">
<text>An asynchronous observer method may be declared by annotating the event parameter of the observer method |(a)javax.event.Asynchronously| or ~in XML by a child |<Asynchronously>| element of the |<Observes>| element~</text>
@@ -4625,10 +4035,6 @@
<assertion id="m">
<text>The |@Dependent| scope is inactive except when the container is injecting dependencies of a servlet</text>
</assertion>
-
- <assertion id="n">
- <text>The |@Dependent| scope is even active during invocation of interceptors and decorators of observer methods and interceptors and decorators of |@PostConstruct| and |@PreDestroy| callbacks</text>
- </assertion>
</section>
@@ -4638,9 +4044,6 @@
<note>A statement of intent</note>
</assertion>
- <assertion id="b">
- <text>Instances of interceptors or decorators with scope |@Dependent| are also dependent objects of the bean they intercept or decorate</text>
- </assertion>
</section>
<section id="8.3.2" title="Dependent object destruction">
@@ -5075,9 +4478,6 @@
</section>
<section id="9" title="XML based metadata">
- <assertion id="a">
- <text>XML-based bean declarations define additional beans they do not redefine or disable any bean that was declared via annotations</text>
- </assertion>
<assertion id="b">
<text>Multiple namespaces are accommodated, each representing a Java package</text>
@@ -5277,783 +4677,6 @@
</section>
- <section id="9.5" title="Bean declarations">
-
- <assertion id="a">
- <text>An XML element that appears as a direct child of the root |<Beans>| element is interpreted as a bean declaration if it is not a |<Deploy>|, |<Interceptors>| or |<Decorators>| element in the Java EE namespace, and does not have a direct child |<BindingType>|,|<InterceptorBindingType>| or |<Stereotype>| element in the Java EE namespace</text>
- </assertion>
-
- <assertion id="b">
- <text>The name of the XML element is interpreted as a Java type. The container inspects the Java type and other metadata to determine what kind of bean is being declared. If no such Java type exists in the classpath, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="c">
- <text>If the type is |javax.jms.Queue| or |javax.jms.Topic|, it declares a JMS resource, as defined in Section 3.7.2, "Declaring a JMS resource using XML"</text>
- </assertion>
-
- <assertion id="d">
- <text>If the element has a child |<Resource>|, |<PersistenceContext>|, |<PersistenceUnit>|, |<EJB>| or |<WebServiceRef>| element, it declares a resource, as defined in Section 3.6.1, "Declaring a resource using XML"</text>
- </assertion>
-
- <assertion id="e">
- <text>If the type is an EJB bean class, a session bean was declared, as defined in Section 3.3.5, "Declaring a session bean using XML"</text>
- </assertion>
-
- <assertion id="f">
- <text>If the type is a concrete class, is not an EJB bean class, and is not a parameterized type, a simple bean was declared, as defined in Section 3.2.4, "Declaring a simple bean using XML"</text>
- </assertion>
-
- <assertion id="g">
- <text>Otherwise, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="h">
- <text>Inline bean declarations may occur at injection points, as defined in Section 9.9, "Inline bean declarations". Inline bean declarations always declare simple beans</text>
- </assertion>
-
- </section>
-
- <section id="9.5.1" title="Child elements of a bean declaration">
- <assertion id="a">
- <text>If the child element can be interpreted as a Java annotation type, the container interprets the child element as declaring type-level metadata</text>
- </assertion>
-
- <assertion id="b">
- <text>If the child element can be interpreted as a Java class or interface, the container interprets the child element as declaring a parameter of the bean constructor</text>
- </assertion>
-
- <assertion id="c">
- <text>If the child element namespace is the same as the namespace of the parent, the container interprets the element as declaring a method or field of the bean</text>
- </assertion>
-
- <assertion id="d">
- <text>If the name of the child element matches the name of both a method and a field of the bean class, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="e">
- <text>If the name of the child element matches the name of a method of the bean class, is it interpreted to represent that method</text>
- </assertion>
-
- <assertion id="f">
- <text>If the name of the child element matches the name of a field of the bean class, is it interpreted to represent that field</text>
- </assertion>
-
- <assertion id="g">
- <text>Otherwise, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="9.5.2" title="Type-level metadata for a bean">
- <assertion id="a">
- <text>Type-level metadata is specified via direct child elements of the bean declaration that represent Java annotation types</text>
- </assertion>
-
- <assertion id="b">
- <text>The child element is interpreted as a Java annotation type</text>
- </assertion>
-
- <assertion id="c">
- <text>If the annotation type is a deployment type, the deployment type of the bean was declared, as defined in Section 2.5.4, "Declaring the deployment type of a bean using XML"</text>
- </assertion>
-
- <assertion id="d">
- <text>If the annotation type is a scope type, the scope of the bean was declared, as defined in Section 2.4.4, "Declaring the bean scope using XML"</text>
- </assertion>
-
- <assertion id="e">
- <text>If the annotation type is a binding type, a binding of the bean was declared, as defined in Section 2.3.4, "Declaring the bindings of a bean using XML"</text>
- </assertion>
-
- <assertion id="f">
- <text>If the annotation type is an interceptor binding type, an interceptor binding of the bean was declared, as defined in Section A.3.6.2, "Binding an interceptor using XML"</text>
- </assertion>
-
- <assertion id="g">
- <text>If the annotation type is a stereotype, a stereotype of the bean was declared, as defined in Section 2.7.3, "Declaring the stereotypes for a bean using XML"</text>
- </assertion>
-
- <assertion id="h">
- <text>If the annotation type is |javax.annotation.Name|, the name of the bean was declared, as defined in Section 2.6.2, "Declaring the bean name using XML"</text>
- </assertion>
-
- <assertion id="i">
- <text>If the annotation type is |javax.inject.Specializes|, the bean was declared to directly specialize the bean with the same bean class that was defined using annotations, as specified in Section 3.2.7, "Specializing a simple bean" and Section 3.3.7, "Specializing a session bean"</text>
- </assertion>
-
- <assertion id="j">
- <text>If the annotation type is |javax.inject.Realizes|, the bean was declared to realize the bean with the same bean class that was defined using annotations</text>
- </assertion>
-
- <assertion id="k">
- <text>If the annotation type is |javax.interceptor.Interceptor|, or |javax.decorator.Decorator| the bean is an interceptor or decorator, as defined in Section 9.7, "Interceptor and decorator declarations"</text>
- </assertion>
-
- <assertion id="l">
- <text>If the annotation type is |javax.annotation.Resource|, |javax.ejb.EJB|, |javax.xml.ws.WebServiceRef|, |javax.persistence.PersistenceContext| or |javax.persistence.PersistenceUnit|, the metadata for a resource or JMS resource was declared, as defined in Section 3.6.1, "Declaring a resource using XML" and Section 3.7.2, "Declaring a JMS resource using XML"</text>
- </assertion>
-
- <assertion id="m">
- <text>Otherwise, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="9.5.3" title="Bean constructor declarations">
- <assertion id="a">
- <text>The bean constructor for a simple bean is declared by the list of direct child elements of the bean declaration that represent Java class or interface types</text>
- </assertion>
-
- <assertion id="b">
- <text>The container interprets these elements as declaring parameters of the constructor</text>
- </assertion>
-
- <assertion id="c">
- <text>Each constructor parameter declaration is interpreted as an injection point declaration, as specified in Section 9.8, "Injection point declarations"</text>
- </assertion>
-
- <assertion id="d">
- <text>If the simple bean class has exactly one constructor such that the constructor has the same number of parameters as the bean declaration has constructor parameter declarations, and the Java type represented by each constructor parameter declaration is assignable to the Java type of the corresponding constructor parameter then the element is interpreted to represent that constructor, and that constructor is the bean constructor</text>
- </assertion>
-
- <assertion id="e">
- <text>If more than one constructor exists which satisfies these conditions, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="f">
- <text>If no constructor of the simple bean class satisfies these conditions, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="g">
- <text>For any constructor parameter, the bean type declared in XML may be a subtype of the Java parameter type. In this case, the container will use the bean type declared in XML when resolving the dependency</text>
- </assertion>
- </section>
-
- <section id="9.5.4" title="Fields of a bean">
- <assertion id="a">
- <text>A field of a bean is declared by a direct child element of the bean declaration. The name of the field is the same as the name of the element</text>
- </assertion>
-
- <assertion id="b">
- <text>If the bean class has exactly one field with the same name as the child element, then the child element is interpreted to represent that field</text>
- </assertion>
-
- <assertion id="c">
- <text>If the bean class does not have exactly one field with the specified name, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>If more than one child element of a bean declaration represents the same field of the bean class, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="e">
- <text>A field declaration may contain child elements</text>
- </assertion>
-
- <assertion id="f">
- <text>If a field declaration has more than one direct child element, and at least
-one of these elements is something other than a |<value>| element in the Java EE namespace, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="g">
- <text>An element that represents a field may declare an injected field, a producer field or a field with an initial value</text>
- </assertion>
-
- <assertion id="h">
- <text>If the element contains a child |<Produces>| element in the Java EE namespace, a producer field was declared, as defined in Section 3.5.3, "Declaring a producer field using XML"</text>
- </assertion>
-
- <assertion id="i">
- <text>If the element contains a child |<value>| element in the Java EE namespace, a field with an initial value of type Set or List was declared, as defined in Section 9.5.5, "Field initial value declarations"</text>
- </assertion>
-
- <assertion id="j">
- <text>If the element has exactly one child element, an injected field was declared, as defined in Section 3.8.2, "Declaring an injected field using XML"</text>
- </assertion>
-
- <assertion id="k">
- <text>If the element has a non-empty body, and no child elements, a field with an initial value was declared, as defined in Section 9.5.5, "Field initial value declarations"</text>
- </assertion>
-
- <assertion id="l">
- <text>Otherwise, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="m">
- <text>If a field declaration represents an injected field, the child element is interpreted as an injection point declaration, as specified in Section 9.8, "Injection point declarations"</text>
- </assertion>
-
- <assertion id="n">
- <text>If the declared type is not assignable to the Java type of the field, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="o">
- <text>The bean type declared in XML may be a subtype of the Java field type. In this case, the container will use the bean type declared in XML when resolving the dependency</text>
- </assertion>
-
- </section>
-
- <section id="9.5.5" title="Field initial value declarations">
- <assertion id="a">
- <text>The initial value of a field of a simple bean or session bean with any one of the following types may be specified in XML: any primitive type, or |java.lang| wrapper type, any enumerated type, |java.lang.String|, |java.util.Date|, |java.sql.Date|, |java.sql.Time| or |java.sql.Timestamp|, |java.util.Calendar|, |java.math.BigDecimal| or |java.math.BigInteger|, |java.lang.Class|, |java.util.List<java.lang.String>| or |java.util.Set<java.lang.String>|, |java.util.List<java.lang.Class>| or |java.util.Set<java.lang.Class>|, |java.util.List<X>| or |java.util.Set<X>| where X is an enumerated type</text>
- </assertion>
-
- <assertion id="b">
- <text>The initial value of the field is specified in the body of an XML element representing the field</text>
- </assertion>
-
- <assertion id="c">
- <text>The initial value of a field of primitive type or |java.lang| wrapper type is specified using the Java literal syntax for that type</text>
- </assertion>
-
- <assertion id="d">
- <text>The initial value of a field of type |java.lang.String| is specified using the string value</text>
- </assertion>
-
- <assertion id="e">
- <text>The initial value of a field of enumerated type is specified using the unqualified name of the enumeration value</text>
- </assertion>
-
- <assertion id="f">
- <text>The initial value of a field of type |java.util.Date|, |java.sql.Date|, |java.sql.Time|, |java.sql.Timestamp| or |java.util.Calendar| is specified using a format that can be parsed by calling
-|java.text.DateFormat.getDateTimeInstance().parse()|</text>
- </assertion>
-
- <assertion id="g">
- <text>The initial value of a field of type |java.math.BigDecimal| or |java.math.BigInteger| is specified using a format that can be parsed by the constructor that accepts a string</text>
- </assertion>
-
- <assertion id="h">
- <text>The initial value of a field of type |java.lang.Class| is specified using the fully qualified Java class name</text>
- </assertion>
-
- <assertion id="i">
- <text>The initial value of a field of type |java.util.List| or |java.util.Set| is specified by a list of |<value>| elements. The body of the value element is specified using the string value, fully qualified Java class name or unqualified name of the enumeration value</text>
- </assertion>
-
- <assertion id="j">
- <text>If a field with an initial value specified in XML is not of one of the listed types, or if the initial value is not specified in the correct format for the type of the field, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="k">
- <text>If an element representing a field specifies both an initial value and a type declaration, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="9.5.6" title="Methods of a bean">
- <assertion id="a">
- <text>A method of a bean is declared by a direct child element of the bean declaration. The name of the declared method is the same as the name of the child element</text>
- </assertion>
-
- <assertion id="b">
- <text>A method declaration may have any number of direct child elements</text>
- </assertion>
-
- <assertion id="c">
- <text>The container inspects the direct child elements of the method declaration. For each child element, the element is interpreted as a Java type. If no such Java type exists in the classpath, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>If the type is |javax.inject.Disposes|, the container searches for a direct child element of the child element and interprets that element as declaring a disposed parameter of the disposal method</text>
- </assertion>
-
- <assertion id="e">
- <text>If the type is |javax.event.Observes|, the container searches for a direct child element of the child element that is not an |<IfExists>|, |<Asynchronously>|, |<AfterTransactionCompletion>|, |<AfterTransactionSuccess>|, |<AfterTransactionFailure>| or |<BeforeTransactionCompletion>| element in the Java EE namespace, and interprets that element as declaring an event parameter of the observer method</text>
- </assertion>
-
- <assertion id="f">
- <text>If the type is some other Java annotation type, the container interprets the child element as declaring method-level metadata</text>
- </assertion>
-
- <assertion id="g">
- <text>If the type is a Java class or interface, the container interprets the child element as declaring a parameter of the method</text>
- </assertion>
-
- <assertion id="h">
- <text>Otherwise, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="i">
- <text>If a method declaration has more than one direct child element which is an |<Initializer>|, |<Produces>|, |<Disposes>| or |<Observes>| element in the Java EE namespace, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="j">
- <text>If a |<Disposes>| element does not contain exactly one direct child element, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="k">
- <text>If an |<Observes>| element does not contain exactly one direct child element that is not an |<IfExists>|, |<Asynchronously>|, |<AfterTransactionCompletion>|, |<AfterTransactionSuccess>|, |<AfterTransactionFailure>| or |<BeforeTransactionCompletion>| element in the Java EE namespace, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="l">
- <text>Each method parameter declaration and disposed parameter declaration is interpreted as an injection point declaration, as specified in Section 9.8, "Injection point declarations". An event parameter declaration is interpreted as a type declaration, as defined in Section 9.10, "Specifying bean types and bindings"</text>
- </assertion>
-
- <assertion id="m">
- <text>If the bean class has exactly one method such that the method name is the same as the name of the element that declares the method, the method has the same number of parameters as the element that declares the method has child elements, and the Java type represented by each method parameter declaration is assignable to the Java type of the corresponding method parameter, then the element is interpreted to represent that method</text>
- </assertion>
-
- <assertion id="n">
- <text>If more than one method exists which satisfies these conditions, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="o">
- <text>If no method of the bean class satisfies these conditions, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="p">
- <text>For any method parameter, the bean type declared in XML may be a subtype of the Java parameter type. In this case, the container will use the bean type declared in XML when resolving the dependency</text>
- </assertion>
-
- <assertion id="q">
- <text>If more than one child element of a bean declaration represents the same method of the bean class, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="r">
- <text>An element that represents a method may declare an initializer method, an observer method, a producer method or a disposal method. Alternatively, or additionally, it may declare method-level interceptor binding</text>
- </assertion>
-
- <assertion id="s">
- <text>If the element contains a child |<Initializes>| element in the Java EE namespace, an initializer method was declared, as defined in Section 3.9.2, "Declaring an initializer method using XML"</text>
- </assertion>
-
- <assertion id="t">
- <text>If the element contains a child |<Produces>| element in the Java EE namespace, a producer method was declared, as defined in Section 3.4.3, "Declaring a producer method using XML"</text>
- </assertion>
-
- <assertion id="u">
- <text>If the element contains a child |<Disposes>| element in the Java EE namespace, a disposal method was declared, as defined in Section 3.4.9, "Declaring a disposal method using XML"</text>
- </assertion>
-
- <assertion id="v">
- <text>If the element contains a child |<Observes>| element in the Java EE namespace, an observer method was declared, as defined in Section 7.5.3, "Declaring an observer method using XML"</text>
- </assertion>
-
- <assertion id="w">
- <text>If the element contains a child element which can be interpreted as an interceptor binding type, method-level interceptor binding was declared, as defined in Section A.3.6.2, "Binding an interceptor using XML"</text>
- </assertion>
- </section>
-
- <section id="9.6" title="Producer method and field declarations">
- <assertion id="a">
- <text>A producer method or field declaration is formed by adding a direct child |<Produces>| element to an element that represents the method or field, as defined in Section 3.4.3, "Declaring a producer method using XML" and Section 3.5.3, "Declaring a producer field using XML"</text>
- </assertion>
-
- </section>
-
- <section id="9.6.1" title="Child elements of a producer field declaration">
- <assertion id="a">
- <text>The container inspects the direct child elements of a producer field declaration</text>
- </assertion>
-
- <assertion id="b">
- <text>If there is more than one direct child element, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="c">
- <text>Otherwise, the direct child element is a |<Produces>| element in the Java EE namespace, and declares the return type, bindings and member-level metadata of the producer field</text>
- </assertion>
-
- <assertion id="d">
- <text>The container inspects the direct child elements of the |<Produces>| element. For each child element, the element is interpreted as a Java type. If no such Java type exists in the classpath, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="e">
- <text>If the type is a Java class or interface type, the type of the producer field was declared</text>
- </assertion>
-
- <assertion id="f">
- <text>If the type is a Java annotation type, it declares member-level metadata of the producer field</text>
- </assertion>
-
- <assertion id="g">
- <text>Otherwise, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="h">
- <text>If more than one child element represents a Java class or interface type, or if no child element represents a Java class or interface type, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="9.6.2" title="Child elements of a producer method declaration">
- <assertion id="a">
- <text>If a child element of a producer method declaration is the |<Produces>| element in the Java EE namespace, it declares the return type, bindings and member-level metadata of the producer method</text>
- </assertion>
-
- <assertion id="b">
- <text>If the child element of a producer method declaration can be interpreted as an interceptor binding type, it declares a method-level interceptor binding</text>
- </assertion>
-
- <assertion id="c">
- <text>The container interprets the child element of a producer method declaration as declaring a parameter of the producer method, if it is not a |<Produces>| element and cannot be interpreted as an interceptor binding type</text>
- </assertion>
-
- <assertion id="d">
- <text>If there is more than one child |<Produces>| element of a producer method declaration in the Java EE namespace, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="e">
- <text>The container inspects the direct child elements of the |<Produces>| element. For each child element, the element is interpreted as a Java type. If no such Java type exists in the classpath, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="f">
- <text>If the type of the direct child element of a |<Produces>| element is a Java class or interface type, the return type of the producer method was declared</text>
- </assertion>
-
- <assertion id="g">
- <text>If the type of the direct child element of a |<Produces>| element is a Java annotation type, it declares member-level metadata of the producer method</text>
- </assertion>
-
- <assertion id="h">
- <text>If the type of the direct child element of a |<Produces>| element is not a Java class or Java annotation, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="i">
- <text>If more than one child element represents a Java class or interface type, or if no child element represents a Java class or interface type, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="9.6.3" title="Return type and bindings of a producer method or field">
- <assertion id="a">
- <text>Every XML producer method or field declaration has a direct child |<Produces>| element</text>
- </assertion>
-
- <assertion id="b">
- <text>This |<Produces>| element must, in turn, have a direct child element which declares the return type of the producer method or the type of the producer field and which is interpreted by the container as a type declaration, as defined in Section 9.10, "Specifying bean types and bindings"</text>
- </assertion>
-
- <assertion id="c">
- <text>The type declaration that declares the return type of the producer method or the type of the producer field specifies the return type and bindings of the producer method bean, or the type and bindings of the producer field bean.</text>
- </assertion>
-
- <assertion id="d">
- <text>The type is used to calculate the set of bean types</text>
- </assertion>
-
- <assertion id="e">
- <text>The type declared in XML must be a supertype or subtype of the Java method or field type. If the declared type is not a supertype or subtype of the Java method or field type, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- </section>
-
- <section id="9.6.4" title="Member-level metadata for a producer method or field">
- <assertion id="a">
- <text>Member-level metadata for a producer method or field declaration is specified via direct child elements of the |<Produces>| element that represent Java annotation types.</text>
- </assertion>
-
- <assertion id="b">
- <text>Each child element is interpreted as a Java annotation type. If the type is not a Java annotation type, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="c">
- <text>If the annotation type is a deployment type, the deployment type of the producer method or field was declared, as defined in Section 2.5.4, "Declaring the deployment type of a bean using XML".</text>
- </assertion>
-
- <assertion id="d">
- <text>If the annotation type is a scope type, the scope of the producer method or field was declared, as defined in Section 2.4.4, "Declaring the bean scope using XML".</text>
- </assertion>
-
- <assertion id="e">
- <text>If the annotation type is a stereotype, a stereotype of the producer method or field was declared, as defined in Section 2.7.3, "Declaring the stereotypes for a bean using XML".</text>
- </assertion>
-
- <assertion id="f">
- <text>If the annotation type is |javax.annotation.Name|, the name of the producer method or field was declared, as defined in Section 2.6.2, "Declaring the bean name using XML".</text>
- </assertion>
-
- <assertion id="g">
- <text>If the annotation type is not a deployment type, or a scope type, or a stereotype, or a |javax.annotation.Name|, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="9.7" title="Interceptor and decorator declarations">
- <assertion id="a">
- <text>A simple bean declaration is interpreted as an interceptor declaration if it contains a direct child |<Interceptor>| element in the Java EE namespace</text>
- </assertion>
-
- <assertion id="b">
- <text>A simple bean declaration is interpreted as a decorator declaration if it contains a direct child |<Decorator>| element in the Java EE namespace</text>
- </assertion>
-
- <assertion id="c">
- <text>If a bean declaration that is not a simple bean declaration contains a child |<Interceptor>| element, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="d">
- <text>If a bean declaration that is not a simple bean declaration contains a child |<Decorator>| element, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="e">
- <text>If an inline bean declaration contains a child |<Interceptor>| element, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="f">
- <text>If an inline bean declaration contains a child |<Decorator>| element, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="g">
- <text>If a simple bean declaration contains more than one direct child |<Interceptor>| element in the Java EE namespace, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="h">
- <text>If a simple bean declaration contains more than one direct child |<Decorator>| element in the Java EE namespace, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
- </section>
-
- <section id="9.7.1" title="Decorator delegate attribute">
- <assertion id="a">
- <text>Decorator declarations may declare the delegate attribute</text>
- </assertion>
-
- <assertion id="b">
- <text>A delegate declaration is a direct child element of the decorator declaration.</text>
- </assertion>
-
- <assertion id="c">
- <text>The name of the delegate attribute is the same as the name of the element.</text>
- </assertion>
-
- <assertion id="d">
- <text>If a direct child element of a decorator declaration exists in the same namespace as its parent, and has direct child |<Decorates>| element in the Java EE namespace then it is interpreted as a delegate declaration.</text>
- </assertion>
-
- <assertion id="e">
- <text>If the bean class has a field with the same name as the child element, then the child element is interpreted to represent that field.</text>
- </assertion>
-
- <assertion id="f">
- <text>If the bean class does not have have a field with the specified name, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="g">
- <text>If a delegate declaration has more than one direct child element, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="h">
- <text>The child element of the delegate declaration is a |<Decorates>| element in the Java EE namespace. If the |<Decorates>| element does not, in turn, have exactly one direct child element, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="i">
- <text>The direct child element of the |<Decorates>| element is interpreted as a type declaration as specified by Section 9.10, "Specifying bean types and bindings". If the declared bean type is not assignable to the type of the Java field, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="j">
- <text>The bean type declared in XML may be a subtype of the Java field type. In this case, the container will use the bean type declared in XML when resolving the dependency.</text>
- </assertion>
-
- <assertion id="k">
- <text>If simple bean declaration that is not a decorator declaration contains a direct child element that in turn contains a direct child |<Decorates>| element, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- </section>
-
- <section id="9.8" title="Injection point declarations">
- <assertion id="a">
- <text>An injection point declaration is either a type declaration, as defined in Section 9.10, "Specifying bean types and bindings", or an inline bean declaration, as defined in Section 9.9, "Inline bean declarations".</text>
- </assertion>
-
- <assertion id="b">
- <text>When the container encounters an injection point declaration, it interprets the element as a Java class or interface. If no such Java type exists in the classpath, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="c">
- <text>If the Java type is a parameterized type, the injection point declaration is a type declaration, and the declared type of the injection point is the bean type of the type declaration, including actual type parameters.</text>
- </assertion>
-
- <assertion id="d">
- <text>Otherwise, the container inspects the direct child elements. If any direct child element can be interpreted as a binding type, the injection point declaration is a type declaration, and the declared type of the injection point is the bean type of the type declaration.</text>
- </assertion>
-
- <assertion id="e">
- <text>Otherwise, if any direct child elements exist, the injection point declaration is an inline bean declaration, and the declared type of the injection point is the bean class of the bean.</text>
- </assertion>
-
- <assertion id="f">
- <text>Otherwise, the injection point declaration is a type declaration, and the declared type of the injection point is the bean type of the type declaration.</text>
- </assertion>
- </section>
-
- <section id="9.9" title="Inline bean declarations">
- <assertion id="a">
- <text>An inline bean declaration is a simple bean declaration, as defined in Section 9.5, "Bean declarations" that occurs as an injection point declaration, instead of as a direct child of the <Beans> element.</text>
- </assertion>
-
- <assertion id="b">
- <text>The element is interpreted as a Java class. This Java class is the bean class of the simple bean</text>
- </assertion>
-
- <assertion id="c">
- <text>Inline bean declarations may not explicitly specify a binding type. If an inline bean declaration explicitly specifies a binding type, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="d">
- <text>For every inline injection point, the container generates a unique value for an implementation-specific binding type. This generated value is the binding of the injection point, and the only binding of the simple bean. The bean type of the injection point is the declared bean class of the simple bean.</text>
- </assertion>
-
- <assertion id="e">
- <text>An inline bean declaration results in a simple bean that is bound only to the injection point at which it was declared.</text>
- </assertion>
- </section>
-
- <section id="9.10" title="Specifying bean types and bindings">
- <assertion id="a">
- <text>Every injection point defined in XML must explicitly specify a bean type and combination of bindings.</text>
- </assertion>
-
- <assertion id="b">
- <text>Every event parameter defined in XML must explicitly specify a bean type and combination of bindings.</text>
- </assertion>
-
- <assertion id="c">
- <text>Every delegate attribute defined in XML must explicitly specify a bean type and combination of bindings.</text>
- </assertion>
-
- <assertion id="d">
- <text>XML-based producer method declarations must explicitly specify the return type (which is used to calculate the set of bean types) and bindings</text>
- </assertion>
-
- <assertion id="e">
- <text>A type declaration is an element that represents a Java class or interface, or |<Array>|</text>
- </assertion>
-
- <assertion id="f">
- <text>A type declaration is (if the type is a parameterized type), a set of child elements that represent Java classes and/or interfaces, and are interpreted as the actual type parameters, or, if the type is an array type, a single child element that represents the array element type</text>
- </assertion>
-
- <assertion id="g">
- <text>A type declaration is optionally, a set of child elements that represent Java annotation types, and are interpreted as bindings</text>
- </assertion>
-
- <assertion id="h">
- <text>When the container encounters a type declaration it interprets the element as a Java type</text>
- </assertion>
-
- <assertion id="i">
- <text>If the element is an |<Array>| element in the Java EE namespace, an array type was declared.</text>
- </assertion>
-
- <assertion id="j">
- <text>Otherwise, the element is interpreted as a Java class or interface. If no such Java type exists in the classpath, a |DefinitionException| is thrown by the container at deployment time. If the Java type is not a class or interface type, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="k">
- <text>The container inspects every direct child element of the type declaration. Each child element is interpreted as a Java type. If no such Java type exists in the classpath, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="l">
- <text>If the type is a Java annotation type, a binding was declared.</text>
- </assertion>
-
- <assertion id="m">
- <text>If the type is a Java class or interface type, an actual type parameter or array element type was declared</text>
- </assertion>
-
- <assertion id="n">
- <text>If the type is not a Java annotation type or a Java class or interface type, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="o">
- <text>If multiple array element types are declared, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="p">
- <text>If the number of declared actual type parameters is not the same as the number of parameters of the Java type, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="q">
- <text>If a type parameter of the Java type is bounded, and the corresponding declared actual type parameter does not satisfy the upper or lower bound, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="r">
- <text>If a binding declaration declares a Java annotation type that is not a binding type, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="s">
- <text>If no binding is declared, the default binding |@Current| is assumed</text>
- </assertion>
-
- <assertion id="t">
- <text>If the same binding type occurs more than once, a |DuplicateBindingTypeException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="u">
- <text>For fields, type declarations are specified as direct child elements of the field declaration</text>
- </assertion>
-
- <assertion id="v">
- <text>For methods, the method parameter declarations are type declarations</text>
- </assertion>
-
- <assertion id="w">
- <text>For producer methods, the return type must be specified</text>
- </assertion>
-
- <assertion id="x">
- <text>For constructors, the constructor parameter declarations are type declarations</text>
- </assertion>
- </section>
-
- <section id="9.11" title="Annotation members">
- <assertion id="a">
- <text>Any binding or interceptor binding declaration must define the value of any annotation member without a default value, and may additionally define the value of any annotation member with a default value.</text>
- </assertion>
-
- <assertion id="b">
- <text>Annotation member values are defined by attributes of the XML element which represents the Java annotation.</text>
- </assertion>
-
- <assertion id="c">
- <text>All attributes of any XML element which represents a Java annotation are interpreted as members of the annotation</text>
- </assertion>
-
- <assertion id="d">
- <text>The name of the attribute is interpreted as the name of the corresponding annotation member.</text>
- </assertion>
-
- <assertion id="e">
- <text>The value of the attribute is interpreted as the value of the annotation member.</text>
- </assertion>
-
- <assertion id="f">
- <text>If there is no annotation member with the same name as the attribute, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="g">
- <text>The value of an annotation member named value may be specified in the body of the XML element which represents the Java annotation.</text>
- </assertion>
-
- <assertion id="h">
- <text>If the XML element has a non-empty body and also specifies an attribute named value, a
-|DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="i">
- <text>If the XML element has a non-empty body, and there is no annotation member named value, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="j">
- <text>The value of a member of primitive type is specified using the Java literal syntax for that type</text>
- </assertion>
-
- <assertion id="k">
- <text>The value of a member of type |java.lang.String| is specified using the string value</text>
- </assertion>
-
- <assertion id="l">
- <text>The value of a member of enumerated type is specified using the unqualified name of the enumeration value.</text>
- </assertion>
-
- <assertion id="m">
- <text>The value of a member of type |java.lang.Class| is specified using the fully qualified Java class name.</text>
- </assertion>
-
- <assertion id="n">
- <text>If the member value is not specified in the correct format for the type of the member, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="o">
- <text>If an XML element that refers to a Java annotation with a member with no default value does not declare a value for that member, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
- </section>
-
<section id="9.12" title="Deployment declarations">
<assertion id="a">
<text>The |<Deploy>|, |<Interceptors>| and |<Decorators>| elements in the Java EE namespace determine which beans, interceptors and decorators are enabled in a particular deployment</text>
@@ -6074,35 +4697,6 @@
</assertion>
</section>
- <section id="9.12.2" title="The <Interceptors> declaration">
- <assertion id="a">
- <text>Each direct child element of an |<Interceptors>| element is interpreted as the declaring an enabled interceptor, as specified in Section A.3.7, "Interceptor enablement and ordering".</text>
- </assertion>
-
- <assertion id="b">
- <text>Each child element is interpreted as a Java class. If no such Java class exists in the classpath, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="c">
- <text>If the same interceptor is declared more than once, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- </section>
-
- <section id="9.12.3" title="The <Decorators> declaration">
- <assertion id="a">
- <text>Each direct child element of a |<Decorators>| element is interpreted as the declaring an enabled decorator, as specified in Section A.5.5, "Decorator enablement and ordering".</text>
- </assertion>
-
- <assertion id="b">
- <text>Each child element is interpreted as a Java class. If no such Java class exists in the classpath, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="c">
- <text>If the same decorator is declared more than once, a |DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
- </section>
-
<section id="11" title="Packaging and Deployment">
</section>
@@ -6232,57 +4826,23 @@
<text>The container automatically discovers~ simple beans (according to the rules of Section 3.2.1, "Which Java classes are beans?") and session beans (according to the rules of Section 3.3.2, "Which EJBs are beans?") deployed and/or declared in these locations and searches the bean classes for producer methods, producer fields, disposal methods and~ observer methods declared using annotations.</text>
<note>Check all archive types enumerated above, and session beans and simple beans</note>
</assertion>
-
- <assertion id="w">
- <text>The container discovers beans~, disposal methods and observer methods~ defined using XML by parsing the |beans.xml| files according to the rules of Chapter 9, XML based metadata.</text>
- <note>Check all archive types enumerated above, simple beans, session beans, producer methods and producer fields</note>
- </assertion>
-
- <assertion id="x">
- <text>The container discovers ~beans, ~disposal methods ~and observer methods~ defined using XML by parsing the |beans.xml| files according to the rules of Chapter 9, XML based metadata.</text>
- <note>Check all archive types enumerated above</note>
- </assertion>
-
- <assertion id="y">
- <text>The container discovers ~beans, disposal methods and~ observer methods defined using XML by parsing the |beans.xml| files according to the rules of Chapter 9, XML based metadata.</text>
- <note>Check all archive types enumerated above</note>
- </assertion>
<assertion id="z">
<text>Next, the container determines which beans~, interceptors and decorators are enabled,~ according to the rules defined in Section 2.5.6, "Enabled deployment types", Section A.3.7, "Interceptor enablement and ordering" and Section A.5.5, "Decorator enablement and ordering", taking into account any |<Deploy>|, ~|<Interceptors>| and |<Decorators>|~ declarations in the |beans.xml| files.</text>
</assertion>
- <assertion id="aa">
- <text>Next, the container determines which ~beans,~ interceptors ~and decorators~ are enabled, according to the rules defined in Section 2.5.6, "Enabled deployment types", Section A.3.7, "Interceptor enablement and ordering" and Section A.5.5, "Decorator enablement and ordering", taking into account any ~|<Deploy>|,~ |<Interceptors>| ~and |<Decorators>|~ declarations in the |beans.xml| files.</text>
- </assertion>
-
- <assertion id="ab">
- <text>Next, the container determines which ~beans, interceptors and~ decorators are enabled, according to the rules defined in Section 2.5.6, "Enabled deployment types", Section A.3.7, "Interceptor enablement and ordering" and Section A.5.5, "Decorator enablement and ordering", taking into account any ~|<Deploy>|, |<Interceptors>| and~ |<Decorators>| declarations in the |beans.xml| files.</text>
- </assertion>
-
<assertion id="ac">
<text>For each enabled bean that is not an interceptor or decorator, the container creates an instance of |Bean|, and registers it by calling |Manager.addBean()|</text>
<note>Check that interceptors aren't registered as beans, decorators aren't registered as beans, that disabled beans aren't registered and that simple beans, session beans, producer methods and producer fields are registered</note>
</assertion>
- <assertion id="ad">
- <text>For each enabled interceptor, the container creates an instance of |Interceptor| and registers it by calling |Manager.addInterceptor()|</text>
- </assertion>
-
- <assertion id="ae">
- <text>For each enabled decorator, the container creates an instance of |Decorator| and registers it by calling |Manager.addDecorator()|.</text>
- </assertion>
-
<assertion id="af">
<text>For each observer method of an enabled bean, the container creates an instance of |Observer| that implements the rules of Section 7.5.8, "Observer object for an observer method" and registers it by calling |Manager.addObserver()|</text>
</assertion>
</section>
<section id="11.4" title="Providing additional XML based metadata">
- <assertion id="a">
- <text>The container parses the XML stream according to the rules of Chapter 9, XML based metadata. This method may be called at any time by the application or third-party framework.</text>
- <note>Check that the parse method adds beans etc.</note>
- </assertion>
+
</section>
<section id="11.6" title="Activities">
@@ -6304,22 +4864,6 @@
<text>Every bean belonging to a parent activity ~also belongs to the child activity, is eligible for injection into other beans belonging to the child activity and~ may be obtained by dynamic lookup via the child activity</text>
</assertion>
- <assertion id="e">
- <text>Every interceptor ~and decorator~ belonging to a parent activity also belongs to the child activity ~and may be applied to any bean belonging to the child activity~</text>
- </assertion>
-
- <assertion id="f">
- <text>Every interceptor ~and decorator~ belonging to a parent activity ~also belongs to the child activity and~ may be applied to any bean belonging to the child activity</text>
- </assertion>
-
- <assertion id="g">
- <text>Every ~interceptor and~ decorator belonging to a parent activity also belongs to the child activity and~ may be applied to any bean belonging to the child activity~</text>
- </assertion>
-
- <assertion id="h">
- <text>Every ~interceptor and~ decorator belonging to a parent activity ~also belongs to the child activity and~ may be applied to any bean belonging to the child activity</text>
- </assertion>
-
<assertion id="j">
<text>Every observer belonging to a parent activity also belongs to the child activity ~and receives events fired via the child activity~</text>
</assertion>
@@ -6367,14 +4911,6 @@
<assertion id="u">
<text>If a bean registered with a child activity has the bean type and all bindings of some injection point of some bean registered with a~ direct or~ indirect parent activity, a |DeploymentException| is throw by the container at deployment time.</text>
</assertion>
-
- <assertion id="v">
- <text>The |addInterceptor()| ~and |addDecorator()|~ methods throw |UnsupportedOperationException| when called on a |Manager| object that represents a child activity.</text>
- </assertion>
-
- <assertion id="w">
- <text>The ~|addInterceptor()| and~ |addDecorator()| methods throw |UnsupportedOperationException| when called on a |Manager| object that represents a child activity.</text>
- </assertion>
</section>
Added: tck/trunk/interceptor/pom.xml
===================================================================
--- tck/trunk/interceptor/pom.xml (rev 0)
+++ tck/trunk/interceptor/pom.xml 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,292 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>parent</artifactId>
+ <groupId>org.jboss.jsr299.tck</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.jsr299.tck</groupId>
+ <artifactId>jsr299-tck-interceptor-decorator</artifactId>
+ <name>JSR-299 TCK tests and harness (Interceptors and Decorators)</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>jsr299-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jsr299.tck</groupId>
+ <artifactId>jsr299-tck-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.test-harness</groupId>
+ <artifactId>jboss-test-harness</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <classifier>jdk15</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>tck-utils-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-api</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>jboss-jaxrpc</artifactId>
+ <groupId>jbossws</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jboss-transaction-api</artifactId>
+ <groupId>org.jboss.javaee</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jboss-jaxrpc</artifactId>
+ <groupId>jboss.jbossws</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.2</version>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>${basedir}/src/main/resources/tck-tests.xml</file>
+ <type>xml</type>
+ <classifier>suite</classifier>
+ </artifact>
+ <artifact>
+ <file>${basedir}/src/main/resources/tck-audit.xml</file>
+ <type>xml</type>
+ <classifier>audit</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-in-container-dependencies</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.outputDirectory}/lib</outputDirectory>
+ <stripVersion>true</stripVersion>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.test-harness</groupId>
+ <artifactId>jboss-test-harness</artifactId>
+ <overWrite>true</overWrite>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>tck-audit</id>
+ <activation>
+ <property>
+ <name>tck-audit</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>tck-utils-impl</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <compilerArgument>-AauditXml=${basedir}/src/main/resources/tck-audit.xml</compilerArgument>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>enforce-versions</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireJavaVersion>
+ <version>1.6</version>
+ </requireJavaVersion>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.2</version>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>${basedir}/src/main/resources/tck-tests.xml</file>
+ <type>xml</type>
+ <classifier>suite</classifier>
+ </artifact>
+ <artifact>
+ <file>${basedir}/src/main/resources/tck-audit.xml</file>
+ <type>xml</type>
+ <classifier>audit</classifier>
+ </artifact>
+ <artifact>
+ <file>../target/coverage.html</file>
+ <type>html</type>
+ <classifier>coverage</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <defaultGoal>compile</defaultGoal>
+ </build>
+ </profile>
+
+ <profile>
+ <id>write-artifacts-to-disk</id>
+ <activation>
+ <property>
+ <name>dumpArtifacts</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-jsr-299-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <mainClass>org.jboss.jsr299.tck.api.TCK</mainClass>
+ <systemProperties>
+ <systemProperty>
+ <key>dumpArtifacts</key>
+ <value>true</value>
+ </systemProperty>
+ <systemProperty>
+ <key>org.jboss.jsr299.tck.outputDirectory</key>
+ <value>target/jsr299-artifacts</value>
+ </systemProperty>
+ <systemProperty>
+ <key>org.jboss.jsr299.tck.libraryDirectory</key>
+ <value>${libaryDir}</value>
+ </systemProperty>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
+
+</project>
Added: tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
===================================================================
--- tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java (rev 0)
+++ tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,144 @@
+package org.jboss.jsr299.tck;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+
+import javax.context.Context;
+import javax.inject.manager.Manager;
+
+import org.jboss.jsr299.tck.api.JSR299Configuration;
+import org.jboss.jsr299.tck.impl.JSR299ConfigurationImpl;
+
+public abstract class AbstractJSR299Test extends org.jboss.testharness.AbstractTest
+{
+
+ protected abstract static class RunInDependentContext
+ {
+
+ protected void setup()
+ {
+ getCurrentConfiguration().getContexts().setActive(getCurrentConfiguration().getContexts().getDependentContext());
+ }
+
+ protected void cleanup()
+ {
+ getCurrentConfiguration().getContexts().setInactive(getCurrentConfiguration().getContexts().getDependentContext());
+ }
+
+ public final void run() throws Exception
+ {
+ try
+ {
+ setup();
+ execute();
+ }
+ finally
+ {
+ cleanup();
+ }
+ }
+
+ protected JSR299Configuration getCurrentConfiguration()
+ {
+ return JSR299ConfigurationImpl.get();
+ }
+
+ protected abstract void execute() throws Exception;
+
+ }
+
+ private Manager currentManager;
+
+ protected void setCurrentManager(Manager currentManager)
+ {
+ this.currentManager = currentManager;
+ }
+
+
+ protected Manager getCurrentManager()
+ {
+ return currentManager;
+ }
+
+ protected byte[] serialize(Object instance) throws IOException
+ {
+ ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(bytes);
+ out.writeObject(instance);
+ return bytes.toByteArray();
+ }
+
+ protected Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException
+ {
+ ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
+ return in.readObject();
+ }
+
+ protected void setContextActive(Context context)
+ {
+ getCurrentConfiguration().getContexts().setActive(context);
+ }
+
+ protected void setContextInactive(Context context)
+ {
+ getCurrentConfiguration().getContexts().setInactive(context);
+ }
+
+ protected void destroyContext(Context context)
+ {
+ getCurrentConfiguration().getContexts().destroyContext(context);
+ }
+
+ protected JSR299Configuration getCurrentConfiguration()
+ {
+ return JSR299ConfigurationImpl.get();
+ }
+
+ @Override
+ public void beforeMethod()
+ {
+ super.beforeMethod();
+ setCurrentManager(getCurrentConfiguration().getManagers().getManager());
+ }
+
+ @Override
+ public void afterMethod()
+ {
+ super.afterMethod();
+ setCurrentManager(null);
+ }
+
+ /**
+ * Checks if all annotations are in a given set of annotations
+ *
+ * @param annotations The annotation set
+ * @param annotationTypes The annotations to match
+ * @return True if match, false otherwise
+ */
+ public boolean annotationSetMatches(Set<Annotation> annotations, Class<? extends Annotation>... annotationTypes)
+ {
+ List<Class<? extends Annotation>> annotationTypeList = new ArrayList<Class<? extends Annotation>>();
+ annotationTypeList.addAll(Arrays.asList(annotationTypes));
+ for (Annotation annotation : annotations)
+ {
+ if (annotationTypeList.contains(annotation.annotationType()))
+ {
+ annotationTypeList.remove(annotation.annotationType());
+ }
+ else
+ {
+ return false;
+ }
+ }
+ return annotationTypeList.size() == 0;
+ }
+
+}
\ No newline at end of file
Added: tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java
===================================================================
--- tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java (rev 0)
+++ tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,97 @@
+package org.jboss.jsr299.tck;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.context.CreationalContext;
+import javax.inject.manager.Bean;
+import javax.inject.manager.InjectionPoint;
+import javax.inject.manager.Manager;
+
+public abstract class ForwardingBean<T> extends Bean<T>
+{
+
+ protected ForwardingBean(Manager manager)
+ {
+ super(manager);
+ }
+
+ protected abstract Bean<T> delegate();
+
+ @Override
+ public Set<Annotation> getBindings()
+ {
+ return delegate().getBindings();
+ }
+
+ @Override
+ public Class<? extends Annotation> getDeploymentType()
+ {
+ return delegate().getDeploymentType();
+ }
+
+ @Override
+ public Set<? extends InjectionPoint> getInjectionPoints()
+ {
+ return delegate().getInjectionPoints();
+ }
+
+ @Override
+ public String getName()
+ {
+ return delegate().getName();
+ }
+
+ @Override
+ public Class<? extends Annotation> getScopeType()
+ {
+ return delegate().getScopeType();
+ }
+
+ @Override
+ public Set<Type> getTypes()
+ {
+ return delegate().getTypes();
+ }
+
+ @Override
+ public boolean isNullable()
+ {
+ return delegate().isNullable();
+ }
+
+ @Override
+ public boolean isSerializable()
+ {
+ return delegate().isSerializable();
+ }
+
+ public T create(CreationalContext<T> creationalContext)
+ {
+ return delegate().create(creationalContext);
+ }
+
+ public void destroy(T instance)
+ {
+ delegate().destroy(instance);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delegate().equals(obj);
+ }
+
+ @Override
+ public String toString()
+ {
+ return delegate().toString();
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate().hashCode();
+ }
+}
Added: tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/impl/JSR299ConfigurationImpl.java
===================================================================
--- tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/impl/JSR299ConfigurationImpl.java (rev 0)
+++ tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/impl/JSR299ConfigurationImpl.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,98 @@
+package org.jboss.jsr299.tck.impl;
+
+import javax.context.Context;
+
+import org.jboss.jsr299.tck.api.JSR299Configuration;
+import org.jboss.jsr299.tck.spi.Beans;
+import org.jboss.jsr299.tck.spi.Contexts;
+import org.jboss.jsr299.tck.spi.EL;
+import org.jboss.jsr299.tck.spi.Managers;
+import org.jboss.testharness.impl.ConfigurationImpl;
+
+public class JSR299ConfigurationImpl extends ConfigurationImpl implements JSR299Configuration
+{
+
+ public static JSR299Configuration get()
+ {
+ return ConfigurationImpl.get(JSR299Configuration.class);
+ }
+
+ public static final String INTEGRATION_TEST_PACKAGE_NAME = "org.jboss.jsr299.tck.integration";
+ public static final String UNIT_TEST_PACKAGE_NAME = "org.jboss.jsr299.tck.unit";
+
+ private Beans beans;
+ private Contexts<? extends Context> contexts;
+ private Managers managers;
+ private EL el;
+
+ protected JSR299ConfigurationImpl()
+ {
+ }
+
+ public JSR299ConfigurationImpl(JSR299Configuration configuration)
+ {
+ this.beans = configuration.getBeans();
+ this.contexts = configuration.getContexts();
+ this.managers = configuration.getManagers();
+ this.el = configuration.getEl();
+ }
+
+
+ public Beans getBeans()
+ {
+ return beans;
+ }
+
+ public void setBeans(Beans beans)
+ {
+ this.beans = beans;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T extends Context> Contexts<T> getContexts()
+ {
+ return (Contexts<T>) contexts;
+ }
+
+ public <T extends Context> void setContexts(Contexts<T> contexts)
+ {
+ this.contexts = contexts;
+ }
+
+ public Managers getManagers()
+ {
+ return managers;
+ }
+
+ public void setManagers(Managers managers)
+ {
+ this.managers = managers;
+ }
+
+ public EL getEl()
+ {
+ return el;
+ }
+
+ public void setEl(EL el)
+ {
+ this.el = el;
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuilder configuration = new StringBuilder();
+ configuration.append("JSR 299 TCK Configuration\n");
+ configuration.append("-----------------\n");
+ configuration.append("\tBeans: ").append(getBeans()).append("\n");
+ configuration.append("\tContainers: ").append(getContainers()).append("\n");
+ configuration.append("\tContexts: ").append(getContexts()).append("\n");
+ configuration.append("\tEL: ").append(getEl()).append("\n");
+ configuration.append("\tManagers: ").append(getManagers()).append("\n");
+ configuration.append("\n");
+ configuration.append(super.toString());
+ return configuration.toString();
+ }
+
+}
Added: tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/impl/JSR299PropertiesBasedConfigurationBuilder.java
===================================================================
--- tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/impl/JSR299PropertiesBasedConfigurationBuilder.java (rev 0)
+++ tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/impl/JSR299PropertiesBasedConfigurationBuilder.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,45 @@
+package org.jboss.jsr299.tck.impl;
+
+import java.io.IOException;
+
+import javax.context.Context;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.api.JSR299Configuration;
+import org.jboss.jsr299.tck.literals.NewLiteral;
+import org.jboss.jsr299.tck.spi.Beans;
+import org.jboss.jsr299.tck.spi.Contexts;
+import org.jboss.jsr299.tck.spi.EL;
+import org.jboss.jsr299.tck.spi.Managers;
+import org.jboss.testharness.impl.PropertiesBasedConfigurationBuilder;
+
+public class JSR299PropertiesBasedConfigurationBuilder extends PropertiesBasedConfigurationBuilder<JSR299Configuration>
+{
+
+ public JSR299PropertiesBasedConfigurationBuilder() throws IOException
+ {
+ super(new JSR299ConfigurationImpl());
+ super.getConfiguration().getExtraPackages().add(NewLiteral.class.getPackage().getName());
+ super.getConfiguration().getExtraPackages().add(AbstractJSR299Test.class.getPackage().getName());
+ super.getConfiguration().getExtraPackages().add(JSR299ConfigurationImpl.class.getPackage().getName());
+ super.getConfiguration().getExtraPackages().add(JSR299Configuration.class.getPackage().getName());
+ super.getConfiguration().getExtraPackages().add(Managers.class.getPackage().getName());
+ super.getConfiguration().getExtraDeploymentProperties().add("org.jboss.testharness.api.ConfigurationBuilder=org.jboss.jsr299.tck.impl.JSR299PropertiesBasedConfigurationBuilder");
+ }
+
+ @Override
+ public JSR299PropertiesBasedConfigurationBuilder init()
+ {
+ super.init();
+ getConfiguration().setManagers(getInstanceValue(Managers.PROPERTY_NAME, Managers.class, true));
+ getConfiguration().setBeans(getInstanceValue(Beans.PROPERTY_NAME, Beans.class, true));
+ getConfiguration().setEl(getInstanceValue(EL.PROPERTY_NAME, EL.class, true));
+
+ @SuppressWarnings("unchecked")
+ Contexts<? extends Context> instanceValue = getInstanceValue(Contexts.PROPERTY_NAME, Contexts.class, true);
+
+ getConfiguration().setContexts(instanceValue);
+ return this;
+ }
+
+}
Added: tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/literals/CurrentLiteral.java
===================================================================
--- tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/literals/CurrentLiteral.java (rev 0)
+++ tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/literals/CurrentLiteral.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.literals;
+
+import javax.inject.AnnotationLiteral;
+import javax.inject.Current;
+
+/**
+ * Annotation literal for @Current
+ *
+ * @author Pete Muir
+ */
+public class CurrentLiteral extends AnnotationLiteral<Current> implements Current {}
\ No newline at end of file
Added: tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/literals/NewLiteral.java
===================================================================
--- tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/literals/NewLiteral.java (rev 0)
+++ tck/trunk/interceptor/src/main/java/org/jboss/jsr299/tck/literals/NewLiteral.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.literals;
+
+import javax.inject.AnnotationLiteral;
+import javax.inject.New;
+
+public class NewLiteral extends AnnotationLiteral<New> implements New
+{
+
+}
Added: tck/trunk/interceptor/src/main/resources/META-INF/jboss-test-harness.properties
===================================================================
--- tck/trunk/interceptor/src/main/resources/META-INF/jboss-test-harness.properties (rev 0)
+++ tck/trunk/interceptor/src/main/resources/META-INF/jboss-test-harness.properties 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,2 @@
+org.jboss.testharness.api.ConfigurationBuilder=org.jboss.jsr299.tck.impl.JSR299PropertiesBasedConfigurationBuilder
+org.jboss.testharness.testPackage=org.jboss.jsr299.tck.tests
\ No newline at end of file
Added: tck/trunk/interceptor/src/main/resources/META-INF/tck-unit.properties
===================================================================
--- tck/trunk/interceptor/src/main/resources/META-INF/tck-unit.properties (rev 0)
+++ tck/trunk/interceptor/src/main/resources/META-INF/tck-unit.properties 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,5 @@
+fisheye_base_url=http\://fisheye.jboss.org/browse/Webbeans/tck/trunk/impl/src/main/java
+svn_base_url=http\://anonsvn.jboss.org/repos/webbeans/tck/trunk/impl/src/main/java/
+pass_threshold=75
+fail_threshold=50
+unimplemented_test_groups=stub,broken
\ No newline at end of file
Added: tck/trunk/interceptor/src/main/resources/org/jboss/testharness/impl/packaging/ear/ejb-jar.xml
===================================================================
--- tck/trunk/interceptor/src/main/resources/org/jboss/testharness/impl/packaging/ear/ejb-jar.xml (rev 0)
+++ tck/trunk/interceptor/src/main/resources/org/jboss/testharness/impl/packaging/ear/ejb-jar.xml 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
+ version="3.0">
+
+</ejb-jar>
Added: tck/trunk/interceptor/src/main/resources/org/jboss/testharness/impl/packaging/jsr299/default/beans.xml
===================================================================
Added: tck/trunk/interceptor/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/interceptor/src/main/resources/tck-audit.xml (rev 0)
+++ tck/trunk/interceptor/src/main/resources/tck-audit.xml 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,410 @@
+<specification
+ xmlns="http://jboss.com/products/webbeans/tck/audit"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.com/products/webbeans/tck/audit http://snapshots.jboss.org/maven2/org/hibernate/tck-utils-api/0.9-SNAPSHO..."
+ name="JSR-299: Java Contexts and Dependency Injection"
+ version="Revised Public Review Draft">
+
+ <section id="2" title="Bean definition">
+
+ <assertion id="f">
+ <text>A bean comprises of a set of interceptor bindings</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.7.1.2" title="Specifying interceptor bindings for a stereotype">
+
+ <assertion id="a">
+ <text>A stereotype may declare zero interceptor bindings</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A stereotype may declare one interceptor binding</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A stereotype may declare multiple interceptor bindings</text>
+ </assertion>
+
+ </section>
+
+ <section id="3" title="Bean Implementation">
+
+ </section>
+
+
+ <section id="3.2" title="Simple beans">
+
+ <assertion id="cb">
+ <text>The bean class of a simple bean may not be an abstract class, _unless the simple bean is a decorator_</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the bean class of a simple bean is annotated with both the |@Interceptor| and |@Decorator| stereotypes, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.2.1" title="Which Java classes are beans?">
+
+ <assertion id="da">
+ <text>A top-level abstract Java class is a simple bean if it is annotated |@Decorator|.</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.2.5" title="Simple beans with the @New binding">
+ <assertion id="c">
+ <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such simple bean, a second simple bean exists which has _the same interceptor bindings defined by annotations_.</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.3" title="Session beans">
+
+ <assertion id="f">
+ <text>If the bean class of a session bean is annotated |@Interceptor|, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the bean class of a session bean is annotated |@Decorator|, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.6" title="Session beans with the @New binding">
+
+
+ <assertion id="c">
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such session bean, a second bean exists which has the same interceptor bindings defined by annotations</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.8" title="Injected fields">
+
+ <assertion id="i">
+ <text>If a field is a decorator delegate attribute, it is not an injected field</text>
+ </assertion>
+ </section>
+
+ <section id="3.10" title="Support for Common Annotations">
+
+ <assertion id="g">
+ <text>Interception, as defined in |javax.interceptor| is provided by the container when annotations are applied to the bean class of a simple bean</text>
+ </assertion>
+
+ </section>
+
+ <section id="4" title="Inheritance, specialization and realization">
+
+ </section>
+
+ <section id="4.1" title="Inheritance of type-level metadata">
+
+ <assertion id="ac">
+ <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X is annotated with a _interceptor binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
+ </assertion>
+
+ <assertion id="af">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _interceptor binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
+ </assertion>
+
+ <assertion id="ai">
+ <text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, if X is annotated with a _interceptor binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ </assertion>
+
+ <assertion id="al">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X is annotated with a _interceptor binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ </assertion>
+
+ </section>
+
+ <section id="4.2" title="Inheritance of member-level metadata">
+
+ <assertion id="ca">
+ <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X declares a _non-static method_ x() annotated with an interceptor binding type Z then Y inherits the binding if and only if Y does not override the method x().</text>
+ </assertion>
+
+ <assertion id="cb">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static method_ x() annotated with an interceptor binding type Z then Y inherits the binding if and only if Y does not override the method x().</text>
+ </assertion>
+
+ <assertion id="cc">
+ <text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, if X declares a _non-static method_ x() annotated with an interceptor binding type Z then Y inherits the binding if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x().</text>
+ </assertion>
+
+ <assertion id="cd">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static method_ x() annotated with an interceptor binding type Z then Y inherits the binding if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x().</text>
+ </assertion>
+
+ <assertion id="fa">
+ <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if Y is a decorator and X declares a delegate attribute x then Y inherits x if and only if Y does not define a delegate attribute</text>
+ </assertion>
+
+ <assertion id="fb">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if Y is a decorator and X declares a delegate attribute x then Y inherits x if and only if neither Y does not define a delegate attribute</text>
+ </assertion>
+
+ <assertion id="fc">
+ <text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, if Y is a decorator and X declares a delegate attribute x then Y inherits x if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y defines a delegate attribute</text>
+ </assertion>
+
+ <assertion id="fd">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if Y is a decorator and X declares a delegate attribute x then Y inherits x if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y defines a delegate attribute</text>
+ </assertion>
+
+ </section>
+
+ <section id="4.4" title="Realization">
+
+ </section>
+
+ <section id="4.4.1" title="Using realization">
+
+ <assertion id="ca">
+ <text>If a generic class Y declares a non-static _producer method_ with a certain combination of scope, stereotypes, bindings and interceptor bindings, then every bean X that realizes Y also has a _producer method_ with the same scope, stereotypes and interceptor bindings. The bindings for this inherited _producer method_ consist of all bindings declared by the _producer method_ of Y, excluding all bindings of Y, together with the bindings declared explicitly by X. The deployment type of the inherited _producer method_ is the deployment type of X</text>
+ </assertion>
+
+ <assertion id="cb">
+ <text>If a generic class Y declares a non-static _producer field_ with a certain combination of scope, stereotypes, bindings and interceptor bindings, then every bean X that realizes Y also has a _producer field_ with the same scope, stereotypes and interceptor bindings. The bindings for this inherited _producer field_ consist of all bindings declared by the _producer field_ of Y, excluding all bindings of Y, together with the bindings declared explicitly by X. The deployment type of the inherited _producer field_ is the deployment type of X</text>
+ </assertion>
+
+ </section>
+
+ <section id="5" title="Lookup, dependency injection and EL resolution">
+
+ </section>
+
+ <section id="5.12" title="Injection into non-contextual objects">
+
+ </section>
+
+ <section id="5.12.1" title="Non-contextual instances of session beans">
+
+ <assertion id="f">
+ <text>The container is required to create interceptor stacks for session bean instances obtained directly from JNDI</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The container is required to create interceptor stacks for session bean instances injected using |@EJB|</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The container is required to create interceptor stacks for session bean instances injected using |@Resource|</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The container is required to create interceptor stacks for session bean instances created by the container to receive remote method calls</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The container is required to create interceptor stacks for session bean instances created by the container to receive timeouts</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>The container is required to create decorator stacks for session bean instances obtained directly from JNDI</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The container is required to create decorator stacks for session bean instances injected using |@EJB|</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>The container is required to create decorator stacks for session bean instances injected using |@Resource|</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>The container is required to create decorator stacks for session bean instances created by the container to receive remote method calls</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>The container is required to create decorator stacks for session bean instances created by the container to receive timeouts</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>For the purposes of interceptor stack creation, the container must treat non-contextual instances of session beans as instances of the most specialized bean that specializes the bean with binding |@New| and deployment type |@Standard| defined in Section 3.3.6, "Session beans with the |@New| binding"</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>For the purposes of decorator stack creation, the container must treat non-contextual instances of session beans as instances of the most specialized bean that specializes the bean with binding |@New| and deployment type |@Standard| defined in Section 3.3.6, "Session beans with the |@New| binding"</text>
+ </assertion>
+
+ </section>
+
+ <section id="5.12.2" title="Message-driven beans">
+
+ <assertion id="b">
+ <text>The container creates interceptor stacks for message-driven bean instances according to the bean class annotations</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container creates decorator stacks for message-driven bean instances according to the bean class annotations</text>
+ </assertion>
+ </section>
+
+ <section id="6" title="Bean lifecycle">
+
+ </section>
+
+ <section id="6.2" title="Creation">
+
+
+ <assertion id="b">
+ <text>The |Contextual.create()| method creates the interceptor stacks and binds them to the instance</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The |Contextual.create()| method creates the decorator stacks and binds them to the instance</text>
+ </assertion>
+
+ </section>
+
+ <section id="6.4" title="Lifecycle of simple beans">
+ <assertion id="a">
+ <text>When the |create()| method of the |Bean| object that represents a simple bean is called, the container first calls the bean constructor to obtain an instance of the bean. For each constructor parameter, the container passes the object returned by |Manager.getInstanceToInject()|. The container is permitted to return an instance of a container-generated subclass of the bean class, allowing interceptor and decorator bindings</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>When the |create()| method of the |Bean| object that represents a simple bean is called, after all initializer methods are called the container builds the interceptor stacks for the instance as defined in Section A.3.10 "Interceptor stack creation"</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>When the |create()| method of the |Bean| object that represents a simple bean is called, after all initializer methods are called the container builds the decorator stacks for the instance as defined in Section A.5.8 "Decorator stack creation"</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>When the |create()| method of the |Bean| object that represents a simple bean is called, after the interceptor and decorator stacks are built the container calls the |@PostConstruct| method, if any</text>
+ </assertion>
+
+ </section>
+
+ <section id="6.11" title="Lifecycle of EJBs">
+
+ <assertion id="d">
+ <text>When the EJB container creates a new instance of an EJB, after Java EE injection has been performed and before the |@PostConstruct| callback occurs the container builds the interceptor stacks for the instance as defined in Section A.3.10, "Interceptor stack creation" and Section A.5.8, "Decorator stack creation" and binds them to the instance</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>When the EJB container creates a new instance of an EJB, after Java EE injection has been performed and before the |@PostConstruct| callback occurs the container builds the decorator stacks for the instance as defined in Section A.3.10, "Interceptor stack creation" and Section A.5.8, "Decorator stack creation" and binds them to the instance</text>
+ </assertion>
+
+ </section>
+
+ <section id="8" title="Scopes and contexts">
+
+ </section>
+
+ <section id="8.3" title="Dependent pseudo-scope">
+
+ <assertion id="n">
+ <text>The |@Dependent| scope is even active during invocation of interceptors and decorators of observer methods and interceptors and decorators of |@PostConstruct| and |@PreDestroy| callbacks</text>
+ </assertion>
+
+ </section>
+
+ <section id="8.3.1" title="Dependent objects">
+
+ <assertion id="b">
+ <text>Instances of interceptors or decorators with scope |@Dependent| are also dependent objects of the bean they intercept or decorate</text>
+ </assertion>
+ </section>
+
+ <section id="9" title="XML based metadata">
+
+ </section>
+
+ <section id="9.12" title="Deployment declarations">
+
+ </section>
+
+ <section id="9.12.2" title="The <Interceptors> declaration">
+ <assertion id="a">
+ <text>Each direct child element of an |<Interceptors>| element is interpreted as the declaring an enabled interceptor, as specified in Section A.3.7, "Interceptor enablement and ordering".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Each child element is interpreted as a Java class. If no such Java class exists in the classpath, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the same interceptor is declared more than once, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ </section>
+
+ <section id="9.12.3" title="The <Decorators> declaration">
+ <assertion id="a">
+ <text>Each direct child element of a |<Decorators>| element is interpreted as the declaring an enabled decorator, as specified in Section A.5.5, "Decorator enablement and ordering".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Each child element is interpreted as a Java class. If no such Java class exists in the classpath, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the same decorator is declared more than once, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+ </section>
+
+ <section id="11" title="Packaging and Deployment">
+
+ </section>
+
+ <section id="11.2" title="Bean discovery">
+
+ <assertion id="p">
+ <text>First, the container discovers all ~binding types, stereotypes and~ interceptor binding types declared in XML, according to the rules of Section 9.4, "Stereotype, binding type and interceptor binding type declarations".</text>
+ </assertion>
+
+ <assertion id="aa">
+ <text>Next, the container determines which ~beans,~ interceptors ~and decorators~ are enabled, according to the rules defined in Section 2.5.6, "Enabled deployment types", Section A.3.7, "Interceptor enablement and ordering" and Section A.5.5, "Decorator enablement and ordering", taking into account any ~|<Deploy>|,~ |<Interceptors>| ~and |<Decorators>|~ declarations in the |beans.xml| files.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>Next, the container determines which ~beans, interceptors and~ decorators are enabled, according to the rules defined in Section 2.5.6, "Enabled deployment types", Section A.3.7, "Interceptor enablement and ordering" and Section A.5.5, "Decorator enablement and ordering", taking into account any ~|<Deploy>|, |<Interceptors>| and~ |<Decorators>| declarations in the |beans.xml| files.</text>
+ </assertion>
+
+ <assertion id="ad">
+ <text>For each enabled interceptor, the container creates an instance of |Interceptor| and registers it by calling |Manager.addInterceptor()|</text>
+ </assertion>
+
+ <assertion id="ae">
+ <text>For each enabled decorator, the container creates an instance of |Decorator| and registers it by calling |Manager.addDecorator()|.</text>
+ </assertion>
+
+ </section>
+
+ <section id="11.4" title="Providing additional XML based metadata">
+
+ </section>
+
+ <section id="11.6" title="Activities">
+
+ <assertion id="e">
+ <text>Every interceptor ~and decorator~ belonging to a parent activity also belongs to the child activity ~and may be applied to any bean belonging to the child activity~</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Every interceptor ~and decorator~ belonging to a parent activity ~also belongs to the child activity and~ may be applied to any bean belonging to the child activity</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Every ~interceptor and~ decorator belonging to a parent activity also belongs to the child activity and~ may be applied to any bean belonging to the child activity~</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>Every ~interceptor and~ decorator belonging to a parent activity ~also belongs to the child activity and~ may be applied to any bean belonging to the child activity</text>
+ </assertion>
+
+ <assertion id="v">
+ <text>The |addInterceptor()| ~and |addDecorator()|~ methods throw |UnsupportedOperationException| when called on a |Manager| object that represents a child activity.</text>
+ </assertion>
+
+ <assertion id="w">
+ <text>The ~|addInterceptor()| and~ |addDecorator()| methods throw |UnsupportedOperationException| when called on a |Manager| object that represents a child activity.</text>
+ </assertion>
+
+ </section>
+
+</specification>
Added: tck/trunk/interceptor/src/main/resources/tck-tests.xml
===================================================================
--- tck/trunk/interceptor/src/main/resources/tck-tests.xml (rev 0)
+++ tck/trunk/interceptor/src/main/resources/tck-tests.xml 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,26 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="JSR-299 TCK" verbose="2" >
+ <test name="JSR-299 TCK" >
+ <method-selectors>
+ <method-selector>
+ <selector-class name="org.jboss.testharness.impl.testng.DisableIntegrationTestsMethodSelector" />
+ </method-selector>
+ <method-selector>
+ <selector-class name="org.jboss.testharness.impl.testng.ExcludeIncontainerUnderInvestigationMethodSelector" />
+ </method-selector>
+ </method-selectors>
+ <groups>
+ <run>
+ <exclude name="stub" />
+ <exclude name="ri-broken" />
+ <exclude name="underInvestigation" />
+ <exclude name="broken" />
+ </run>
+ </groups>
+ <packages>
+ <package name="org.jboss.jsr299.tck.tests" />
+ </packages>
+ </test>
+
+</suite>
\ No newline at end of file
Added: tck/trunk/xml/pom.xml
===================================================================
--- tck/trunk/xml/pom.xml (rev 0)
+++ tck/trunk/xml/pom.xml 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,292 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>parent</artifactId>
+ <groupId>org.jboss.jsr299.tck</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.jsr299.tck</groupId>
+ <artifactId>jsr299-tck-xml-beans</artifactId>
+ <name>JSR-299 TCK tests and harness (XML bean definition)</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>jsr299-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jsr299.tck</groupId>
+ <artifactId>jsr299-tck-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.test-harness</groupId>
+ <artifactId>jboss-test-harness</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <classifier>jdk15</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>tck-utils-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-api</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>jboss-jaxrpc</artifactId>
+ <groupId>jbossws</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jboss-transaction-api</artifactId>
+ <groupId>org.jboss.javaee</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jboss-jaxrpc</artifactId>
+ <groupId>jboss.jbossws</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.2</version>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>${basedir}/src/main/resources/tck-tests.xml</file>
+ <type>xml</type>
+ <classifier>suite</classifier>
+ </artifact>
+ <artifact>
+ <file>${basedir}/src/main/resources/tck-audit.xml</file>
+ <type>xml</type>
+ <classifier>audit</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-in-container-dependencies</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.outputDirectory}/lib</outputDirectory>
+ <stripVersion>true</stripVersion>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.test-harness</groupId>
+ <artifactId>jboss-test-harness</artifactId>
+ <overWrite>true</overWrite>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>tck-audit</id>
+ <activation>
+ <property>
+ <name>tck-audit</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>tck-utils-impl</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <compilerArgument>-AauditXml=${basedir}/src/main/resources/tck-audit.xml</compilerArgument>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>enforce-versions</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireJavaVersion>
+ <version>1.6</version>
+ </requireJavaVersion>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.2</version>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>${basedir}/src/main/resources/tck-tests.xml</file>
+ <type>xml</type>
+ <classifier>suite</classifier>
+ </artifact>
+ <artifact>
+ <file>${basedir}/src/main/resources/tck-audit.xml</file>
+ <type>xml</type>
+ <classifier>audit</classifier>
+ </artifact>
+ <artifact>
+ <file>../target/coverage.html</file>
+ <type>html</type>
+ <classifier>coverage</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <defaultGoal>compile</defaultGoal>
+ </build>
+ </profile>
+
+ <profile>
+ <id>write-artifacts-to-disk</id>
+ <activation>
+ <property>
+ <name>dumpArtifacts</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-jsr-299-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <mainClass>org.jboss.jsr299.tck.api.TCK</mainClass>
+ <systemProperties>
+ <systemProperty>
+ <key>dumpArtifacts</key>
+ <value>true</value>
+ </systemProperty>
+ <systemProperty>
+ <key>org.jboss.jsr299.tck.outputDirectory</key>
+ <value>target/jsr299-artifacts</value>
+ </systemProperty>
+ <systemProperty>
+ <key>org.jboss.jsr299.tck.libraryDirectory</key>
+ <value>${libaryDir}</value>
+ </systemProperty>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
+
+</project>
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,144 @@
+package org.jboss.jsr299.tck;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+
+import javax.context.Context;
+import javax.inject.manager.Manager;
+
+import org.jboss.jsr299.tck.api.JSR299Configuration;
+import org.jboss.jsr299.tck.impl.JSR299ConfigurationImpl;
+
+public abstract class AbstractJSR299Test extends org.jboss.testharness.AbstractTest
+{
+
+ protected abstract static class RunInDependentContext
+ {
+
+ protected void setup()
+ {
+ getCurrentConfiguration().getContexts().setActive(getCurrentConfiguration().getContexts().getDependentContext());
+ }
+
+ protected void cleanup()
+ {
+ getCurrentConfiguration().getContexts().setInactive(getCurrentConfiguration().getContexts().getDependentContext());
+ }
+
+ public final void run() throws Exception
+ {
+ try
+ {
+ setup();
+ execute();
+ }
+ finally
+ {
+ cleanup();
+ }
+ }
+
+ protected JSR299Configuration getCurrentConfiguration()
+ {
+ return JSR299ConfigurationImpl.get();
+ }
+
+ protected abstract void execute() throws Exception;
+
+ }
+
+ private Manager currentManager;
+
+ protected void setCurrentManager(Manager currentManager)
+ {
+ this.currentManager = currentManager;
+ }
+
+
+ protected Manager getCurrentManager()
+ {
+ return currentManager;
+ }
+
+ protected byte[] serialize(Object instance) throws IOException
+ {
+ ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(bytes);
+ out.writeObject(instance);
+ return bytes.toByteArray();
+ }
+
+ protected Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException
+ {
+ ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
+ return in.readObject();
+ }
+
+ protected void setContextActive(Context context)
+ {
+ getCurrentConfiguration().getContexts().setActive(context);
+ }
+
+ protected void setContextInactive(Context context)
+ {
+ getCurrentConfiguration().getContexts().setInactive(context);
+ }
+
+ protected void destroyContext(Context context)
+ {
+ getCurrentConfiguration().getContexts().destroyContext(context);
+ }
+
+ protected JSR299Configuration getCurrentConfiguration()
+ {
+ return JSR299ConfigurationImpl.get();
+ }
+
+ @Override
+ public void beforeMethod()
+ {
+ super.beforeMethod();
+ setCurrentManager(getCurrentConfiguration().getManagers().getManager());
+ }
+
+ @Override
+ public void afterMethod()
+ {
+ super.afterMethod();
+ setCurrentManager(null);
+ }
+
+ /**
+ * Checks if all annotations are in a given set of annotations
+ *
+ * @param annotations The annotation set
+ * @param annotationTypes The annotations to match
+ * @return True if match, false otherwise
+ */
+ public boolean annotationSetMatches(Set<Annotation> annotations, Class<? extends Annotation>... annotationTypes)
+ {
+ List<Class<? extends Annotation>> annotationTypeList = new ArrayList<Class<? extends Annotation>>();
+ annotationTypeList.addAll(Arrays.asList(annotationTypes));
+ for (Annotation annotation : annotations)
+ {
+ if (annotationTypeList.contains(annotation.annotationType()))
+ {
+ annotationTypeList.remove(annotation.annotationType());
+ }
+ else
+ {
+ return false;
+ }
+ }
+ return annotationTypeList.size() == 0;
+ }
+
+}
\ No newline at end of file
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,97 @@
+package org.jboss.jsr299.tck;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.context.CreationalContext;
+import javax.inject.manager.Bean;
+import javax.inject.manager.InjectionPoint;
+import javax.inject.manager.Manager;
+
+public abstract class ForwardingBean<T> extends Bean<T>
+{
+
+ protected ForwardingBean(Manager manager)
+ {
+ super(manager);
+ }
+
+ protected abstract Bean<T> delegate();
+
+ @Override
+ public Set<Annotation> getBindings()
+ {
+ return delegate().getBindings();
+ }
+
+ @Override
+ public Class<? extends Annotation> getDeploymentType()
+ {
+ return delegate().getDeploymentType();
+ }
+
+ @Override
+ public Set<? extends InjectionPoint> getInjectionPoints()
+ {
+ return delegate().getInjectionPoints();
+ }
+
+ @Override
+ public String getName()
+ {
+ return delegate().getName();
+ }
+
+ @Override
+ public Class<? extends Annotation> getScopeType()
+ {
+ return delegate().getScopeType();
+ }
+
+ @Override
+ public Set<Type> getTypes()
+ {
+ return delegate().getTypes();
+ }
+
+ @Override
+ public boolean isNullable()
+ {
+ return delegate().isNullable();
+ }
+
+ @Override
+ public boolean isSerializable()
+ {
+ return delegate().isSerializable();
+ }
+
+ public T create(CreationalContext<T> creationalContext)
+ {
+ return delegate().create(creationalContext);
+ }
+
+ public void destroy(T instance)
+ {
+ delegate().destroy(instance);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delegate().equals(obj);
+ }
+
+ @Override
+ public String toString()
+ {
+ return delegate().toString();
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate().hashCode();
+ }
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/impl/JSR299ConfigurationImpl.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/impl/JSR299ConfigurationImpl.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/impl/JSR299ConfigurationImpl.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,98 @@
+package org.jboss.jsr299.tck.impl;
+
+import javax.context.Context;
+
+import org.jboss.jsr299.tck.api.JSR299Configuration;
+import org.jboss.jsr299.tck.spi.Beans;
+import org.jboss.jsr299.tck.spi.Contexts;
+import org.jboss.jsr299.tck.spi.EL;
+import org.jboss.jsr299.tck.spi.Managers;
+import org.jboss.testharness.impl.ConfigurationImpl;
+
+public class JSR299ConfigurationImpl extends ConfigurationImpl implements JSR299Configuration
+{
+
+ public static JSR299Configuration get()
+ {
+ return ConfigurationImpl.get(JSR299Configuration.class);
+ }
+
+ public static final String INTEGRATION_TEST_PACKAGE_NAME = "org.jboss.jsr299.tck.integration";
+ public static final String UNIT_TEST_PACKAGE_NAME = "org.jboss.jsr299.tck.unit";
+
+ private Beans beans;
+ private Contexts<? extends Context> contexts;
+ private Managers managers;
+ private EL el;
+
+ protected JSR299ConfigurationImpl()
+ {
+ }
+
+ public JSR299ConfigurationImpl(JSR299Configuration configuration)
+ {
+ this.beans = configuration.getBeans();
+ this.contexts = configuration.getContexts();
+ this.managers = configuration.getManagers();
+ this.el = configuration.getEl();
+ }
+
+
+ public Beans getBeans()
+ {
+ return beans;
+ }
+
+ public void setBeans(Beans beans)
+ {
+ this.beans = beans;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T extends Context> Contexts<T> getContexts()
+ {
+ return (Contexts<T>) contexts;
+ }
+
+ public <T extends Context> void setContexts(Contexts<T> contexts)
+ {
+ this.contexts = contexts;
+ }
+
+ public Managers getManagers()
+ {
+ return managers;
+ }
+
+ public void setManagers(Managers managers)
+ {
+ this.managers = managers;
+ }
+
+ public EL getEl()
+ {
+ return el;
+ }
+
+ public void setEl(EL el)
+ {
+ this.el = el;
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuilder configuration = new StringBuilder();
+ configuration.append("JSR 299 TCK Configuration\n");
+ configuration.append("-----------------\n");
+ configuration.append("\tBeans: ").append(getBeans()).append("\n");
+ configuration.append("\tContainers: ").append(getContainers()).append("\n");
+ configuration.append("\tContexts: ").append(getContexts()).append("\n");
+ configuration.append("\tEL: ").append(getEl()).append("\n");
+ configuration.append("\tManagers: ").append(getManagers()).append("\n");
+ configuration.append("\n");
+ configuration.append(super.toString());
+ return configuration.toString();
+ }
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/impl/JSR299PropertiesBasedConfigurationBuilder.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/impl/JSR299PropertiesBasedConfigurationBuilder.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/impl/JSR299PropertiesBasedConfigurationBuilder.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,45 @@
+package org.jboss.jsr299.tck.impl;
+
+import java.io.IOException;
+
+import javax.context.Context;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.api.JSR299Configuration;
+import org.jboss.jsr299.tck.literals.NewLiteral;
+import org.jboss.jsr299.tck.spi.Beans;
+import org.jboss.jsr299.tck.spi.Contexts;
+import org.jboss.jsr299.tck.spi.EL;
+import org.jboss.jsr299.tck.spi.Managers;
+import org.jboss.testharness.impl.PropertiesBasedConfigurationBuilder;
+
+public class JSR299PropertiesBasedConfigurationBuilder extends PropertiesBasedConfigurationBuilder<JSR299Configuration>
+{
+
+ public JSR299PropertiesBasedConfigurationBuilder() throws IOException
+ {
+ super(new JSR299ConfigurationImpl());
+ super.getConfiguration().getExtraPackages().add(NewLiteral.class.getPackage().getName());
+ super.getConfiguration().getExtraPackages().add(AbstractJSR299Test.class.getPackage().getName());
+ super.getConfiguration().getExtraPackages().add(JSR299ConfigurationImpl.class.getPackage().getName());
+ super.getConfiguration().getExtraPackages().add(JSR299Configuration.class.getPackage().getName());
+ super.getConfiguration().getExtraPackages().add(Managers.class.getPackage().getName());
+ super.getConfiguration().getExtraDeploymentProperties().add("org.jboss.testharness.api.ConfigurationBuilder=org.jboss.jsr299.tck.impl.JSR299PropertiesBasedConfigurationBuilder");
+ }
+
+ @Override
+ public JSR299PropertiesBasedConfigurationBuilder init()
+ {
+ super.init();
+ getConfiguration().setManagers(getInstanceValue(Managers.PROPERTY_NAME, Managers.class, true));
+ getConfiguration().setBeans(getInstanceValue(Beans.PROPERTY_NAME, Beans.class, true));
+ getConfiguration().setEl(getInstanceValue(EL.PROPERTY_NAME, EL.class, true));
+
+ @SuppressWarnings("unchecked")
+ Contexts<? extends Context> instanceValue = getInstanceValue(Contexts.PROPERTY_NAME, Contexts.class, true);
+
+ getConfiguration().setContexts(instanceValue);
+ return this;
+ }
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/literals/CurrentLiteral.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/literals/CurrentLiteral.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/literals/CurrentLiteral.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.literals;
+
+import javax.inject.AnnotationLiteral;
+import javax.inject.Current;
+
+/**
+ * Annotation literal for @Current
+ *
+ * @author Pete Muir
+ */
+public class CurrentLiteral extends AnnotationLiteral<Current> implements Current {}
\ No newline at end of file
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/literals/NewLiteral.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/literals/NewLiteral.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/literals/NewLiteral.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.literals;
+
+import javax.inject.AnnotationLiteral;
+import javax.inject.New;
+
+public class NewLiteral extends AnnotationLiteral<New> implements New
+{
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Animal.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Animal.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Animal.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+interface Animal
+{
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/AnotherDeploymentType.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/AnotherDeploymentType.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+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
+{
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/BookOrderProcessor.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/BookOrderProcessor.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/BookOrderProcessor.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+class BookOrderProcessor extends OrderProcessor
+{
+
+ @Override
+ public void postConstruct() {}
+
+ @Override
+ public void preDestroy() {}
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/CdOrderProcessor.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/CdOrderProcessor.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/CdOrderProcessor.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+class CdOrderProcessor extends OrderProcessor
+{
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Cod.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Cod.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Cod.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+import javax.annotation.PreDestroy;
+import javax.context.RequestScoped;
+
+@RequestScoped
+class Cod
+{
+ @PreDestroy
+ public void destroyWithProblem()
+ {
+ throw new RuntimeException("Some error");
+ }
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Duck.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Duck.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Duck.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,29 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+import javax.inject.Initializer;
+import javax.inject.Produces;
+import javax.inject.Production;
+
+
+@Production
+class Duck
+{
+
+ @Produces public static String foo = "foo";
+
+ @Produces public static Integer bar = 1;
+
+ @Produces @Synchronous public static Integer synchronousBar = 2;
+
+ public static boolean constructedCorrectly = false;
+
+ @Initializer
+ public Duck(String foo, @Synchronous Integer bar)
+ {
+ if (foo.equals(Duck.foo) && bar.equals(Duck.synchronousBar))
+ {
+ constructedCorrectly = true;
+ }
+ }
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Egg.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Egg.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Egg.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,24 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+import javax.annotation.PreDestroy;
+
+public class Egg
+{
+ private static boolean eggDestroyed = false;
+
+ public Egg()
+ {
+ eggDestroyed = false;
+ }
+
+ @PreDestroy
+ public void destroy()
+ {
+ eggDestroyed = true;
+ }
+
+ public static boolean isEggDestroyed()
+ {
+ return eggDestroyed;
+ }
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/EggProducer.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/EggProducer.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/EggProducer.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,26 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+import javax.inject.Disposes;
+import javax.inject.Produces;
+
+public class EggProducer
+{
+ private static boolean eggDisposed = false;
+
+ @Produces @Synchronous
+ public Egg nextEgg()
+ {
+ eggDisposed = false;
+ return new Egg();
+ }
+
+ public void disposeEgg(@Disposes @Synchronous Egg egg)
+ {
+ eggDisposed = true;
+ }
+
+ public static boolean isEggDisposed()
+ {
+ return eggDisposed;
+ }
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Farm.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Farm.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Farm.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,33 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+import java.util.Date;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.inject.Current;
+
+class Farm
+{
+
+ public Date founded;
+ public Date closed;
+ public int initialStaff;
+ public String location;
+
+ @Current
+ FarmOffice farmOffice;
+
+ @PostConstruct
+ protected void postConstruct()
+ {
+ founded = new Date();
+ initialStaff = farmOffice.noOfStaff;
+ }
+
+ @PreDestroy
+ protected void preDestroy()
+ {
+ closed = new Date();
+ }
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FarmOffice.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FarmOffice.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FarmOffice.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+
+class FarmOffice
+{
+
+ public int noOfStaff = 20;
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FishPond.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FishPond.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FishPond.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,26 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+import javax.annotation.PreDestroy;
+import javax.inject.Current;
+import javax.inject.Initializer;
+
+class FishPond
+{
+
+ public Animal goldfish;
+
+ @Current
+ public Salmon salmon;
+
+ @Initializer
+ public FishPond(Goldfish goldfish)
+ {
+ this.goldfish = goldfish;
+ }
+
+ @PreDestroy
+ public void destroy()
+ {
+ assert !Salmon.isBeanDestroyed();
+ }
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FishStereotype.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FishStereotype.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FishStereotype.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.annotation.Named;
+import javax.annotation.Stereotype;
+import javax.context.ApplicationScoped;
+
+(a)Stereotype(requiredTypes=Animal.class)
+@Target( { TYPE })
+@Retention(RUNTIME)
+@ApplicationScoped
+@Named
+@interface FishStereotype
+{
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FooException.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FooException.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FooException.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+class FooException extends RuntimeException
+{
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Goldfish.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Goldfish.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Goldfish.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+import javax.context.RequestScoped;
+import javax.inject.Production;
+
+@RequestScopedAnimalStereotype
+@RequestScoped
+@Production
+class Goldfish implements Animal
+{
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Goose.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Goose.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Goose.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+
+public class Goose
+{
+ @Synchronous
+ private Egg currentEgg;
+
+ public Egg getCurrentEgg()
+ {
+ return currentEgg;
+ }
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/IndirectOrderProcessor.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/IndirectOrderProcessor.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/IndirectOrderProcessor.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+class IndirectOrderProcessor extends IntermediateOrderProcessor
+{
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/IntermediateOrderProcessor.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/IntermediateOrderProcessor.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/IntermediateOrderProcessor.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+class IntermediateOrderProcessor extends OrderProcessor
+{
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Lion.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Lion.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Lion.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+@Tame
+class Lion
+{
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Lorry_Broken.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Lorry_Broken.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Lorry_Broken.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+class Lorry_Broken
+{
+
+ public Lorry_Broken() throws Exception
+ {
+ throw new Exception();
+ }
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/MountainLion.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/MountainLion.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/MountainLion.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+import javax.inject.Specializes;
+
+@Specializes
+@AnotherDeploymentType
+class MountainLion extends Lion
+{
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/MyCreationalContext.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/MyCreationalContext.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/MyCreationalContext.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,36 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+import javax.context.CreationalContext;
+
+class MyCreationalContext<T> implements CreationalContext<T>
+{
+ private static Object lastBeanPushed = null;
+ private static boolean pushCalled = false;
+
+ public void push(T incompleteInstance)
+ {
+ pushCalled = true;
+ lastBeanPushed = incompleteInstance;
+ }
+
+ public static Object getLastBeanPushed()
+ {
+ return lastBeanPushed;
+ }
+
+ public static void setLastBeanPushed(Object lastBeanPushed)
+ {
+ MyCreationalContext.lastBeanPushed = lastBeanPushed;
+ }
+
+ public static boolean isPushCalled()
+ {
+ return pushCalled;
+ }
+
+ public static void setPushCalled(boolean pushCalled)
+ {
+ MyCreationalContext.pushCalled = pushCalled;
+ }
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/NovelOrderProcessor.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/NovelOrderProcessor.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/NovelOrderProcessor.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+class NovelOrderProcessor extends BookOrderProcessor
+{
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/OrderProcessor.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/OrderProcessor.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/OrderProcessor.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,31 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+
+class OrderProcessor
+{
+
+ public static boolean postConstructCalled = false;
+
+ public static boolean preDestroyCalled = true;
+
+ @PostConstruct
+ public void postConstruct()
+ {
+ postConstructCalled = true;
+ }
+
+ @PreDestroy
+ public void preDestroy()
+ {
+ preDestroyCalled = true;
+ }
+
+ public void order()
+ {
+
+ }
+
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/RedSnapper.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/RedSnapper.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/RedSnapper.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+import javax.context.RequestScoped;
+
+@FishStereotype
+@RequestScoped
+class RedSnapper implements Animal
+{
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/RequestScopedAnimalStereotype.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/RequestScopedAnimalStereotype.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/RequestScopedAnimalStereotype.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.annotation.Stereotype;
+import javax.context.RequestScoped;
+
+(a)Stereotype(requiredTypes=Animal.class, supportedScopes=RequestScoped.class)
+@Target( { TYPE })
+@Retention(RUNTIME)
+@interface RequestScopedAnimalStereotype
+{
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Salmon.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Salmon.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Salmon.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,24 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+import javax.annotation.PreDestroy;
+
+class Salmon
+{
+ private static boolean beanDestroyed = false;
+
+ public Salmon()
+ {
+ beanDestroyed = false;
+ }
+
+ @PreDestroy
+ public void destroy()
+ {
+ beanDestroyed = true;
+ }
+
+ public static boolean isBeanDestroyed()
+ {
+ return beanDestroyed;
+ }
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,47 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+import java.lang.annotation.Annotation;
+
+import javax.context.Context;
+import javax.context.Contextual;
+import javax.context.CreationalContext;
+import javax.context.Dependent;
+import javax.context.RequestScoped;
+import javax.inject.AnnotationLiteral;
+import javax.inject.CreationException;
+import javax.inject.manager.Bean;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: PRD2
+ *
+ */
+@Artifact
+@BeansXml("beans.xml")
+public class SimpleBeanLifecycleTest extends AbstractJSR299Test
+{
+ private static final Annotation TAME_LITERAL = new AnnotationLiteral<Tame>()
+ {
+ };
+
+ @Test(groups = "beanConstruction")
+ @SpecAssertions({
+ @SpecAssertion(section = "3.2.6.3", id = "a"),
+ @SpecAssertion(section = "2.3.6", id = "d"),
+ @SpecAssertion(section = "6.4", id = "a")
+ })
+ public void testInjectionOfParametersIntoBeanConstructor()
+ {
+ assert getCurrentManager().resolveByType(FishPond.class).size() == 1;
+ FishPond fishPond = getCurrentManager().getInstanceByType(FishPond.class);
+ assert fishPond.goldfish != null;
+ }
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Synchronous.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Synchronous.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Synchronous.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+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 Synchronous
+{
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Tame.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Tame.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Tame.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Tame
+{
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Tuna.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Tuna.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Tuna.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+import javax.context.RequestScoped;
+
+@AnotherDeploymentType
+@RequestScoped
+class Tuna
+{
+
+ public String getName()
+ {
+ return "Ophir";
+ }
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/TunaFarm.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/TunaFarm.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/TunaFarm.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+import javax.inject.Current;
+import javax.inject.Production;
+
+@Production
+class TunaFarm
+{
+
+ @SuppressWarnings("unused")
+ @Current
+ public Tuna tuna;
+
+ public Tuna notInjectedTuna = new Tuna();
+
+
+}
Added: tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Van_Broken.java
===================================================================
--- tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Van_Broken.java (rev 0)
+++ tck/trunk/xml/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Van_Broken.java 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+class Van_Broken
+{
+
+ public Van_Broken() throws Exception
+ {
+ throw new FooException();
+ }
+
+}
Added: tck/trunk/xml/src/main/resources/META-INF/jboss-test-harness.properties
===================================================================
--- tck/trunk/xml/src/main/resources/META-INF/jboss-test-harness.properties (rev 0)
+++ tck/trunk/xml/src/main/resources/META-INF/jboss-test-harness.properties 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,2 @@
+org.jboss.testharness.api.ConfigurationBuilder=org.jboss.jsr299.tck.impl.JSR299PropertiesBasedConfigurationBuilder
+org.jboss.testharness.testPackage=org.jboss.jsr299.tck.tests
\ No newline at end of file
Added: tck/trunk/xml/src/main/resources/META-INF/tck-unit.properties
===================================================================
--- tck/trunk/xml/src/main/resources/META-INF/tck-unit.properties (rev 0)
+++ tck/trunk/xml/src/main/resources/META-INF/tck-unit.properties 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,5 @@
+fisheye_base_url=http\://fisheye.jboss.org/browse/Webbeans/tck/trunk/impl/src/main/java
+svn_base_url=http\://anonsvn.jboss.org/repos/webbeans/tck/trunk/impl/src/main/java/
+pass_threshold=75
+fail_threshold=50
+unimplemented_test_groups=stub,broken
\ No newline at end of file
Added: tck/trunk/xml/src/main/resources/README.TXT
===================================================================
--- tck/trunk/xml/src/main/resources/README.TXT (rev 0)
+++ tck/trunk/xml/src/main/resources/README.TXT 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,10 @@
+Notes on using Sigtest
+-----------------------------------------
+Sigtest home page: https://sigtest.dev.java.net/
+User Guide: http://java.sun.com/javame/sigtest/docs/sigtest2.1_usersguide.pdf
+
+Generating a signature file
+---------------------------
+To generate a signature file, use the following command:
+
+java -cp %JAVA_HOME%\jre\lib\rt.jar%;sigtestdev.jar com.sun.tdk.signaturetest.Setup -Package javax.annotation -Package javax.context -Package javax.decorator -Package javax.event -Package javax.inject -Package javax.interceptor -Package javax.webbeans -FileName webbeans.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar -static -Exclude java
\ No newline at end of file
Added: tck/trunk/xml/src/main/resources/images/4.1.aa.png
===================================================================
(Binary files differ)
Property changes on: tck/trunk/xml/src/main/resources/images/4.1.aa.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tck/trunk/xml/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/beans.xml
===================================================================
--- tck/trunk/xml/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/beans.xml (rev 0)
+++ tck/trunk/xml/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/beans.xml 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,11 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.simple.lifecycle">
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+ <test:Farm>
+ <test:location>Indiana</test:location>
+ </test:Farm>
+</Beans>
Added: tck/trunk/xml/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/xml/src/main/resources/tck-audit.xml (rev 0)
+++ tck/trunk/xml/src/main/resources/tck-audit.xml 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,1966 @@
+<specification
+ xmlns="http://jboss.com/products/webbeans/tck/audit"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.com/products/webbeans/tck/audit http://snapshots.jboss.org/maven2/org/hibernate/tck-utils-api/0.9-SNAPSHO..."
+ name="JSR-299: Java Contexts and Dependency Injection"
+ version="Revised Public Review Draft">
+
+ <section id="2" title="Bean definition">
+
+ </section>
+
+ <section id="2.2" title="Bean types">
+
+ </section>
+
+ <section id="2.3" title="Bindings">
+
+ </section>
+
+ <section id="2.3.1" title="Default binding type">
+
+ </section>
+
+ <section id="2.3.3" title="Declaring the bindings of a bean using annotations">
+
+ </section>
+
+ <section id="2.3.4" title="Declaring the bindings of a bean using XML">
+
+ <assertion id="a">
+ <text>If a bean is declared in beans.xml, bindings may be specified using the binding type names</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.3.5" title="Specifying bindings of an injected field">
+
+ <assertion id="c">
+ <text>For a bean defined in XML, the bindings of a field may be specified using XML</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When the bindings of a field are specified using XML, any binding annotations of the field are ignored</text>
+ </assertion>
+ </section>
+
+ <section id="2.3.6" title="Specifying bindings of a method or constructor parameter">
+
+ <assertion id="e">
+ <text>For a bean defined in XML, the bindings of a method parameter may be specified using XML</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>When the bindings of a parameter are specified using XML, any binding annotations of the parameter are ignored</text>
+ </assertion>
+ </section>
+
+ <section id="2.4" title="Scopes">
+
+ </section>
+
+ <section id="2.4.1" title="Built-in scope types">
+
+ </section>
+
+ <section id="2.4.3" title="Declaring the bean scope using annotations">
+
+ </section>
+
+ <section id="2.4.4" title="Declaring the bean scope using XML">
+ <assertion id="a">
+ <text>If the bean is declared in beans.xml, the scope may be specified using the scope annotation type name</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If more than one scope type is specified in XML, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A scope type may be specified using a stereotype declared in XML, as defined in Section 2.7.3, "Declaring the stereotypes for a bean using XML"</text>
+ </assertion>
+ </section>
+
+ <section id="2.4.5" title="Default scope">
+ <assertion id="a">
+ <text>When no scope is explicitly declared by annotating the bean class or producer method or field, or by using XML, the scope of a bean is defaulted</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.5.1" title="Built-in deployment types">
+
+ </section>
+
+ <section id="2.5.2" title="Defining new deployment types">
+
+ </section>
+
+ <section id="2.5.3" title="Declaring the deployment type of a bean using annotations">
+
+ </section>
+
+ <section id="2.5.4" title="Declaring the deployment type of a bean using XML">
+ <assertion id="a">
+ <text>When a bean is declared in beans.xml, the deployment type may be specified using a tag with the annotation type name</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If more than one deployment type is specified in XML, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A deployment type may be specified using a stereotype declared in XML, as defined in Section 2.7.3, "Declaring the stereotypes for a bean using XML".</text>
+ </assertion>
+ </section>
+
+ <section id="2.5.5" title="Default deployment type">
+
+ </section>
+
+ <section id="2.5.6" title="Enabled deployment types">
+
+ </section>
+
+ <section id="2.6" title="Bean names">
+
+ </section>
+
+ <section id="2.6.1" title="Declaring the bean name using annotations">
+
+ </section>
+
+ <section id="2.6.2" title="Declaring the bean name using XML">
+
+ <assertion id="a">
+ <text>If the bean is declared in beans.xml, the name may be specified using |<Named>|</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the |<Named>| element is empty, the default name is assumed</text>
+ </assertion>
+ </section>
+
+ <section id="2.6.3" title="Default bean names">
+
+ <assertion id="d">
+ <text>A default name must be assigned by the container when an empty |<Named>| element is specified by a bean defined in XML</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.6.4" title="Beans with no name">
+
+ <assertion id="a">
+ <text>If neither |<Named>| nor |@Named| is specified, by the bean or its stereotypes, a bean has no name</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.7" title="Stereotypes">
+
+ </section>
+
+ <section id="2.7.1" title="Defining new stereotypes">
+
+ </section>
+
+ <section id="2.7.1.1" title="Declaring the default scope and deployment type for a stereotype">
+
+ </section>
+
+ <section id="2.7.1.2" title="Specifying interceptor bindings for a stereotype">
+
+ </section>
+
+ <section id="2.7.1.3" title="Specifying name defaulting for a stereotype">
+
+ </section>
+
+ <section id="2.7.1.4" title="Restricting bean scopes and types using a stereotype">
+
+ </section>
+
+ <section id="2.7.1.5" title="Stereotypes with additional stereotypes">
+
+ </section>
+
+ <section id="2.7.2" title="Declaring the stereotypes for a bean using annotations">
+
+ </section>
+
+ <section id="2.7.3" title="Declaring the stereotypes for a bean using XML">
+ <assertion id="a">
+ <text>If the bean is declared in beans.xml, stereotypes may be declared using the stereotype annotation type name</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.4" title="Stereotype restrictions">
+ </section>
+
+ <section id="2.7.5" title="Built-in stereotypes">
+
+ </section>
+
+ <section id="3" title="Bean Implementation">
+
+ </section>
+
+ <section id="3.1" title="Restriction upon bean instantiation">
+
+ </section>
+
+ <section id="3.2" title="Simple beans">
+
+ <assertion id="e">
+ <text>Multiple simple beans may share the same bean class. This occurs when beans are defined using XML. Only one simple bean per bean class may be defined using annotations.</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.2.1" title="Which Java classes are beans?">
+
+ <assertion id="r">
+ <text>Additional simple beans with the same bean class may be defined using XML, by specifying the class in |beans.xml|.</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.2.2" title="Bean types of a simple bean">
+
+ </section>
+
+ <section id="3.2.3" title="Declaring a simple bean using annotations">
+
+ </section>
+
+ <section id="3.2.4" title="Declaring a simple bean using XML">
+ <assertion id="a">
+ <text>Simple beans may be declared in |beans.xml| using the bean class name</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A simple bean may even be declared at any injection point declared in XML, as defined in Section 9.9, "Inline bean declarations", in which case no bindings are specified.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the bean class of a simple bean defined in XML is a parameterized type , a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the bean class of a simple bean defined in XML is a non-static inner class, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If the bean class of a simple bean defined in XML is a static inner class, a |DefinitionException| is not thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the bean class of a simple bean defined in XML is an abstract class, and the simple bean is not a decorator, a |DefinitionException|
+is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the bean class of a simple bean defined in XML is annotated @Interceptor, then the bean must be explicitly declared as an interceptor in XML, as defined in Section A.3.5.2, "Declaring an interceptor using XML". If a simple bean defined in XML has a bean class annotated |@Interceptor| and is not declared as an interceptor in XML, a |DefinitionException| is
+thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the bean class of a simple bean defined in XML is annotated @Interceptor, then the bean must be explicitly declared as an interceptor in XML, as defined in Section A.3.5.2, "Declaring an interceptor using XML". If a simple bean defined in XML has a bean class annotated |@Interceptor| and is not declared as an interceptor in XML, a |DefinitionException| is
+thrown by the container at deployment time.</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.5" title="Simple beans with the @New binding">
+
+ </section>
+
+ <section id="3.2.6" title="Bean constructors">
+
+ </section>
+
+ <section id="3.2.6.1" title="Declaring a bean constructor using annotations">
+
+ </section>
+
+ <section id="3.2.6.2" title="Declaring a bean constructor using XML">
+
+ <assertion id="a">
+ <text>For a simple bean defined using XML, the bean constructor may be specified by listing the parameter types of the constructer, in order, as direct children of the element that declares the bean</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If a simple bean defined using XML does not explicitly declare constructor parameters in XML, the constructor that accepts no parameters is the bean constructor</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a simple bean declared in XML does not have a constructor with the parameter types declared in XML, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When a bean constructor is declared in XML, the container ignores binding annotations applied to Java constructor parameters</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.2.6.3" title="Bean constructor parameters">
+
+ </section>
+
+ <section id="3.2.7" title="Specializing a simple bean">
+ <assertion id="e">
+ <text>If a simple bean X defined in XML declares the |<Specializes>| element, then the bean class of X must be the bean class of another simple bean Y defined using annotations. Then X inherits all bindings of Y, and if Y has a name, X has the same name as Y</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.8" title="Default name for a simple bean">
+
+ </section>
+
+ <section id="3.3" title="Session beans">
+
+ <assertion id="e">
+ <text>Note that multiple session beans may share the same bean class. This occurs when beans are defined using XML</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.3.1" title="EJB remove methods of session beans">
+
+ </section>
+
+ <section id="3.3.2" title="Which EJBs are beans?">
+
+ </section>
+
+ <section id="3.3.3" title="Bean types of a session bean">
+
+ </section>
+
+ <section id="3.3.4" title="Declaring a session bean using annotations">
+
+ </section>
+
+ <section id="3.3.5" title="Declaring a session bean using XML">
+ <assertion id="a">
+ <text>Session beans may be declared in |beans.xml| using the bean class name (for EJBs defined using a component-defining annotation) or bean class and EJB name (for EJBs defined in |ejb-jar.xml|)</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The ejbName attribute declares the EJB name of an EJB defined in |ejb-jar.xml|</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If an entity bean class is declared in XML, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a message-driven bean class is declared in XML, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.6" title="Session beans with the @New binding">
+
+
+ </section>
+
+ <section id="3.3.7" title="Specializing a session bean">
+
+ <assertion id="e">
+ <text>If a session bean X defined in XML declares the |<Specializes>| element, then the bean class of X must be the bean class of another session bean Y defined using annotations. Then X inherits all bindings of Y, and if Y has a name, X has the same name as Y.</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.8" title="Default name for a session bean">
+
+ </section>
+
+ <section id="3.3.9" title="Session bean proxies">
+
+ </section>
+
+ <section id="3.4" title="Producer methods">
+
+ </section>
+
+ <section id="3.4.1" title="Bean types of a producer method">
+
+ </section>
+
+ <section id="3.4.2" title="Declaring a producer method using annotations">
+
+ </section>
+
+ <section id="3.4.3" title="Declaring a producer method using XML">
+
+ <assertion id="a">
+ <text>For a bean defined in XML, a producer method may be declared using the method name, the |<Produces>| element, the return type, and the parameter types of the method</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When a producer method is declared in XML, the container ignores binding annotations applied to the Java method or method parameters</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the bean class of a bean declared in XML does not have a method with the name and parameter types declared in XML, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.4" title="Producer method parameters">
+
+ </section>
+
+ <section id="3.4.5" title="Specializing a producer method">
+
+ </section>
+
+ <section id="3.4.6" title="Disposal methods">
+
+ </section>
+
+ <section id="3.4.7" title="Disposed parameter of a disposal method">
+
+ </section>
+
+ <section id="3.4.8" title="Declaring a disposal method using annotations">
+
+ </section>
+
+ <section id="3.4.9" title="Declaring a disposal method using XML">
+
+ <assertion id="a">
+ <text>For a bean defined in XML, a disposal method may be declared using the method name, the <Disposes> element, and the parameter types of the method</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When a disposal method is declared in XML, the container ignores binding annotations applied to the Java method parameter</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the bean class of a bean declared in XML does not have a method with the name and parameter types declared in XML, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.10" title="Disposal method parameters">
+
+ </section>
+
+ <section id="3.4.11" title="Disposal method resolution">
+
+ </section>
+
+ <section id="3.4.12" title="Default name for a producer method">
+
+ </section>
+
+ <section id="3.5" title="Producer fields">
+
+ </section>
+
+ <section id="3.5.1" title="Bean types of a producer field">
+
+ </section>
+
+ <section id="3.5.2" title="Declaring a producer field using annotations">
+
+ </section>
+
+ <section id="3.5.3" title="Declaring a producer field using XML">
+
+ <assertion id="a">
+ <text>For a bean defined in XML, a producer field may be declared using the field name, the |<Produces>| element, and the type</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When a producer field is declared in XML, the container ignores binding annotations applied to the Java field</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the bean class of a bean declared in XML does not have a field with the name and type declared in XML, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.5.4" title="Default name for a producer field">
+
+ </section>
+
+ <section id="3.6" title="Resources">
+
+ </section>
+
+ <section id="3.6.1" title="Declaring a resource using XML">
+
+ </section>
+
+ <section id="3.7" title="JMS resources">
+
+ </section>
+
+ <section id="3.7.1" title="Bean types of a JMS resource">
+
+ </section>
+
+ <section id="3.7.2" title="Declaring a JMS resource using XML">
+
+ </section>
+
+ <section id="3.8" title="Injected fields">
+
+ </section>
+
+ <section id="3.8.1" title="Declaring an injected field using annotations">
+
+ </section>
+
+ <section id="3.8.2" title="Declaring an injected field using XML">
+ <assertion id="a">
+ <text>For bean defined in XML, an injected field may be declared using the field name and a child element representing the type of the field</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When an injected field is declared in XML, the container ignores binding annotations applied to the Java field</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the type element does not declare any binding, the default binding |@Current| is assumed</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the bean class of a bean declared in XML does not have a field with the name and type declared in XML, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Check fields declared in XML and Java injected</text>
+ <note>Sanity check</note>
+ </assertion>
+ </section>
+
+ <section id="3.9" title="Initializer methods">
+
+ </section>
+
+ <section id="3.9.1" title="Declaring an initializer method using annotations">
+
+ </section>
+
+ <section id="3.9.2" title="Declaring an initializer method using XML">
+
+ <assertion id="a">
+ <text>For a bean defined in XML, an initializer method may be declared using the method name, the |<Initializer>| element and the parameter types of the method</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When an initializer method is declared in XML, the container ignores binding annotations applied to the Java method parameters</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the bean class of a bean declared in XML does not have a method with the name and parameter types declared in XML, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="3.9.3" title="Initializer method parameters">
+
+ </section>
+
+ <section id="3.10" title="Support for Common Annotations">
+
+ </section>
+
+ <section id="3.11" title="The Bean object for a bean">
+
+ </section>
+
+ <section id="4" title="Inheritance, specialization and realization">
+
+ </section>
+
+ <section id="4.1" title="Inheritance of type-level metadata">
+
+ <assertion id="ea">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare an annotation of type Z using XML.</text>
+ </assertion>
+
+ <assertion id="eb">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare an annotation of type Z using XML.</text>
+ </assertion>
+
+ <assertion id="ec">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X is annotated with an _interceptor binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare an annotation of type Z using XML.</text>
+ </assertion>
+
+ <assertion id="ed">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare an annotation of type Z using XML.</text>
+ </assertion>
+
+ <assertion id="ee">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare an annotation of type Z using XML.</text>
+ </assertion>
+
+ <assertion id="ef">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X is annotated with an _interceptor binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare an annotation of type Z using XML.</text>
+ </assertion>
+
+ <assertion id="fa">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X is annotated with a scope type Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare a scope type using XML.</text>
+ </assertion>
+
+ <assertion id="fb">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X is annotated with a scope type Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare a scope type using XML.</text>
+ </assertion>
+
+ <assertion id="ga">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X is annotated with a deployment type Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare a deployment type using XML.</text>
+ </assertion>
+
+ <assertion id="gb">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X is annotated with a deployment type Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not explicitly declare a deployment type using XML.</text>
+ </assertion>
+
+ <assertion id="ha">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, the scope types and deployment types explicitly declared by and inherited from the class X take precedence over default scope and deployment types declared by stereotypes.</text>
+ </assertion>
+
+ <assertion id="hb">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, the scope types and deployment types explicitly declared by and inherited from the class X take precedence over default scope and deployment types declared by stereotypes.</text>
+ </assertion>
+
+ </section>
+
+ <section id="4.2" title="Inheritance of member-level metadata">
+
+ <assertion id="ga">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares an injected field x then Y inherits x, unless Y explicitly declares x using XML.</text>
+ </assertion>
+
+ <assertion id="gb">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares an injected field x then Y inherits x, unless Y explicitly declares x using XML.</text>
+ </assertion>
+
+ <assertion id="ha">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares an _initializer method_ x() then Y inherits x(), unless Y explicitly declares x() using XML</text>
+ </assertion>
+
+ <assertion id="hb">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a _@PostConstruct method_ x() then Y inherits x(), unless Y explicitly declares x() using XML</text>
+ </assertion>
+
+ <assertion id="hc">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a _@PreDestroy method_ x() then Y inherits x(), unless Y explicitly declares x() using XML</text>
+ </assertion>
+
+ <assertion id="hd">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares an _initializer method_ x() then Y inherits x(), unless Y explicitly declares x() using XML</text>
+ </assertion>
+
+ <assertion id="he">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a _@PostConstruct method_ x() then Y inherits x(), unless Y explicitly declares x() using XML</text>
+ </assertion>
+
+ <assertion id="hf">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a _@PreDestroy method_ x() then Y inherits x(), unless Y explicitly declares x() using XML</text>
+ </assertion>
+
+ <assertion id="ia">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a non-static method x() annotated with an interceptor binding type Z then Y inherits the binding, unless Y explicitly declares x() using XML.</text>
+ </assertion>
+
+ <assertion id="ib">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a non-static method x() annotated with an interceptor binding type Z then Y inherits the binding, unless Y explicitly declares x() using XML.</text>
+ </assertion>
+
+ <assertion id="ja">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a non-static _producer method_ x() then Y does not inherit this method, unless Y is explicitly declared to _specialize_ X.</text>
+ </assertion>
+
+ <assertion id="jb">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a non-static _producer method_ x() then Y does not inherit this method, unless Y is explicitly declared to _realize_ X.</text>
+ </assertion>
+
+ <assertion id="jc">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a non-static _disposal method_ x() then Y does not inherit this method, unless Y is explicitly declared to _specialize_ X.</text>
+ </assertion>
+
+ <assertion id="jd">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a non-static _disposal method_ x() then Y does not inherit this method, unless Y is explicitly declared to _realize_ X.</text>
+ </assertion>
+
+ <assertion id="je">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a non-static _observer method_ x() then Y does not inherit this method, unless Y is explicitly declared to _specialize_ X.</text>
+ </assertion>
+
+ <assertion id="jf">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a non-static _observer method_ x() then Y does not inherit this method, unless Y is explicitly declared to _realize_ X.</text>
+ </assertion>
+
+ <assertion id="jg">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a non-static _producer method_ x() then Y does not inherit this method, unless Y is explicitly declared to _specialize_ X.</text>
+ </assertion>
+
+ <assertion id="jh">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a non-static _producer method_ x() then Y does not inherit this method, unless Y is explicitly declared to _realize_ X.</text>
+ </assertion>
+
+ <assertion id="ji">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a non-static _disposal method_ x() then Y does not inherit this method, unless Y is explicitly declared to _specialize_ X.</text>
+ </assertion>
+
+ <assertion id="jj">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a non-static _disposal method_ x() then Y does not inherit this method, unless Y is explicitly declared to _realize_ X.</text>
+ </assertion>
+
+ <assertion id="jk">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a non-static _observer method_ x() then Y does not inherit this method, unless Y is explicitly declared to _specialize_ X.</text>
+ </assertion>
+
+ <assertion id="jl">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a non-static _observer method_ x() then Y does not inherit this method, unless Y is explicitly declared to _realize_ X.</text>
+ </assertion>
+
+ <assertion id="ka">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a non-static producer field x then Y does not inherit this field, unless Y is explicitly declared to _specialize_ X.</text>
+ </assertion>
+
+ <assertion id="kb">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if X declares a non-static producer field x then Y does not inherit this field, unless Y is explicitly declared to _realize_ X.</text>
+ </assertion>
+
+ <assertion id="kc">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a non-static producer field x then Y does not inherit this field, unless Y is explicitly declared to _specialize_ X.</text>
+ </assertion>
+
+ <assertion id="kd">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, if X declares a non-static producer field x then Y does not inherit this field, unless Y is explicitly declared to _realize_ X.</text>
+ </assertion>
+
+ <assertion id="la">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using XML, if Y is a decorator and X declares a delegate attribute x then Y inherits x, unless Y explicitly declares a delegate attribute using XML.</text>
+ </assertion>
+
+ <assertion id="lb">
+ <text>For class X which is the bean class of a _session_ bean Y declared using XML, if Y is a decorator and X declares a delegate attribute x then Y inherits x, unless Y explicitly declares a delegate attribute using XML.</text>
+ </assertion>
+ </section>
+
+ <section id="4.3" title="Specialization">
+
+ </section>
+
+ <section id="4.3.1" title="Using specialization">
+
+ <assertion id="b">
+ <text>A bean declared using XML may declare that it specializes a lower-priority bean using the |<Specializes>| element</text>
+ </assertion>
+
+ </section>
+
+ <section id="4.3.2" title="Direct and indirect specialization">
+ <assertion id="a" testable="false">
+ <text>The |(a)javax.inject.Specializes| annotation or |<Specializes>| XML element is used to indicate that one bean directly specializes another bean</text>
+ <note>A statement of intent</note>
+ </assertion>
+
+ </section>
+
+ <section id="4.3.3" title="Inconsistent specialization">
+
+ <assertion id="b" testable="false">
+ <text>Any bean that extends a generic class may declare that the generic class is the bean class, in the case of a bean declared using XML and then explicitly declare that it realizes the generic class.</text>
+ <note>A statement of intent</note>
+ </assertion>
+
+ </section>
+
+ <section id="4.4.1" title="Using realization">
+
+ <assertion id="b" testable="false">
+ <text>A bean declared using XML may declare that it realizes a generic class using the |<Realizes>| element.</text>
+ <note>A statement of intent</note>
+ </assertion>
+
+ </section>
+
+ <section id="5" title="Lookup, dependency injection and EL resolution">
+
+ </section>
+
+ <section id="5.1" title="Unsatisfied and ambiguous dependencies">
+
+ </section>
+
+ <section id="5.2" title="Primitive types and null values">
+
+ </section>
+
+ <section id="5.3" title="Injected reference validity">
+
+ </section>
+
+ <section id="5.4" title="Client proxies">
+
+ </section>
+
+ <section id="5.4.1" title="Unproxyable bean types">
+
+ </section>
+
+ <section id="5.5" title="The default binding at injection points">
+
+ </section>
+
+ <section id="5.6" title="Injection point metadata">
+
+ <assertion id="bd">
+ <text>An injection point declared in XML has it's bindings determined according to Section 9.10, "Specifying bean types and bindings"</text>
+ </assertion>
+
+ </section>
+
+ <section id="5.6.1" title="Injecting InjectionPoint">
+
+ </section>
+
+ <section id="5.7" title="The Manager object">
+
+ </section>
+
+ <section id="5.7.1" title="Resolving dependencies">
+
+ </section>
+
+ <section id="5.8" title="Dynamic lookup">
+
+ </section>
+
+ <section id="5.9" title="Typesafe resolution algorithm">
+
+ </section>
+
+ <section id="5.9.1" title="Binding annotations with members">
+
+ </section>
+
+ <section id="5.9.2" title="Multiple bindings">
+
+ </section>
+
+ <section id="5.10" title="EL name resolution">
+
+ </section>
+
+ <section id="5.11" title="Name resolution algorithm">
+
+ </section>
+
+ <section id="5.12" title="Injection into non-contextual objects">
+
+ </section>
+
+ <section id="5.12.1" title="Non-contextual instances of session beans">
+
+ </section>
+
+ <section id="5.12.2" title="Message-driven beans">
+
+ </section>
+
+ <section id="5.12.3" title="Servlets">
+
+ </section>
+
+ <section id="6" title="Bean lifecycle">
+
+ </section>
+
+ <section id="6.1" title="The Contextual interface">
+
+ </section>
+
+ <section id="6.2" title="Creation">
+
+
+ <assertion id="e">
+ <text>The |Contextual.create()| method sets any initial field values defined in XML</text>
+ </assertion>
+ </section>
+
+ <section id="6.4" title="Lifecycle of simple beans">
+
+ <assertion id="f">
+ <text>When the |create()| method of the |Bean| object that represents a simple bean is called, after injected fields are initialized the container initializes the values of any fields with initial values specified in XML, as defined in Section 9.5.5, "Field initial value declarations".</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>When the |create()| method of the |Bean| object that represents a simple bean is called, after the values of fields with initial values specified in XML are initialized the container calls all initializer methods. For each initializer method parameter, the container passes the object
+returned by |Manager.getInstanceToInject()|</text>
+ </assertion>
+
+ </section>
+
+ <section id="6.5" title="Lifecycle of stateful session beans">
+
+ </section>
+
+ <section id="6.6" title="Lifecycle of stateless session and singleton beans">
+
+ </section>
+
+ <section id="6.7" title="Lifecycle of producer methods">
+
+ </section>
+
+ <section id="6.8" title="Lifecycle of producer fields">
+
+ </section>
+
+ <section id="6.9" title="Lifecycle of resources">
+
+ </section>
+
+ <section id="6.10" title="Lifecycle of JMS resources">
+
+ </section>
+
+ <section id="6.11" title="Lifecycle of EJBs">
+
+ <assertion id="b">
+ <text>When the EJB container creates a new instance of an EJB, after Java EE injection has been performed and before the |@PostConstruct| callback occurs the container must initialize the values of any fields with initial values specified in XML, as defined in Section 9.5.5, "Field initial value declarations"</text>
+ </assertion>
+
+ </section>
+
+ <section id="6.12" title="Lifecycle of servlets">
+
+ </section>
+
+ <section id="7" title="Events">
+
+ </section>
+
+ <section id="7.1" title="Event types and binding types">
+
+ </section>
+
+ <section id="7.2" title="Firing an event via the Manager interface">
+
+ </section>
+
+ <section id="7.3" title="Observing events via the Observer interface">
+
+ </section>
+
+ <section id="7.4" title="Observer notification">
+
+ </section>
+
+ <section id="7.5" title="Observer methods">
+
+ </section>
+
+ <section id="7.5.1" title="Event parameter of an observer method">
+
+ </section>
+
+ <section id="7.5.2" title="Declaring an observer method using annotations">
+
+ </section>
+
+ <section id="7.5.3" title="Declaring an observer method using XML">
+ <assertion id="a">
+ <text>For a beans defined in XML, an observer method may be declared using the method name, the |<Observes>| element, and the parameter types of the method</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When an observer method is declared in XML, the container ignores binding annotations applied to the Java method parameters</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the bean class of a bean declared in XML does not have a method with parameters that match those declared in XML, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="7.5.4" title="Observer method parameters">
+
+ </section>
+
+ <section id="7.5.5" title="Conditional observer methods">
+
+ <assertion id="c">
+ <text>Conditional observer methods may be declared in XML by adding a child |<IfExists>| element to the |<Observes>| element</text>
+ </assertion>
+ </section>
+
+ <section id="7.5.6" title="Transactional observer methods">
+
+ <assertion id="f">
+ <text>A transactional observer method may be declared by ~annotating the event parameter of the observer method~ or in XML by a child element of the <Observes> element</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A transactional observer method may be declared by annotating the event parameter of the observer method or ~in XML by a child element of the |<Observes>| element~</text>
+ </assertion>
+
+ </section>
+
+ <section id="7.5.7" title="Asynchronous observer methods">
+ <assertion id="a">
+ <text>An asynchronous observer method may be declared by ~annotating the event parameter of the observer method |(a)javax.event.Asynchronously|~ or in XML by a child |<Asynchronously>| element of the |<Observes>| element</text>
+ </assertion>
+
+ </section>
+
+ <section id="7.5.8" title="Observer object for an observer method">
+
+ </section>
+
+ <section id="7.5.9" title="Observer invocation context">
+
+ </section>
+
+ <section id="7.6" title="The Event interface">
+
+ </section>
+
+ <section id="7.7" title="Observer resolution">
+
+ </section>
+
+ <section id="7.7.1" title="Event binding types with members">
+
+ </section>
+
+ <section id="7.7.2" title="Multiple event bindings">
+
+ </section>
+
+ <section id="7.8" title="JMS event mappings">
+
+ </section>
+
+ <section id="8" title="Scopes and contexts">
+
+ </section>
+
+ <section id="8.1" title="The Context interface">
+
+ </section>
+
+ <section id="8.2" title="Normal scopes and pseudo-scopes">
+
+ </section>
+
+ <section id="8.3" title="Dependent pseudo-scope">
+
+ </section>
+
+ <section id="8.3.1" title="Dependent objects">
+
+ </section>
+
+ <section id="8.3.2" title="Dependent object destruction">
+
+
+ </section>
+
+ <section id="8.4" title="Passivating scopes and serialization">
+
+ </section>
+
+ <section id="8.5" title="Context management for built-in scopes">
+
+ </section>
+
+ <section id="8.5.1" title="Request context lifecycle">
+
+ </section>
+
+ <section id="8.5.2" title="Session context lifecycle">
+
+ </section>
+
+ <section id="8.5.3" title="Application context lifecycle">
+
+ </section>
+
+ <section id="8.5.4" title="Conversation context lifecycle">
+
+
+ </section>
+
+ <section id="8.6" title="Context management for custom scopes">
+
+ </section>
+
+ <section id="9" title="XML based metadata">
+ <assertion id="a">
+ <text>XML-based bean declarations define additional beans they do not redefine or disable any bean that was declared via annotations</text>
+ </assertion>
+
+ </section>
+
+ <section id="9.1" title="XML namespace for a Java package">
+
+ </section>
+
+ <section id="9.2" title="XML namespace aggregating multiple packages">
+
+ </section>
+
+ <section id="9.2.1" title="The Java EE namespace">
+
+ </section>
+
+ <section id="9.3" title="Standard schema location for a namespace">
+
+ </section>
+
+ <section id="9.4" title="Stereotype, binding type and interceptor binding type declarations">
+
+ </section>
+
+ <section id="9.4.1" title="Child elements of a stereotype declaration">
+
+ </section>
+
+ <section id="9.4.2" title="Child elements of an interceptor binding type declaration">
+
+ </section>
+
+ <section id="9.5" title="Bean declarations">
+
+ <assertion id="a">
+ <text>An XML element that appears as a direct child of the root |<Beans>| element is interpreted as a bean declaration if it is not a |<Deploy>|, |<Interceptors>| or |<Decorators>| element in the Java EE namespace, and does not have a direct child |<BindingType>|,|<InterceptorBindingType>| or |<Stereotype>| element in the Java EE namespace</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The name of the XML element is interpreted as a Java type. The container inspects the Java type and other metadata to determine what kind of bean is being declared. If no such Java type exists in the classpath, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the type is |javax.jms.Queue| or |javax.jms.Topic|, it declares a JMS resource, as defined in Section 3.7.2, "Declaring a JMS resource using XML"</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the element has a child |<Resource>|, |<PersistenceContext>|, |<PersistenceUnit>|, |<EJB>| or |<WebServiceRef>| element, it declares a resource, as defined in Section 3.6.1, "Declaring a resource using XML"</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the type is an EJB bean class, a session bean was declared, as defined in Section 3.3.5, "Declaring a session bean using XML"</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the type is a concrete class, is not an EJB bean class, and is not a parameterized type, a simple bean was declared, as defined in Section 3.2.4, "Declaring a simple bean using XML"</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Otherwise, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>Inline bean declarations may occur at injection points, as defined in Section 9.9, "Inline bean declarations". Inline bean declarations always declare simple beans</text>
+ </assertion>
+
+ </section>
+
+ <section id="9.5.1" title="Child elements of a bean declaration">
+ <assertion id="a">
+ <text>If the child element can be interpreted as a Java annotation type, the container interprets the child element as declaring type-level metadata</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the child element can be interpreted as a Java class or interface, the container interprets the child element as declaring a parameter of the bean constructor</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the child element namespace is the same as the namespace of the parent, the container interprets the element as declaring a method or field of the bean</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the name of the child element matches the name of both a method and a field of the bean class, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the name of the child element matches the name of a method of the bean class, is it interpreted to represent that method</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the name of the child element matches the name of a field of the bean class, is it interpreted to represent that field</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Otherwise, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="9.5.2" title="Type-level metadata for a bean">
+ <assertion id="a">
+ <text>Type-level metadata is specified via direct child elements of the bean declaration that represent Java annotation types</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The child element is interpreted as a Java annotation type</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the annotation type is a deployment type, the deployment type of the bean was declared, as defined in Section 2.5.4, "Declaring the deployment type of a bean using XML"</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the annotation type is a scope type, the scope of the bean was declared, as defined in Section 2.4.4, "Declaring the bean scope using XML"</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the annotation type is a binding type, a binding of the bean was declared, as defined in Section 2.3.4, "Declaring the bindings of a bean using XML"</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the annotation type is an interceptor binding type, an interceptor binding of the bean was declared, as defined in Section A.3.6.2, "Binding an interceptor using XML"</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the annotation type is a stereotype, a stereotype of the bean was declared, as defined in Section 2.7.3, "Declaring the stereotypes for a bean using XML"</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If the annotation type is |javax.annotation.Name|, the name of the bean was declared, as defined in Section 2.6.2, "Declaring the bean name using XML"</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If the annotation type is |javax.inject.Specializes|, the bean was declared to directly specialize the bean with the same bean class that was defined using annotations, as specified in Section 3.2.7, "Specializing a simple bean" and Section 3.3.7, "Specializing a session bean"</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If the annotation type is |javax.inject.Realizes|, the bean was declared to realize the bean with the same bean class that was defined using annotations</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If the annotation type is |javax.interceptor.Interceptor|, or |javax.decorator.Decorator| the bean is an interceptor or decorator, as defined in Section 9.7, "Interceptor and decorator declarations"</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>If the annotation type is |javax.annotation.Resource|, |javax.ejb.EJB|, |javax.xml.ws.WebServiceRef|, |javax.persistence.PersistenceContext| or |javax.persistence.PersistenceUnit|, the metadata for a resource or JMS resource was declared, as defined in Section 3.6.1, "Declaring a resource using XML" and Section 3.7.2, "Declaring a JMS resource using XML"</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>Otherwise, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="9.5.3" title="Bean constructor declarations">
+ <assertion id="a">
+ <text>The bean constructor for a simple bean is declared by the list of direct child elements of the bean declaration that represent Java class or interface types</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The container interprets these elements as declaring parameters of the constructor</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Each constructor parameter declaration is interpreted as an injection point declaration, as specified in Section 9.8, "Injection point declarations"</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the simple bean class has exactly one constructor such that the constructor has the same number of parameters as the bean declaration has constructor parameter declarations, and the Java type represented by each constructor parameter declaration is assignable to the Java type of the corresponding constructor parameter then the element is interpreted to represent that constructor, and that constructor is the bean constructor</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If more than one constructor exists which satisfies these conditions, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If no constructor of the simple bean class satisfies these conditions, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>For any constructor parameter, the bean type declared in XML may be a subtype of the Java parameter type. In this case, the container will use the bean type declared in XML when resolving the dependency</text>
+ </assertion>
+ </section>
+
+ <section id="9.5.4" title="Fields of a bean">
+ <assertion id="a">
+ <text>A field of a bean is declared by a direct child element of the bean declaration. The name of the field is the same as the name of the element</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the bean class has exactly one field with the same name as the child element, then the child element is interpreted to represent that field</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the bean class does not have exactly one field with the specified name, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If more than one child element of a bean declaration represents the same field of the bean class, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A field declaration may contain child elements</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If a field declaration has more than one direct child element, and at least
+one of these elements is something other than a |<value>| element in the Java EE namespace, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>An element that represents a field may declare an injected field, a producer field or a field with an initial value</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If the element contains a child |<Produces>| element in the Java EE namespace, a producer field was declared, as defined in Section 3.5.3, "Declaring a producer field using XML"</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If the element contains a child |<value>| element in the Java EE namespace, a field with an initial value of type Set or List was declared, as defined in Section 9.5.5, "Field initial value declarations"</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If the element has exactly one child element, an injected field was declared, as defined in Section 3.8.2, "Declaring an injected field using XML"</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If the element has a non-empty body, and no child elements, a field with an initial value was declared, as defined in Section 9.5.5, "Field initial value declarations"</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>Otherwise, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>If a field declaration represents an injected field, the child element is interpreted as an injection point declaration, as specified in Section 9.8, "Injection point declarations"</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>If the declared type is not assignable to the Java type of the field, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>The bean type declared in XML may be a subtype of the Java field type. In this case, the container will use the bean type declared in XML when resolving the dependency</text>
+ </assertion>
+
+ </section>
+
+ <section id="9.5.5" title="Field initial value declarations">
+ <assertion id="a">
+ <text>The initial value of a field of a simple bean or session bean with any one of the following types may be specified in XML: any primitive type, or |java.lang| wrapper type, any enumerated type, |java.lang.String|, |java.util.Date|, |java.sql.Date|, |java.sql.Time| or |java.sql.Timestamp|, |java.util.Calendar|, |java.math.BigDecimal| or |java.math.BigInteger|, |java.lang.Class|, |java.util.List<java.lang.String>| or |java.util.Set<java.lang.String>|, |java.util.List<java.lang.Class>| or |java.util.Set<java.lang.Class>|, |java.util.List<X>| or |java.util.Set<X>| where X is an enumerated type</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The initial value of the field is specified in the body of an XML element representing the field</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The initial value of a field of primitive type or |java.lang| wrapper type is specified using the Java literal syntax for that type</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The initial value of a field of type |java.lang.String| is specified using the string value</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The initial value of a field of enumerated type is specified using the unqualified name of the enumeration value</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The initial value of a field of type |java.util.Date|, |java.sql.Date|, |java.sql.Time|, |java.sql.Timestamp| or |java.util.Calendar| is specified using a format that can be parsed by calling
+|java.text.DateFormat.getDateTimeInstance().parse()|</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The initial value of a field of type |java.math.BigDecimal| or |java.math.BigInteger| is specified using a format that can be parsed by the constructor that accepts a string</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The initial value of a field of type |java.lang.Class| is specified using the fully qualified Java class name</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The initial value of a field of type |java.util.List| or |java.util.Set| is specified by a list of |<value>| elements. The body of the value element is specified using the string value, fully qualified Java class name or unqualified name of the enumeration value</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If a field with an initial value specified in XML is not of one of the listed types, or if the initial value is not specified in the correct format for the type of the field, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If an element representing a field specifies both an initial value and a type declaration, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="9.5.6" title="Methods of a bean">
+ <assertion id="a">
+ <text>A method of a bean is declared by a direct child element of the bean declaration. The name of the declared method is the same as the name of the child element</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A method declaration may have any number of direct child elements</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container inspects the direct child elements of the method declaration. For each child element, the element is interpreted as a Java type. If no such Java type exists in the classpath, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the type is |javax.inject.Disposes|, the container searches for a direct child element of the child element and interprets that element as declaring a disposed parameter of the disposal method</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the type is |javax.event.Observes|, the container searches for a direct child element of the child element that is not an |<IfExists>|, |<Asynchronously>|, |<AfterTransactionCompletion>|, |<AfterTransactionSuccess>|, |<AfterTransactionFailure>| or |<BeforeTransactionCompletion>| element in the Java EE namespace, and interprets that element as declaring an event parameter of the observer method</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the type is some other Java annotation type, the container interprets the child element as declaring method-level metadata</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the type is a Java class or interface, the container interprets the child element as declaring a parameter of the method</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>Otherwise, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If a method declaration has more than one direct child element which is an |<Initializer>|, |<Produces>|, |<Disposes>| or |<Observes>| element in the Java EE namespace, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If a |<Disposes>| element does not contain exactly one direct child element, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If an |<Observes>| element does not contain exactly one direct child element that is not an |<IfExists>|, |<Asynchronously>|, |<AfterTransactionCompletion>|, |<AfterTransactionSuccess>|, |<AfterTransactionFailure>| or |<BeforeTransactionCompletion>| element in the Java EE namespace, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>Each method parameter declaration and disposed parameter declaration is interpreted as an injection point declaration, as specified in Section 9.8, "Injection point declarations". An event parameter declaration is interpreted as a type declaration, as defined in Section 9.10, "Specifying bean types and bindings"</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>If the bean class has exactly one method such that the method name is the same as the name of the element that declares the method, the method has the same number of parameters as the element that declares the method has child elements, and the Java type represented by each method parameter declaration is assignable to the Java type of the corresponding method parameter, then the element is interpreted to represent that method</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>If more than one method exists which satisfies these conditions, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>If no method of the bean class satisfies these conditions, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>For any method parameter, the bean type declared in XML may be a subtype of the Java parameter type. In this case, the container will use the bean type declared in XML when resolving the dependency</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>If more than one child element of a bean declaration represents the same method of the bean class, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>An element that represents a method may declare an initializer method, an observer method, a producer method or a disposal method. Alternatively, or additionally, it may declare method-level interceptor binding</text>
+ </assertion>
+
+ <assertion id="s">
+ <text>If the element contains a child |<Initializes>| element in the Java EE namespace, an initializer method was declared, as defined in Section 3.9.2, "Declaring an initializer method using XML"</text>
+ </assertion>
+
+ <assertion id="t">
+ <text>If the element contains a child |<Produces>| element in the Java EE namespace, a producer method was declared, as defined in Section 3.4.3, "Declaring a producer method using XML"</text>
+ </assertion>
+
+ <assertion id="u">
+ <text>If the element contains a child |<Disposes>| element in the Java EE namespace, a disposal method was declared, as defined in Section 3.4.9, "Declaring a disposal method using XML"</text>
+ </assertion>
+
+ <assertion id="v">
+ <text>If the element contains a child |<Observes>| element in the Java EE namespace, an observer method was declared, as defined in Section 7.5.3, "Declaring an observer method using XML"</text>
+ </assertion>
+
+ <assertion id="w">
+ <text>If the element contains a child element which can be interpreted as an interceptor binding type, method-level interceptor binding was declared, as defined in Section A.3.6.2, "Binding an interceptor using XML"</text>
+ </assertion>
+ </section>
+
+ <section id="9.6" title="Producer method and field declarations">
+ <assertion id="a">
+ <text>A producer method or field declaration is formed by adding a direct child |<Produces>| element to an element that represents the method or field, as defined in Section 3.4.3, "Declaring a producer method using XML" and Section 3.5.3, "Declaring a producer field using XML"</text>
+ </assertion>
+
+ </section>
+
+ <section id="9.6.1" title="Child elements of a producer field declaration">
+ <assertion id="a">
+ <text>The container inspects the direct child elements of a producer field declaration</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If there is more than one direct child element, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Otherwise, the direct child element is a |<Produces>| element in the Java EE namespace, and declares the return type, bindings and member-level metadata of the producer field</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container inspects the direct child elements of the |<Produces>| element. For each child element, the element is interpreted as a Java type. If no such Java type exists in the classpath, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the type is a Java class or interface type, the type of the producer field was declared</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the type is a Java annotation type, it declares member-level metadata of the producer field</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Otherwise, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If more than one child element represents a Java class or interface type, or if no child element represents a Java class or interface type, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="9.6.2" title="Child elements of a producer method declaration">
+ <assertion id="a">
+ <text>If a child element of a producer method declaration is the |<Produces>| element in the Java EE namespace, it declares the return type, bindings and member-level metadata of the producer method</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the child element of a producer method declaration can be interpreted as an interceptor binding type, it declares a method-level interceptor binding</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container interprets the child element of a producer method declaration as declaring a parameter of the producer method, if it is not a |<Produces>| element and cannot be interpreted as an interceptor binding type</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If there is more than one child |<Produces>| element of a producer method declaration in the Java EE namespace, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The container inspects the direct child elements of the |<Produces>| element. For each child element, the element is interpreted as a Java type. If no such Java type exists in the classpath, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the type of the direct child element of a |<Produces>| element is a Java class or interface type, the return type of the producer method was declared</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the type of the direct child element of a |<Produces>| element is a Java annotation type, it declares member-level metadata of the producer method</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If the type of the direct child element of a |<Produces>| element is not a Java class or Java annotation, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If more than one child element represents a Java class or interface type, or if no child element represents a Java class or interface type, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="9.6.3" title="Return type and bindings of a producer method or field">
+ <assertion id="a">
+ <text>Every XML producer method or field declaration has a direct child |<Produces>| element</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>This |<Produces>| element must, in turn, have a direct child element which declares the return type of the producer method or the type of the producer field and which is interpreted by the container as a type declaration, as defined in Section 9.10, "Specifying bean types and bindings"</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The type declaration that declares the return type of the producer method or the type of the producer field specifies the return type and bindings of the producer method bean, or the type and bindings of the producer field bean.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The type is used to calculate the set of bean types</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The type declared in XML must be a supertype or subtype of the Java method or field type. If the declared type is not a supertype or subtype of the Java method or field type, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ </section>
+
+ <section id="9.6.4" title="Member-level metadata for a producer method or field">
+ <assertion id="a">
+ <text>Member-level metadata for a producer method or field declaration is specified via direct child elements of the |<Produces>| element that represent Java annotation types.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Each child element is interpreted as a Java annotation type. If the type is not a Java annotation type, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the annotation type is a deployment type, the deployment type of the producer method or field was declared, as defined in Section 2.5.4, "Declaring the deployment type of a bean using XML".</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the annotation type is a scope type, the scope of the producer method or field was declared, as defined in Section 2.4.4, "Declaring the bean scope using XML".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the annotation type is a stereotype, a stereotype of the producer method or field was declared, as defined in Section 2.7.3, "Declaring the stereotypes for a bean using XML".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the annotation type is |javax.annotation.Name|, the name of the producer method or field was declared, as defined in Section 2.6.2, "Declaring the bean name using XML".</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the annotation type is not a deployment type, or a scope type, or a stereotype, or a |javax.annotation.Name|, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="9.7" title="Interceptor and decorator declarations">
+ <assertion id="a">
+ <text>A simple bean declaration is interpreted as an interceptor declaration if it contains a direct child |<Interceptor>| element in the Java EE namespace</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A simple bean declaration is interpreted as a decorator declaration if it contains a direct child |<Decorator>| element in the Java EE namespace</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a bean declaration that is not a simple bean declaration contains a child |<Interceptor>| element, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a bean declaration that is not a simple bean declaration contains a child |<Decorator>| element, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an inline bean declaration contains a child |<Interceptor>| element, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If an inline bean declaration contains a child |<Decorator>| element, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If a simple bean declaration contains more than one direct child |<Interceptor>| element in the Java EE namespace, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If a simple bean declaration contains more than one direct child |<Decorator>| element in the Java EE namespace, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+ </section>
+
+ <section id="9.7.1" title="Decorator delegate attribute">
+ <assertion id="a">
+ <text>Decorator declarations may declare the delegate attribute</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A delegate declaration is a direct child element of the decorator declaration.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The name of the delegate attribute is the same as the name of the element.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a direct child element of a decorator declaration exists in the same namespace as its parent, and has direct child |<Decorates>| element in the Java EE namespace then it is interpreted as a delegate declaration.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the bean class has a field with the same name as the child element, then the child element is interpreted to represent that field.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the bean class does not have have a field with the specified name, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If a delegate declaration has more than one direct child element, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The child element of the delegate declaration is a |<Decorates>| element in the Java EE namespace. If the |<Decorates>| element does not, in turn, have exactly one direct child element, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The direct child element of the |<Decorates>| element is interpreted as a type declaration as specified by Section 9.10, "Specifying bean types and bindings". If the declared bean type is not assignable to the type of the Java field, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The bean type declared in XML may be a subtype of the Java field type. In this case, the container will use the bean type declared in XML when resolving the dependency.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If simple bean declaration that is not a decorator declaration contains a direct child element that in turn contains a direct child |<Decorates>| element, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ </section>
+
+ <section id="9.8" title="Injection point declarations">
+ <assertion id="a">
+ <text>An injection point declaration is either a type declaration, as defined in Section 9.10, "Specifying bean types and bindings", or an inline bean declaration, as defined in Section 9.9, "Inline bean declarations".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When the container encounters an injection point declaration, it interprets the element as a Java class or interface. If no such Java type exists in the classpath, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the Java type is a parameterized type, the injection point declaration is a type declaration, and the declared type of the injection point is the bean type of the type declaration, including actual type parameters.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Otherwise, the container inspects the direct child elements. If any direct child element can be interpreted as a binding type, the injection point declaration is a type declaration, and the declared type of the injection point is the bean type of the type declaration.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Otherwise, if any direct child elements exist, the injection point declaration is an inline bean declaration, and the declared type of the injection point is the bean class of the bean.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Otherwise, the injection point declaration is a type declaration, and the declared type of the injection point is the bean type of the type declaration.</text>
+ </assertion>
+ </section>
+
+ <section id="9.9" title="Inline bean declarations">
+ <assertion id="a">
+ <text>An inline bean declaration is a simple bean declaration, as defined in Section 9.5, "Bean declarations" that occurs as an injection point declaration, instead of as a direct child of the <Beans> element.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The element is interpreted as a Java class. This Java class is the bean class of the simple bean</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Inline bean declarations may not explicitly specify a binding type. If an inline bean declaration explicitly specifies a binding type, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>For every inline injection point, the container generates a unique value for an implementation-specific binding type. This generated value is the binding of the injection point, and the only binding of the simple bean. The bean type of the injection point is the declared bean class of the simple bean.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>An inline bean declaration results in a simple bean that is bound only to the injection point at which it was declared.</text>
+ </assertion>
+ </section>
+
+ <section id="9.10" title="Specifying bean types and bindings">
+ <assertion id="a">
+ <text>Every injection point defined in XML must explicitly specify a bean type and combination of bindings.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Every event parameter defined in XML must explicitly specify a bean type and combination of bindings.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Every delegate attribute defined in XML must explicitly specify a bean type and combination of bindings.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>XML-based producer method declarations must explicitly specify the return type (which is used to calculate the set of bean types) and bindings</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A type declaration is an element that represents a Java class or interface, or |<Array>|</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A type declaration is (if the type is a parameterized type), a set of child elements that represent Java classes and/or interfaces, and are interpreted as the actual type parameters, or, if the type is an array type, a single child element that represents the array element type</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A type declaration is optionally, a set of child elements that represent Java annotation types, and are interpreted as bindings</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>When the container encounters a type declaration it interprets the element as a Java type</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If the element is an |<Array>| element in the Java EE namespace, an array type was declared.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>Otherwise, the element is interpreted as a Java class or interface. If no such Java type exists in the classpath, a |DefinitionException| is thrown by the container at deployment time. If the Java type is not a class or interface type, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>The container inspects every direct child element of the type declaration. Each child element is interpreted as a Java type. If no such Java type exists in the classpath, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>If the type is a Java annotation type, a binding was declared.</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>If the type is a Java class or interface type, an actual type parameter or array element type was declared</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>If the type is not a Java annotation type or a Java class or interface type, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>If multiple array element types are declared, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>If the number of declared actual type parameters is not the same as the number of parameters of the Java type, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>If a type parameter of the Java type is bounded, and the corresponding declared actual type parameter does not satisfy the upper or lower bound, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>If a binding declaration declares a Java annotation type that is not a binding type, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="s">
+ <text>If no binding is declared, the default binding |@Current| is assumed</text>
+ </assertion>
+
+ <assertion id="t">
+ <text>If the same binding type occurs more than once, a |DuplicateBindingTypeException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="u">
+ <text>For fields, type declarations are specified as direct child elements of the field declaration</text>
+ </assertion>
+
+ <assertion id="v">
+ <text>For methods, the method parameter declarations are type declarations</text>
+ </assertion>
+
+ <assertion id="w">
+ <text>For producer methods, the return type must be specified</text>
+ </assertion>
+
+ <assertion id="x">
+ <text>For constructors, the constructor parameter declarations are type declarations</text>
+ </assertion>
+ </section>
+
+ <section id="9.11" title="Annotation members">
+ <assertion id="a">
+ <text>Any binding or interceptor binding declaration must define the value of any annotation member without a default value, and may additionally define the value of any annotation member with a default value.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Annotation member values are defined by attributes of the XML element which represents the Java annotation.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>All attributes of any XML element which represents a Java annotation are interpreted as members of the annotation</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The name of the attribute is interpreted as the name of the corresponding annotation member.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The value of the attribute is interpreted as the value of the annotation member.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If there is no annotation member with the same name as the attribute, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The value of an annotation member named value may be specified in the body of the XML element which represents the Java annotation.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If the XML element has a non-empty body and also specifies an attribute named value, a
+|DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If the XML element has a non-empty body, and there is no annotation member named value, a |DefinitionException| is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The value of a member of primitive type is specified using the Java literal syntax for that type</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>The value of a member of type |java.lang.String| is specified using the string value</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The value of a member of enumerated type is specified using the unqualified name of the enumeration value.</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>The value of a member of type |java.lang.Class| is specified using the fully qualified Java class name.</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>If the member value is not specified in the correct format for the type of the member, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>If an XML element that refers to a Java annotation with a member with no default value does not declare a value for that member, a |DefinitionException| is thrown by the container at deployment time.</text>
+ </assertion>
+ </section>
+
+ <section id="9.12" title="Deployment declarations">
+
+ </section>
+
+ <section id="9.12.1" title="The <Deploy> declaration">
+
+ </section>
+
+ <section id="9.12.2" title="The <Interceptors> declaration">
+
+ </section>
+
+ <section id="9.12.3" title="The <Decorators> declaration">
+
+ </section>
+
+ <section id="11" title="Packaging and Deployment">
+
+ </section>
+
+ <section id="11.1" title="Deployment lifecycle">
+
+ </section>
+
+ <section id="11.2" title="Bean discovery">
+
+
+
+ <assertion id="w">
+ <text>The container discovers beans~, disposal methods and observer methods~ defined using XML by parsing the |beans.xml| files according to the rules of Chapter 9, XML based metadata.</text>
+ <note>Check all archive types enumerated above, simple beans, session beans, producer methods and producer fields</note>
+ </assertion>
+
+ <assertion id="x">
+ <text>The container discovers ~beans, ~disposal methods ~and observer methods~ defined using XML by parsing the |beans.xml| files according to the rules of Chapter 9, XML based metadata.</text>
+ <note>Check all archive types enumerated above</note>
+ </assertion>
+
+ <assertion id="y">
+ <text>The container discovers ~beans, disposal methods and~ observer methods defined using XML by parsing the |beans.xml| files according to the rules of Chapter 9, XML based metadata.</text>
+ <note>Check all archive types enumerated above</note>
+ </assertion>
+
+ </section>
+
+ <section id="11.4" title="Providing additional XML based metadata">
+ <assertion id="a">
+ <text>The container parses the XML stream according to the rules of Chapter 9, XML based metadata. This method may be called at any time by the application or third-party framework.</text>
+ <note>Check that the parse method adds beans etc.</note>
+ </assertion>
+ </section>
+
+ <section id="11.6" title="Activities">
+
+ </section>
+
+ <section id="11.6.1" title="Current Activity">
+
+ </section>
+
+</specification>
Added: tck/trunk/xml/src/main/resources/tck-tests.xml
===================================================================
--- tck/trunk/xml/src/main/resources/tck-tests.xml (rev 0)
+++ tck/trunk/xml/src/main/resources/tck-tests.xml 2009-04-16 15:14:19 UTC (rev 2435)
@@ -0,0 +1,26 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="JSR-299 TCK" verbose="2" >
+ <test name="JSR-299 TCK" >
+ <method-selectors>
+ <method-selector>
+ <selector-class name="org.jboss.testharness.impl.testng.DisableIntegrationTestsMethodSelector" />
+ </method-selector>
+ <method-selector>
+ <selector-class name="org.jboss.testharness.impl.testng.ExcludeIncontainerUnderInvestigationMethodSelector" />
+ </method-selector>
+ </method-selectors>
+ <groups>
+ <run>
+ <exclude name="stub" />
+ <exclude name="ri-broken" />
+ <exclude name="underInvestigation" />
+ <exclude name="broken" />
+ </run>
+ </groups>
+ <packages>
+ <package name="org.jboss.jsr299.tck.tests" />
+ </packages>
+ </test>
+
+</suite>
\ No newline at end of file
17 years
[webbeans-commits] Webbeans SVN: r2434 - in examples/trunk: wicket-conversations and 37 other directories.
by webbeans-commits@lists.jboss.org
Author: cpopetz
Date: 2009-04-16 11:09:21 -0400 (Thu, 16 Apr 2009)
New Revision: 2434
Added:
examples/trunk/wicket-conversations/
examples/trunk/wicket-conversations/pom.xml
examples/trunk/wicket-conversations/readme.txt
examples/trunk/wicket-conversations/src/
examples/trunk/wicket-conversations/src/main/
examples/trunk/wicket-conversations/src/main/java/
examples/trunk/wicket-conversations/src/main/java/org/
examples/trunk/wicket-conversations/src/main/java/org/jboss/
examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/
examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/
examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/
examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/Conversations.java
examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/Data.java
examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/Example.java
examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/HomePage.html
examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/HomePage.java
examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/SampleApplication.java
examples/trunk/wicket-conversations/src/main/resources/
examples/trunk/wicket-conversations/src/main/resources/beans.xml
examples/trunk/wicket-conversations/src/main/resources/log4j.properties
examples/trunk/wicket-conversations/src/main/webapp/
examples/trunk/wicket-conversations/src/main/webapp/WEB-INF/
examples/trunk/wicket-conversations/src/main/webapp/WEB-INF/beans.xml
examples/trunk/wicket-conversations/src/main/webapp/WEB-INF/web.xml
examples/trunk/wicket-conversations/src/test/
examples/trunk/wicket-conversations/src/test/java/
examples/trunk/wicket-conversations/src/test/java/org/
examples/trunk/wicket-conversations/src/test/java/org/jboss/
examples/trunk/wicket-conversations/src/test/java/org/jboss/webbeans/
examples/trunk/wicket-conversations/src/test/java/org/jboss/webbeans/examples/
examples/trunk/wicket-conversations/src/test/java/org/jboss/webbeans/examples/wicket/
examples/trunk/wicket-conversations/src/test/java/org/jboss/webbeans/examples/wicket/Start.java
examples/trunk/wicket-numberguess/
examples/trunk/wicket-numberguess/pom.xml
examples/trunk/wicket-numberguess/readme.txt
examples/trunk/wicket-numberguess/src/
examples/trunk/wicket-numberguess/src/main/
examples/trunk/wicket-numberguess/src/main/java/
examples/trunk/wicket-numberguess/src/main/java/org/
examples/trunk/wicket-numberguess/src/main/java/org/jboss/
examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/
examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/
examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/
examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/Game.java
examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/Generator.java
examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/HomePage.html
examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/HomePage.java
examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/MaxNumber.java
examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/Random.java
examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/SampleApplication.java
examples/trunk/wicket-numberguess/src/main/resources/
examples/trunk/wicket-numberguess/src/main/resources/beans.xml
examples/trunk/wicket-numberguess/src/main/resources/log4j.properties
examples/trunk/wicket-numberguess/src/main/webapp/
examples/trunk/wicket-numberguess/src/main/webapp/WEB-INF/
examples/trunk/wicket-numberguess/src/main/webapp/WEB-INF/beans.xml
examples/trunk/wicket-numberguess/src/main/webapp/WEB-INF/web.xml
examples/trunk/wicket-numberguess/src/test/
examples/trunk/wicket-numberguess/src/test/java/
examples/trunk/wicket-numberguess/src/test/java/org/
examples/trunk/wicket-numberguess/src/test/java/org/jboss/
examples/trunk/wicket-numberguess/src/test/java/org/jboss/webbeans/
examples/trunk/wicket-numberguess/src/test/java/org/jboss/webbeans/examples/
examples/trunk/wicket-numberguess/src/test/java/org/jboss/webbeans/examples/wicket/
examples/trunk/wicket-numberguess/src/test/java/org/jboss/webbeans/examples/wicket/Start.java
Log:
Add two wicket examples, simliar to numberguess and conversations.
Added: examples/trunk/wicket-conversations/pom.xml
===================================================================
--- examples/trunk/wicket-conversations/pom.xml (rev 0)
+++ examples/trunk/wicket-conversations/pom.xml 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,125 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.jboss.webbeans.examples</groupId>
+ <artifactId>parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.jboss.webbeans.examples</groupId>
+ <artifactId>wicket-conversations</artifactId>
+ <packaging>war</packaging>
+ <name>Web Beans Examples: Conversations with Wicket</name>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>codehaus snapshot repository</id>
+ <url>http://snapshots.repository.codehaus.org/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>jsr299-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans.tomcat</groupId>
+ <artifactId>webbeans-tomcat</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-wicket</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket</artifactId>
+ <version>${wicket.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.4.2</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
+
+
+ <!-- JETTY DEPENDENCIES FOR TESTING -->
+
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>${jetty.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <filtering>false</filtering>
+ <directory>src/test/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>${jetty.version}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.5.1</version>
+ </plugin>
+ </plugins>
+ </build>
+
+ <properties>
+ <wicket.version>1.3-SNAPSHOT</wicket.version>
+ <jetty.version>6.1.16</jetty.version>
+ </properties>
+
+</project>
Property changes on: examples/trunk/wicket-conversations/pom.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-conversations/readme.txt
===================================================================
--- examples/trunk/wicket-conversations/readme.txt (rev 0)
+++ examples/trunk/wicket-conversations/readme.txt 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,18 @@
+This example is similar to its sibling "conversations" example, but implemented with wicket
+and the wicket-webbeans integration. It also follows the wicket standard usage of running from
+within eclipse with jetty. So, for example, to run the app, right-click on Start.java in
+the project and choos "Run as Java Application," which will launch jetty with the example. Then hit http://localhost:8080/
+
+
+Note that conversational behavior for wicket is different than that of jsf. Roughly:
+
+- Conversations are started/ended in the same way, with Conversation.begin/end
+
+- Conversations are by default propagated to new PageTargets, whether directly instantiated
+or created with boomkarkable mounts. In the former case, the new Page instance will have the
+conversation id embedded in its page metadata. In the latter, a "cid" parameter is passed along.
+
+- To switch a conversation, you need to explicitly pass the cid in wicket
+RequestParameters. See the example.
+
+
Added: examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/Conversations.java
===================================================================
--- examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/Conversations.java (rev 0)
+++ examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/Conversations.java 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,23 @@
+package org.jboss.webbeans.examples.conversations;
+
+import java.io.Serializable;
+
+import javax.annotation.Named;
+import javax.context.SessionScoped;
+import javax.inject.Produces;
+
+import org.jboss.webbeans.conversation.ConversationInactivityTimeout;
+
+
+@SessionScoped
+@Named("conversations")
+public class Conversations implements Serializable {
+
+ @Produces
+ @ConversationInactivityTimeout
+ @Example
+ public static long getConversationTimeoutInMilliseconds()
+ {
+ return 600000;
+ }
+}
\ No newline at end of file
Added: examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/Data.java
===================================================================
--- examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/Data.java (rev 0)
+++ examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/Data.java 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,23 @@
+package org.jboss.webbeans.examples.conversations;
+
+import java.io.Serializable;
+
+import javax.annotation.Named;
+import javax.context.ConversationScoped;
+
+@ConversationScoped
+@Named
+public class Data implements Serializable
+{
+ private String data;
+
+ public String getData()
+ {
+ return data;
+ }
+
+ public void setData(String data)
+ {
+ this.data = data;
+ }
+}
\ No newline at end of file
Added: examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/Example.java
===================================================================
--- examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/Example.java (rev 0)
+++ examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/Example.java 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.examples.conversations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.DeploymentType;
+
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+public @interface Example
+{
+}
\ No newline at end of file
Added: examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/HomePage.html
===================================================================
--- examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/HomePage.html (rev 0)
+++ examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/HomePage.html 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,26 @@
+<html>
+ <head>
+ <title>Wicket WebBeans conversation example</title>
+ </head>
+ <body>
+
+
+ <form wicket:id="conversationForm">
+ Conversation list: <select wicket:id="cidSelect"/> (Chosen conversation is current)
+ </form>
+ <form wicket:id="form">
+ Data in conversation: <input type="text" wicket:id="dataField"/>
+ <input type="submit" wicket:id="changeValue" value="Change Value"/>
+ </form>
+
+ <form wicket:id="buttons">
+ <input type="submit" wicket:id="begin" value="begin"/><p/>
+ <input type="submit" wicket:id="noop" value="noop"/><p/>
+ <input type="submit" wicket:id="end" value="end"/><p/>
+ <input type="submit" wicket:id="longop" value="longop"/><p/>
+ <a href="/">Abandon</a><p/>
+ </form>
+ <p/>
+ <span wicket:id="feedback"/>
+ </body>
+</html>
Added: examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/HomePage.java
===================================================================
--- examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/HomePage.java (rev 0)
+++ examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/HomePage.java 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,141 @@
+package org.jboss.webbeans.examples.conversations;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.context.Conversation;
+import javax.inject.Current;
+
+import org.apache.wicket.PageParameters;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.form.Button;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.jboss.webbeans.conversation.ConversationManager;
+
+/**
+ * This is a port of the JSF-based "conversation" example to use Wicket and the
+ * Wicket/WebBeans integration module. This shows how long-running conversations
+ * are propogated across redirects using wicket page metadata (i.e. without
+ * url-rewriting), and how wicket components can use WebBeans injections.
+ *
+ * @author cpopetz
+ *
+ */
+public class HomePage extends WebPage
+{
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * These are injections for displaying information about existing conversations to the user
+ */
+ @Current ConversationManager conversationManager;
+ @Current Conversation currentConversation;
+
+ /**
+ * This is our conversational data component, to illustrate how data is used in conversations and
+ * exists per-conversation.
+ */
+ @Current Data data;
+
+ /**
+ * This is the conversation we'll switch to, chosen by the popup
+ */
+ transient Conversation chosenConversation;
+
+ @SuppressWarnings("serial")
+ public HomePage()
+ {
+
+ chosenConversation = currentConversation;
+
+ add(new FeedbackPanel("feedback"));
+
+ //the first from is to change the value in the conversational data component
+ Form form = new Form("form");
+ add(form);
+ form.add(new TextField("dataField", new PropertyModel(this, "data.data")));
+ form.add(new Button("changeValue"));
+
+
+ //the second form is for switching conversations
+ form = new Form("conversationForm");
+ add(form);
+ form.add(new DropDownChoice("cidSelect",
+ new PropertyModel(this,"chosenConversation"),
+ new Model() {
+ public Object getObject()
+ {
+ //the popup is the set of all long running conversations, plus our own conversation if it is not long running
+ List<Conversation> list =
+ new ArrayList<Conversation>(conversationManager.getLongRunningConversations());
+ if (!currentConversation.isLongRunning())
+ {
+ list.add(0, currentConversation);
+ }
+ return list;
+ }
+ }) {
+ protected boolean wantOnSelectionChangedNotifications() { return true; }
+ protected void onSelectionChanged(Object newSelection)
+ {
+ getSession().info("Switched to conversation " + chosenConversation.getId());
+ setRedirect(true);
+ setResponsePage(HomePage.class,new PageParameters("cid=" + chosenConversation.getId()));
+ }
+ });
+
+ form = new Form("buttons");
+
+ add(form);
+ form.add(new Button("begin")
+ {
+ public void onSubmit()
+ {
+ currentConversation.begin();
+ getSession().info("conversation " + currentConversation.getId() + " promoted to long-running.");
+ //we do this because the conversationManager doesn't update its list
+ //until we cleanup the conversation after the request, so we want a redirect
+ //in order to get the select to look right
+ setRedirect(true);
+ setResponsePage(HomePage.class);
+ }
+ });
+
+ form.add(new Button("noop"));
+
+ form.add(new Button("end")
+ {
+ public void onSubmit()
+ {
+ getSession().info("Ended conversation " + currentConversation.getId());
+ currentConversation.end();
+ //we do this because the conversationManager doesn't update its list
+ //until we cleanup the conversation after the request, so we want a redirect
+ //in order to get the select to look right
+ setRedirect(true);
+ setResponsePage(HomePage.class);
+ }
+ });
+
+ form.add(new Button("longop")
+ {
+ public void onSubmit()
+ {
+ try
+ {
+ Thread.sleep(5000);
+ }
+ catch (InterruptedException e)
+ {
+ }
+ }
+ });
+
+ }
+}
Property changes on: examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/HomePage.java
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/SampleApplication.java
===================================================================
--- examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/SampleApplication.java (rev 0)
+++ examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/SampleApplication.java 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.examples.conversations;
+
+import org.jboss.webbeans.wicket.WebBeansApplication;
+
+public class SampleApplication extends WebBeansApplication
+{
+
+ @Override
+ public Class getHomePage()
+ {
+ return HomePage.class;
+ }
+
+}
Property changes on: examples/trunk/wicket-conversations/src/main/java/org/jboss/webbeans/examples/conversations/SampleApplication.java
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-conversations/src/main/resources/beans.xml
===================================================================
--- examples/trunk/wicket-conversations/src/main/resources/beans.xml (rev 0)
+++ examples/trunk/wicket-conversations/src/main/resources/beans.xml 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,7 @@
+<Beans xmlns="urn:java:ee" xmlns:conversations="urn:java:org.jboss.webbeans.examples.conversations">
+ <Deploy>
+ <Standard />
+ <Production />
+ <conversations:Example />
+ </Deploy>
+</Beans>
Property changes on: examples/trunk/wicket-conversations/src/main/resources/beans.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-conversations/src/main/resources/log4j.properties
===================================================================
--- examples/trunk/wicket-conversations/src/main/resources/log4j.properties (rev 0)
+++ examples/trunk/wicket-conversations/src/main/resources/log4j.properties 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,11 @@
+log4j.appender.Stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.Stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.Stdout.layout.conversionPattern=%-5p - %-26.26c{1} - %m\n
+
+
+log4j.rootLogger=INFO,Stdout
+
+#log4j.logger.org.jboss.webbeans=DEBUG
+#log4j.logger.org.apache.wicket=DEBUG
+
+
Property changes on: examples/trunk/wicket-conversations/src/main/resources/log4j.properties
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-conversations/src/main/webapp/WEB-INF/beans.xml
===================================================================
--- examples/trunk/wicket-conversations/src/main/webapp/WEB-INF/beans.xml (rev 0)
+++ examples/trunk/wicket-conversations/src/main/webapp/WEB-INF/beans.xml 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,7 @@
+<Beans xmlns="urn:java:ee" xmlns:conversations="urn:java:org.jboss.webbeans.examples.conversations">
+ <Deploy>
+ <Standard />
+ <Production />
+ <conversations:Example />
+ </Deploy>
+</Beans>
\ No newline at end of file
Property changes on: examples/trunk/wicket-conversations/src/main/webapp/WEB-INF/beans.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-conversations/src/main/webapp/WEB-INF/web.xml
===================================================================
--- examples/trunk/wicket-conversations/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ examples/trunk/wicket-conversations/src/main/webapp/WEB-INF/web.xml 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <display-name>webbeans-conversations-wicket</display-name>
+
+ <filter>
+ <filter-name>wicket.conversations-example</filter-name>
+ <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+ <init-param>
+ <param-name>applicationClassName</param-name>
+ <param-value>org.jboss.webbeans.examples.conversations.SampleApplication</param-value>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>wicket.conversations-example</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <listener>
+ <listener-class>org.jboss.webbeans.environment.servlet.Listener</listener-class>
+ </listener>
+
+
+</web-app>
Property changes on: examples/trunk/wicket-conversations/src/main/webapp/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-conversations/src/test/java/org/jboss/webbeans/examples/wicket/Start.java
===================================================================
--- examples/trunk/wicket-conversations/src/test/java/org/jboss/webbeans/examples/wicket/Start.java (rev 0)
+++ examples/trunk/wicket-conversations/src/test/java/org/jboss/webbeans/examples/wicket/Start.java 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,35 @@
+package org.jboss.webbeans.examples.wicket;
+
+import org.mortbay.jetty.Connector;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.bio.SocketConnector;
+import org.mortbay.jetty.webapp.WebAppContext;
+
+public class Start {
+
+ public static void main(String[] args) throws Exception {
+ Server server = new Server();
+ SocketConnector connector = new SocketConnector();
+ connector.setPort(8080);
+ server.setConnectors(new Connector[] { connector });
+
+ WebAppContext bb = new WebAppContext();
+ bb.setServer(server);
+ bb.setContextPath("/");
+ bb.setWar("src/main/webapp");
+ server.addHandler(bb);
+
+ try {
+ System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP");
+ server.start();
+ while (System.in.available() == 0) {
+ Thread.sleep(500);
+ }
+ server.stop();
+ server.join();
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(100);
+ }
+ }
+}
Property changes on: examples/trunk/wicket-conversations/src/test/java/org/jboss/webbeans/examples/wicket/Start.java
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-numberguess/pom.xml
===================================================================
--- examples/trunk/wicket-numberguess/pom.xml (rev 0)
+++ examples/trunk/wicket-numberguess/pom.xml 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,125 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.jboss.webbeans.examples</groupId>
+ <artifactId>parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.jboss.webbeans.examples</groupId>
+ <artifactId>wicket-numberguess</artifactId>
+ <packaging>war</packaging>
+ <name>Web Beans Examples: Numberguess with wicket</name>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>codehaus snapshot repository</id>
+ <url>http://snapshots.repository.codehaus.org/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>jsr299-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans.tomcat</groupId>
+ <artifactId>webbeans-tomcat</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-wicket</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket</artifactId>
+ <version>${wicket.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.4.2</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
+
+
+ <!-- JETTY DEPENDENCIES FOR TESTING -->
+
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>${jetty.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <filtering>false</filtering>
+ <directory>src/test/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>${jetty.version}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.5.1</version>
+ </plugin>
+ </plugins>
+ </build>
+
+ <properties>
+ <wicket.version>1.3-SNAPSHOT</wicket.version>
+ <jetty.version>6.1.16</jetty.version>
+ </properties>
+
+</project>
Property changes on: examples/trunk/wicket-numberguess/pom.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-numberguess/readme.txt
===================================================================
--- examples/trunk/wicket-numberguess/readme.txt (rev 0)
+++ examples/trunk/wicket-numberguess/readme.txt 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,6 @@
+This example is similar to its sibling "numberguess" example, but implemented with wicket
+and the wicket-webbeans integration. It also follows the wicket standard usage of running from
+within eclipse with jetty. So, for example, to run the app, right-click on Start.java in
+the project and choos "Run as Java Application," which will launch jetty with the example. Then hit http://localhost:8080/
+
+
Added: examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/Game.java
===================================================================
--- examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/Game.java (rev 0)
+++ examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/Game.java 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,89 @@
+package org.jboss.webbeans.examples.wicket;
+
+
+import java.io.Serializable;
+
+import javax.annotation.Named;
+import javax.annotation.PostConstruct;
+import javax.context.SessionScoped;
+import javax.inject.AnnotationLiteral;
+import javax.inject.Current;
+import javax.inject.manager.Manager;
+import javax.naming.NamingException;
+
+@Named
+@SessionScoped
+public class Game implements Serializable
+{
+ private int number;
+
+ private int guess;
+ private int smallest;
+
+ @MaxNumber
+ private int maxNumber;
+
+ private int biggest;
+ private int remainingGuesses;
+
+ @Current Manager manager;
+
+ public Game() throws NamingException {}
+
+ public int getNumber()
+ {
+ return number;
+ }
+
+ public int getGuess()
+ {
+ return guess;
+ }
+
+ public void setGuess(int guess)
+ {
+ this.guess = guess;
+ }
+
+ public int getSmallest()
+ {
+ return smallest;
+ }
+
+ public int getBiggest()
+ {
+ return biggest;
+ }
+
+ public int getRemainingGuesses()
+ {
+ return remainingGuesses;
+ }
+
+ public boolean check()
+ {
+ if (guess>number)
+ {
+ biggest = guess - 1;
+ }
+ if (guess<number)
+ {
+ smallest = guess + 1;
+ }
+ remainingGuesses--;
+ return (guess == number);
+ }
+
+
+ @PostConstruct
+ public void reset()
+ {
+ this.smallest = 0;
+ this.guess = 0;
+ this.remainingGuesses = 10;
+ this.biggest = maxNumber;
+ this.number = manager.getInstanceByType(Integer.class, new AnnotationLiteral<Random>(){});
+ }
+
+
+}
Property changes on: examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/Game.java
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/Generator.java
===================================================================
--- examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/Generator.java (rev 0)
+++ examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/Generator.java 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,34 @@
+package org.jboss.webbeans.examples.wicket;
+
+
+import java.io.Serializable;
+
+import javax.context.ApplicationScoped;
+import javax.inject.Produces;
+
+
+@ApplicationScoped
+public class Generator implements Serializable
+{
+
+ private static final long serialVersionUID = -7213673465118041882L;
+
+ private java.util.Random random = new java.util.Random( System.currentTimeMillis() );
+
+ private int maxNumber = 100;
+
+ java.util.Random getRandom()
+ {
+ return random;
+ }
+
+ @Produces @Random int next() {
+ return getRandom().nextInt(maxNumber);
+ }
+
+ @Produces @MaxNumber int getMaxNumber()
+ {
+ return maxNumber;
+ }
+
+}
Property changes on: examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/Generator.java
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/HomePage.html
===================================================================
--- examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/HomePage.html (rev 0)
+++ examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/HomePage.html 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,29 @@
+<html>
+ <head>
+ <title>Wicket WebBeans example</title>
+ </head>
+ <body>
+ <h1>Guess a number...</h1>
+ <form wicket:id="NumberGuessMain">
+ <div style="color: red">
+ <span wicket:id="messages"/>
+ </div>
+
+ <div wicket:id="prompt">
+ I'm thinking of a number between 0 and 100. You have 10 guesses.
+ </div>
+
+ <div>
+ <span wicket:id="guessLabel">Your guess:</span>
+ <input wicket:id="inputGuess" type="text" size="3"/>
+ <input wicket:id="GuessButton" type="submit" value="Guess"/>
+ <input wicket:id="RestartButton" type="submit" value="Reset"/>
+ <h:commandButton id="GuessButton" value="Guess" action="#{game.check}" disabled="#{game.number eq game.guess}"/>
+ </div>
+ <div>
+ <h:commandButton id="RestartButton" value="Reset" action="#{game.reset}" immediate="true" />
+ </div>
+ </form>
+ </body>
+</html>
+
Property changes on: examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/HomePage.html
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/HomePage.java
===================================================================
--- examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/HomePage.java (rev 0)
+++ examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/HomePage.java 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,84 @@
+package org.jboss.webbeans.examples.wicket;
+
+import javax.inject.Current;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.PageParameters;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.behavior.AbstractBehavior;
+import org.apache.wicket.behavior.IBehavior;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Button;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.request.target.component.listener.BehaviorRequestTarget;
+
+public class HomePage extends WebPage {
+
+ private static final long serialVersionUID = 1L;
+
+ @Current Game game;
+
+ public HomePage() {
+
+
+ Form form = new Form("NumberGuessMain");
+ add(form);
+ form.add(new FeedbackPanel("messages").setOutputMarkupId(true));
+
+ final Component prompt = new Label("prompt", new Model() {
+ @Override
+ public Object getObject() {
+ return "I'm thinking of a number between " + game.getSmallest() + " and " + game.getBiggest() +
+ ". You have " + game.getRemainingGuesses() + " guesses.";
+ }
+ });
+ form.add(prompt);
+
+ final Component guessLabel = new Label("guessLabel","Your Guess:");
+ form.add(guessLabel);
+ final Component inputGuess = new TextField("inputGuess",new Model() {
+ public Object getObject() {
+ return game.getGuess();
+ }
+ public void setObject(Object object) {
+ game.setGuess(Integer.parseInt((String)object));
+ }
+ });
+ form.add(inputGuess);
+
+ final Component guessButton = new AjaxButton("GuessButton") {
+ protected void onSubmit(AjaxRequestTarget target, Form form) {
+ if (game.check()) {
+ info("Correct!");
+ setVisible(false);
+ prompt.setVisible(false);
+ guessLabel.setVisible(false);
+ inputGuess.setVisible(false);
+ }
+ else if (game.getNumber() > game.getGuess())
+ info("Higher!");
+ else if (game.getNumber() < game.getGuess())
+ info("Lower");
+ target.addComponent(form);
+ }
+ };
+ form.add(guessButton);
+
+ form.add(new AjaxButton("RestartButton") {
+ protected void onSubmit(AjaxRequestTarget target, Form form) {
+ game.reset();
+ guessButton.setVisible(true);
+ prompt.setVisible(true);
+ guessLabel.setVisible(true);
+ inputGuess.setVisible(true);
+ target.addComponent(form);
+ }
+ });
+
+ }
+}
Property changes on: examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/HomePage.java
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/MaxNumber.java
===================================================================
--- examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/MaxNumber.java (rev 0)
+++ examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/MaxNumber.java 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,23 @@
+package org.jboss.webbeans.examples.wicket;
+
+
+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
+public @interface MaxNumber
+{
+
+}
Property changes on: examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/MaxNumber.java
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/Random.java
===================================================================
--- examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/Random.java (rev 0)
+++ examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/Random.java 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,23 @@
+package org.jboss.webbeans.examples.wicket;
+
+
+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
+public @interface Random
+{
+
+}
Property changes on: examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/Random.java
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/SampleApplication.java
===================================================================
--- examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/SampleApplication.java (rev 0)
+++ examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/SampleApplication.java 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.examples.wicket;
+
+import org.jboss.webbeans.wicket.WebBeansApplication;
+
+public class SampleApplication extends WebBeansApplication
+{
+
+ @Override
+ public Class getHomePage()
+ {
+ return HomePage.class;
+ }
+
+}
Property changes on: examples/trunk/wicket-numberguess/src/main/java/org/jboss/webbeans/examples/wicket/SampleApplication.java
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-numberguess/src/main/resources/beans.xml
===================================================================
Property changes on: examples/trunk/wicket-numberguess/src/main/resources/beans.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-numberguess/src/main/resources/log4j.properties
===================================================================
--- examples/trunk/wicket-numberguess/src/main/resources/log4j.properties (rev 0)
+++ examples/trunk/wicket-numberguess/src/main/resources/log4j.properties 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,10 @@
+log4j.appender.Stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.Stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.Stdout.layout.conversionPattern=%-5p - %-26.26c{1} - %m\n
+
+
+log4j.rootLogger=INFO,Stdout
+
+log4j.logger.org.jboss.webbeans=DEBUG
+
+
Property changes on: examples/trunk/wicket-numberguess/src/main/resources/log4j.properties
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-numberguess/src/main/webapp/WEB-INF/beans.xml
===================================================================
Property changes on: examples/trunk/wicket-numberguess/src/main/webapp/WEB-INF/beans.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-numberguess/src/main/webapp/WEB-INF/web.xml
===================================================================
--- examples/trunk/wicket-numberguess/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ examples/trunk/wicket-numberguess/src/main/webapp/WEB-INF/web.xml 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <display-name>webbeans-numberguess-wicket</display-name>
+
+ <filter>
+ <filter-name>wicket.numberguess-example</filter-name>
+ <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+ <init-param>
+ <param-name>applicationClassName</param-name>
+ <param-value>org.jboss.webbeans.examples.wicket.SampleApplication</param-value>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>wicket.numberguess-example</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <listener>
+ <listener-class>org.jboss.webbeans.environment.servlet.Listener</listener-class>
+ </listener>
+
+
+</web-app>
Property changes on: examples/trunk/wicket-numberguess/src/main/webapp/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: examples/trunk/wicket-numberguess/src/test/java/org/jboss/webbeans/examples/wicket/Start.java
===================================================================
--- examples/trunk/wicket-numberguess/src/test/java/org/jboss/webbeans/examples/wicket/Start.java (rev 0)
+++ examples/trunk/wicket-numberguess/src/test/java/org/jboss/webbeans/examples/wicket/Start.java 2009-04-16 15:09:21 UTC (rev 2434)
@@ -0,0 +1,36 @@
+package org.jboss.webbeans.examples.wicket;
+
+import org.mortbay.jetty.Connector;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.bio.SocketConnector;
+import org.mortbay.jetty.webapp.WebAppContext;
+
+public class Start {
+
+ public static void main(String[] args) throws Exception {
+ Server server = new Server();
+ SocketConnector connector = new SocketConnector();
+ connector.setPort(8080);
+ server.setConnectors(new Connector[] { connector });
+
+ WebAppContext bb = new WebAppContext();
+ bb.setServer(server);
+ bb.setContextPath("/");
+ bb.setWar("src/main/webapp");
+
+ server.addHandler(bb);
+
+ try {
+ System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP");
+ server.start();
+ while (System.in.available() == 0) {
+ Thread.sleep(500);
+ }
+ server.stop();
+ server.join();
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(100);
+ }
+ }
+}
Property changes on: examples/trunk/wicket-numberguess/src/test/java/org/jboss/webbeans/examples/wicket/Start.java
___________________________________________________________________
Name: svn:executable
+ *
17 years
[webbeans-commits] Webbeans SVN: r2433 - ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation.
by webbeans-commits@lists.jboss.org
Author: cpopetz
Date: 2009-04-16 10:47:08 -0400 (Thu, 16 Apr 2009)
New Revision: 2433
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java
Log:
Override equals/hashcode to use the cid, so that conversations can live in collections.
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java 2009-04-16 14:27:01 UTC (rev 2432)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java 2009-04-16 14:47:08 UTC (rev 2433)
@@ -163,4 +163,20 @@
{
return originalCid;
}
+
+ @Override
+ public boolean equals(Object obj)
+ {
+
+ if (obj == null || !(obj instanceof Conversation))
+ return false;
+ String otherCid = ((Conversation)obj).getId();
+ return (cid == null || otherCid == null) ? false : cid.equals(otherCid);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return cid == null ? super.hashCode() : cid.hashCode();
+ }
}
17 years
[webbeans-commits] Webbeans SVN: r2432 - ri/trunk/impl/src/main/java/org/jboss/webbeans/injection.
by webbeans-commits@lists.jboss.org
Author: cpopetz
Date: 2009-04-16 10:27:01 -0400 (Thu, 16 Apr 2009)
New Revision: 2432
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java
Log:
Don't deactivate the app context if it was active on entry, as it doesn't protect itself from
reentrant calls like the dependent scope does.
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java 2009-04-16 12:33:10 UTC (rev 2431)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java 2009-04-16 14:27:01 UTC (rev 2432)
@@ -98,7 +98,11 @@
if (DependentContext.instance() != null && ApplicationContext.instance() != null)
{
DependentContext.instance().setActive(true);
- ApplicationContext.instance().setActive(true);
+ boolean startApplication = !ApplicationContext.instance().isActive();
+ if (startApplication)
+ {
+ ApplicationContext.instance().setActive(true);
+ }
Set<FieldInjectionPoint<?>> injectionPoints = instances.putIfAbsent(instance.getClass(), new Callable<Set<FieldInjectionPoint<?>>>()
{
@@ -114,7 +118,10 @@
injectionPoint.inject(instance, manager, null);
}
DependentContext.instance().setActive(false);
- ApplicationContext.instance().setActive(false);
+ if (startApplication)
+ {
+ ApplicationContext.instance().setActive(false);
+ }
}
}
17 years
[webbeans-commits] Webbeans SVN: r2431 - ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-16 08:33:10 -0400 (Thu, 16 Apr 2009)
New Revision: 2431
Modified:
doc/trunk/reference/en-US/ri-spi.xml
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/WebBeanDiscovery.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbDescriptor.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/messaging/spi/JmsServices.java
Log:
SPI docs update
Modified: doc/trunk/reference/en-US/ri-spi.xml
===================================================================
--- doc/trunk/reference/en-US/ri-spi.xml 2009-04-16 12:12:33 UTC (rev 2430)
+++ doc/trunk/reference/en-US/ri-spi.xml 2009-04-16 12:33:10 UTC (rev 2431)
@@ -1,30 +1,21 @@
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
<appendix id="ri-spi">
- <title>Integrating the Web Beans RI into other environments</title>
+ <title>Integrating Web Beans into other environments</title>
<para>
- Currently the Web Beans RI only runs in JBoss AS 5; integrating the RI
+ Currently Web Beans only runs in JBoss AS 5; integrating the RI
into other EE environments (for example another application server like
Glassfish), into a servlet container (like Tomcat), or with an
Embedded EJB3.1 implementation is fairly easy. In this Appendix we will
briefly discuss the steps needed.
</para>
- <note>
- <para>
- It should be possible to run Web Beans in an SE environment, but
- you'll to do more work, adding your own contexts and lifecycle. The
- Web Beans RI currently doesn't expose lifecycle extension points, so
- you would have to code directly against Web Beans RI classes.
- </para>
- </note>
-
<section>
- <title>The Web Beans RI SPI</title>
+ <title>The Web Beans SPI</title>
<para>
- The Web Beans SPI is located in <literal>webbeans-spi</literal>
+ The Web Beans SPI is located in the <literal>webbeans-spi</literal>
module, and packaged as <literal>webbeans-spi.jar</literal>. Some
SPIs are optional, if you need to override the default behavior,
others are required.
@@ -32,31 +23,32 @@
<para>
All interfaces in the SPI support the decorator pattern and provide a
- <literal>Forwarding</literal> class.
+ <literal>Forwarding</literal> class located in the
+ <literal>helpers</literal> sub package. Additional, commonly used,
+ utility classes, and standard implementations are also located in the
+ <literal>helpers</literal> sub package.
</para>
<section>
<title>Web Bean Discovery</title>
- <programlisting role="JAVA"><![CDATA[public interface WebBeanDiscovery {
- /**
- * Gets list of all classes in classpath archives with web-beans.xml files
+ <programlisting role="JAVA"><![CDATA[/**
+ * Gets list of all classes in classpath archives with META-INF/beans.xml (or
+ * for WARs WEB-INF/beans.xml) files
*
* @return An iterable over the classes
*/
public Iterable<Class<?>> discoverWebBeanClasses();
/**
- * Gets a list of all web-beans.xml files in the app classpath
+ * Gets a list of all deployment descriptors in the app classpath
*
- * @return An iterable over the web-beans.xml files
+ * @return An iterable over the beans.xml files
*/
- public Iterable<URL> discoverWebBeansXml();
-
-}]]></programlisting>
+ public Iterable<URL> discoverWebBeansXml();]]></programlisting>
<para>
- The discovery of Web Bean classes and <literal>web-bean.xml</literal>
+ The discovery of Web Bean classes and <literal>beans.xml</literal>
files is self-explanatory (the algorithm is described in Section 11.1
of the JSR-299 specification, and isn't repeated here).
</para>
@@ -66,26 +58,24 @@
<section>
<title>EJB services</title>
+ <note>
+ <para>
+ Web Beans will run without an EJB container; in this case you
+ don't need to implement the EJB SPI.
+ </para>
+ </note>
+
<para>
- The Web Beans RI also delegates EJB3 bean discovery to the container
+ Web Beans also delegates EJB3 bean discovery to the container
so that it doesn't have to scan for EJB3 annotations or parse
<literal>ejb-jar.xml</literal>. For each EJB in the application an
EJBDescriptor should be discovered:
</para>
- <programlisting role="JAVA"><![CDATA[public interface EjbServices
+ <programlisting role="JAVA"><![CDATA[public interface EjbDescriptor<T>
{
/**
- * Gets a descriptor for each EJB in the application
- *
- * @return The bean class to descriptor map
- */
- public Iterable<EjbDescriptor<?>> discoverEjbs();]]></programlisting>
-
- <programlisting role="JAVA"><![CDATA[public interface EjbDescriptor<T> {
-
- /**
* Gets the EJB type
*
* @return The EJB Bean class
@@ -146,10 +136,7 @@
*
* @return The name
*/
- public String getEjbName();
-
-
-}]]></programlisting>
+ public String getEjbName();]]></programlisting>
<para>
The <literal>EjbDescriptor</literal> is fairly self-explanatory,
@@ -161,25 +148,26 @@
</para>
<para>
- The resolution of <literal>@EJB</literal> and
- <literal>@Resource</literal> is delegated to the container. You must
- provide an implementation of
+ The resolution of <literal>@EJB</literal> (for injection into simple
+ beans), the resolution of local EJBs (for backing session beans) and
+ remote EJBs (for injection as a Java EE resource) is delegated to
+ the container. You must provide an implementation of
<literal>org.jboss.webbeans.ejb.spi.EjbServices</literal> which
- provides these operations. Web Beans passes in the
- <literal>javax.inject.manager.InjectionPoint</literal> the
- resolution is for, as well as the <literal>NamingContext</literal>
- in use for each resolution request.
+ provides these operations. For resolving the <literal>@EJB</literal>
+ injection point, Web Beans will provide the
+ <literal>InjectionPoint</literal>; for resolving local EJBs, the
+ <literal>EjbDescriptor</literal> will be provided, and for remote
+ EJBs the <literal>jndiName</literal>, <literal>mappedName</literal>,
+ or <literal>ejbLink</literal> will be provided.
</para>
-<!-- <para>-->
-<!-- JSR-299 also requires that when the <literal>Bean.destroy()</literal>-->
-<!-- is called on a session bean that the container removes the stateful-->
-<!-- session bean. As there is no specified way of doing this, the-->
-<!-- <literal>EjbResolver.removeEjb()</literal> method is used by Web -->
-<!-- Beans to request the EJB container remove a stateful session bean.-->
-<!-- Web Beans assumes that the EJB container will invoke any-->
-<!-- <literal>@PreDestroy</literal> lifecycle callbacks.-->
-<!-- </para>-->
+ <para>
+ When resolving local EJBs (used to back session beans) a wrapper
+ (<literal>SessionObjectReference</literal>) around the EJB reference
+ is returned. This wrapper allows Web Beans to request a reference
+ that implements the given business interface, and, in the case of
+ SFSBs, request the removal of the EJB from the container.
+ </para>
</section>
@@ -187,24 +175,39 @@
<title>JPA services</title>
<para>
- Just as resolution of <literal>@EJB</literal> is delegated to the
- container, so is resolution of
- <literal>@PersistenceContext</literal>.
+ Just as EJB resolution is delegated to the container, resolution of
+ <literal>@PersistenceContext</literal> for injection into simple
+ beans (with the <literal>InjectionPoint</literal> provided),
+ and resolution of persistence contexts and persistence units (with
+ the <literal>unitName</literal> provided) for injection as a Java EE
+ resource is delegated to the container.
</para>
<para>
- OPEN ISSUE: Web Beans also requires the container to provide a list
- of entities in the deployment, so that they aren't discovered as
- simple beans.
+ To allow JPA integration, the <literal>JpaServices</literal>
+ interface should be implemented.
</para>
+
+ <para>
+ Web Beans also needs to know what entities are in a deployment (so
+ that they aren't managed by Web Beans). An implementation that
+ detects entities through <literal>@Entity</literal> and
+ <literal>orm.xml</literal> is provided by default. If you want to
+ provide support for a entities defined by a JPA provider (such as
+ Hibernate's <literal>.hbm.xml</literal> you can wrap or replace the
+ default implementation.
+ </para>
+
+ <programlisting><![CDATA[EntityDiscovery delegate = bootstrap.getServices().get(EntityDiscovery.class);]]></programlisting>
+
</section>
<section>
<title>Transaction Services</title>
<para>
- The Web Beans RI must delegate JTA activities to the container.
- The SPI provides a couple hooks to easily achieve this with the
+ Web Beans must delegate JTA activities to the container. The SPI
+ provides a couple hooks to easily achieve this with the
<literal>TransactionServices</literal> interface.
</para>
@@ -237,44 +240,98 @@
public boolean isTransactionActive();
}]]></programlisting>
- <para>
- The enumeration <literal>Status</literal> is a convenience for implementors
- to be able to keep track of whether a synchronization is supposed to notify
- an observer only when the transaction is successful, or after a failure, or
- regardless of the status of the transaction.
- </para>
+ <para>
+ The enumeration <literal>Status</literal> is a convenience for
+ implementors to be able to keep track of whether a synchronization
+ is supposed to notify an observer only when the transaction is
+ successful, or after a failure, or regardless of the status of the
+ transaction.
+ </para>
- <para>
- Any <literal>javax.transaction.Synchronization</literal> implementation
- may be passed to the <literal>registerSynchronization()</literal> method
- and the SPI implementation should immediately register the synchronization
- with the JTA transaction manager used for the EJBs.
- </para>
+ <para>
+ Any <literal>javax.transaction.Synchronization</literal>
+ implementation may be passed to the
+ <literal>registerSynchronization()</literal> method and the SPI
+ implementation should immediately register the synchronization with
+ the JTA transaction manager used for the EJBs.
+ </para>
- <para>
- To make it easier to determine whether or not a transaction is currently
- active for the requesting thread, the <literal>isTransactionActive()</literal>
- method can be used. The SPI implementation should query the same
- JTA transaction manager used for the EJBs.
- </para>
- </section>
+ <para>
+ To make it easier to determine whether or not a transaction is
+ currently active for the requesting thread, the
+ <literal>isTransactionActive()</literal> method can be used. The SPI
+ implementation should query the same JTA transaction manager used
+ for the EJBs.
+ </para>
+ </section>
+
+ <section>
+ <title>JMS services</title>
+
+ <para>
+ A number of JMS operations are not container specific, and so should
+ be provided via the SPI <literal>JmsServices</literal>.
+ JMS does not specify how to obtain a
+ <literal>ConnectionFactory</literal> so the SPI provides a method
+ which should be used to look up a factory. Web Beans also delegates
+ <literal>Destination</literal> lookup to the container via the SPI.
+ </para>
+ </section>
+
+ <section>
+ <title>Resource Services</title>
+
+ <para>
+ The resolution of <literal>@Resource</literal> (for injection into simple
+ beans) and the resolution of resources (for injection as a Java EE
+ resource) is delegated to the container. You must provide an
+ implementation of <literal>ResourceServices</literal> which
+ provides these operations. For resolving the
+ <literal>@Resource</literal> injection, Web Beans will provide the
+ <literal>InjectionPoint</literal>; and for Java EE resources, the
+ <literal>jndiName</literal> or <literal>mappedName</literal> will be
+ provided.
+ </para>
+ </section>
+
+ <section>
+ <title>Web Services</title>
+
+ <para>
+ The resolution of web service references (for injection as a Java EE
+ resource) is delegated to the container. You must provide an
+ implementation of <literal>WebServices</literal> whichprovides this
+ operation. For resolving the Java EE resource, the
+ <literal>jndiName</literal> or <literal>mappedName</literal> will be
+ provided.
+ </para>
+ </section>
+
+ <section>
+ <title>The bean store</title>
+
+ <para>
+ Web Beans uses a map like structure to store bean instances -
+ <literal>org.jboss.webbeans.context.api.BeanStore</literal>. You may
+ find
+ <literal>org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore</literal>
+ useful.
+ </para>
+ </section>
- <section>
+ <section>
<title>The application context</title>
<para>
Web Beans expects the Application Server or other container to
provide the storage for each application's context. The
<literal>org.jboss.webbeans.context.api.BeanStore</literal> should
- be implemented to provide an application scoped storage. You may
- find
- <literal>org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore</literal>
- useful.
+ be implemented to provide an application scoped storage.
</para>
- </section>
+ </section>
- <section>
+ <section>
<title>Bootstrap and shutdown</title>
<para>
The <literal>org.jboss.webbeans.bootstrap.api.Bootstrap</literal>
@@ -294,7 +351,10 @@
</para>
<para>
- The bootstrap supports multiple environments. Different environments
+ The bootstrap supports multiple environments. An environment is
+ defined by an implementation of the <literal>Environment</literal>
+ interface. A number of standard envrionments are built in as the
+ enumeration <literal>Environments</literal>. Different environments
require different services to be present (for example servlet
doesn't require transaction, EJB or JPA services). By default an
EE environment is assumed, but you can adjust the environment by
@@ -302,6 +362,13 @@
</para>
<para>
+ Web Beans uses a generic-typed service registry to allow services to
+ be registered. All services implement the <literal>Service</literal>
+ interface. The service registry allows services to be added and
+ retrieved.
+ </para>
+
+ <para>
To initialize the bootstrap you call
<literal>Bootstrap.initialize()</literal>. Before calling
<literal>initialize()</literal>, you must register any services
@@ -322,8 +389,9 @@
<para>
To shutdown the container you call
- <literal>Bootstrap.shutdown()</literal>. This allows the container
- to perform any cleanup operations needed.
+ <literal>Bootstrap.shutdown()</literal> or
+ <literal>webBeansManager.shutdown()</literal>. This allows the
+ container to perform any cleanup operations needed.
</para>
</section>
@@ -332,45 +400,30 @@
<title>JNDI</title>
<para>
- The Web Beans RI implements JNDI binding and lookup according to
- standards, however you may want to alter the binding and lookup (for
- example in an environment where JNDI isn't available). To do this,
- implement
- <literal>org.jboss.webbeans.resources.spi.NamingContext</literal>:
+ Web Beans delegates all JNDI operations to the container through the
+ SPI.
</para>
- <programlisting role="JAVA"><![CDATA[public interface NamingContext extends Serializable {
-
- /**
- * Typed JNDI lookup
- *
- * @param <T> The type
- * @param name The JNDI name
- * @param expectedType The expected type
- * @return The object
- */
- public <T> T lookup(String name, Class<? extends T> expectedType);
+ <note>
+ <para>
+ A number of the SPI interface require JNDI lookup, and the class
+ <literal>AbstractResourceServices</literal> provides JNDI/Java EE
+ spec compliant lookup methods.
+ </para>
+ </note>
+
- /**
- * Binds an item to JNDI
- *
- * @param name The key to bind under
- * @param value The item to bind
- */
- public void bind(String name, Object value);
-
-}]]></programlisting>
-
</section>
<section>
<title>Resource loading</title>
<para>
- The Web Beans RI needs to load classes and resources from the
- classpath at various times. By default, they are loaded from the
- same classloader that was used to load the RI, however this may not
- be correct for some environments. If this is case, you can implement
+ Web Beans needs to load classes and resources from the classpath at
+ various times. By default, they are loaded from the Thread Context
+ ClassLoader if available, if not the same classloader that was used
+ to load Web Beans, however this may not be correct for some
+ environments. If this is case, you can implement
<literal>org.jboss.webbeans.spi.ResourceLoader</literal>:
</para>
@@ -456,7 +509,7 @@
</varlistentry>
<varlistentry>
<term>
- Servlet listener and filters
+ Servlet
</term>
<listitem>
<para>
@@ -467,6 +520,24 @@
configuration, for each Web Beans application which uses
Servlet.
</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ JSF
+ </term>
+ <listitem>
+
+ <para>
+ If you are integrating the Web Beans into a JSF
+ environment you must register
+ <literal>org.jboss.webbeans.jsf.WebBeansPhaseListener</literal>
+ as a phase listener, and
+ <literal>org.jboss.webbeans.el.WebBeansELREsolver</literal> as
+ an EL resolver, either automatically, or through user
+ configuration, for each Web Beans application which uses
+ JSF.
+ </para>
<para>
If you are integrating the Web Beans into a JSF environment
@@ -477,6 +548,12 @@
JSF. This filter can be registered for all Servlet deployment
safely.
</para>
+
+ <note>
+ <para>
+ Web Beans only supports JSF 1.2 and above.
+ </para>
+ </note>
</listitem>
</varlistentry>
<varlistentry>
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/WebBeanDiscovery.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/WebBeanDiscovery.java 2009-04-16 12:12:33 UTC (rev 2430)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/WebBeanDiscovery.java 2009-04-16 12:33:10 UTC (rev 2431)
@@ -22,27 +22,27 @@
import org.jboss.webbeans.bootstrap.api.Service;
/**
- * A container should implement this interface to allow the Web Beans RI to
- * discover the Web Beans to deploy
+ * A container should implement this interface to allow Web Beans to
+ * discover the beans to deploy
*
* @author Pete Muir
*
*/
public interface WebBeanDiscovery extends Service
{
- public static final String PROPERTY_NAME = WebBeanDiscovery.class.getName();
/**
- * Gets list of all classes in classpath archives with web-beans.xml files
+ * Gets list of all classes in classpath archives with META-INF/beans.xml (or
+ * for WARs WEB-INF/beans.xml) files
*
* @return An iterable over the classes
*/
public Iterable<Class<?>> discoverWebBeanClasses();
/**
- * Gets a list of all web-beans.xml files in the app classpath
+ * Gets a list of all deployment descriptors in the app classpath
*
- * @return An iterable over the web-beans.xml files
+ * @return An iterable over the beans.xml files
*/
public Iterable<URL> discoverWebBeansXml();
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbDescriptor.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbDescriptor.java 2009-04-16 12:12:33 UTC (rev 2430)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbDescriptor.java 2009-04-16 12:33:10 UTC (rev 2431)
@@ -25,7 +25,7 @@
*
* @author Pete Muir
*
- * @param <T>
+ * @param <T> the bean type
*/
public interface EjbDescriptor<T>
{
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java 2009-04-16 12:12:33 UTC (rev 2430)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java 2009-04-16 12:33:10 UTC (rev 2431)
@@ -23,7 +23,7 @@
import org.jboss.webbeans.ejb.api.SessionObjectReference;
/**
- * A container should implement this interface to allow the Web Beans RI to
+ * A container should implement this interface to allow Web Beans to
* resolve EJB and discover EJBs
*
* @author Pete Muir
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/messaging/spi/JmsServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/messaging/spi/JmsServices.java 2009-04-16 12:12:33 UTC (rev 2430)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/messaging/spi/JmsServices.java 2009-04-16 12:33:10 UTC (rev 2431)
@@ -28,8 +28,18 @@
*/
public <T extends Destination> T resolveDestination(String jndiName, String mappedName);
+ /**
+ * Get a QueueConnectionFactory
+ *
+ * @return the queue connection factory
+ */
public QueueConnectionFactory getQueueConnectionFactory();
+ /**
+ * Get a TopicConnectionFactory
+ *
+ * @return
+ */
public TopicConnectionFactory getTopicConnectionFactory();
}
\ No newline at end of file
17 years
[webbeans-commits] Webbeans SVN: r2430 - in ri/trunk: impl/src/main/java/org/jboss/webbeans/xml and 5 other directories.
by webbeans-commits@lists.jboss.org
Author: vitold
Date: 2009-04-16 08:12:33 -0400 (Thu, 16 Apr 2009)
New Revision: 2430
Modified:
ri/trunk/impl/pom.xml
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/ParseXmlHelper.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/registrator/bean/ext/ResourceElementRegistrator.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/Order.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/parser/user-defined-beans.xml
ri/trunk/version-matrix/pom.xml
Log:
make 3.6
Modified: ri/trunk/impl/pom.xml
===================================================================
--- ri/trunk/impl/pom.xml 2009-04-16 11:21:41 UTC (rev 2429)
+++ ri/trunk/impl/pom.xml 2009-04-16 12:12:33 UTC (rev 2430)
@@ -86,26 +86,6 @@
</dependency>
<dependency>
- <groupId>msv</groupId>
- <artifactId>isorelax</artifactId>
- </dependency>
-
- <dependency>
- <groupId>msv</groupId>
- <artifactId>msv</artifactId>
- </dependency>
-
- <dependency>
- <groupId>msv</groupId>
- <artifactId>relaxngDatatype</artifactId>
- </dependency>
-
- <dependency>
- <groupId>msv</groupId>
- <artifactId>xsdlib</artifactId>
- </dependency>
-
- <dependency>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
<optional>true</optional>
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/ParseXmlHelper.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/ParseXmlHelper.java 2009-04-16 11:21:41 UTC (rev 2429)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/ParseXmlHelper.java 2009-04-16 12:12:33 UTC (rev 2430)
@@ -12,20 +12,19 @@
import java.util.Set;
import javax.inject.DefinitionException;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
import org.dom4j.Attribute;
import org.dom4j.Element;
import org.dom4j.Namespace;
import org.dom4j.QName;
-import org.iso_relax.verifier.Verifier;
-import org.iso_relax.verifier.VerifierConfigurationException;
-import org.iso_relax.verifier.VerifierFactory;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.resources.spi.ResourceLoadingException;
import org.xml.sax.SAXException;
-import com.sun.msv.verifier.jarv.TheFactoryImpl;
-
public class ParseXmlHelper
{
public static boolean isJavaEeNamespace(Element element)
@@ -148,31 +147,29 @@
{
Namespace namespace = (Namespace) namespacesIterator.next();
String prefix = namespace.getPrefix();
+ String uri = namespace.getURI();
- for(String uri : namespace.getURI().split(" "))
+ if (uri.startsWith(XmlConstants.URN_PREFIX))
{
- if (uri.startsWith(XmlConstants.URN_PREFIX))
- {
- Set<String> packagesSet = new HashSet<String>();
+ Set<String> packagesSet = new HashSet<String>();
- URL schemaUrl = environment.loadFileByUrn(uri, XmlConstants.SCHEMA_FILE_NAME);
- if(schemaUrl != null)
- validateXmlWithXsd(xmlUrl, schemaUrl);
-
- URL namespaceFile = environment.loadFileByUrn(uri, XmlConstants.NAMESPACE_FILE_NAME);
- if (namespaceFile != null)
- {
- packagesSet.addAll(parseNamespaceFile(namespaceFile));
- }
- else
- {
- String packageName = uri.replaceFirst(XmlConstants.URN_PREFIX, "");
- packagesSet.add(packageName);
- }
-
- addElementToPackagesMap(packagesMap, prefix, packagesSet);
+ URL schemaUrl = environment.loadFileByUrn(uri, XmlConstants.SCHEMA_FILE_NAME);
+ if(schemaUrl != null)
+ validateXmlWithXsd(xmlUrl, schemaUrl);
+
+ URL namespaceFile = environment.loadFileByUrn(uri, XmlConstants.NAMESPACE_FILE_NAME);
+ if (namespaceFile != null)
+ {
+ packagesSet.addAll(parseNamespaceFile(namespaceFile));
}
- }
+ else
+ {
+ String packageName = uri.replaceFirst(XmlConstants.URN_PREFIX, "");
+ packagesSet.add(packageName);
+ }
+
+ addElementToPackagesMap(packagesMap, prefix, packagesSet);
+ }
}
}
@@ -180,25 +177,22 @@
{
try
{
- VerifierFactory factory = new TheFactoryImpl();
- Verifier verifier = factory.newVerifier(schemaUrl.openStream());
- verifier.verify(xmlUrl.toExternalForm());
+ final StreamSource stream = new StreamSource(xmlUrl.toExternalForm());
+ final SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+ final Schema schema = schemaFactory.newSchema(schemaUrl);
+ final Validator validator = schema.newValidator();
+ validator.validate(stream);
}
- catch (VerifierConfigurationException e)
+ catch(SAXException e)
{
- String message = "VerifierConfigurationException while create verifier for " + schemaUrl;
+ String message = "SAXException while validate " + xmlUrl + " with " + schemaUrl;
throw new DefinitionException(message, e);
}
- catch (SAXException e)
+ catch(IOException e)
{
String message = "IOException while validate " + xmlUrl + " with " + schemaUrl;
throw new DefinitionException(message, e);
}
- catch (IOException e)
- {
- String message = "IOException while validate " + xmlUrl + " with " + schemaUrl;
- throw new DefinitionException(message, e);
- }
}
public static List<Element> findElementsInEeNamespace(Element elementParent, String elementName)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java 2009-04-16 11:21:41 UTC (rev 2429)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java 2009-04-16 12:12:33 UTC (rev 2430)
@@ -60,8 +60,8 @@
{
parseForArrays(document);
parseForAnnotationTypes(document);
+ parseForDeploy(document);
parseForBeans(document);
- parseForDeploy(document);
}
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/registrator/bean/ext/ResourceElementRegistrator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/registrator/bean/ext/ResourceElementRegistrator.java 2009-04-16 11:21:41 UTC (rev 2429)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/registrator/bean/ext/ResourceElementRegistrator.java 2009-04-16 12:12:33 UTC (rev 2430)
@@ -1,10 +1,20 @@
package org.jboss.webbeans.xml.registrator.bean.ext;
import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import javax.annotation.Resource;
+import javax.ejb.EJB;
+import javax.inject.Current;
+import javax.inject.DeploymentType;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceUnit;
+import javax.xml.ws.WebServiceRef;
+
import org.dom4j.Element;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bean.ee.AbstractJavaEEResourceBean;
@@ -17,6 +27,7 @@
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.persistence.spi.JpaServices;
import org.jboss.webbeans.resources.spi.ResourceServices;
+import org.jboss.webbeans.util.reflection.AnnotationImpl;
import org.jboss.webbeans.ws.spi.WebServices;
import org.jboss.webbeans.xml.ParseXmlHelper;
import org.jboss.webbeans.xml.XmlConstants;
@@ -169,12 +180,48 @@
private Class<? extends Annotation> obtainDeploymentType(Element beanElement)
{
+ Iterator<?> elIterator = beanElement.elementIterator();
+ while (elIterator.hasNext())
+ {
+ Element childElement = (Element) elIterator.next();
+ AnnotatedClass<?> childClass = ParseXmlHelper.loadElementClass(childElement, Object.class, environment, packagesMap);
+ if(childClass.getRawType().isAnnotation() && childClass.isAnnotationPresent(DeploymentType.class))
+ return ParseXmlHelper.loadAnnotationClass(childElement, Annotation.class, environment, packagesMap);
+ }
+
return null;
}
private Set<Annotation> obtainBindings(Element beanElement)
{
- return null;
+ Set<Annotation> result = new HashSet<Annotation>();
+
+ Iterator<?> elIterator = beanElement.elementIterator();
+ while (elIterator.hasNext())
+ {
+ Element childElement = (Element) elIterator.next();
+ AnnotatedClass<?> childClass = ParseXmlHelper.loadElementClass(childElement, Object.class, environment, packagesMap);
+ if(childClass.getRawType().isAnnotation() && !childClass.isAnnotationPresent(DeploymentType.class) &&
+ !childClass.getRawType().equals(Resource.class) && !childClass.getRawType().equals(PersistenceContext.class) &&
+ !childClass.getRawType().equals(PersistenceUnit.class) && !childClass.getRawType().equals(EJB.class) &&
+ !childClass.getRawType().equals(WebServiceRef.class))
+ {
+ Class<?> annotationClass = childClass.getRawType();
+ Method[] annotationMethods = annotationClass.getDeclaredMethods();
+ AnnotationImpl annotation = new AnnotationImpl(annotationClass, annotationMethods);
+ result.add(annotation);
+ }
+ }
+
+ if(result.size() == 0)
+ {
+ Class<?> annotationClass = Current.class;
+ Method[] annotationMethods = annotationClass.getDeclaredMethods();
+ AnnotationImpl annotation = new AnnotationImpl(annotationClass, annotationMethods);
+ result.add(annotation);
+ }
+
+ return result;
}
private String obtainElementValue(Element elementParent, String elementName)
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/Order.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/Order.java 2009-04-16 11:21:41 UTC (rev 2429)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/Order.java 2009-04-16 12:12:33 UTC (rev 2430)
@@ -1,25 +1,34 @@
package org.jboss.webbeans.test.unit.xml.beans;
+import javax.context.Dependent;
+import javax.inject.Current;
+import javax.inject.Initializer;
+import javax.inject.manager.Manager;
+
import org.jboss.webbeans.test.unit.xml.beans.annotationtype.TestBindingType;
+import org.jboss.webbeans.test.unit.xml.beans.annotationtype.TestDeploymentType;
import org.jboss.webbeans.test.unit.xml.beans.annotationtype.TestInterceptorBindingType;
import org.jboss.webbeans.test.unit.xml.beans.annotationtype.TestStereotype;
@TestBindingType
@TestInterceptorBindingType
@TestStereotype
+@TestDeploymentType
public class Order
{
- public int val;
+ private boolean active;
- public String[] strArray;
-
- public Order(int val)
+ @Initializer
+ public Order(@Current Manager manager)
{
- this.val = val;
+ if (manager.getContext(Dependent.class).isActive())
+ {
+ active = true;
+ }
}
- public int getVal()
+ public boolean isActive()
{
- return val;
+ return active;
}
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java 2009-04-16 11:21:41 UTC (rev 2429)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java 2009-04-16 12:12:33 UTC (rev 2430)
@@ -3,6 +3,7 @@
import java.lang.annotation.Annotation;
import java.net.URL;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
import javax.inject.manager.Bean;
@@ -52,20 +53,24 @@
assert parserEnv.getClasses().size() == 1;
}
-// @Test
+ @Test
public void testDd()
{
XmlEnvironment parserEnv = new MockXmlEnvironment(getResources("user-defined-beans.xml"), new EjbDescriptorCache());
XmlParser parser = new XmlParser(parserEnv);
+
+ List<Class<? extends Annotation>> dTypes1 = parserEnv.getManager().getEnabledDeploymentTypes();
+
parser.parse();
ManagerImpl manager = parserEnv.getManager();
Set<Bean<Order>> beansSet = manager.resolveByType(Order.class);
+ List<Class<? extends Annotation>> dTypes = manager.getEnabledDeploymentTypes();
for(Bean<Order> bean : beansSet)
{
Class<? extends Annotation> deploymentType = bean.getDeploymentType();
- System.out.println(bean.getClass());
+ System.out.println("after parsing: " + deploymentType);
}
}
}
Modified: ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/parser/user-defined-beans.xml
===================================================================
--- ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/parser/user-defined-beans.xml 2009-04-16 11:21:41 UTC (rev 2429)
+++ ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/parser/user-defined-beans.xml 2009-04-16 12:12:33 UTC (rev 2430)
@@ -1,5 +1,6 @@
<Beans xmlns="urn:java:ee"
xmlns:myapp="urn:java:org.jboss.webbeans.test.unit.xml.parser"
+ xmlns:manager="urn:java:javax.inject.manager"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:java:ee
urn:java:org.jboss.webbeans.test.unit.xml.parser http://mydomain.com/myapp/schema-1.2.xsd">
@@ -25,19 +26,19 @@
</myapp:TestStereotype>
<myapp:Order>
- <RequestScoped />
<myapp:TestBindingType />
<myapp:TestInterceptorBindingType />
<myapp:TestStereotype />
- <myapp:TestDeploymentType />
- <myapp:val />
- <Array>
- <String />
- </Array>
- <Integer />
- <myapp:getVal />
+ <myapp:TestDeploymentType />
+ <myapp:isActive />
+ <manager:Manager />
</myapp:Order>
<myapp:PaymentService>
+ <RequestScoped />
+ <myapp:TestBindingType />
+ <myapp:TestInterceptorBindingType />
+ <myapp:TestStereotype />
+ <myapp:TestDeploymentType />
<Resource>
<name>java:app/service/PaymentService</name>
</Resource>
Modified: ri/trunk/version-matrix/pom.xml
===================================================================
--- ri/trunk/version-matrix/pom.xml 2009-04-16 11:21:41 UTC (rev 2429)
+++ ri/trunk/version-matrix/pom.xml 2009-04-16 12:12:33 UTC (rev 2430)
@@ -116,30 +116,6 @@
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
-
- <dependency>
- <groupId>msv</groupId>
- <artifactId>msv</artifactId>
- <version>20050913</version>
- </dependency>
-
- <dependency>
- <groupId>msv</groupId>
- <artifactId>isorelax</artifactId>
- <version>20050913</version>
- </dependency>
-
- <dependency>
- <groupId>msv</groupId>
- <artifactId>relaxngDatatype</artifactId>
- <version>20050913</version>
- </dependency>
-
- <dependency>
- <groupId>msv</groupId>
- <artifactId>xsdlib</artifactId>
- <version>20050913</version>
- </dependency>
<dependency>
<groupId>jaxen</groupId>
17 years
[webbeans-commits] Webbeans SVN: r2429 - extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-16 07:21:41 -0400 (Thu, 16 Apr 2009)
New Revision: 2429
Modified:
extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansApplication.java
extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansComponentInstantiationListener.java
extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansMetaData.java
extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansRequestCycle.java
extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansWebRequestCycleProcessor.java
Log:
ws
Modified: extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansApplication.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansApplication.java 2009-04-16 11:17:22 UTC (rev 2428)
+++ extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansApplication.java 2009-04-16 11:21:41 UTC (rev 2429)
@@ -10,13 +10,17 @@
import org.apache.wicket.request.IRequestCycleProcessor;
/**
- * A convenience subclass of wicket's WebApplication which adds the hooks necessary to use JSR-299 injections
- * in wicket components, as well as manage JSR-299 conversation scopes with Wicket page metadata. If you have
- * your own WebApplication subclass, and can't subclass this class, you just need to do the three things that this
- * class does, i.e. register the WebBeansComponentInstantiationListener, and override the two methods below to return
- * the RequestCycle and IRequestCycleProcessor subclasses specific to WebBeans, or your subclasses of those classes.
+ * A convenience subclass of wicket's WebApplication which adds the hooks
+ * necessary to use JSR-299 injections in wicket components, as well as manage
+ * JSR-299 conversation scopes with Wicket page metadata. If you have your own
+ * WebApplication subclass, and can't subclass this class, you just need to do
+ * the three things that this class does, i.e. register the
+ * WebBeansComponentInstantiationListener, and override the two methods below to
+ * return the RequestCycle and IRequestCycleProcessor subclasses specific to
+ * WebBeans, or your subclasses of those classes.
+ *
* @author cpopetz
- *
+ *
* @see WebApplication
* @see WebBeansWebRequestCycleProcessor
* @see WebBeansRequestCycle
@@ -25,6 +29,7 @@
{
/**
* Use the constructor to add our component instantiation listener
+ *
* @see WebBeansComponentInstantiationListener
*/
public WebBeansApplication()
@@ -34,6 +39,7 @@
/**
* Override to return our WebBeans-specific request cycle processor
+ *
* @see WebBeansWebRequestCycleProcessor
*/
@Override
@@ -44,6 +50,7 @@
/**
* Override to return our WebBeans-specific request cycle
+ *
* @see WebBeansRequestCycle
*/
@Override
Modified: extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansComponentInstantiationListener.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansComponentInstantiationListener.java 2009-04-16 11:17:22 UTC (rev 2428)
+++ extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansComponentInstantiationListener.java 2009-04-16 11:21:41 UTC (rev 2429)
@@ -6,10 +6,12 @@
import org.jboss.webbeans.manager.api.WebBeansManager;
/**
- * This listener uses the WebBeansManager to handle injections for all wicket components.
+ * This listener uses the WebBeansManager to handle injections for all wicket
+ * components.
+ *
* @author cpopetz
* @see WebBeansManager
- *
+ *
*/
public class WebBeansComponentInstantiationListener implements IComponentInstantiationListener
{
Modified: extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansMetaData.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansMetaData.java 2009-04-16 11:17:22 UTC (rev 2428)
+++ extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansMetaData.java 2009-04-16 11:21:41 UTC (rev 2429)
@@ -3,10 +3,11 @@
import org.apache.wicket.MetaDataKey;
/**
- * Public storage for the metadata key used by the WebBeans integration to store
+ * Public storage for the metadata key used by the WebBeans integration to store
* conversation ids in wicket page metadata.
+ *
* @author cpopetz
- *
+ *
*/
public class WebBeansMetaData
{
@@ -15,7 +16,8 @@
* This is the key we will use to to store the conversation metadata in the
* wicket page.
*/
- public static final MetaDataKey CID = new MetaDataKey(String.class) {
+ public static final MetaDataKey CID = new MetaDataKey(String.class)
+ {
private static final long serialVersionUID = -8788010688731927318L;
};
}
Modified: extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansRequestCycle.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansRequestCycle.java 2009-04-16 11:17:22 UTC (rev 2428)
+++ extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansRequestCycle.java 2009-04-16 11:21:41 UTC (rev 2429)
@@ -17,91 +17,100 @@
import org.jboss.webbeans.servlet.ConversationBeanStore;
/**
- * WebBeansRequestCycle is a subclass of the standard wicket WebRequestCycle which:
+ * WebBeansRequestCycle is a subclass of the standard wicket WebRequestCycle
+ * which:
* <ul>
- * <li>restores long-running conversations specified in wicket page metadata when a page target is first used.
- * <li>propagates long running conversations to new page targets by specifying the above metadata
- * <li>propagates long running conversations across redirects through the use of a request parameter if the
- * redirect is handled with a BookmarkablePageRequest
- * <li> Sets up the conversational context
+ * <li>restores long-running conversations specified in wicket page metadata
+ * when a page target is first used.
+ * <li>propagates long running conversations to new page targets by specifying
+ * the above metadata
+ * <li>propagates long running conversations across redirects through the use of
+ * a request parameter if the redirect is handled with a BookmarkablePageRequest
+ * <li>Sets up the conversational context
* </ul>
- * @see WebBeansWebRequestCycleProcessor Which handles propogation of conversation data for newly-started
- * long running conversations, by storing their ids in the page metadata
+ *
+ * @see WebBeansWebRequestCycleProcessor Which handles propogation of
+ * conversation data for newly-started long running conversations, by
+ * storing their ids in the page metadata
* @author cpopetz
- *
+ *
*/
public class WebBeansRequestCycle extends WebRequestCycle
{
+
public WebBeansRequestCycle(WebApplication application, WebRequest request, Response response)
{
super(application, request, response);
}
/**
- * Override to set up the conversation context and to choose the conversation if a conversation id
- * is present in target metadata.
+ * Override to set up the conversation context and to choose the conversation
+ * if a conversation id is present in target metadata.
*/
@Override
protected void onRequestTargetSet(IRequestTarget target)
{
super.onRequestTargetSet(target);
-
+
Page page = null;
if (target instanceof IPageRequestTarget)
{
page = ((IPageRequestTarget) target).getPage();
}
-
- //Two possible specifications of cid: page metadata or request url; the latter is used
- //to propagate the conversation to mounted (bookmarkable) paths after a redirect
-
+
+ // Two possible specifications of cid: page metadata or request url; the
+ // latter is used to propagate the conversation to mounted (bookmarkable)
+ // paths after a redirect
+
String specifiedCid = null;
- if (page != null)
+ if (page != null)
{
specifiedCid = (String) page.getMetaData(WebBeansMetaData.CID);
}
- else
+ else
{
specifiedCid = request.getParameter("cid");
}
-
+
Manager manager = CurrentManager.rootManager();
Conversation conversation = manager.getInstanceByType(Conversation.class);
-
- //restore a conversation if it exists
+
+ // restore a conversation if it exists
if (specifiedCid != null)
{
// Restore this conversation
manager.getInstanceByType(ConversationManager.class).beginOrRestoreConversation(specifiedCid);
}
-
- //handle propagation of existing long running converstaions to new targets
- if (conversation.isLongRunning())
+
+ // handle propagation of existing long running converstaions to new
+ // targets
+ if (conversation.isLongRunning())
{
- //Note that we can't propagate conversations with other redirect targets like
- //RequestRedirectTarget through this mechanism, because it does not provide an
- //interface to modify its target URL. If propagation with those targets is to be supported,
- //it needs a custom Response subclass.
+ // Note that we can't propagate conversations with other redirect
+ // targets like RequestRedirectTarget through this mechanism, because
+ // it does not provide an interface to modify its target URL. If
+ // propagation with those targets is to be supported, it needs a custom
+ // Response subclass.
if (isRedirect() && target instanceof BookmarkablePageRequestTarget)
{
BookmarkablePageRequestTarget bookmark = (BookmarkablePageRequestTarget) target;
- //if a cid has already been specified, don't override it
+ // if a cid has already been specified, don't override it
if (!bookmark.getPageParameters().containsKey("cid"))
bookmark.getPageParameters().add("cid", conversation.getId());
}
-
- //If we have a target page, propagate the conversation to the page's metadata
+
+ // If we have a target page, propagate the conversation to the page's
+ // metadata
if (page != null)
{
page.setMetaData(WebBeansMetaData.CID, conversation.getId());
}
}
-
- //Now set up the conversational context if it isn't already
+
+ // Now set up the conversational context if it isn't already
if (!ConversationContext.INSTANCE.isActive())
{
- ConversationContext.INSTANCE.setBeanStore(
- new ConversationBeanStore(((WebRequest)request).getHttpServletRequest().getSession(), conversation.getId()));
+ ConversationContext.INSTANCE.setBeanStore(new ConversationBeanStore(((WebRequest) request).getHttpServletRequest().getSession(), conversation.getId()));
ConversationContext.INSTANCE.setActive(true);
}
}
Modified: extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansWebRequestCycleProcessor.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansWebRequestCycleProcessor.java 2009-04-16 11:17:22 UTC (rev 2428)
+++ extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansWebRequestCycleProcessor.java 2009-04-16 11:21:41 UTC (rev 2429)
@@ -10,17 +10,19 @@
import org.jboss.webbeans.conversation.ConversationManager;
/**
- * WebBeansWebRequestCycleProcessor is a subclass of the standard wicket WebRequestCycleProcessor which saves the conversation id
- * of any long-running cornversation in wicket page metadata. It also cleans up the conversation context.
+ * WebBeansWebRequestCycleProcessor is a subclass of the standard wicket
+ * WebRequestCycleProcessor which saves the conversation id of any long-running
+ * cornversation in wicket page metadata. It also cleans up the conversation
+ * context.
*
* @author cpopetz
- *
+ *
*/
-
public class WebBeansWebRequestCycleProcessor extends WebRequestCycleProcessor
{
/**
- * If a long running conversation has been started, store its id into page metadata
+ * If a long running conversation has been started, store its id into page
+ * metadata
*/
@Override
public void respond(RequestCycle requestCycle)
17 years
[webbeans-commits] Webbeans SVN: r2428 - ri/trunk/impl/src/main/java/org/jboss/webbeans/util/reflection.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-16 07:17:22 -0400 (Thu, 16 Apr 2009)
New Revision: 2428
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/reflection/AnnotationImpl.java
Log:
Add an implementation of Annotation
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/reflection/AnnotationImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/reflection/AnnotationImpl.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/reflection/AnnotationImpl.java 2009-04-16 11:17:22 UTC (rev 2428)
@@ -0,0 +1,125 @@
+/*
+* 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.util.reflection;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import javax.inject.ExecutionException;
+
+
+/**
+ * Supports instantiation of annotation type instances.
+ *
+ * @author Pete Muir
+ * @author Gavin King
+ *
+ * @param <T>
+ * the annotation type
+ */
+public class AnnotationImpl<T extends Annotation> implements Annotation
+{
+
+ private final Class<T> annotationType;
+ private final Method[] members;
+
+ public AnnotationImpl(Class<T> annotationType, Method[] members)
+ {
+ this.annotationType = annotationType;
+ this.members = members;
+ }
+
+ public Class<? extends Annotation> annotationType()
+ {
+ return annotationType;
+ }
+
+ @Override
+ public String toString()
+ {
+ String string = "@" + annotationType().getName() + "(";
+ for (int i = 0; i < members.length; i++)
+ {
+ string += members[i].getName() + "=";
+ string += invoke(members[i], this);
+ if (i < members.length - 1)
+ {
+ string += ",";
+ }
+ }
+ return string + ")";
+ }
+
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other instanceof Annotation)
+ {
+ Annotation that = (Annotation) other;
+ if (this.annotationType().equals(that.annotationType()))
+ {
+ for (Method member : members)
+ {
+ Object thisValue = invoke(member, this);
+ Object thatValue = invoke(member, that);
+ if (!thisValue.equals(thatValue))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int hashCode = 0;
+ for (Method member : members)
+ {
+ int memberNameHashCode = 127 * member.getName().hashCode();
+ int memberValueHashCode = invoke(member, this).hashCode();
+ hashCode += memberNameHashCode ^ memberValueHashCode;
+ }
+ return hashCode;
+ }
+
+ private static Object invoke(Method method, Object instance)
+ {
+ try
+ {
+ method.setAccessible(true);
+ return method.invoke(instance);
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new ExecutionException("Error checking value of member method " + method.getName() + " on " + method.getDeclaringClass(), e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new ExecutionException("Error checking value of member method " + method.getName() + " on " + method.getDeclaringClass(), e);
+ }
+ catch (InvocationTargetException e)
+ {
+ throw new ExecutionException("Error checking value of member method " + method.getName() + " on " + method.getDeclaringClass(), e);
+ }
+ }
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/reflection/AnnotationImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years