[webbeans-commits] Webbeans SVN: r514 - in ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test: contexts and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2008-12-13 17:17:48 -0500 (Sat, 13 Dec 2008)
New Revision: 514
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/DependentContextTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/NormalContextTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java
Removed:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NormalContextTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/PassivatingContextTest.java
Log:
Move contexts test into own package.
Update dependent context tests to 20081206
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java 2008-12-13 21:51:48 UTC (rev 513)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java 2008-12-13 22:17:48 UTC (rev 514)
@@ -1,578 +0,0 @@
-package org.jboss.webbeans.test;
-
-import static org.jboss.webbeans.util.BeanFactory.createProducerMethodBean;
-import static org.jboss.webbeans.util.BeanFactory.createSimpleBean;
-
-import java.lang.reflect.Method;
-
-import javax.webbeans.ContextNotActiveException;
-import javax.webbeans.Dependent;
-import javax.webbeans.manager.Bean;
-
-import org.jboss.webbeans.bean.ProducerMethodBean;
-import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.contexts.DependentContext;
-import org.jboss.webbeans.test.beans.Fox;
-import org.jboss.webbeans.test.beans.FoxRun;
-import org.jboss.webbeans.test.beans.SpiderProducer;
-import org.jboss.webbeans.test.beans.Tarantula;
-import org.testng.annotations.Test;
-
-@SpecVersion("20081206")
-public class DependentContextTest extends AbstractTest
-{
-
- /**
- * No injected instance of the Web Bean is ever shared between multiple
- * injection points.
- */
- @Test(groups = { "contexts", "injection" })
- @SpecAssertion(section = "9.4")
- public void testInstanceNotSharedBetweenInjectionPoints()
- {
- Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
- Bean<Fox> foxBean = createSimpleBean(Fox.class);
- manager.addBean(foxBean);
- FoxRun foxRun = foxRunBean.create();
- assert !foxRun.fox.equals(foxRun.anotherFox);
- }
-
- /**
- * Any instance of the Web Bean that is used to evaluate a Unified EL
- * expression exists to service that evaluation only.
- */
- @Test(groups = { "stub", "contexts", "el" })
- @SpecAssertion(section = "9.4")
- public void testInstanceUsedForElEvalutionNotShared()
- {
- assert false;
- }
-
- /**
- * Any instance of the Web Bean that receives a producer method, producer
- * field, disposal method or observer method invocation exists to service
- * that invocation only
- */
- @Test(groups = { "contexts", "producerMethod" })
- @SpecAssertion(section = "9.4")
- public void testInstanceUsedForProducerMethodNotShared() throws Exception
- {
- SimpleBean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
- manager.addBean(spiderProducer);
- Method method = SpiderProducer.class.getMethod("produceTarantula");
- ProducerMethodBean<Tarantula> tarantulaBean = createProducerMethodBean(Tarantula.class, method, spiderProducer);
- Tarantula tarantula = tarantulaBean.create();
- Tarantula tarantula2 = tarantulaBean.create();
- assert tarantula != null;
- assert tarantula2 != null;
- assert tarantula != tarantula2;
- }
-
- /**
- * Any instance of the Web Bean that receives a producer method, producer
- * field, disposal method or observer method invocation exists to service
- * that invocation only
- */
- @Test(groups = { "contexts", "producerMethod", "stub" })
- @SpecAssertion(section = "9.4")
- public void testInstanceUsedForProducerFieldNotShared() throws Exception
- {
- assert false;
- }
-
- /**
- * Any instance of the Web Bean that receives a producer method, producer
- * field, disposal method or observer method invocation exists to service
- * that invocation only
- */
- @Test(groups = { "stub", "contexts", "disposalMethod" })
- @SpecAssertion(section = "9.4")
- public void testInstanceUsedForDisposalMethodNotShared()
- {
- assert false;
- }
-
- /**
- * Any instance of the Web Bean that receives a producer method, producer
- * field, disposal method or observer method invocation exists to service
- * that invocation only
- */
- @Test(groups = { "stub", "contexts", "observerMethod" })
- @SpecAssertion(section = "9.4")
- public void testInstanceUsedForObserverMethodNotShared()
- {
- assert false;
- }
-
- /**
- * Every invocation of the get() operation of the Context object for the @Dependent
- * scope with the value true for the create parameter returns a new instance
- * of the given Web Bean
- */
- @Test(groups = "contexts")
- @SpecAssertion(section = "9.4")
- public void testContextGetWithCreateTrueReturnsNewInstance()
- {
- Bean<Fox> foxBean = createSimpleBean(Fox.class);
- manager.addBean(foxBean);
- DependentContext context = new DependentContext();
- context.setActive(true);
- assert context.get(foxBean, true) != null;
- assert context.get(foxBean, true) instanceof Fox;
- }
-
- /**
- * Every invocation of the get() operation of the Context object for the @Dependent
- * scope with the value false for the create parameter returns a null value
- */
- @Test(groups = "contexts")
- @SpecAssertion(section = "9.4")
- public void testContextGetWithCreateFalseReturnsNull()
- {
- Bean<Fox> foxBean = createSimpleBean(Fox.class);
- manager.addBean(foxBean);
- DependentContext context = new DependentContext();
- context.setActive(true);
- assert context.get(foxBean, false) == null;
- }
-
- /**
- * The @Dependent scope is inactive except:
- */
- @Test(groups = "contexts", expectedExceptions = ContextNotActiveException.class)
- @SpecAssertion(section = "9.4")
- public void testContextIsInactive()
- {
- manager.getContext(Dependent.class).isActive();
- }
-
- /**
- * when an instance of a Web Bean with scope @Dependent is created by the Web
- * Bean manager to receive a producer method, producer field, disposal method
- * or observer method invocation, or
- */
- @Test(groups = { "stub", "contexts", "producerMethod" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveWhenInvokingProducerMethod()
- {
- assert false;
- }
-
- /**
- * when an instance of a Web Bean with scope @Dependent is created by the Web
- * Bean manager to receive a producer method, producer field, disposal method
- * or observer method invocation, or
- */
- @Test(groups = { "stub", "contexts", "producerField" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveWhenInvokingProducerField()
- {
- assert false;
- }
-
- /**
- * when an instance of a Web Bean with scope @Dependent is created by the Web
- * Bean manager to receive a producer method, producer field, disposal method
- * or observer method invocation, or
- */
- @Test(groups = { "stub", "contexts", "disposalMethod" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveWhenInvokingDisposalMethod()
- {
- assert false;
- }
-
- /**
- * when an instance of a Web Bean with scope @Dependent is created by the Web
- * Bean manager to receive a producer method, producer field, disposal method
- * or observer method invocation, or
- */
- @Test(groups = { "stub", "contexts", "observerMethod" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveWhenInvokingObserverMethod()
- {
- assert false;
- }
-
- /**
- * while a Unified EL expression is evaluated, or
- */
- @Test(groups = { "stub", "contexts", "el" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveWhenEvaluatingElExpression()
- {
- assert false;
- }
-
- /**
- * when the Web Bean manager is creating or destroying a Web Bean instance or
- * injecting its dependencies, or
- */
- @Test(groups = { "contexts", "beanLifecycle" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringBeanCreation()
- {
- // Slightly roundabout, but I can't see a better way to test atm
- Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
- Bean<Fox> foxBean = createSimpleBean(Fox.class);
- manager.addBean(foxBean);
- FoxRun foxRun = foxRunBean.create();
- assert foxRun.fox != null;
- }
-
- /**
- * when the Web Bean manager is creating or destroying a Web Bean instance or
- * injecting its dependencies, or
- */
- @Test(groups = { "stub", "contexts", "beanDestruction" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringBeanDestruction()
- {
- assert false;
- }
-
- /**
- * when the Web Bean manager is creating or destroying a Web Bean instance or
- * injecting its dependencies, or
- */
- @Test(groups = { "contexts", "injection" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringInjection()
- {
- Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
- Bean<Fox> foxBean = createSimpleBean(Fox.class);
- manager.addBean(foxBean);
- FoxRun foxRun = foxRunBean.create();
- assert foxRun.fox != null;
- }
-
- /**
- * when the Web Bean manager is injecting dependencies of an EJB bean or
- * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
- * invoked by the EJB container
- */
- @Test(groups = { "contexts", "injection", "stub", "ejb3" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringEJBDependencyInjection()
- {
- assert false;
- }
-
- /**
- * when the Web Bean manager is injecting dependencies of an EJB bean or
- * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
- * invoked by the EJB container
- */
- @Test(groups = { "contexts", "injection", "stub", "servlet" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringServletDependencyInjection()
- {
- assert false;
- }
-
- /**
- * when the Web Bean manager is injecting dependencies of an EJB bean or
- * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
- * invoked by the EJB container
- */
- @Test(groups = { "contexts", "postconstruct", "stub", "ejb3" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringEJBPostConstruct()
- {
- assert false;
- }
-
- /**
- * when the Web Bean manager is injecting dependencies of an EJB bean or
- * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
- * invoked by the EJB container
- */
- @Test(groups = { "contexts", "predestroy", "stub", "ejb3" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringEJBPreDestroy()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "constructor" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromConstructor()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "removeMethod" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromRemoveMethod()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "initalizerMethod" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromInitializerMethod()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "producerMethod" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromProducerMethod()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "disposalMethod" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromDisposalMethod()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "preDestroy" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromPreDestroy()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "postConstruct" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromPostConstruct()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "interceptor" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromInterceptorOfActiveMethod()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "decorator" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromDecoratorOfActiveMethod()
- {
- assert false;
- }
-
- /**
- * An EJB bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from initializer methods, from @PostConstruct
- * and @PreDestroy callbacks and from Web Beans interceptors for these
- * methods.
- */
- @Test(groups = { "stub", "contexts", "ejb3", "initializerMethod" })
- @SpecAssertion(section = "9.4.1")
- public void testEjbBeanMayCreateInstanceFromInitializer()
- {
- assert false;
- }
-
- /**
- * An EJB bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from initializer methods, from @PostConstruct
- * and @PreDestroy callbacks and from Web Beans interceptors for these
- * methods.
- */
- @Test(groups = { "stub", "contexts", "ejb3", "postConstruct" })
- @SpecAssertion(section = "9.4.1")
- public void testEjbBeanMayCreateInstanceFromPostConstruct()
- {
- assert false;
- }
-
- /**
- * An EJB bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from initializer methods, from @PostConstruct
- * and @PreDestroy callbacks and from Web Beans interceptors for these
- * methods.
- */
- @Test(groups = { "stub", "contexts", "ejb3", "preDestroy" })
- @SpecAssertion(section = "9.4.1")
- public void testEjbBeanMayCreateInstanceFromPreDestroy()
- {
- assert false;
- }
-
- /**
- * An EJB bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from initializer methods, from @PostConstruct
- * and @PreDestroy callbacks and from Web Beans interceptors for these
- * methods.
- */
- @Test(groups = { "stub", "contexts", "ejb3", "interceptor" })
- @SpecAssertion(section = "9.4.1")
- public void testEjbBeanMayCreateInstanceFromInterceptorOfActiveMethod()
- {
- assert false;
- }
-
- /**
- * A Servlet may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from initializer methods
- */
- @Test(groups = { "stub", "contexts", "servlet", "initializerMethod" })
- @SpecAssertion(section = "9.4.1")
- public void testServletBeanMayCreateInstanceFromInitializer()
- {
- assert false;
- }
-
- /**
- * destroy all dependent objects of a Web Bean instance when the instance is
- * destroyed,
- */
- @Test(groups = { "stub", "contexts", "beanDestruction" })
- @SpecAssertion(section = "9.4.2")
- public void testDestroyingParentDestroysDependents()
- {
- assert false;
- }
-
- /**
- * destroy all dependent objects of an EJB bean or Servlet when the EJB bean
- * or Servlet is destroyed,
- */
- @Test(groups = { "stub", "contexts", "ejb3" })
- @SpecAssertion(section = "9.4.2")
- public void testDestroyingEjbDestroysDependents()
- {
- assert false;
- }
-
- /**
- * destroy all dependent objects of an EJB bean or Servlet when the EJB bean
- * or Servlet is destroyed,
- */
- @Test(groups = { "stub", "contexts", "servlet" })
- @SpecAssertion(section = "9.4.2")
- public void testDestroyingServletDestroysDependents()
- {
- assert false;
- }
-
- /**
- * destroy all @Dependent scoped contextual instances created during an EL
- * expression evaluation when the evaluation completes, and
- */
- @Test(groups = { "stub", "contexts", "el" })
- @SpecAssertion(section = "9.4.2")
- public void testDependentsDestroyedWhenElEvaluationCompletes()
- {
- assert false;
- }
-
- /**
- * destroy any @Dependent scoped contextual instance created to receive a
- * producer method, producer field, disposal method or observer method
- * invocation when the invocation completes
- */
- @Test(groups = { "stub", "contexts", "producerMethod" })
- @SpecAssertion(section = "9.4.2")
- public void testDependentsDestroyedWhenProducerMethodCompletes()
- {
- assert false;
- }
-
- /**
- * destroy any @Dependent scoped contextual instance created to receive a
- * producer method, producer field, disposal method or observer method
- * invocation when the invocation completes
- */
- @Test(groups = { "stub", "contexts", "producerField" })
- @SpecAssertion(section = "9.4.2")
- public void testDependentsDestroyedWhenProducerFieldCompletes()
- {
- assert false;
- }
-
- /**
- * destroy any @Dependent scoped contextual instance created to receive a
- * producer method, producer field, disposal method or observer method
- * invocation when the invocation completes
- */
- @Test(groups = { "stub", "contexts", "disposalMethod" })
- @SpecAssertion(section = "9.4.2")
- public void testDependentsDestroyedWhenDisposalMethodCompletes()
- {
- assert false;
- }
-
- /**
- * destroy any @Dependent scoped contextual instance created to receive a
- * producer method, producer field, disposal method or observer method
- * invocation when the invocation completes
- */
- @Test(groups = { "stub", "contexts", "observerMethod" })
- @SpecAssertion(section = "9.4")
- public void testDependentsDestroyedWhenObserverMethodEvaluationCompletes()
- {
- assert false;
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NormalContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NormalContextTest.java 2008-12-13 21:51:48 UTC (rev 513)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NormalContextTest.java 2008-12-13 22:17:48 UTC (rev 514)
@@ -1,77 +0,0 @@
-package org.jboss.webbeans.test;
-
-import static org.jboss.webbeans.util.BeanFactory.createProducerMethodBean;
-import static org.jboss.webbeans.util.BeanFactory.createSimpleBean;
-
-import java.lang.reflect.Method;
-
-import javax.webbeans.ContextNotActiveException;
-import javax.webbeans.manager.Bean;
-import javax.webbeans.manager.Context;
-
-import org.jboss.webbeans.bean.ProducerMethodBean;
-import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.contexts.AbstractContext;
-import org.jboss.webbeans.contexts.RequestContext;
-import org.jboss.webbeans.test.beans.SpiderProducer;
-import org.jboss.webbeans.test.beans.Tarantula;
-import org.jboss.webbeans.test.beans.Tuna;
-import org.jboss.webbeans.util.BeanFactory;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Nicklas Karlsson (nickarls(a)gmail.com)
- * @author Pete Muir
- *
- * This class tests a basic context against section 8 of the specification
- *
- */
-@SpecVersion("PDR")
-public class NormalContextTest extends AbstractTest
-{
- Context context;
-
- @BeforeMethod
- public void initContext() {
- context = new RequestContext() {};
- }
-
- @Test(groups="contexts") @SpecAssertion(section="8.1")
- public void testGetWithCreateFalseReturnsNull() {
- Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class);
- assert context.get(tunaBean, false) == null;
- }
-
- @Test(groups="contexts") @SpecAssertion(section="8.1")
- public void testGetWithCreateTrueReturnsBean() {
- Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class);
- assert context.get(tunaBean, true) != null;
- }
-
- @Test(groups="contexts", expectedExceptions=ContextNotActiveException.class) @SpecAssertion(section="8.1")
- public void testInactiveContextThrowsContextNotActiveException() {
- ((AbstractContext)context).setActive(false);
- context.get(null, false);
- assert true;
- }
-
- @Test(groups="contexts") @SpecAssertion(section="8.1")
- public void testReturnsCorrectExistingBean() {
- Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class);
- Tuna firstTuna = context.get(tunaBean, true);
- Tuna secondTuna = context.get(tunaBean, false);
- assert firstTuna == secondTuna;
- }
-
- @Test(groups={"contexts", "producerMethod"}) @SpecAssertion(section="8.1")
- public void testProducerMethodReturningNullOK() throws SecurityException, NoSuchMethodException {
- SimpleBean<SpiderProducer> producer = createSimpleBean(SpiderProducer.class);
- manager.addBean(producer);
- Method nullProducer = SpiderProducer.class.getMethod("produceShelob");
- ProducerMethodBean<Tarantula> shelobBean = createProducerMethodBean(Tarantula.class, nullProducer, producer);
- assert shelobBean.create() == null;
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/PassivatingContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/PassivatingContextTest.java 2008-12-13 21:51:48 UTC (rev 513)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/PassivatingContextTest.java 2008-12-13 22:17:48 UTC (rev 514)
@@ -1,156 +0,0 @@
-package org.jboss.webbeans.test;
-
-import javax.webbeans.manager.Context;
-
-import org.jboss.webbeans.contexts.RequestContext;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Nicklas Karlsson (nickarls(a)gmail.com)
- *
- */
-@SpecVersion("20081029-PDR")
-public class PassivatingContextTest extends AbstractTest
-{
- Context context;
-
- @BeforeMethod
- public void initContext()
- {
- context = new RequestContext() {};
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testIsSessionScopePassivating()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testIsConversationScopePassivating()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testIsApplicationScopeNonPassivating()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testIsRequestScopePassivating()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testEJBWebBeanCanDefinePassivatingScope()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testSimpleWebBeanWithNonSerializableImplementationClassFails()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testProducerMethodDeclaringPassivatingScopeButReturningNonSerializableImplementationClassFails()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testSimpleWebBeanDeclaringPassivatingScopeIsSerializedWhenContextIsPassivated()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testStatefulEJBIsSerializedWhenPassivatedByEJBContainer()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testReferencesToWebBeansAreSerializable()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testDependentEJBsAreSerializable()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoStatefulSessionBeanWithPassivatingScopeFails()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoProducerMethodParameterWithPassivatingScopeFails()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoStatefulSessionBeanWithPassivatingScopeFails()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoProducerMethodParameterWithPassivatingScopeFails()
- {
- assert false;
- }
-
- @Test(groups = {"stub", "contexts", "passivation" }) @SpecAssertion(section = "8.4")
- public void testJMSEndpointProxyIsSerializable()
- {
- assert false;
- }
-}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/DependentContextTest.java (from rev 513, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/DependentContextTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/DependentContextTest.java 2008-12-13 22:17:48 UTC (rev 514)
@@ -0,0 +1,581 @@
+package org.jboss.webbeans.test.contexts;
+
+import static org.jboss.webbeans.util.BeanFactory.createProducerMethodBean;
+import static org.jboss.webbeans.util.BeanFactory.createSimpleBean;
+
+import java.lang.reflect.Method;
+
+import javax.webbeans.ContextNotActiveException;
+import javax.webbeans.Dependent;
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.bean.ProducerMethodBean;
+import org.jboss.webbeans.bean.SimpleBean;
+import org.jboss.webbeans.contexts.DependentContext;
+import org.jboss.webbeans.test.AbstractTest;
+import org.jboss.webbeans.test.SpecAssertion;
+import org.jboss.webbeans.test.SpecVersion;
+import org.jboss.webbeans.test.beans.Fox;
+import org.jboss.webbeans.test.beans.FoxRun;
+import org.jboss.webbeans.test.beans.SpiderProducer;
+import org.jboss.webbeans.test.beans.Tarantula;
+import org.testng.annotations.Test;
+
+@SpecVersion("20081206")
+public class DependentContextTest extends AbstractTest
+{
+
+ /**
+ * No injected instance of the Web Bean is ever shared between multiple
+ * injection points.
+ */
+ @Test(groups = { "contexts", "injection" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceNotSharedBetweenInjectionPoints()
+ {
+ Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
+ manager.addBean(foxBean);
+ FoxRun foxRun = foxRunBean.create();
+ assert !foxRun.fox.equals(foxRun.anotherFox);
+ }
+
+ /**
+ * Any instance of the Web Bean that is used to evaluate a Unified EL
+ * expression exists to service that evaluation only.
+ */
+ @Test(groups = { "stub", "contexts", "el" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceUsedForElEvalutionNotShared()
+ {
+ assert false;
+ }
+
+ /**
+ * Any instance of the Web Bean that receives a producer method, producer
+ * field, disposal method or observer method invocation exists to service
+ * that invocation only
+ */
+ @Test(groups = { "contexts", "producerMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceUsedForProducerMethodNotShared() throws Exception
+ {
+ SimpleBean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
+ manager.addBean(spiderProducer);
+ Method method = SpiderProducer.class.getMethod("produceTarantula");
+ ProducerMethodBean<Tarantula> tarantulaBean = createProducerMethodBean(Tarantula.class, method, spiderProducer);
+ Tarantula tarantula = tarantulaBean.create();
+ Tarantula tarantula2 = tarantulaBean.create();
+ assert tarantula != null;
+ assert tarantula2 != null;
+ assert tarantula != tarantula2;
+ }
+
+ /**
+ * Any instance of the Web Bean that receives a producer method, producer
+ * field, disposal method or observer method invocation exists to service
+ * that invocation only
+ */
+ @Test(groups = { "contexts", "producerMethod", "stub" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceUsedForProducerFieldNotShared() throws Exception
+ {
+ assert false;
+ }
+
+ /**
+ * Any instance of the Web Bean that receives a producer method, producer
+ * field, disposal method or observer method invocation exists to service
+ * that invocation only
+ */
+ @Test(groups = { "stub", "contexts", "disposalMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceUsedForDisposalMethodNotShared()
+ {
+ assert false;
+ }
+
+ /**
+ * Any instance of the Web Bean that receives a producer method, producer
+ * field, disposal method or observer method invocation exists to service
+ * that invocation only
+ */
+ @Test(groups = { "stub", "contexts", "observerMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceUsedForObserverMethodNotShared()
+ {
+ assert false;
+ }
+
+ /**
+ * Every invocation of the get() operation of the Context object for the @Dependent
+ * scope with the value true for the create parameter returns a new instance
+ * of the given Web Bean
+ */
+ @Test(groups = "contexts")
+ @SpecAssertion(section = "9.4")
+ public void testContextGetWithCreateTrueReturnsNewInstance()
+ {
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
+ manager.addBean(foxBean);
+ DependentContext context = new DependentContext();
+ context.setActive(true);
+ assert context.get(foxBean, true) != null;
+ assert context.get(foxBean, true) instanceof Fox;
+ }
+
+ /**
+ * Every invocation of the get() operation of the Context object for the @Dependent
+ * scope with the value false for the create parameter returns a null value
+ */
+ @Test(groups = "contexts")
+ @SpecAssertion(section = "9.4")
+ public void testContextGetWithCreateFalseReturnsNull()
+ {
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
+ manager.addBean(foxBean);
+ DependentContext context = new DependentContext();
+ context.setActive(true);
+ assert context.get(foxBean, false) == null;
+ }
+
+ /**
+ * The @Dependent scope is inactive except:
+ */
+ @Test(groups = "contexts", expectedExceptions = ContextNotActiveException.class)
+ @SpecAssertion(section = "9.4")
+ public void testContextIsInactive()
+ {
+ manager.getContext(Dependent.class).isActive();
+ }
+
+ /**
+ * when an instance of a Web Bean with scope @Dependent is created by the Web
+ * Bean manager to receive a producer method, producer field, disposal method
+ * or observer method invocation, or
+ */
+ @Test(groups = { "stub", "contexts", "producerMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveWhenInvokingProducerMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * when an instance of a Web Bean with scope @Dependent is created by the Web
+ * Bean manager to receive a producer method, producer field, disposal method
+ * or observer method invocation, or
+ */
+ @Test(groups = { "stub", "contexts", "producerField" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveWhenInvokingProducerField()
+ {
+ assert false;
+ }
+
+ /**
+ * when an instance of a Web Bean with scope @Dependent is created by the Web
+ * Bean manager to receive a producer method, producer field, disposal method
+ * or observer method invocation, or
+ */
+ @Test(groups = { "stub", "contexts", "disposalMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveWhenInvokingDisposalMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * when an instance of a Web Bean with scope @Dependent is created by the Web
+ * Bean manager to receive a producer method, producer field, disposal method
+ * or observer method invocation, or
+ */
+ @Test(groups = { "stub", "contexts", "observerMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveWhenInvokingObserverMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * while a Unified EL expression is evaluated, or
+ */
+ @Test(groups = { "stub", "contexts", "el" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveWhenEvaluatingElExpression()
+ {
+ assert false;
+ }
+
+ /**
+ * when the Web Bean manager is creating or destroying a Web Bean instance or
+ * injecting its dependencies, or
+ */
+ @Test(groups = { "contexts", "beanLifecycle" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringBeanCreation()
+ {
+ // Slightly roundabout, but I can't see a better way to test atm
+ Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
+ manager.addBean(foxBean);
+ FoxRun foxRun = foxRunBean.create();
+ assert foxRun.fox != null;
+ }
+
+ /**
+ * when the Web Bean manager is creating or destroying a Web Bean instance or
+ * injecting its dependencies, or
+ */
+ @Test(groups = { "stub", "contexts", "beanDestruction" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringBeanDestruction()
+ {
+ assert false;
+ }
+
+ /**
+ * when the Web Bean manager is creating or destroying a Web Bean instance or
+ * injecting its dependencies, or
+ */
+ @Test(groups = { "contexts", "injection" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringInjection()
+ {
+ Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
+ manager.addBean(foxBean);
+ FoxRun foxRun = foxRunBean.create();
+ assert foxRun.fox != null;
+ }
+
+ /**
+ * when the Web Bean manager is injecting dependencies of an EJB bean or
+ * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
+ * invoked by the EJB container
+ */
+ @Test(groups = { "contexts", "injection", "stub", "ejb3" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringEJBDependencyInjection()
+ {
+ assert false;
+ }
+
+ /**
+ * when the Web Bean manager is injecting dependencies of an EJB bean or
+ * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
+ * invoked by the EJB container
+ */
+ @Test(groups = { "contexts", "injection", "stub", "servlet" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringServletDependencyInjection()
+ {
+ assert false;
+ }
+
+ /**
+ * when the Web Bean manager is injecting dependencies of an EJB bean or
+ * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
+ * invoked by the EJB container
+ */
+ @Test(groups = { "contexts", "postconstruct", "stub", "ejb3" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringEJBPostConstruct()
+ {
+ assert false;
+ }
+
+ /**
+ * when the Web Bean manager is injecting dependencies of an EJB bean or
+ * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
+ * invoked by the EJB container
+ */
+ @Test(groups = { "contexts", "predestroy", "stub", "ejb3" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringEJBPreDestroy()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "constructor" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromConstructor()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "removeMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromRemoveMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "initalizerMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromInitializerMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "producerMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromProducerMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "disposalMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromDisposalMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "preDestroy" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromPreDestroy()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "postConstruct" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromPostConstruct()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "interceptor" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromInterceptorOfActiveMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "decorator" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromDecoratorOfActiveMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * An EJB bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods, from @PostConstruct
+ * and @PreDestroy callbacks and from Web Beans interceptors for these
+ * methods.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3", "initializerMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testEjbBeanMayCreateInstanceFromInitializer()
+ {
+ assert false;
+ }
+
+ /**
+ * An EJB bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods, from @PostConstruct
+ * and @PreDestroy callbacks and from Web Beans interceptors for these
+ * methods.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3", "postConstruct" })
+ @SpecAssertion(section = "9.4.1")
+ public void testEjbBeanMayCreateInstanceFromPostConstruct()
+ {
+ assert false;
+ }
+
+ /**
+ * An EJB bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods, from @PostConstruct
+ * and @PreDestroy callbacks and from Web Beans interceptors for these
+ * methods.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3", "preDestroy" })
+ @SpecAssertion(section = "9.4.1")
+ public void testEjbBeanMayCreateInstanceFromPreDestroy()
+ {
+ assert false;
+ }
+
+ /**
+ * An EJB bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods, from @PostConstruct
+ * and @PreDestroy callbacks and from Web Beans interceptors for these
+ * methods.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3", "interceptor" })
+ @SpecAssertion(section = "9.4.1")
+ public void testEjbBeanMayCreateInstanceFromInterceptorOfActiveMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Servlet may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods
+ */
+ @Test(groups = { "stub", "contexts", "servlet", "initializerMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testServletBeanMayCreateInstanceFromInitializer()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy all dependent objects of a Web Bean instance when the instance is
+ * destroyed,
+ */
+ @Test(groups = { "stub", "contexts", "beanDestruction" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDestroyingParentDestroysDependents()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy all dependent objects of an EJB bean or Servlet when the EJB bean
+ * or Servlet is destroyed,
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDestroyingEjbDestroysDependents()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy all dependent objects of an EJB bean or Servlet when the EJB bean
+ * or Servlet is destroyed,
+ */
+ @Test(groups = { "stub", "contexts", "servlet" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDestroyingServletDestroysDependents()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy all @Dependent scoped contextual instances created during an EL
+ * expression evaluation when the evaluation completes, and
+ */
+ @Test(groups = { "stub", "contexts", "el" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDependentsDestroyedWhenElEvaluationCompletes()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy any @Dependent scoped contextual instance created to receive a
+ * producer method, producer field, disposal method or observer method
+ * invocation when the invocation completes
+ */
+ @Test(groups = { "stub", "contexts", "producerMethod" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDependentsDestroyedWhenProducerMethodCompletes()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy any @Dependent scoped contextual instance created to receive a
+ * producer method, producer field, disposal method or observer method
+ * invocation when the invocation completes
+ */
+ @Test(groups = { "stub", "contexts", "producerField" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDependentsDestroyedWhenProducerFieldCompletes()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy any @Dependent scoped contextual instance created to receive a
+ * producer method, producer field, disposal method or observer method
+ * invocation when the invocation completes
+ */
+ @Test(groups = { "stub", "contexts", "disposalMethod" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDependentsDestroyedWhenDisposalMethodCompletes()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy any @Dependent scoped contextual instance created to receive a
+ * producer method, producer field, disposal method or observer method
+ * invocation when the invocation completes
+ */
+ @Test(groups = { "stub", "contexts", "observerMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testDependentsDestroyedWhenObserverMethodEvaluationCompletes()
+ {
+ assert false;
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/DependentContextTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:mergeinfo
+
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/NormalContextTest.java (from rev 511, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NormalContextTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/NormalContextTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/NormalContextTest.java 2008-12-13 22:17:48 UTC (rev 514)
@@ -0,0 +1,80 @@
+package org.jboss.webbeans.test.contexts;
+
+import static org.jboss.webbeans.util.BeanFactory.createProducerMethodBean;
+import static org.jboss.webbeans.util.BeanFactory.createSimpleBean;
+
+import java.lang.reflect.Method;
+
+import javax.webbeans.ContextNotActiveException;
+import javax.webbeans.manager.Bean;
+import javax.webbeans.manager.Context;
+
+import org.jboss.webbeans.bean.ProducerMethodBean;
+import org.jboss.webbeans.bean.SimpleBean;
+import org.jboss.webbeans.contexts.AbstractContext;
+import org.jboss.webbeans.contexts.RequestContext;
+import org.jboss.webbeans.test.AbstractTest;
+import org.jboss.webbeans.test.SpecAssertion;
+import org.jboss.webbeans.test.SpecVersion;
+import org.jboss.webbeans.test.beans.SpiderProducer;
+import org.jboss.webbeans.test.beans.Tarantula;
+import org.jboss.webbeans.test.beans.Tuna;
+import org.jboss.webbeans.util.BeanFactory;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Nicklas Karlsson (nickarls(a)gmail.com)
+ * @author Pete Muir
+ *
+ * This class tests a basic context against section 8 of the specification
+ *
+ */
+@SpecVersion("PDR")
+public class NormalContextTest extends AbstractTest
+{
+ Context context;
+
+ @BeforeMethod
+ public void initContext() {
+ context = new RequestContext() {};
+ }
+
+ @Test(groups="contexts") @SpecAssertion(section="8.1")
+ public void testGetWithCreateFalseReturnsNull() {
+ Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class);
+ assert context.get(tunaBean, false) == null;
+ }
+
+ @Test(groups="contexts") @SpecAssertion(section="8.1")
+ public void testGetWithCreateTrueReturnsBean() {
+ Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class);
+ assert context.get(tunaBean, true) != null;
+ }
+
+ @Test(groups="contexts", expectedExceptions=ContextNotActiveException.class) @SpecAssertion(section="8.1")
+ public void testInactiveContextThrowsContextNotActiveException() {
+ ((AbstractContext)context).setActive(false);
+ context.get(null, false);
+ assert true;
+ }
+
+ @Test(groups="contexts") @SpecAssertion(section="8.1")
+ public void testReturnsCorrectExistingBean() {
+ Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class);
+ Tuna firstTuna = context.get(tunaBean, true);
+ Tuna secondTuna = context.get(tunaBean, false);
+ assert firstTuna == secondTuna;
+ }
+
+ @Test(groups={"contexts", "producerMethod"}) @SpecAssertion(section="8.1")
+ public void testProducerMethodReturningNullOK() throws SecurityException, NoSuchMethodException {
+ SimpleBean<SpiderProducer> producer = createSimpleBean(SpiderProducer.class);
+ manager.addBean(producer);
+ Method nullProducer = SpiderProducer.class.getMethod("produceShelob");
+ ProducerMethodBean<Tarantula> shelobBean = createProducerMethodBean(Tarantula.class, nullProducer, producer);
+ assert shelobBean.create() == null;
+ }
+
+}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java (from rev 511, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/PassivatingContextTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java 2008-12-13 22:17:48 UTC (rev 514)
@@ -0,0 +1,322 @@
+package org.jboss.webbeans.test.contexts;
+
+import javax.webbeans.DefinitionException;
+import javax.webbeans.IllegalProductException;
+import javax.webbeans.UnserializableDependencyException;
+import javax.webbeans.manager.Context;
+
+import org.jboss.webbeans.contexts.RequestContext;
+import org.jboss.webbeans.test.AbstractTest;
+import org.jboss.webbeans.test.SpecAssertion;
+import org.jboss.webbeans.test.SpecVersion;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Nicklas Karlsson (nickarls(a)gmail.com)
+ *
+ */
+@SpecVersion("20081206")
+public class PassivatingContextTest extends AbstractTest
+{
+ Context context;
+
+ @BeforeMethod
+ public void initContext()
+ {
+ context = new RequestContext()
+ {
+ };
+ }
+
+ /**
+ * EJB local objects are serializable. Therefore, an enterprise Web Bean may
+ * declare any passivating scope.
+ */
+ @Test(groups = { "stub", "contexts", "passivation", "enterpriseBean" })
+ @SpecAssertion(section = "9.5")
+ public void testEJBWebBeanCanDeclarePassivatingScope()
+ {
+ assert false;
+ }
+
+ /**
+ * Simple Web Beans are not required to be serializable. If a simple Web Bean
+ * declares a passivating scope, and the implementation class is not
+ * serializable, a DefinitionException is thrown by the Web Bean manager at
+ * initialization time.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = "9.5")
+ public void testSimpleWebBeanWithNonSerializableImplementationClassFails()
+ {
+ assert false;
+ }
+
+ /**
+ * If a producer method or field declares a passivating scope and returns a
+ * non-serializable object at runtime, an Illegal- ProductException is thrown
+ * by the Web Bean manager.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testProducerMethodDeclaringPassivatingScopeButReturningNonSerializableImplementationClassFails()
+ {
+ assert false;
+ }
+
+ /**
+ * The built-in session and conversation scopes are passivating. No other
+ * built-in scope is passivating.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" })
+ @SpecAssertion(section = "9.5")
+ public void testIsSessionScopePassivating()
+ {
+ assert false;
+ }
+
+ /**
+ * The built-in session and conversation scopes are passivating. No other
+ * built-in scope is passivating.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" })
+ @SpecAssertion(section = "9.5")
+ public void testIsConversationScopePassivating()
+ {
+ assert false;
+ }
+
+ /**
+ * The built-in session and conversation scopes are passivating. No other
+ * built-in scope is passivating.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" })
+ @SpecAssertion(section = "9.5")
+ public void testIsApplicationScopeNonPassivating()
+ {
+ assert false;
+ }
+
+ /**
+ * The built-in session and conversation scopes are passivating. No other
+ * built-in scope is passivating.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" })
+ @SpecAssertion(section = "9.5")
+ public void testIsRequestScopeNonPassivating()
+ {
+ assert false;
+ }
+
+ /**
+ * the Web Bean declares a passivating scope type, and context passivation
+ * occurs, or
+ */
+ @Test(groups = { "stub", "contexts", "passivation" })
+ @SpecAssertion(section = "9.5")
+ public void testSimpleWebBeanDeclaringPassivatingScopeIsSerializedWhenContextIsPassivated()
+ {
+ assert false;
+ }
+
+ /**
+ * the Web Bean is an EJB stateful session bean, and it is passivated by the
+ * EJB container.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" })
+ @SpecAssertion(section = "9.5")
+ public void testStatefulEJBIsSerializedWhenPassivatedByEJBContainer()
+ {
+ assert false;
+ }
+
+ /**
+ * Therefore, any reference to a Web Bean which declares a normal scope type
+ * is serializable.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" })
+ @SpecAssertion(section = "9.5")
+ public void testReferencesToWebBeansWithNormalScopeAreSerializable()
+ {
+ assert false;
+ }
+
+ /**
+ * EJB local objects are serializable. Therefore, any reference to an
+ * enterprise Web Bean of scope @Dependent is serializable.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" })
+ @SpecAssertion(section = "9.5")
+ public void testDependentEJBsAreSerializable()
+ {
+ assert false;
+ }
+
+ /**
+ * If a simple Web Bean of scope @Dependent and a non-serializable
+ * implementation class is injected into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * UnserializableDependencyException must be thrown by the Web Bean manager
+ * at initialization time.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @SpecAssertion(section = "9.5")
+ public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoStatefulSessionBeanWithPassivatingScopeFails()
+ {
+ assert false;
+ }
+
+ /**
+ * If a simple Web Bean of scope @Dependent and a non-serializable
+ * implementation class is injected into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * UnserializableDependencyException must be thrown by the Web Bean manager
+ * at initialization time.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @SpecAssertion(section = "9.5")
+ public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
+ {
+ assert false;
+ }
+
+ /**
+ * If a simple Web Bean of scope @Dependent and a non-serializable
+ * implementation class is injected into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * UnserializableDependencyException must be thrown by the Web Bean manager
+ * at initialization time.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @SpecAssertion(section = "9.5")
+ public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
+ {
+ assert false;
+ }
+
+ /**
+ * If a simple Web Bean of scope @Dependent and a non-serializable
+ * implementation class is injected into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * UnserializableDependencyException must be thrown by the Web Bean manager
+ * at initialization time.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @SpecAssertion(section = "9.5")
+ public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
+ {
+ assert false;
+ }
+
+ /**
+ * If a simple Web Bean of scope @Dependent and a non-serializable
+ * implementation class is injected into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * UnserializableDependencyException must be thrown by the Web Bean manager
+ * at initialization time.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @SpecAssertion(section = "9.5")
+ public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoProducerMethodParameterWithPassivatingScopeFails()
+ {
+ assert false;
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoStatefulSessionBeanWithPassivatingScopeFails()
+ {
+ assert false;
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
+ {
+ assert false;
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
+ {
+ assert false;
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
+ {
+ assert false;
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoProducerMethodParameterWithPassivatingScopeFails()
+ {
+ assert false;
+ }
+
+ /**
+ * The Web Bean manager must guarantee that JMS endpoint proxy objects are
+ * serializable.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" })
+ @SpecAssertion(section = "9.5")
+ public void testJMSEndpointProxyIsSerializable()
+ {
+ assert false;
+ }
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
17 years, 4 months
[webbeans-commits] Webbeans SVN: r513 - ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2008-12-13 16:51:48 -0500 (Sat, 13 Dec 2008)
New Revision: 513
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java
Log:
update tests to 20081206
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java 2008-12-11 11:36:01 UTC (rev 512)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java 2008-12-13 21:51:48 UTC (rev 513)
@@ -18,11 +18,16 @@
import org.jboss.webbeans.test.beans.Tarantula;
import org.testng.annotations.Test;
-@SpecVersion("PDR")
+@SpecVersion("20081206")
public class DependentContextTest extends AbstractTest
{
-
- @Test(groups={"contexts", "injection"}) @SpecAssertion(section="9.4")
+
+ /**
+ * No injected instance of the Web Bean is ever shared between multiple
+ * injection points.
+ */
+ @Test(groups = { "contexts", "injection" })
+ @SpecAssertion(section = "9.4")
public void testInstanceNotSharedBetweenInjectionPoints()
{
Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
@@ -31,17 +36,28 @@
FoxRun foxRun = foxRunBean.create();
assert !foxRun.fox.equals(foxRun.anotherFox);
}
-
- @Test(groups={"stub", "contexts", "el"}) @SpecAssertion(section="9.4")
+
+ /**
+ * Any instance of the Web Bean that is used to evaluate a Unified EL
+ * expression exists to service that evaluation only.
+ */
+ @Test(groups = { "stub", "contexts", "el" })
+ @SpecAssertion(section = "9.4")
public void testInstanceUsedForElEvalutionNotShared()
{
assert false;
}
-
- @Test(groups={"contexts", "producerMethod"}) @SpecAssertion(section="9.4")
+
+ /**
+ * Any instance of the Web Bean that receives a producer method, producer
+ * field, disposal method or observer method invocation exists to service
+ * that invocation only
+ */
+ @Test(groups = { "contexts", "producerMethod" })
+ @SpecAssertion(section = "9.4")
public void testInstanceUsedForProducerMethodNotShared() throws Exception
{
- SimpleBean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
+ SimpleBean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("produceTarantula");
ProducerMethodBean<Tarantula> tarantulaBean = createProducerMethodBean(Tarantula.class, method, spiderProducer);
@@ -51,14 +67,50 @@
assert tarantula2 != null;
assert tarantula != tarantula2;
}
-
- @Test(groups={"stub", "contexts", "observerMethod"}) @SpecAssertion(section="9.4")
+
+ /**
+ * Any instance of the Web Bean that receives a producer method, producer
+ * field, disposal method or observer method invocation exists to service
+ * that invocation only
+ */
+ @Test(groups = { "contexts", "producerMethod", "stub" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceUsedForProducerFieldNotShared() throws Exception
+ {
+ assert false;
+ }
+
+ /**
+ * Any instance of the Web Bean that receives a producer method, producer
+ * field, disposal method or observer method invocation exists to service
+ * that invocation only
+ */
+ @Test(groups = { "stub", "contexts", "disposalMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceUsedForDisposalMethodNotShared()
+ {
+ assert false;
+ }
+
+ /**
+ * Any instance of the Web Bean that receives a producer method, producer
+ * field, disposal method or observer method invocation exists to service
+ * that invocation only
+ */
+ @Test(groups = { "stub", "contexts", "observerMethod" })
+ @SpecAssertion(section = "9.4")
public void testInstanceUsedForObserverMethodNotShared()
{
assert false;
}
-
- @Test(groups="contexts") @SpecAssertion(section="9.4")
+
+ /**
+ * Every invocation of the get() operation of the Context object for the @Dependent
+ * scope with the value true for the create parameter returns a new instance
+ * of the given Web Bean
+ */
+ @Test(groups = "contexts")
+ @SpecAssertion(section = "9.4")
public void testContextGetWithCreateTrueReturnsNewInstance()
{
Bean<Fox> foxBean = createSimpleBean(Fox.class);
@@ -68,8 +120,13 @@
assert context.get(foxBean, true) != null;
assert context.get(foxBean, true) instanceof Fox;
}
-
- @Test(groups="contexts") @SpecAssertion(section="9.4")
+
+ /**
+ * Every invocation of the get() operation of the Context object for the @Dependent
+ * scope with the value false for the create parameter returns a null value
+ */
+ @Test(groups = "contexts")
+ @SpecAssertion(section = "9.4")
public void testContextGetWithCreateFalseReturnsNull()
{
Bean<Fox> foxBean = createSimpleBean(Fox.class);
@@ -78,27 +135,81 @@
context.setActive(true);
assert context.get(foxBean, false) == null;
}
-
- @Test(groups="contexts", expectedExceptions=ContextNotActiveException.class) @SpecAssertion(section="9.4")
+
+ /**
+ * The @Dependent scope is inactive except:
+ */
+ @Test(groups = "contexts", expectedExceptions = ContextNotActiveException.class)
+ @SpecAssertion(section = "9.4")
public void testContextIsInactive()
{
manager.getContext(Dependent.class).isActive();
}
-
- @Test(groups={"stub", "contexts", "observerMethod"}) @SpecAssertion(section="9.4")
+
+ /**
+ * when an instance of a Web Bean with scope @Dependent is created by the Web
+ * Bean manager to receive a producer method, producer field, disposal method
+ * or observer method invocation, or
+ */
+ @Test(groups = { "stub", "contexts", "producerMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveWhenInvokingProducerMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * when an instance of a Web Bean with scope @Dependent is created by the Web
+ * Bean manager to receive a producer method, producer field, disposal method
+ * or observer method invocation, or
+ */
+ @Test(groups = { "stub", "contexts", "producerField" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveWhenInvokingProducerField()
+ {
+ assert false;
+ }
+
+ /**
+ * when an instance of a Web Bean with scope @Dependent is created by the Web
+ * Bean manager to receive a producer method, producer field, disposal method
+ * or observer method invocation, or
+ */
+ @Test(groups = { "stub", "contexts", "disposalMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveWhenInvokingDisposalMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * when an instance of a Web Bean with scope @Dependent is created by the Web
+ * Bean manager to receive a producer method, producer field, disposal method
+ * or observer method invocation, or
+ */
+ @Test(groups = { "stub", "contexts", "observerMethod" })
+ @SpecAssertion(section = "9.4")
public void testContextIsActiveWhenInvokingObserverMethod()
{
assert false;
}
-
-
- @Test(groups={"stub", "contexts", "el"}) @SpecAssertion(section="9.4")
+
+ /**
+ * while a Unified EL expression is evaluated, or
+ */
+ @Test(groups = { "stub", "contexts", "el" })
+ @SpecAssertion(section = "9.4")
public void testContextIsActiveWhenEvaluatingElExpression()
{
assert false;
}
-
- @Test(groups={"contexts", "beanLifecycle"}) @SpecAssertion(section="9.4")
+
+ /**
+ * when the Web Bean manager is creating or destroying a Web Bean instance or
+ * injecting its dependencies, or
+ */
+ @Test(groups = { "contexts", "beanLifecycle" })
+ @SpecAssertion(section = "9.4")
public void testContextIsActiveDuringBeanCreation()
{
// Slightly roundabout, but I can't see a better way to test atm
@@ -108,14 +219,24 @@
FoxRun foxRun = foxRunBean.create();
assert foxRun.fox != null;
}
-
- @Test(groups={"stub", "contexts", "beanDestruction"}) @SpecAssertion(section="9.4")
+
+ /**
+ * when the Web Bean manager is creating or destroying a Web Bean instance or
+ * injecting its dependencies, or
+ */
+ @Test(groups = { "stub", "contexts", "beanDestruction" })
+ @SpecAssertion(section = "9.4")
public void testContextIsActiveDuringBeanDestruction()
{
assert false;
}
-
- @Test(groups={"contexts", "injection"}) @SpecAssertion(section="9.4")
+
+ /**
+ * when the Web Bean manager is creating or destroying a Web Bean instance or
+ * injecting its dependencies, or
+ */
+ @Test(groups = { "contexts", "injection" })
+ @SpecAssertion(section = "9.4")
public void testContextIsActiveDuringInjection()
{
Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
@@ -124,59 +245,334 @@
FoxRun foxRun = foxRunBean.create();
assert foxRun.fox != null;
}
-
- @Test(groups={"stub", "contexts", "ejb3"}) @SpecAssertion(section="9.4")
- public void testEjbBeanMayMayCreateInstanceFromInitializer()
+
+ /**
+ * when the Web Bean manager is injecting dependencies of an EJB bean or
+ * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
+ * invoked by the EJB container
+ */
+ @Test(groups = { "contexts", "injection", "stub", "ejb3" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringEJBDependencyInjection()
{
assert false;
}
-
- @Test(groups={"stub", "contexts", "ejb3"}) @SpecAssertion(section="9.4")
- public void testEjbBeanMayMayCreateInstanceFromPostConstruct()
+
+ /**
+ * when the Web Bean manager is injecting dependencies of an EJB bean or
+ * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
+ * invoked by the EJB container
+ */
+ @Test(groups = { "contexts", "injection", "stub", "servlet" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringServletDependencyInjection()
{
assert false;
}
-
- @Test(groups={"stub", "contexts", "ejb3"}) @SpecAssertion(section="9.4")
- public void testEjbBeanMayMayCreateInstanceFromPreDestroy()
+
+ /**
+ * when the Web Bean manager is injecting dependencies of an EJB bean or
+ * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
+ * invoked by the EJB container
+ */
+ @Test(groups = { "contexts", "postconstruct", "stub", "ejb3" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringEJBPostConstruct()
{
assert false;
}
-
- @Test(groups={"stub", "contexts", "servlet"}) @SpecAssertion(section="9.4")
- public void testServletBeanMayMayCreateInstanceFromInitializer()
+
+ /**
+ * when the Web Bean manager is injecting dependencies of an EJB bean or
+ * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
+ * invoked by the EJB container
+ */
+ @Test(groups = { "contexts", "predestroy", "stub", "ejb3" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringEJBPreDestroy()
{
assert false;
}
-
- @Test(groups={"stub", "contexts", "beanDestruction"}) @SpecAssertion(section="9.4")
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "constructor" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromConstructor()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "removeMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromRemoveMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "initalizerMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromInitializerMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "producerMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromProducerMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "disposalMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromDisposalMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "preDestroy" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromPreDestroy()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "postConstruct" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromPostConstruct()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "interceptor" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromInterceptorOfActiveMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "decorator" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromDecoratorOfActiveMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * An EJB bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods, from @PostConstruct
+ * and @PreDestroy callbacks and from Web Beans interceptors for these
+ * methods.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3", "initializerMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testEjbBeanMayCreateInstanceFromInitializer()
+ {
+ assert false;
+ }
+
+ /**
+ * An EJB bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods, from @PostConstruct
+ * and @PreDestroy callbacks and from Web Beans interceptors for these
+ * methods.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3", "postConstruct" })
+ @SpecAssertion(section = "9.4.1")
+ public void testEjbBeanMayCreateInstanceFromPostConstruct()
+ {
+ assert false;
+ }
+
+ /**
+ * An EJB bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods, from @PostConstruct
+ * and @PreDestroy callbacks and from Web Beans interceptors for these
+ * methods.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3", "preDestroy" })
+ @SpecAssertion(section = "9.4.1")
+ public void testEjbBeanMayCreateInstanceFromPreDestroy()
+ {
+ assert false;
+ }
+
+ /**
+ * An EJB bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods, from @PostConstruct
+ * and @PreDestroy callbacks and from Web Beans interceptors for these
+ * methods.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3", "interceptor" })
+ @SpecAssertion(section = "9.4.1")
+ public void testEjbBeanMayCreateInstanceFromInterceptorOfActiveMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Servlet may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods
+ */
+ @Test(groups = { "stub", "contexts", "servlet", "initializerMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testServletBeanMayCreateInstanceFromInitializer()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy all dependent objects of a Web Bean instance when the instance is
+ * destroyed,
+ */
+ @Test(groups = { "stub", "contexts", "beanDestruction" })
+ @SpecAssertion(section = "9.4.2")
public void testDestroyingParentDestroysDependents()
{
assert false;
}
-
- @Test(groups={"stub", "contexts", "ejb3"}) @SpecAssertion(section="9.4")
+
+ /**
+ * destroy all dependent objects of an EJB bean or Servlet when the EJB bean
+ * or Servlet is destroyed,
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.4.2")
public void testDestroyingEjbDestroysDependents()
{
assert false;
}
-
- @Test(groups={"stub", "contexts", "servlet"}) @SpecAssertion(section="9.4")
+
+ /**
+ * destroy all dependent objects of an EJB bean or Servlet when the EJB bean
+ * or Servlet is destroyed,
+ */
+ @Test(groups = { "stub", "contexts", "servlet" })
+ @SpecAssertion(section = "9.4.2")
public void testDestroyingServletDestroysDependents()
{
assert false;
}
-
- @Test(groups={"stub", "contexts", "el"}) @SpecAssertion(section="9.4")
+
+ /**
+ * destroy all @Dependent scoped contextual instances created during an EL
+ * expression evaluation when the evaluation completes, and
+ */
+ @Test(groups = { "stub", "contexts", "el" })
+ @SpecAssertion(section = "9.4.2")
public void testDependentsDestroyedWhenElEvaluationCompletes()
{
assert false;
}
+
+ /**
+ * destroy any @Dependent scoped contextual instance created to receive a
+ * producer method, producer field, disposal method or observer method
+ * invocation when the invocation completes
+ */
+ @Test(groups = { "stub", "contexts", "producerMethod" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDependentsDestroyedWhenProducerMethodCompletes()
+ {
+ assert false;
+ }
- @Test(groups={"stub", "contexts", "observerMethod"}) @SpecAssertion(section="9.4")
+ /**
+ * destroy any @Dependent scoped contextual instance created to receive a
+ * producer method, producer field, disposal method or observer method
+ * invocation when the invocation completes
+ */
+ @Test(groups = { "stub", "contexts", "producerField" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDependentsDestroyedWhenProducerFieldCompletes()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy any @Dependent scoped contextual instance created to receive a
+ * producer method, producer field, disposal method or observer method
+ * invocation when the invocation completes
+ */
+ @Test(groups = { "stub", "contexts", "disposalMethod" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDependentsDestroyedWhenDisposalMethodCompletes()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy any @Dependent scoped contextual instance created to receive a
+ * producer method, producer field, disposal method or observer method
+ * invocation when the invocation completes
+ */
+ @Test(groups = { "stub", "contexts", "observerMethod" })
+ @SpecAssertion(section = "9.4")
public void testDependentsDestroyedWhenObserverMethodEvaluationCompletes()
{
assert false;
}
-
+
}
17 years, 4 months
[webbeans-commits] Webbeans SVN: r512 - in ri/trunk: examples and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-11 06:36:01 -0500 (Thu, 11 Dec 2008)
New Revision: 512
Modified:
ri/trunk/build.xml
ri/trunk/examples/build.xml
Log:
target for gavin
Modified: ri/trunk/build.xml
===================================================================
--- ri/trunk/build.xml 2008-12-10 09:40:02 UTC (rev 511)
+++ ri/trunk/build.xml 2008-12-11 11:36:01 UTC (rev 512)
@@ -1,41 +1,43 @@
<?xml version="1.0"?>
<project name="JBoss5DeployerInstall" default="install-jboss5" basedir="." xmlns:artifact="urn:maven-artifact-ant">
-
+
<path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath" />
+ <property name="maven.dir" location="${basedir}/maven" />
+
<property file="build.properties" />
-
+
<target name="install-jboss5">
-
+
<fail unless="jboss.home" message="Please pass in -Djboss.home=..."/>
-
+
<mkdir dir="target/webbeans.deployer"/>
-
+
<artifact:dependencies filesetId="jboss5.deployer.fileset" versionsId="jboss5.deployer.versions" >
- <dependency groupId="org.jboss.webbeans.integration" artifactId="webbeans-ri-int-microcontainer" version="5.2.0-SNAPSHOT"/>
- <dependency groupId="org.jboss.webbeans.integration" artifactId="webbeans-ri-int-jbossas" version="5.2.0-SNAPSHOT"/>
+ <dependency groupId="org.jboss.webbeans.integration" artifactId="webbeans-ri-int-microcontainer" version="5.2.0-SNAPSHOT"/>
+ <dependency groupId="org.jboss.webbeans.integration" artifactId="webbeans-ri-int-jbossas" version="5.2.0-SNAPSHOT"/>
<remoteRepository id="snapshots.jboss.org" url="http://snapshots.jboss.org/maven2" />
<remoteRepository id="repository.jboss.org" url="http://repository.jboss.org/maven2" />
- </artifact:dependencies>
-
+ </artifact:dependencies>
+
<artifact:dependencies filesetId="google.collections.fileset">
- <dependency groupId="com.google.collections" artifactId="google-collections" version="0.8"/>
- </artifact:dependencies>
-
+ <dependency groupId="com.google.collections" artifactId="google-collections" version="0.8"/>
+ </artifact:dependencies>
+
<copy todir="target/webbeans.deployer">
<fileset refid="jboss5.deployer.fileset"/>
<flattenmapper />
</copy>
-
- <mkdir dir="target/webbeans.deployer/META-INF" />
-
+
+ <mkdir dir="target/webbeans.deployer/META-INF" />
+
<copy todir="target/webbeans.deployer/META-INF">
<fileset dir="${basedir}/webbeans-ri">
- <include name="webbeans-deployers-jboss-beans.xml"/>
- </fileset>
+ <include name="webbeans-deployers-jboss-beans.xml"/>
+ </fileset>
</copy>
-
+
<copy todir="${jboss.home}/server/default/deployers/webbeans.deployer">
<fileset dir="target/webbeans.deployer">
<include name="**/*.xml" />
@@ -44,7 +46,33 @@
</fileset>
<mapper classpathref="maven-ant-tasks.classpath" classname="org.apache.maven.artifact.ant.VersionMapper" from="${jboss5.deployer.versions}" to="flatten" />
</copy>
-
+
</target>
+ <target name="install">
+ <maven target="install" basedir="${basedir}"/>
+ </target>
+
+ <macrodef name="maven">
+ <attribute name="target" />
+ <attribute name="basedir" />
+ <element name="args" implicit="true" optional="true" />
+ <sequential>
+ <java classname="org.codehaus.classworlds.Launcher" fork="true" dir="@{basedir}">
+ <classpath>
+ <fileset dir="${maven.dir}/boot">
+ <include name="*.jar" />
+ </fileset>
+ <fileset dir="${maven.dir}/bin">
+ <include name="*.*" />
+ </fileset>
+ </classpath>
+ <sysproperty key="classworlds.conf" value="${maven.dir}/bin/m2.conf" />
+ <sysproperty key="maven.home" value="${maven.dir}" />
+ <args />
+ <arg line="@{target}" />
+ </java>
+ </sequential>
+ </macrodef>
+
</project>
\ No newline at end of file
Modified: ri/trunk/examples/build.xml
===================================================================
--- ri/trunk/examples/build.xml 2008-12-10 09:40:02 UTC (rev 511)
+++ ri/trunk/examples/build.xml 2008-12-11 11:36:01 UTC (rev 512)
@@ -34,26 +34,26 @@
<delete file="${jboss.home}/server/default/deploy/${example.name}.war" failonerror="false" />
</target>
- <macrodef name="maven">
- <attribute name="target" />
- <attribute name="basedir" />
- <element name="args" implicit="true" optional="true" />
- <sequential>
- <java classname="org.codehaus.classworlds.Launcher" fork="true" dir="@{basedir}">
- <classpath>
- <fileset dir="${maven.dir}/boot">
- <include name="*.jar" />
- </fileset>
- <fileset dir="${maven.dir}/bin">
- <include name="*.*" />
- </fileset>
- </classpath>
- <sysproperty key="classworlds.conf" value="${maven.dir}/bin/m2.conf" />
- <sysproperty key="maven.home" value="${maven.dir}" />
- <args />
- <arg line="@{target}" />
- </java>
- </sequential>
- </macrodef>
+ <macrodef name="maven">
+ <attribute name="target" />
+ <attribute name="basedir" />
+ <element name="args" implicit="true" optional="true" />
+ <sequential>
+ <java classname="org.codehaus.classworlds.Launcher" fork="true" dir="@{basedir}">
+ <classpath>
+ <fileset dir="${maven.dir}/boot">
+ <include name="*.jar" />
+ </fileset>
+ <fileset dir="${maven.dir}/bin">
+ <include name="*.*" />
+ </fileset>
+ </classpath>
+ <sysproperty key="classworlds.conf" value="${maven.dir}/bin/m2.conf" />
+ <sysproperty key="maven.home" value="${maven.dir}" />
+ <args />
+ <arg line="@{target}" />
+ </java>
+ </sequential>
+ </macrodef>
</project>
\ No newline at end of file
17 years, 4 months
[webbeans-commits] Webbeans SVN: r511 - in ri/trunk: examples and 4 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-10 04:40:02 -0500 (Wed, 10 Dec 2008)
New Revision: 511
Added:
ri/trunk/examples/build.xml
Modified:
ri/trunk/pom.xml
ri/trunk/webbeans-api/.settings/org.eclipse.jdt.core.prefs
ri/trunk/webbeans-ri/.settings/org.eclipse.jdt.core.prefs
ri/trunk/webbeans-ri/pom.xml
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractEjbEmbeddableTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanTest.java
Log:
add ejb3 embedded support
Added: ri/trunk/examples/build.xml
===================================================================
--- ri/trunk/examples/build.xml (rev 0)
+++ ri/trunk/examples/build.xml 2008-12-10 09:40:02 UTC (rev 511)
@@ -0,0 +1,59 @@
+<project basedir="." name="example.build.script" default="restart">
+
+ <dirname property="wbri.dir" file="${ant.file.example.build.script}/../" />
+
+ <property name="maven.dir" location="${wbri.dir}/maven" />
+
+ <property file="${wbri.dir}/build.properties"/>
+
+ <target name="package">
+ <maven target="package" basedir="${basedir}"/>
+ </target>
+
+ <target name="explode" depends="package">
+ <mkdir dir="${jboss.home}/server/default/deploy/${example.name}.war"/>
+ <copy todir="${jboss.home}/server/default/deploy/${example.name}.war">
+ <fileset dir="${basedir}/target/${example.name}" />
+ </copy>
+ </target>
+
+ <target name="deploy" depends="package">
+ <copy todir="${jboss.home}/server/default/deploy/" file="${basedir}/target/${example.name}.war"/>
+ </target>
+
+ <target name="clean">
+ <maven target="clean" basedir="${basedir}"/>
+ </target>
+
+ <target name="restart" depends="explode">
+ <touch file="${jboss.home}/server/default/deploy/${example.name}.war/WEB-INF/web.xml" />
+ </target>
+
+ <target name="undeploy">
+ <delete dir="${jboss.home}/server/default/deploy/${example.name}.war" failonerror="false" />
+ <delete file="${jboss.home}/server/default/deploy/${example.name}.war" failonerror="false" />
+ </target>
+
+ <macrodef name="maven">
+ <attribute name="target" />
+ <attribute name="basedir" />
+ <element name="args" implicit="true" optional="true" />
+ <sequential>
+ <java classname="org.codehaus.classworlds.Launcher" fork="true" dir="@{basedir}">
+ <classpath>
+ <fileset dir="${maven.dir}/boot">
+ <include name="*.jar" />
+ </fileset>
+ <fileset dir="${maven.dir}/bin">
+ <include name="*.*" />
+ </fileset>
+ </classpath>
+ <sysproperty key="classworlds.conf" value="${maven.dir}/bin/m2.conf" />
+ <sysproperty key="maven.home" value="${maven.dir}" />
+ <args />
+ <arg line="@{target}" />
+ </java>
+ </sequential>
+ </macrodef>
+
+</project>
\ No newline at end of file
Modified: ri/trunk/pom.xml
===================================================================
--- ri/trunk/pom.xml 2008-12-10 09:28:19 UTC (rev 510)
+++ ri/trunk/pom.xml 2008-12-10 09:40:02 UTC (rev 511)
@@ -46,12 +46,6 @@
<url>http://repository.jboss.org/maven2</url>
</repository>
<repository>
- <id>snapshots.jboss.org</id>
- <name>JBoss Snapshots Repository</name>
- <url>http://snapshots.jboss.org/maven2</url>
- <snapshots />
- </repository>
- <repository>
<id>google-maven-repository</id>
<name>Google Maven Repository</name>
<url>http://google-maven-repository.googlecode.com/svn/repository/</url>
@@ -154,7 +148,7 @@
<dependency>
<groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3-embedded</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-Alpha1</version>
</dependency>
<dependency>
Modified: ri/trunk/webbeans-api/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- ri/trunk/webbeans-api/.settings/org.eclipse.jdt.core.prefs 2008-12-10 09:28:19 UTC (rev 510)
+++ ri/trunk/webbeans-api/.settings/org.eclipse.jdt.core.prefs 2008-12-10 09:40:02 UTC (rev 511)
@@ -1,4 +1,4 @@
-#Tue Dec 09 14:39:16 CET 2008
+#Wed Dec 10 10:36:17 CET 2008
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.5
Modified: ri/trunk/webbeans-ri/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- ri/trunk/webbeans-ri/.settings/org.eclipse.jdt.core.prefs 2008-12-10 09:28:19 UTC (rev 510)
+++ ri/trunk/webbeans-ri/.settings/org.eclipse.jdt.core.prefs 2008-12-10 09:40:02 UTC (rev 511)
@@ -1,4 +1,4 @@
-#Tue Dec 09 14:39:16 CET 2008
+#Wed Dec 10 10:36:49 CET 2008
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.5
Modified: ri/trunk/webbeans-ri/pom.xml
===================================================================
--- ri/trunk/webbeans-ri/pom.xml 2008-12-10 09:28:19 UTC (rev 510)
+++ ri/trunk/webbeans-ri/pom.xml 2008-12-10 09:40:02 UTC (rev 511)
@@ -25,11 +25,11 @@
<classifier>jdk15</classifier>
</dependency>
- <!-- <dependency>
+ <dependency>
<groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3-embedded</artifactId>
<scope>test</scope>
- </dependency>-->
+ </dependency>
<dependency>
<groupId>javax.servlet</groupId>
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractEjbEmbeddableTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractEjbEmbeddableTest.java 2008-12-10 09:28:19 UTC (rev 510)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractEjbEmbeddableTest.java 2008-12-10 09:40:02 UTC (rev 511)
@@ -1,11 +1,19 @@
package org.jboss.webbeans.test;
+import java.net.URL;
+import java.util.Properties;
+import javax.ejb.EJBContainer;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+
+
+
public abstract class AbstractEjbEmbeddableTest extends AbstractTest
{
- /*@AfterClass
+ @AfterClass
public void afterClass()
{
EJBContainer current = EJBContainer.getCurrentEJBContainer();
@@ -35,6 +43,6 @@
URL url = Thread.currentThread().getContextClassLoader().getResource(path);
String s = url.toString();
return s.substring(0, s.length() - path.length());
- }*/
+ }
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanTest.java 2008-12-10 09:28:19 UTC (rev 510)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanTest.java 2008-12-10 09:40:02 UTC (rev 511)
@@ -1,11 +1,18 @@
package org.jboss.webbeans.test;
+import javax.ejb.EJBException;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.jboss.webbeans.examples.Translator;
+import org.testng.annotations.Test;
+
+
public class EnterpriseBeanTest extends AbstractEjbEmbeddableTest
{
- /*(a)Test(expectedExceptions=UnsupportedOperationException.class)
+ @Test(expectedExceptions=UnsupportedOperationException.class)
public void test() throws NamingException
{
@@ -26,6 +33,6 @@
throw new RuntimeException(e.getCausedByException());
}
}
- }*/
+ }
}
17 years, 4 months
[webbeans-commits] Webbeans SVN: r510 - ri/trunk.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-10 04:28:19 -0500 (Wed, 10 Dec 2008)
New Revision: 510
Modified:
ri/trunk/build.xml
Log:
fix script
Modified: ri/trunk/build.xml
===================================================================
--- ri/trunk/build.xml 2008-12-09 22:31:04 UTC (rev 509)
+++ ri/trunk/build.xml 2008-12-10 09:28:19 UTC (rev 510)
@@ -15,6 +15,8 @@
<artifact:dependencies filesetId="jboss5.deployer.fileset" versionsId="jboss5.deployer.versions" >
<dependency groupId="org.jboss.webbeans.integration" artifactId="webbeans-ri-int-microcontainer" version="5.2.0-SNAPSHOT"/>
<dependency groupId="org.jboss.webbeans.integration" artifactId="webbeans-ri-int-jbossas" version="5.2.0-SNAPSHOT"/>
+ <remoteRepository id="snapshots.jboss.org" url="http://snapshots.jboss.org/maven2" />
+ <remoteRepository id="repository.jboss.org" url="http://repository.jboss.org/maven2" />
</artifact:dependencies>
<artifact:dependencies filesetId="google.collections.fileset">
17 years, 4 months
[webbeans-commits] Webbeans SVN: r509 - in ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans: bean and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2008-12-09 17:31:04 -0500 (Tue, 09 Dec 2008)
New Revision: 509
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/FacadeImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/InstanceImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/MetaDataCache.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/FacadeBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ManagerBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java
Log:
doc synchronization
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/FacadeImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/FacadeImpl.java 2008-12-09 22:00:33 UTC (rev 508)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/FacadeImpl.java 2008-12-09 22:31:04 UTC (rev 509)
@@ -106,4 +106,15 @@
return mergeBindingTypes(bindingTypes, newBindingTypes).toArray(new Annotation[0]);
}
+ /**
+ * Gets a string representation
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ return "Abstract facade implmentation";
+ }
+
}
\ No newline at end of file
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/InstanceImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/InstanceImpl.java 2008-12-09 22:00:33 UTC (rev 508)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/InstanceImpl.java 2008-12-09 22:31:04 UTC (rev 509)
@@ -60,6 +60,11 @@
return manager.getInstanceByType(type, mergeBindings(bindingTypes));
}
+ /**
+ * Gets a string representation
+ *
+ * @return A string representation
+ */
@Override
public String toString()
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-09 22:00:33 UTC (rev 508)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-09 22:31:04 UTC (rev 509)
@@ -657,6 +657,11 @@
return resolver;
}
+ /**
+ * Gets a string representation
+ *
+ * @return A string representation
+ */
@Override
public String toString() {
StringBuilder buffer = new StringBuilder();
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/MetaDataCache.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/MetaDataCache.java 2008-12-09 22:00:33 UTC (rev 508)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/MetaDataCache.java 2008-12-09 22:31:04 UTC (rev 509)
@@ -149,6 +149,11 @@
});
}
+ /**
+ * Gets a string representation
+ *
+ * @return A string representation
+ */
@Override
public String toString()
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java 2008-12-09 22:00:33 UTC (rev 508)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java 2008-12-09 22:31:04 UTC (rev 509)
@@ -364,6 +364,11 @@
return null;
}
+ /**
+ * Gets a string representation
+ *
+ * @return A string representation
+ */
@Override
public String toString()
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2008-12-09 22:00:33 UTC (rev 508)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2008-12-09 22:31:04 UTC (rev 509)
@@ -89,21 +89,28 @@
// Logger
private LogProvider log = Logging.getLogProvider(AbstractBean.class);
-
+ // The binding types
private Set<Annotation> bindingTypes;
+ // The name
protected String name;
+ // The scope type
protected Class<? extends Annotation> scopeType;
+ // The merged stereotypes
private MergedStereotypes<T, E> mergedStereotypes;
+ // The deployment type
protected Class<? extends Annotation> deploymentType;
+ // The type
protected Class<T> type;
+ // The remove method
protected AnnotatedMethod<Object> removeMethod;
+ // The API types
protected Set<Class<?>> apiTypes;
+ // The injection points
protected Set<AnnotatedItem<?, ?>> injectionPoints;
-
+ // If the type a primitive?
private boolean primitive;
-
+ // The Web Beans manager
protected ManagerImpl manager;
-
// Cached values
private Type declaredBeanType;
@@ -198,6 +205,11 @@
return;
}
+ /**
+ * Gets the default deployment type
+ *
+ * @return The default deployment type
+ */
protected abstract Class<? extends Annotation> getDefaultDeploymentType();
/**
@@ -344,14 +356,14 @@
}
/**
- * Returns the annotated time the bean reresents
+ * Returns the annotated time the bean represents
*
* @return The annotated item
*/
protected abstract AnnotatedItem<T, E> getAnnotatedItem();
/**
- * Returns the binding types
+ * Gets the binding types
*
* @return The set of binding types
*
@@ -363,7 +375,7 @@
}
/**
- * Returns the declared bean type
+ * Gets the declared bean type
*
* @return The bean type
*/
@@ -385,14 +397,14 @@
}
/**
- * Returns the default name of the bean
+ * Gets the default name of the bean
*
* @return The default name
*/
protected abstract String getDefaultName();
/**
- * Returns the deployment type of the bean
+ * Gets the deployment type of the bean
*
* @return The deployment type
*
@@ -404,7 +416,7 @@
}
/**
- * Returns the injection points of the bean
+ * Gets the injection points of the bean
*
* @return The set of injection points
*/
@@ -414,7 +426,7 @@
}
/**
- * Returns the merged sterotypes of the bean
+ * Gets the merged stereotypes of the bean
*
* @return The set of merged stereotypes
*/
@@ -424,7 +436,7 @@
}
/**
- * Returns the name of the bean
+ * Gets the name of the bean
*
* @return The name
*
@@ -436,7 +448,7 @@
}
/**
- * Returns the remove method of the bean
+ * Gets the remove method of the bean
*
* @return The remove method
*/
@@ -446,7 +458,7 @@
}
/**
- * Returns the scope type of the bean
+ * Gets the scope type of the bean
*
* @return The scope type
*
@@ -458,7 +470,7 @@
}
/**
- * Returns the specializes type of the bean
+ * Gets the specializes type of the bean
*
* @return The specialized type
*/
@@ -468,7 +480,7 @@
}
/**
- * Returns the type of the bean
+ * Gets the type of the bean
*
* @return The type
*/
@@ -478,7 +490,7 @@
}
/**
- * Returns the API types of the bean
+ * Gets the API types of the bean
*
* @return The set of API types
*
@@ -503,7 +515,7 @@
}
/**
- * Inicates if bean is nullable
+ * Indicates if bean is nullable
*
* @return True if nullable, false otherwise
*
@@ -540,7 +552,7 @@
}
/**
- * Returns a string representation
+ * Gets a string representation
*
* @return The string representation
*/
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2008-12-09 22:00:33 UTC (rev 508)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2008-12-09 22:31:04 UTC (rev 509)
@@ -52,11 +52,13 @@
*/
public abstract class AbstractClassBean<T> extends AbstractBean<T, Class<T>>
{
-
+ // Logger
private static final LogProvider log = Logging.getLogProvider(AbstractClassBean.class);
-
+ // The item representation
private AnnotatedClass<T> annotatedItem;
+ // The injectable fields
private Set<AnnotatedField<Object>> injectableFields;
+ // The initializer methods
private Set<AnnotatedMethod<Object>> initializerMethods;
/**
@@ -95,7 +97,7 @@
}
/**
- * Returns the producer methods
+ * Gets the producer methods
*
* @return A set of producer methods. An empty set is returned if there are
* none present
@@ -106,7 +108,7 @@
}
/**
- * Returns the producer fields
+ * Gets the producer fields
*
* @return A set of producer fields. An empty set is returned if there are
* none present
@@ -116,6 +118,11 @@
return getAnnotatedItem().getAnnotatedFields(Produces.class);
}
+ /**
+ * Gets the observer methods
+ *
+ * @return A set of observer methods. An empty set is returned if there are no matches.
+ */
public Set<AnnotatedMethod<Object>> getObserverMethods()
{
return getAnnotatedItem().getMethodsWithAnnotatedParameters(Observes.class);
@@ -229,7 +236,7 @@
}
/**
- * Returns the annotated item
+ * Gets the annotated item
*
* @return The annotated item
*/
@@ -240,7 +247,7 @@
}
/**
- * Returns the default name
+ * Gets the default name
*
* @return The default name
*/
@@ -253,7 +260,7 @@
}
/**
- * Returns the injectable fields
+ * Gets the injectable fields
*
* @return The set of injectable fields
*/
@@ -263,7 +270,7 @@
}
/**
- * Returns the annotated methods
+ * Gets the annotated methods
*
* @return The set of annotated methods
*/
@@ -273,7 +280,7 @@
}
/**
- * Returns a string representation
+ * Gets a string representation
*
* @return The string representation
*/
@@ -296,6 +303,11 @@
}
@Override
+ /**
+ * Gets the default deployment type
+ *
+ * @return The default deployment type
+ */
protected Class<? extends Annotation> getDefaultDeploymentType()
{
return Production.class;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-09 22:00:33 UTC (rev 508)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-09 22:31:04 UTC (rev 509)
@@ -271,7 +271,7 @@
}
/**
- * Returns the specializes type of the bean
+ * Gets the specializes type of the bean
*
* @return The specialized type
*/
@@ -305,7 +305,7 @@
}
/**
- * Returns the EJB metadata
+ * Gets the EJB metadata
*
* @return The metadata
*/
@@ -314,6 +314,11 @@
return ejbMetaData;
}
+ /**
+ * Gets a string representation
+ *
+ * @return The string representation
+ */
@Override
public String toString()
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java 2008-12-09 22:00:33 UTC (rev 508)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java 2008-12-09 22:31:04 UTC (rev 509)
@@ -31,6 +31,7 @@
* @author David Allen
*
* @param <T>
+ * @param <S>
*/
public class EventBean<T, S> extends FacadeBean<Event<T>, S, T>
{
@@ -46,6 +47,11 @@
super(field, manager);
}
+ /**
+ * Creates an instance
+ *
+ * @return an event instance
+ */
@Override
public Event<T> create()
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/FacadeBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/FacadeBean.java 2008-12-09 22:00:33 UTC (rev 508)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/FacadeBean.java 2008-12-09 22:31:04 UTC (rev 509)
@@ -32,16 +32,24 @@
* Facade bean for implicit beans
*
* @author Gavin King
- *
+ *
* @param <T>
* @param <S>
* @param <P>
*/
-public abstract class FacadeBean<T, S, P> extends AbstractBean<T, S> {
-
+public abstract class FacadeBean<T, S, P> extends AbstractBean<T, S>
+{
+ // The underlying item
protected AnnotatedItem<T, S> annotatedItem;
- public FacadeBean(AnnotatedItem<T, S> field, ManagerImpl manager) {
+ /**
+ * Constructor
+ *
+ * @param field The facaded field
+ * @param manager The Web Beans manager
+ */
+ public FacadeBean(AnnotatedItem<T, S> field, ManagerImpl manager)
+ {
super(manager);
this.annotatedItem = field;
init();
@@ -52,7 +60,8 @@
*
* Calls super method and validates the annotated item
*/
- protected void init() {
+ protected void init()
+ {
super.init();
checkAnnotatedItem();
}
@@ -60,7 +69,8 @@
/**
* Validates the annotated item
*/
- private void checkAnnotatedItem() {
+ private void checkAnnotatedItem()
+ {
Type[] actualTypeArguments = annotatedItem.getActualTypeArguments();
if (actualTypeArguments.length != 1)
{
@@ -72,37 +82,73 @@
}
}
- protected Annotation[] getBindingTypesArray() {
+ /*
+ * Gets the binding type as an array
+ *
+ * @return The binding types
+ */
+ protected Annotation[] getBindingTypesArray()
+ {
return annotatedItem.getBindingTypesAsArray();
}
+ /**
+ * Gets the type paramater of the facade
+ *
+ * @return The type parameter
+ */
@SuppressWarnings("unchecked")
- protected Class<P> getTypeParameter() {
+ protected Class<P> getTypeParameter()
+ {
return (Class<P>) annotatedItem.getType().getTypeParameters()[0].getClass();
}
+ /**
+ * Initializes the scope type to dependent
+ */
@Override
- protected void initScopeType() {
+ protected void initScopeType()
+ {
this.scopeType = Dependent.class;
}
+ /**
+ * Initializes the deployment type to Standard
+ */
@Override
- protected void initDeploymentType() {
+ protected void initDeploymentType()
+ {
this.deploymentType = Standard.class;
}
+ /**
+ * Gets the underlying item
+ *
+ * @return The underlying item
+ */
@Override
- protected AnnotatedItem<T, S> getAnnotatedItem() {
+ protected AnnotatedItem<T, S> getAnnotatedItem()
+ {
return annotatedItem;
}
+ /**
+ * Gets the default name
+ *
+ * @return The default name
+ */
@Override
- protected String getDefaultName() {
+ protected String getDefaultName()
+ {
return null;
}
+ /**
+ * Initializes the type
+ */
@Override
- protected void initType() {
+ protected void initType()
+ {
try
{
if (getAnnotatedItem() != null)
@@ -117,11 +163,15 @@
}
}
+ /**
+ * Gets the default deployment type, Production
+ */
@Override
- protected Class<? extends Annotation> getDefaultDeploymentType() {
+ protected Class<? extends Annotation> getDefaultDeploymentType()
+ {
return Production.class;
}
-
+
/**
* Returns a string representation
*
@@ -130,7 +180,7 @@
@Override
public String toString()
{
- return "FacadeBean " + getName();
- }
+ return "FacadeBean " + getName() + " for " + annotatedItem;
+ }
}
\ No newline at end of file
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java 2008-12-09 22:00:33 UTC (rev 508)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java 2008-12-09 22:31:04 UTC (rev 509)
@@ -27,83 +27,148 @@
* A delegating bean
*
* @author Pete Muir
- *
+ *
* @param <T>
*/
public abstract class ForwardingBean<T> extends Bean<T>
{
-
+
+ /**
+ * Constructor
+ *
+ * @param manager The Web Beans manager
+ */
public ForwardingBean(Manager manager)
{
super(manager);
}
+ /**
+ * Creates an instance of the delegate
+ *
+ * @return an instance of the delegate
+ */
@Override
public T create()
{
return delegate().create();
}
+ /**
+ * Destroys an instance through the delegate
+ *
+ * @param instance The instance to destroy
+ */
@Override
public void destroy(T instance)
{
delegate().destroy(instance);
}
+ /**
+ * Gets the binding types of the delegate
+ *
+ * @return The binding types
+ */
@Override
public Set<Annotation> getBindingTypes()
{
return delegate().getBindingTypes();
}
+ /**
+ * Gets the deployment types of the delegate
+ *
+ * @return The deployment types
+ */
@Override
public Class<? extends Annotation> getDeploymentType()
{
return delegate().getDeploymentType();
}
+ /**
+ * Gets the name of the delegate
+ *
+ * @return The name
+ */
@Override
public String getName()
{
return delegate().getName();
}
+ /**
+ * Gets the scope type of the delegate
+ *
+ * @return The scope type
+ */
@Override
public Class<? extends Annotation> getScopeType()
{
return delegate().getScopeType();
}
+ /**
+ * Gets the API types of the delegate
+ *
+ * @return The API types
+ */
@Override
public Set<Class<?>> getTypes()
{
return delegate().getTypes();
}
+ /**
+ * Indicates if the delegate is nullable
+ *
+ * @return True if nullable, false otherwise
+ */
@Override
public boolean isNullable()
{
return delegate().isNullable();
}
+ /**
+ * Indicates if the delegate is serializable
+ *
+ * @return True if serializable, false otherwise
+ */
@Override
public boolean isSerializable()
{
return delegate().isSerializable();
}
-
+
+ /**
+ * Gets the hash code of the delegate
+ *
+ * @return The hash code
+ */
@Override
public int hashCode()
{
return delegate().hashCode();
}
-
+
+ /**
+ * Compares an object with the delegate
+ *
+ * @return True if equals, false otherwise
+ */
@Override
public boolean equals(Object obj)
{
return delegate().equals(obj);
}
-
+
+ /**
+ * Abstract getter for the delegate
+ *
+ * @return The delegate
+ */
protected abstract Bean<T> delegate();
/**
@@ -114,7 +179,7 @@
@Override
public String toString()
{
- return "ForwardingBean " + getName();
- }
-
+ return "ForwardingBean " + getName() + " for " + delegate().toString();
+ }
+
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ManagerBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ManagerBean.java 2008-12-09 22:00:33 UTC (rev 508)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ManagerBean.java 2008-12-09 22:31:04 UTC (rev 509)
@@ -34,71 +34,120 @@
* Helper bean for accessing the Manager
*
* @author Gavin King
- *
+ *
*/
public class ManagerBean extends Bean<Manager>
{
-
+ // The API types of the manager
private static Set<Class<?>> types = Reflections.getTypeHierachy(Manager.class);
+ // The binding types of the manager
private static final Set<Annotation> BINDING = new HashSet<Annotation>(Arrays.asList(new CurrentAnnotationLiteral()));
+ /**
+ * Constructor
+ *
+ * @param manager The Web Beans manager
+ */
public ManagerBean(Manager manager)
{
super(manager);
}
-
+
+ /**
+ * Creates an instance of the manager
+ *
+ * @return An instance
+ */
@Override
public Manager create()
{
return getManager();
}
+ /**
+ * Destroys the manager (not)
+ */
@Override
public void destroy(Manager instance)
{
- //No -op
+ // No -op
}
+ /**
+ * Gets the binding types
+ *
+ * @return A set containing Current
+ */
@Override
public Set<Annotation> getBindingTypes()
{
return BINDING;
}
+ /**
+ * Gets the deployment types
+ *
+ * @return Standard
+ */
@Override
public Class<? extends Annotation> getDeploymentType()
{
return Standard.class;
}
+ /**
+ * Gets the name
+ *
+ * @return null
+ */
@Override
public String getName()
{
return null;
}
+ /**
+ * Gets the scope type
+ *
+ * @return Dependent
+ */
@Override
public Class<? extends Annotation> getScopeType()
{
return Dependent.class;
}
+ /**
+ * Gets the API types
+ *
+ * @return The API types
+ */
@Override
public Set<Class<?>> getTypes()
{
return types;
}
+ /**
+ * Indicates if the bean is nullable
+ *
+ * @return true
+ */
@Override
public boolean isNullable()
{
return true;
}
+ /**
+ * Indicates if the bean is serializable
+ *
+ * @return false
+ */
@Override
public boolean isSerializable()
{
return false;
}
-
+
}
\ No newline at end of file
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerBean.java 2008-12-09 22:00:33 UTC (rev 508)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerBean.java 2008-12-09 22:31:04 UTC (rev 509)
@@ -29,23 +29,38 @@
import org.jboss.webbeans.util.Names;
/**
+ * The implicit producer bean
*
* @author Gavin King
- *
+ *
* @param <T>
* @param <S>
*/
-public abstract class ProducerBean<T, S> extends AbstractBean<T, S> {
-
+public abstract class ProducerBean<T, S> extends AbstractBean<T, S>
+{
+ // The declaring bean
protected AbstractClassBean<?> declaringBean;
- public ProducerBean(AbstractClassBean<?> declaringBean, ManagerImpl manager) {
+ /**
+ * Constructor
+ *
+ * @param declaringBean The declaring bean
+ * @param manager The Web Beans manager
+ */
+ public ProducerBean(AbstractClassBean<?> declaringBean, ManagerImpl manager)
+ {
super(manager);
this.declaringBean = declaringBean;
}
+ /**
+ * Gets the deployment types
+ *
+ * @return The deployment types of the declaring bean
+ */
@Override
- protected Class<? extends Annotation> getDefaultDeploymentType() {
+ protected Class<? extends Annotation> getDefaultDeploymentType()
+ {
return deploymentType = declaringBean.getDeploymentType();
}
@@ -53,7 +68,8 @@
* Initializes the API types
*/
@Override
- protected void initApiTypes() {
+ protected void initApiTypes()
+ {
if (getType().isArray() || getType().isPrimitive())
{
apiTypes = new HashSet<Class<?>>();
@@ -84,25 +100,27 @@
this.type = getAnnotatedItem().getType();
}
}
- catch (ClassCastException e)
+ catch (ClassCastException e)
{
throw new RuntimeException(" Cannot cast producer type " + getAnnotatedItem().getType() + " to bean type " + (getDeclaredBeanType() == null ? " unknown " : getDeclaredBeanType()), e);
}
}
-
+
/**
* Returns the declaring bean
*
* @return The bean representation
*/
- public AbstractClassBean<?> getDeclaringBean() {
+ public AbstractClassBean<?> getDeclaringBean()
+ {
return declaringBean;
}
/**
* Validates the producer method
*/
- protected void checkProducerReturnType() {
+ protected void checkProducerReturnType()
+ {
for (Type type : getAnnotatedItem().getActualTypeArguments())
{
if (!(type instanceof Class))
@@ -116,23 +134,40 @@
* Initializes the bean and its metadata
*/
@Override
- protected void init() {
+ protected void init()
+ {
super.init();
checkProducerReturnType();
}
- protected void checkReturnValue(T instance) {
+ /**
+ * Validates the return value
+ *
+ * @param instance The instance to validate
+ */
+ protected void checkReturnValue(T instance)
+ {
if (instance == null && !getScopeType().equals(Dependent.class))
{
throw new IllegalProductException("Cannot return null from a non-dependent producer method");
}
}
- protected Object getReceiver() {
- return getAnnotatedItem().isStatic() ?
- null : manager.getInstance(getDeclaringBean());
+ /**
+ * Gets the receiver of the product
+ *
+ * @return The receiver
+ */
+ protected Object getReceiver()
+ {
+ return getAnnotatedItem().isStatic() ? null : manager.getInstance(getDeclaringBean());
}
-
+
+ /**
+ * Gets a string representation
+ *
+ * @return The string representation
+ */
@Override
public String toString()
{
@@ -149,6 +184,6 @@
buffer.append(" [" + getType().getName() + "]\n");
buffer.append(" API types " + getTypes() + ", binding types " + getBindingTypes() + "\n");
return buffer.toString();
- }
+ }
}
\ No newline at end of file
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java 2008-12-09 22:00:33 UTC (rev 508)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java 2008-12-09 22:31:04 UTC (rev 509)
@@ -33,7 +33,7 @@
*/
public class ProducerFieldBean<T> extends ProducerBean<T, Field>
{
-
+ // The underlying field
private AnnotatedField<T> field;
/**
@@ -97,6 +97,11 @@
return field.getPropertyName();
}
+ /**
+ * Gets a string representation
+ *
+ * @return The string representation
+ */
@Override
public String toString()
{
@@ -125,5 +130,4 @@
return buffer.toString();
}
-
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2008-12-09 22:00:33 UTC (rev 508)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2008-12-09 22:31:04 UTC (rev 509)
@@ -41,7 +41,7 @@
*/
public class ProducerMethodBean<T> extends ProducerBean<T, Method>
{
-
+ // The underlying method
private AnnotatedMethod<T> method;
/**
@@ -184,7 +184,11 @@
return removeMethod;
}
-
+ /**
+ * Gets a string representation
+ *
+ * @return The string representation
+ */
@Override
public String toString()
{
@@ -213,5 +217,4 @@
return buffer.toString();
}
-
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2008-12-09 22:00:33 UTC (rev 508)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2008-12-09 22:31:04 UTC (rev 509)
@@ -46,13 +46,15 @@
*/
public class SimpleBean<T> extends AbstractClassBean<T>
{
-
+ // Logger
private static LogProvider log = Logging.getLogProvider(SimpleBean.class);
+ // Empty list representing no-args
private static List<Class<?>> NO_ARGUMENTS = Collections.emptyList();
-
+ // The constructor
private AnnotatedConstructor<T> constructor;
-
+ // The post-construct method
private AnnotatedMethod<Object> postConstruct;
+ // The pre-destroy method
private AnnotatedMethod<Object> preDestroy;
/**
@@ -347,6 +349,11 @@
return preDestroy;
}
+ /**
+ * Gets a string representation
+ *
+ * @return The string representation
+ */
@Override
public String toString()
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java 2008-12-09 22:00:33 UTC (rev 508)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java 2008-12-09 22:31:04 UTC (rev 509)
@@ -40,8 +40,9 @@
public class ProxyMethodHandler implements MethodHandler, Serializable
{
private static final long serialVersionUID = -5391564935097267888L;
-
+ // The bean
private transient Bean<?> bean;
+ // The bean index in the manager
private int beanIndex;
/**
@@ -80,6 +81,11 @@
return proxiedMethod.invoke(proxiedInstance, args);
}
+ /**
+ * Gets a string representation
+ *
+ * @return The string representation
+ */
@Override
public String toString()
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java 2008-12-09 22:00:33 UTC (rev 508)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java 2008-12-09 22:31:04 UTC (rev 509)
@@ -162,6 +162,11 @@
});
}
+ /**
+ * Gets a string representation
+ *
+ * @return The string representation
+ */
@Override
public String toString()
{
17 years, 4 months
[webbeans-commits] Webbeans SVN: r508 - ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2008-12-09 17:00:33 -0500 (Tue, 09 Dec 2008)
New Revision: 508
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/FacadeImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/InstanceImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/MetaDataCache.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java
Log:
javadoc/comment/toString
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/FacadeImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/FacadeImpl.java 2008-12-09 21:03:47 UTC (rev 507)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/FacadeImpl.java 2008-12-09 22:00:33 UTC (rev 508)
@@ -59,7 +59,7 @@
/**
* Merges and validates the current and new bindings
*
- * Checkes with an abstract method for annotations to exclude
+ * Checks with an abstract method for annotations to exclude
*
* @param currentBindings Existing bindings
* @param newBindings New bindings
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/InstanceImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/InstanceImpl.java 2008-12-09 21:03:47 UTC (rev 507)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/InstanceImpl.java 2008-12-09 22:00:33 UTC (rev 508)
@@ -24,22 +24,20 @@
import javax.webbeans.Instance;
import javax.webbeans.manager.Manager;
-import org.jboss.webbeans.util.Strings;
-
/**
- * Implementation of the Event interface
+ * Helper implementation for Instance for getting instances
*
- * @author David Allen
+ * @author Gavin King
*
* @param <T>
- * @see javax.webbeans.Event
+ * @see javax.webbeans.Instace
*/
public class InstanceImpl<T> extends FacadeImpl<T> implements Instance<T>
{
/**
* Constructor
*
- * @param type The event type
+ * @param type The obtainable type
* @param manager The Web Beans manager
* @param bindingTypes The binding types
*/
@@ -48,6 +46,15 @@
super(type, manager, bindingTypes);
}
+ /**
+ * Gets an instance with the matching binding types
+ *
+ * @param bindingTypes The binding types
+ * @return The instance
+ *
+ * @see javax.webbeans.Instance#get(Annotation...)
+ * @see javax.webbeans.manager.Manager#getInstanceByType(Class, Annotation...)
+ */
public T get(Annotation... bindingTypes)
{
return manager.getInstanceByType(type, mergeBindings(bindingTypes));
@@ -56,13 +63,16 @@
@Override
public String toString()
{
- StringBuilder buffer = new StringBuilder();
- buffer.append("Obtainable Instance:\n");
- buffer.append(Strings.collectionToString(" Bindings: ", bindingTypes));
- return buffer.toString();
+ return "Obtainable instance for type " + type + " and binding types " + bindingTypes;
}
/**
+ * Filters annotations from the binding type or parameter lists
+ *
+ * This implementation filters no annotations
+ *
+ * @return A set of annotations to filter
+ *
* @see org.jboss.webbeans.FacadeImpl#getFilteredAnnotations
*/
@Override
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-09 21:03:47 UTC (rev 507)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-09 22:00:33 UTC (rev 508)
@@ -72,17 +72,29 @@
*/
public class ManagerImpl implements Manager
{
+ // The JNDI key to place the manager under
public static final String JNDI_KEY = "java:comp/Manager";
+ // The enabled deployment types from web-beans.xml
private List<Class<? extends Annotation>> enabledDeploymentTypes;
+ // The Web Beans manager
private EventManager eventManager;
+ // The bean resolver
private Resolver resolver;
+ // The registered contexts
private ContextMap contextMap;
+ // The client proxy pool
private ProxyPool proxyPool;
+ // The registered beans
private List<Bean<?>> beans;
+ // The registered decorators
private Set<Decorator> decorators;
+ // The registered interceptors
private Set<Interceptor> interceptors;
+ /**
+ * Constructor
+ */
@SuppressWarnings("unchecked")
public ManagerImpl()
{
@@ -109,7 +121,7 @@
/**
* Set up the enabled deployment types, if none are specified by the user,
- * the default @Production and @Standard are used
+ * the default @Production and @Standard are used. For internal use.
*
* @param enabledDeploymentTypes The enabled deployment types from
* web-beans.xml
@@ -155,7 +167,7 @@
}
/**
- * Resolve the disposal method for the given producer method
+ * Resolve the disposal method for the given producer method. For internal use.
*
* @param apiType The API type to match
* @param bindingTypes The binding types to match
@@ -182,7 +194,7 @@
}
/**
- * A strongly ordered list of enabled deployment types
+ * A strongly ordered, unmodifyable list of enabled deployment types
*
* @return The ordered enabled deployment types known to the manager
*/
@@ -223,7 +235,7 @@
/**
* Check the resolution request is valid, and then ask the resolver to
- * perform the resolution
+ * perform the resolution. For internal use.
*
* @param element The item to resolve
* @param bindingTypes The binding types to match
@@ -259,7 +271,7 @@
/**
* Wraps a collection of beans into a thread safe list. Since this overwrites
* any existing list of beans in the manager, this should only be done on
- * startup and other controlled situations.
+ * startup and other controlled situations. For internal use.
*
* @param beans The set of beans to add
* @return A reference to the manager
@@ -276,7 +288,7 @@
}
/**
- * The beans registered with the Web Bean manager
+ * The beans registered with the Web Bean manager. For internal use
*
* @return The list of known beans
*/
@@ -286,7 +298,7 @@
}
/**
- * Adds a context
+ * Registers a context with the manager
*
* @param context The context to add
* @return A reference to the manager
@@ -300,9 +312,9 @@
}
/**
- * Adds a decorator
+ * Registers a decorator with the manager
*
- * @param decorator The decorator to add
+ * @param decorator The decorator to register
* @return A reference to the manager
*
* @see javax.webbeans.manager.Manager#addDecorator(javax.webbeans.manager.Decorator)
@@ -314,9 +326,9 @@
}
/**
- * Adds an interceptor
+ * Registers an interceptor with the manager
*
- * @param interceptor The interceptor to add
+ * @param interceptor The interceptor to register
* @return A reference to the manager
*
* @see javax.webbeans.manager.Manager#addInterceptor(javax.webbeans.manager.Interceptor)
@@ -328,9 +340,9 @@
}
/**
- * Adds an observer for a given event type and binding types
+ * Registers an observer for a given event type and binding types
*
- * @param observer The observer to add
+ * @param observer The observer to register
* @param eventType The event type to match
* @param bindings The bindings to match
* @return A reference to the manager
@@ -345,9 +357,9 @@
}
/**
- * Adds an observer for a given event type literal and binding types
+ * Registers an observer for a given event type literal and binding types
*
- * @param observer The observer to add
+ * @param observer The observer to register
* @param eventType The event type literal to match
* @param bindings The bindings to match
* @return A reference to the manager
@@ -358,7 +370,7 @@
@SuppressWarnings("unchecked")
public <T> Manager addObserver(Observer<T> observer, TypeLiteral<T> eventType, Annotation... bindings)
{
- this.eventManager.addObserver(observer, (Class<T>) eventType.getType(), bindings);
+ eventManager.addObserver(observer, (Class<T>) eventType.getType(), bindings);
return this;
}
@@ -391,8 +403,8 @@
// Get the observers for this event. Although resolveObservers is
// parameterized, this method is not, so we have to use
// Observer<Object> for observers.
- Set<Observer<Object>> observers = this.resolveObservers(event, bindings);
- this.eventManager.notifyObservers(observers, event);
+ Set<Observer<Object>> observers = resolveObservers(event, bindings);
+ eventManager.notifyObservers(observers, event);
}
/**
@@ -431,10 +443,10 @@
}
/**
- * Direct access to build in contexts for internal use
+ * Direct access to built in contexts. For internal use.
*
- * @param scopeType
- * @return
+ * @param scopeType The scope type of the context
+ * @return The context
*/
public Context getBuiltInContext(Class<? extends Annotation> scopeType)
{
@@ -636,7 +648,7 @@
}
/**
- * Get the web bean resolver
+ * Get the web bean resolver. For internal use
*
* @return The resolver
*/
@@ -646,7 +658,18 @@
}
@Override
- public String toString()
+ public String toString() {
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("Manager\n");
+ buffer.append("Enabled deployment types: " + getEnabledDeploymentTypes() + "\n");
+ buffer.append("Registered contexts: " + contextMap.keySet() + "\n");
+ buffer.append("Registered beans: " + getBeans().size() + "\n");
+ buffer.append("Registered decorators: " + decorators.size() + "\n");
+ buffer.append("Registered interceptors: " + interceptors.size() + "\n");
+ return buffer.toString();
+ }
+
+ public String toDetailedString()
{
StringBuilder buffer = new StringBuilder();
buffer.append(Strings.collectionToString("Enabled deployment types: ", getEnabledDeploymentTypes()));
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/MetaDataCache.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/MetaDataCache.java 2008-12-09 21:03:47 UTC (rev 507)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/MetaDataCache.java 2008-12-09 22:00:33 UTC (rev 508)
@@ -27,29 +27,50 @@
import org.jboss.webbeans.util.ConcurrentCache;
import org.jboss.webbeans.util.Strings;
+/**
+ * Metadata singleton for holding EJB metadata, scope models etc.
+ *
+ * @author Pete Muir
+ *
+ */
public class MetaDataCache
{
+ // The singleton instance
+ private static MetaDataCache instance;
- private static MetaDataCache instance;
-
+ /**
+ * Gets the singleton
+ *
+ * @return The instance
+ */
public static MetaDataCache instance()
{
return instance;
}
-
+
static
{
instance = new MetaDataCache();
}
-
+
+ // The stereotype models
private ConcurrentCache<Class<? extends Annotation>, StereotypeModel<?>> stereotypes = new ConcurrentCache<Class<? extends Annotation>, StereotypeModel<?>>();
-
+ // The scope models
private ConcurrentCache<Class<? extends Annotation>, ScopeModel<?>> scopes = new ConcurrentCache<Class<? extends Annotation>, ScopeModel<?>>();
-
+ // The binding type models
private ConcurrentCache<Class<? extends Annotation>, BindingTypeModel<?>> bindingTypes = new ConcurrentCache<Class<? extends Annotation>, BindingTypeModel<?>>();
-
+ // EJB metadata
private ConcurrentCache<Class<?>, EjbMetaData<?>> ejbMetaDataMap = new ConcurrentCache<Class<?>, EjbMetaData<?>>();
+ /**
+ * Gets a stereotype model
+ *
+ * Adds the model if it is not present.
+ *
+ * @param <T> The type
+ * @param stereotype The stereotype
+ * @return The stereotype model
+ */
public <T extends Annotation> StereotypeModel<T> getStereotype(final Class<T> stereotype)
{
return stereotypes.putIfAbsent(stereotype, new Callable<StereotypeModel<T>>()
@@ -62,6 +83,15 @@
});
}
+ /**
+ * Gets a scope model
+ *
+ * Adds the model if it is not present.
+ *
+ * @param <T> The type
+ * @param scopeType The scope type
+ * @return The scope type model
+ */
public <T extends Annotation> ScopeModel<T> getScopeModel(final Class<T> scopeType)
{
return scopes.putIfAbsent(scopeType, new Callable<ScopeModel<T>>()
@@ -75,6 +105,15 @@
});
}
+ /**
+ * Gets a binding type model.
+ *
+ * Adds the model if it is not present.
+ *
+ * @param <T> The type
+ * @param bindingType The binding type
+ * @return The binding type model
+ */
public <T extends Annotation> BindingTypeModel<T> getBindingTypeModel(final Class<T> bindingType)
{
return bindingTypes.putIfAbsent(bindingType, new Callable<BindingTypeModel<T>>()
@@ -88,6 +127,15 @@
});
}
+ /**
+ * Gets metadata for an EJB
+ *
+ * Adds the model if it is not present
+ *
+ * @param <T> The type
+ * @param clazz The class of the EJB
+ * @return The EJB metadata
+ */
public <T> EjbMetaData<T> getEjbMetaData(final Class<T> clazz)
{
return ejbMetaDataMap.putIfAbsent(clazz, new Callable<EjbMetaData<T>>()
@@ -105,6 +153,17 @@
public String toString()
{
StringBuilder buffer = new StringBuilder();
+ buffer.append("Metadata cache\n");
+ buffer.append("Registered binding type models: " + bindingTypes.size() + "\n");
+ buffer.append("Registered scope type models: " + scopes.size() + "\n");
+ buffer.append("Registered stereotype models: " + stereotypes.size() + "\n");
+ buffer.append("Registered EJB metadata: " + ejbMetaDataMap.size() + "\n");
+ return buffer.toString();
+ }
+
+ public String toDetailedString()
+ {
+ StringBuilder buffer = new StringBuilder();
buffer.append("====================\n");
buffer.append("Metadata cache\n");
buffer.append("====================\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java 2008-12-09 21:03:47 UTC (rev 507)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java 2008-12-09 22:00:33 UTC (rev 508)
@@ -38,7 +38,6 @@
import org.jboss.webbeans.model.BindingTypeModel;
import org.jboss.webbeans.util.ConcurrentCache;
import org.jboss.webbeans.util.ListComparator;
-import org.jboss.webbeans.util.Strings;
/**
* Implementation of Web Beans type safe and name based bean resolution
@@ -79,25 +78,29 @@
@Override
public String toString()
{
- StringBuilder buffer = new StringBuilder();
- buffer.append("Resolvable annotation item\n");
- buffer.append(delegate().toString() + "\n");
- return buffer.toString();
+ return "Resolvable annotated item for " + delegate();
}
}
+ // The resolved injection points
private ConcurrentCache<ResolvableAnnotatedItem<?, ?>, Set<Bean<?>>> resolvedInjectionPoints;
+ // The registerd injection points
private Set<AnnotatedItem<?, ?>> injectionPoints;
-
+ // The resolved names
private ConcurrentCache<String, Set<Bean<?>>> resolvedNames;
-
+ // The Web Beans manager
private ManagerImpl manager;
+ /**
+ * Constructor
+ *
+ * @param manager The Web Beans manager
+ */
public Resolver(ManagerImpl manager)
{
this.injectionPoints = new HashSet<AnnotatedItem<?, ?>>();
- this.resolvedInjectionPoints = new ConcurrentCache<ResolvableAnnotatedItem<?,?>, Set<Bean<?>>>();
+ this.resolvedInjectionPoints = new ConcurrentCache<ResolvableAnnotatedItem<?, ?>, Set<Bean<?>>>();
this.resolvedNames = new ConcurrentCache<String, Set<Bean<?>>>();
this.manager = manager;
}
@@ -105,12 +108,22 @@
/**
* Add multiple injection points for later resolving using
* {@link #registerInjectionPoint(AnnotatedItem)}. Useful during bootstrap.
+ *
+ * @param elements The injection points to add
*/
public void addInjectionPoints(Collection<AnnotatedItem<?, ?>> elements)
{
injectionPoints.addAll(elements);
}
+ /**
+ * Registers an injection point
+ *
+ * @param <T>
+ * @param <S>
+ * @param element The injection point to add
+ * @return A set of matching beans for the injection point
+ */
private <T, S> Set<Bean<T>> registerInjectionPoint(final ResolvableAnnotatedItem<T, S> element)
{
Callable<Set<Bean<T>>> callable = new Callable<Set<Bean<T>>>()
@@ -142,7 +155,7 @@
*/
public void clear()
{
- this.resolvedInjectionPoints = new ConcurrentCache<ResolvableAnnotatedItem<?,?>, Set<Bean<?>>>();
+ this.resolvedInjectionPoints = new ConcurrentCache<ResolvableAnnotatedItem<?, ?>, Set<Bean<?>>>();
resolvedNames = new ConcurrentCache<String, Set<Bean<?>>>();
}
@@ -169,6 +182,9 @@
/**
* Get the possible beans for the given element
+ *
+ * @param key The resolving criteria
+ * @return An unmodifiable set of matching beans
*/
@SuppressWarnings("unchecked")
public <T, S> Set<Bean<T>> get(final AnnotatedItem<T, S> key)
@@ -200,6 +216,9 @@
/**
* Get the possible beans for the given name
+ *
+ * @param name The name to match
+ * @return The set of matching beans
*/
public Set<Bean<?>> get(final String name)
{
@@ -223,6 +242,14 @@
});
}
+ /**
+ * Filters out the beans with the highest enabled deployment type
+ *
+ * @param <T>
+ * @param beans The beans to filter
+ * @param enabledDeploymentTypes The enabled deployment types
+ * @return The filtered beans
+ */
private static <T> Set<Bean<T>> retainHighestPrecedenceBeans(Set<Bean<T>> beans, List<Class<? extends Annotation>> enabledDeploymentTypes)
{
if (beans.size() > 0)
@@ -254,6 +281,14 @@
}
}
+ /**
+ * Gets the matching beans for binding criteria from a list of beans
+ *
+ * @param <T> The type of the beans
+ * @param element The binding criteria
+ * @param beans The beans to filter
+ * @return A set of filtered beans
+ */
@SuppressWarnings("unchecked")
private <T> Set<Bean<T>> getMatchingBeans(AnnotatedItem<T, ?> element, List<Bean<?>> beans)
{
@@ -268,6 +303,13 @@
return resolvedBeans;
}
+ /**
+ * Checks if binding criteria fulfill all binding types
+ *
+ * @param element The binding criteria to check
+ * @param bindingTypes The binding types to check
+ * @return True if all matches, false otherwise
+ */
private boolean containsAllBindingBindingTypes(AnnotatedItem<?, ?> element, Set<Annotation> bindingTypes)
{
for (Annotation bindingType : element.getBindingTypes())
@@ -296,12 +338,26 @@
return true;
}
+ /**
+ * Resolves decorators according to binding criteria
+ *
+ * @param types The set of API types to match
+ * @param bindingTypes The binding types to match
+ * @return The set of matching decorators
+ */
public List<Decorator> resolveDecorators(Set<Class<?>> types, Annotation[] bindingTypes)
{
// TODO Auto-generated method stub
return null;
}
+ /**
+ * Resolves interceptors according to binding criteria
+ *
+ * @param types The set of API types to match
+ * @param bindingTypes The binding types to match
+ * @return The set of matching interceptors
+ */
public List<Interceptor> resolveInterceptors(InterceptionType type, Annotation[] interceptorBindings)
{
// TODO Auto-generated method stub
@@ -313,9 +369,9 @@
{
StringBuilder buffer = new StringBuilder();
buffer.append("Resolver\n");
- buffer.append(resolvedInjectionPoints.toString() + "\n");
- buffer.append(Strings.collectionToString("Injection points: ", injectionPoints));
- buffer.append(Strings.mapToString("Resolved names: ", resolvedNames));
+ buffer.append("Injection points: " + injectionPoints.size() + "\n");
+ buffer.append("Resolved injection points: " + resolvedInjectionPoints.size() + "\n");
+ buffer.append("Resolved names points: " + resolvedNames.size() + "\n");
return buffer.toString();
}
17 years, 4 months
[webbeans-commits] Webbeans SVN: r507 - in ri/trunk/webbeans-ri/src: main/java/org/jboss/webbeans/bean and 4 other directories.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2008-12-09 16:03:47 -0500 (Tue, 09 Dec 2008)
New Revision: 507
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/FacadeImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/InstanceImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InstanceBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java
Log:
Manager as last parameter, Manager instead of ManagerImpl where applicable, remove proxyable check from manager (done at boot)
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/FacadeImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/FacadeImpl.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/FacadeImpl.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -22,6 +22,7 @@
import java.util.Set;
import javax.webbeans.DuplicateBindingTypeException;
+import javax.webbeans.manager.Manager;
import org.jboss.webbeans.util.Reflections;
@@ -37,18 +38,18 @@
// The binding types the helper operates on
protected final Set<? extends Annotation> bindingTypes;
// The Web Beans manager
- protected final ManagerImpl manager;
+ protected final Manager manager;
// The type of the operation
protected final Class<T> type;
/**
* Constructor
*
+ * @param type The event type
* @param manager The Web Beans manager
- * @param type The event type
* @param bindingTypes The binding types
*/
- protected FacadeImpl(ManagerImpl manager, Class<T> type, Annotation... bindingTypes)
+ protected FacadeImpl(Class<T> type, Manager manager, Annotation... bindingTypes)
{
this.manager = manager;
this.type = type;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/InstanceImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/InstanceImpl.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/InstanceImpl.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -22,6 +22,7 @@
import java.util.Set;
import javax.webbeans.Instance;
+import javax.webbeans.manager.Manager;
import org.jboss.webbeans.util.Strings;
@@ -38,11 +39,13 @@
/**
* Constructor
*
+ * @param type The event type
+ * @param manager The Web Beans manager
* @param bindingTypes The binding types
*/
- public InstanceImpl(ManagerImpl manager, Class<T> type, Annotation... bindingTypes)
+ public InstanceImpl(Class<T> type, Manager manager, Annotation... bindingTypes)
{
- super(manager, type, bindingTypes);
+ super(type, manager, bindingTypes);
}
public T get(Annotation... bindingTypes)
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -39,7 +39,6 @@
import javax.webbeans.Production;
import javax.webbeans.Standard;
import javax.webbeans.TypeLiteral;
-import javax.webbeans.UnproxyableDependencyException;
import javax.webbeans.UnsatisfiedDependencyException;
import javax.webbeans.manager.Bean;
import javax.webbeans.manager.Context;
@@ -74,7 +73,7 @@
public class ManagerImpl implements Manager
{
public static final String JNDI_KEY = "java:comp/Manager";
-
+
private List<Class<? extends Annotation>> enabledDeploymentTypes;
private EventManager eventManager;
private Resolver resolver;
@@ -83,7 +82,7 @@
private List<Bean<?>> beans;
private Set<Decorator> decorators;
private Set<Interceptor> interceptors;
-
+
@SuppressWarnings("unchecked")
public ManagerImpl()
{
@@ -430,7 +429,7 @@
}
return activeContexts.iterator().next();
}
-
+
/**
* Direct access to build in contexts for internal use
*
@@ -450,7 +449,6 @@
*
* @see javax.webbeans.manager.Manager#getInstance(javax.webbeans.manager.Bean)
*/
- @SuppressWarnings("unchecked")
public <T> T getInstance(Bean<T> bean)
{
try
@@ -511,11 +509,11 @@
{
return getInstanceByType(new AnnotatedClassImpl<T>(type, type, bindings), bindings);
}
-
+
public <T> T getMostSpecializedInstance(Bean<T> bean, boolean create)
{
- //TODO!!!!!
- return getInstance(bean);
+ // TODO!!!!!
+ return getInstance(bean);
}
/**
@@ -554,15 +552,7 @@
}
else
{
- Bean<T> bean = beans.iterator().next();
- if (MetaDataCache.instance().getScopeModel(bean.getScopeType()).isNormal() && !element.isProxyable())
- {
- throw new UnproxyableDependencyException(element + "Unable to proxy");
- }
- else
- {
- return getInstance(bean);
- }
+ return getInstance(beans.iterator().next());
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -109,6 +109,8 @@
/**
* Constructor
+ *
+ * @param manager The Web Beans manager
*/
public AbstractBean(ManagerImpl manager)
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -60,9 +60,10 @@
private Set<AnnotatedMethod<Object>> initializerMethods;
/**
+ * Constructor
*
- * @param annotatedItem Annotations read from java classes
- * @param xmlAnnotatedItem Annotations read from XML
+ * @param type The type
+ * @param manager The Web Beans manager
*/
public AbstractClassBean(Class<T> type, ManagerImpl manager)
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -56,6 +56,7 @@
* Constructor
*
* @param type The type of the bean
+ * @param manager The Web Beans manager
*/
public EnterpriseBean(Class<T> type, ManagerImpl manager)
{
@@ -218,7 +219,7 @@
bindDecorators();
bindInterceptors();
injectEjbAndCommonFields();
- injectBoundFields(manager, instance);
+ injectBoundFields(instance, manager);
callInitializers(instance);
return instance;
}
@@ -259,12 +260,13 @@
* Injects bound fields
*
* @param instance The bean instance
+ * @param manager The Web Beans manager
*/
- protected void injectBoundFields(Manager manager, T instance)
+ protected void injectBoundFields(T instance, Manager manager)
{
for (AnnotatedField<?> field : getInjectableFields())
{
- field.inject(manager, instance);
+ field.inject(instance, manager);
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -39,6 +39,7 @@
* Constructor
*
* @param field The underlying field abstraction
+ * @param manager The Web Beans manager
*/
public EventBean(AnnotatedItem<Event<T>, S> field, ManagerImpl manager)
{
@@ -48,7 +49,7 @@
@Override
public Event<T> create()
{
- return new EventImpl<T>(manager, getTypeParameter(), getBindingTypesArray());
+ return new EventImpl<T>(getTypeParameter(), manager, getBindingTypesArray());
}
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InstanceBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InstanceBean.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InstanceBean.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -54,7 +54,7 @@
@Override
public Instance<T> create()
{
- return new InstanceImpl<T>(manager, getTypeParameter(), getBindingTypesArray());
+ return new InstanceImpl<T>(getTypeParameter(), manager, getBindingTypesArray());
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerBean.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerBean.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -39,7 +39,7 @@
protected AbstractClassBean<?> declaringBean;
- public ProducerBean(ManagerImpl manager, AbstractClassBean<?> declaringBean) {
+ public ProducerBean(AbstractClassBean<?> declaringBean, ManagerImpl manager) {
super(manager);
this.declaringBean = declaringBean;
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -41,6 +41,7 @@
*
* @param method The producer field
* @param declaringBean The declaring bean instance
+ * @param manager The Web Beans manager
*/
public ProducerFieldBean(Field field, AbstractClassBean<?> declaringBean, ManagerImpl manager)
{
@@ -52,10 +53,11 @@
*
* @param method The producer field abstraction
* @param declaringBean The declaring bean
+ * @param manager The Web Beans manager
*/
public ProducerFieldBean(AnnotatedField<T> field, AbstractClassBean<?> declaringBean, ManagerImpl manager)
{
- super(manager, declaringBean);
+ super(declaringBean, manager);
this.field = field;
init();
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -49,6 +49,7 @@
*
* @param method The producer method
* @param declaringBean The declaring bean instance
+ * @param manager The Web Beans manager
*/
public ProducerMethodBean(Method method, AbstractClassBean<?> declaringBean, ManagerImpl manager)
{
@@ -60,10 +61,11 @@
*
* @param method The producer method abstraction
* @param declaringBean The declaring bean
+ * @param manager The Web Beans manager
*/
public ProducerMethodBean(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, ManagerImpl manager)
{
- super(manager, declaringBean);
+ super(declaringBean, manager);
this.method = method;
init();
}
@@ -76,7 +78,7 @@
@Override
public T create()
{
- T instance = method.invoke(manager, getReceiver());
+ T instance = method.invoke(getReceiver(), manager);
checkReturnValue(instance);
return instance;
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -59,6 +59,7 @@
* Constructor
*
* @param type The type of the bean
+ * @param manager The Web Beans manager
*/
public SimpleBean(Class<T> type, ManagerImpl manager)
{
@@ -78,7 +79,7 @@
bindDecorators();
bindInterceptors();
injectEjbAndCommonFields();
- injectBoundFields(manager, instance);
+ injectBoundFields(instance, manager);
callInitializers(instance);
callPostConstruct(instance);
return instance;
@@ -108,7 +109,7 @@
try
{
//note: RI supports injection into @PreDestroy
- preDestroy.invoke(manager, instance);
+ preDestroy.invoke(instance, manager);
}
catch (Exception e)
{
@@ -130,7 +131,7 @@
try
{
//note: RI supports injection into @PostConstruct
- postConstruct.invoke(manager, instance);
+ postConstruct.invoke(instance, manager);
}
catch (Exception e)
{
@@ -148,7 +149,7 @@
{
for (AnnotatedMethod<Object> initializer : getInitializerMethods())
{
- initializer.invoke(manager, instance);
+ initializer.invoke(instance, manager);
}
}
@@ -164,12 +165,13 @@
* Injects bound fields
*
* @param instance The instance to inject into
+ * @param manager The Web Beans manager
*/
- protected void injectBoundFields(Manager manager, T instance)
+ protected void injectBoundFields(T instance, Manager manager)
{
for (AnnotatedField<?> injectableField : getInjectableFields())
{
- injectableField.inject(manager, instance);
+ injectableField.inject(instance, manager);
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -25,9 +25,9 @@
import javax.webbeans.Event;
import javax.webbeans.Observable;
import javax.webbeans.Observer;
+import javax.webbeans.manager.Manager;
import org.jboss.webbeans.FacadeImpl;
-import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.util.Strings;
/**
@@ -46,11 +46,13 @@
/**
* Constructor
*
+ * @param eventType The event type
+ * @param manager The Web Beans manager
* @param bindingTypes The binding types
*/
- public EventImpl(ManagerImpl manager, Class<T> eventType, Annotation... bindingTypes)
+ public EventImpl(Class<T> eventType, Manager manager, Annotation... bindingTypes)
{
- super(manager, eventType, bindingTypes);
+ super(eventType, manager, bindingTypes);
}
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -142,6 +142,8 @@
/**
* Initializes a new instance of the EventManager.
+ *
+ * @param manager The Web Beans manager
*/
public EventManager(ManagerImpl manager)
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -73,13 +73,9 @@
* Creates an Observer which describes and encapsulates an observer method
* (8.5).
*
- * @param componentModel The model for the component which defines the
- * observer method
- * @param observer The observer method to notify
- * @param eventType The type of event being observed
- * @param beanModel The model for the bean which defines the observer method
- * @param observer The observer method to notify
- * @param eventType The type of event being observed
+ * @param observer The observer
+ * @param observerBean The observer bean
+ * @param manager The Web Beans manager
*/
public ObserverImpl(final AnnotatedMethod<Object> observer, final Bean<?> observerBean, final ManagerImpl manager)
{
@@ -176,7 +172,7 @@
// TODO replace event parameter
try
{
- observerMethod.invokeWithSpecialValue(manager, instance, Observes.class, event);
+ observerMethod.invokeWithSpecialValue(instance, Observes.class, event, manager);
}
catch (ExecutionException e)
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -53,6 +53,7 @@
/**
* Creates a new instance of the class, using this constructor
*
+ * @param manager The Web Beans manager
* @return The created instance
*/
public T newInstance(Manager manager);
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -42,8 +42,9 @@
* Injects an instance
*
* @param instance The instance to inject
+ * @param manager The Web Beans manager
*/
- public void inject(Manager manager, Object instance);
+ public void inject(Object instance, Manager manager);
/**
* Injects an instance
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -66,18 +66,20 @@
* Invokes the method
*
* @param instance The instance to invoke
+ * @param manager The Web Beans manager
* @return A reference to the instance
*/
- public T invoke(Manager manager, Object instance);
+ public T invoke(Object instance, Manager manager);
/**
* Invokes the observer method
*
* @param instance The instance to invoke
* @param event the event object
+ * @param manager The Web Beans manager
* @return A reference to the instance
*/
- public T invokeWithSpecialValue(Manager manager, Object instance, Class<? extends Annotation> specialParam, Object specialVal);
+ public T invokeWithSpecialValue(Object instance, Class<? extends Annotation> specialParam, Object specialVal, Manager manager);
/**
* Invokes the method
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -33,6 +33,7 @@
/**
* Gets the actual value of the parameter from the manager
*
+ * @param manager The Web Beans manager
* @return The value
*/
public T getValue(Manager manager);
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -194,12 +194,12 @@
* of annotated parameters.
*
* @param parameters The list of annotated parameter to look up
+ * @param manager The Web Beans manager
* @return The object array of looked up values
- *
*/
- protected static Object[] getParameterValues(Manager manager, List<AnnotatedParameter<Object>> parameters)
+ protected static Object[] getParameterValues(List<AnnotatedParameter<Object>> parameters, Manager manager)
{
- return getParameterValues(manager, parameters, null, null);
+ return getParameterValues(parameters, null, null, manager);
}
/**
@@ -207,10 +207,10 @@
* of annotated parameters.
*
* @param parameters The list of annotated parameter to look up
+ * @param manager The Web Beans manager
* @return The object array of looked up values
- *
*/
- protected static Object[] getParameterValues(Manager manager, List<AnnotatedParameter<Object>> parameters, Object specialVal, Class<? extends Annotation> specialParam)
+ protected static Object[] getParameterValues(List<AnnotatedParameter<Object>> parameters, Object specialVal, Class<? extends Annotation> specialParam, Manager manager)
{
Object[] parameterValues = new Object[parameters.size()];
Iterator<AnnotatedParameter<Object>> iterator = parameters.iterator();
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -132,6 +132,7 @@
/**
* Gets the current value of the member
*
+ * @param manager The Web Beans manager
* @return The current value
*/
public T getValue(Manager manager)
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -196,6 +196,7 @@
/**
* Creates a new instance
*
+ * @param manager The Web Beans manager
* @return An instance
*
* @see org.jboss.webbeans.introspector.AnnotatedConstructor#newInstance(ManagerImpl)
@@ -205,7 +206,7 @@
try
{
// TODO: more details in the exceptions
- return getDelegate().newInstance(getParameterValues(manager, parameters));
+ return getDelegate().newInstance(getParameterValues(parameters, manager));
}
catch (IllegalArgumentException e)
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -24,7 +24,6 @@
import javax.webbeans.manager.Manager;
-import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.util.Names;
@@ -119,17 +118,18 @@
* Gets the current value and injects this instance into an instance
*
* @param instance The instance to inject into
- *
+ * @param manager The Web Beans manager
* @see org.jboss.webbeans.introspector.AnnotatedField#inject(Object,
- * ManagerImpl)
+ * Manager)
*/
- public void inject(Manager manager, Object instance)
+ public void inject(Object instance, Manager manager)
{
Reflections.setAndWrap(getDelegate(), instance, getValue(manager));
}
-
+
@SuppressWarnings("unchecked")
- public T get(Object instance) {
+ public T get(Object instance)
+ {
return (T) Reflections.getAndWrap(getDelegate(), instance);
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -232,22 +232,22 @@
/**
* Invokes the method on an instance with current parameters from manager
*
- * @param mananger The Web Beans manager
* @param instance The instance to invoke on
- *
+ * @param manager The Web Beans manager
+ * @return The return value of the invocation
* @see org.jboss.webbeans.introspector.AnnotatedMethod#invoke(ManagerImpl,
* Object)
*/
@SuppressWarnings("unchecked")
- public T invoke(Manager manager, Object instance)
+ public T invoke(Object instance, Manager manager)
{
- return (T) Reflections.invokeAndWrap(getDelegate(), instance, getParameterValues(manager, parameters));
+ return (T) Reflections.invokeAndWrap(getDelegate(), instance, getParameterValues(parameters, manager));
}
@SuppressWarnings("unchecked")
- public T invokeWithSpecialValue(Manager manager, Object instance, Class<? extends Annotation> specialParam, Object specialVal)
+ public T invokeWithSpecialValue(Object instance, Class<? extends Annotation> specialParam, Object specialVal, Manager manager)
{
- return (T) Reflections.invokeAndWrap(getDelegate(), instance, getParameterValues(manager, parameters, specialVal, specialParam));
+ return (T) Reflections.invokeAndWrap(getDelegate(), instance, getParameterValues(parameters, specialVal, specialParam, manager));
}
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -126,6 +126,7 @@
/**
* Gets the current value
*
+ * @param manager The Web Beans manager
* @return the value
*
* @see org.jboss.webbeans.introspector.AnnotatedParameter
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java 2008-12-09 16:00:24 UTC (rev 506)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java 2008-12-09 21:03:47 UTC (rev 507)
@@ -66,7 +66,7 @@
//Create a test annotation for the event and use it to construct the
//event object
Annotation[] annotations = new Annotation[] { new TameAnnotationLiteral() };
- EventImpl<DangerCall> eventComponent = new EventImpl<DangerCall>(manager, DangerCall.class, annotations);
+ EventImpl<DangerCall> eventComponent = new EventImpl<DangerCall>(DangerCall.class, manager, annotations);
eventComponent.fire(anEvent, new SynchronousAnnotationLiteral());
assert anEvent.equals(manager.getEvent());
assert Reflections.annotationSetMatches(manager.getEventBindings(),
@@ -107,7 +107,7 @@
//Create a test annotation for the event and use it to construct the
//event object
Annotation[] annotations = new Annotation[] { new TameAnnotationLiteral() };
- EventImpl<DangerCall> eventComponent = new EventImpl<DangerCall>(manager, DangerCall.class, annotations);
+ EventImpl<DangerCall> eventComponent = new EventImpl<DangerCall>(DangerCall.class, manager, annotations);
Observer<DangerCall> observer = new AnObserver<DangerCall>();
eventComponent.observe(observer, new SynchronousAnnotationLiteral());
assert manager.getObservedEventType().equals(DangerCall.class);
17 years, 4 months
[webbeans-commits] Webbeans SVN: r506 - ri/trunk/examples.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-09 11:00:24 -0500 (Tue, 09 Dec 2008)
New Revision: 506
Added:
ri/trunk/examples/readme.txt
Log:
add readme
Added: ri/trunk/examples/readme.txt
===================================================================
--- ri/trunk/examples/readme.txt (rev 0)
+++ ri/trunk/examples/readme.txt 2008-12-09 16:00:24 UTC (rev 506)
@@ -0,0 +1,13 @@
+The Web Beans RI currently comes with a single example, webbeans-numberguess.
+
+To run the example on JBoss AS 5.0.0.GA, you need to add the Web Beans RI
+deployer to JBoss 5. First, set the path to JBoss 5 in ../build.properties.
+Then, run ant -f ../build.xml install-jboss5 in the examples directory.
+
+To deploy the example to JBoss AS 5, change into numberguess directory and
+choose between:
+
+* ant restart / ant explode - deploy the example in exploded format
+* ant deploy - deploy the example in compressed jar format
+* ant undeploy - remove the example from the server
+* ant clean - clean the example
17 years, 4 months
[webbeans-commits] Webbeans SVN: r505 - ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-09 10:59:59 -0500 (Tue, 09 Dec 2008)
New Revision: 505
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DependentFinalTuna.java
Log:
Oops
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DependentFinalTuna.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DependentFinalTuna.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DependentFinalTuna.java 2008-12-09 15:59:59 UTC (rev 505)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.beans;
+
+import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
+
+@AnotherDeploymentType
+public final class DependentFinalTuna
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DependentFinalTuna.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 4 months