Author: pete.muir(a)jboss.org
Date: 2008-12-14 16:32:14 -0500 (Sun, 14 Dec 2008)
New Revision: 523
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/EnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EJB.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanFactory.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java
Log:
Some better TODOs, move method for testing to MockBootstrap
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-14
21:28:58 UTC (rev 522)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2008-12-14
21:32:14 UTC (rev 523)
@@ -344,7 +344,7 @@
*/
protected void bindDecorators()
{
- // TODO
+ // TODO Implement decorators
}
/**
@@ -352,7 +352,7 @@
*/
protected void bindInterceptors()
{
- // TODO
+ // TODO Implement interceptors
}
/**
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-14
21:28:58 UTC (rev 522)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-14
21:32:14 UTC (rev 523)
@@ -253,7 +253,7 @@
*/
protected void injectEjbAndCommonFields()
{
- // TODO
+ // TODO Support commons and EJB annotations
}
/**
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-14
21:28:58 UTC (rev 522)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2008-12-14
21:32:14 UTC (rev 523)
@@ -160,7 +160,7 @@
*/
protected void injectEjbAndCommonFields()
{
- // TODO
+ // Support common and EJB annotations
}
/**
@@ -266,7 +266,7 @@
// TODO: actually this is wrong, in EJB you can have @PostConstruct
// methods on the superclass,
// though the Web Beans spec is silent on the issue
- throw new DefinitionException("Cannot have more than one post construct
method annotated with @Initializer for " + getType());
+ throw new DefinitionException("Cannot have more than one post construct
method annotated with @PostConstruct for " + getType());
}
else if (postConstructMethods.size() == 1)
{
@@ -288,7 +288,7 @@
// TODO: actually this is wrong, in EJB you can have @PreDestroy
// methods on the superclass,
// though the Web Beans spec is silent on the issue
- throw new DefinitionException("Cannot have more than one pre destroy method
annotated with @Initializer for " + getType());
+ throw new DefinitionException("Cannot have more than one pre destroy method
annotated with @PreDestroy for " + getType());
}
else if (preDestroyMethods.size() == 1)
{
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2008-12-14
21:28:58 UTC (rev 522)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2008-12-14
21:32:14 UTC (rev 523)
@@ -126,19 +126,6 @@
}
/**
- * Discover any beans defined by the provided classes
- *
- * Beans discovered are not registered with the manager
- *
- * @param classes The classes to create Web Beans from
- * @return A set of Web Beans that represents the classes
- */
- public Set<AbstractBean<?, ?>> createBeans(Class<?>... classes)
- {
- return createBeans(new HashSet<Class<?>>(Arrays.asList(classes)));
- }
-
- /**
* Creates Web Beans from a set of classes
*
* Iterates over the classes and creates a Web Bean of the corresponding
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EJB.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EJB.java 2008-12-14 21:28:58
UTC (rev 522)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EJB.java 2008-12-14 21:32:14
UTC (rev 523)
@@ -48,7 +48,7 @@
MESSAGE_DRIVEN_ANNOTATION =
annotationTypeForName("javax.ejb.MessageDriven");
// Fake MDB for tests
FAKE_MESSAGE_DRIVEN_ANNOTATION =
annotationTypeForName("org.jboss.webbeans.test.annotations.MessageDriven");
- // FIXME Faking singleton for tests
+ // TODO Faking singleton for tests
SINGLETON_ANNOTATION =
annotationTypeForName("org.jboss.webbeans.test.annotations.Singleton");
// SINGLETON_ANNOTATION = classForName("javax.ejb.Singleton");
REMOVE_ANNOTATION = annotationTypeForName("javax.ejb.Remove");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanFactory.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanFactory.java 2008-12-14
21:28:58 UTC (rev 522)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanFactory.java 2008-12-14
21:32:14 UTC (rev 523)
@@ -48,7 +48,7 @@
*
* @param <T> The type
* @param clazz The class
- * @param manager TODO
+ * @param manager the current manager
* @return A Web Bean
*/
public static <T> SimpleBean<T> createSimpleBean(Class<T> clazz,
ManagerImpl manager)
@@ -61,7 +61,7 @@
*
* @param <T> The type
* @param clazz The class
- * @param manager TODO
+ * @param manager the current manager
* @return An Enterprise Web Bean
*/
public static <T> EnterpriseBean<T> createEnterpriseBean(Class<T>
clazz, ManagerImpl manager)
@@ -76,7 +76,7 @@
* @param type The class
* @param method The underlying method
* @param declaringBean The declaring bean abstraction
- * @param manager TODO
+ * @param manager the current manager
* @return A producer Web Bean
*/
public static <T> ProducerMethodBean<T>
createProducerMethodBean(Class<T> type, Method method, AbstractClassBean<?>
declaringBean, ManagerImpl manager)
@@ -91,7 +91,7 @@
* @param type The class
* @param field The underlying field
* @param declaringBean The declaring bean abstraction
- * @param manager TODO
+ * @param manager the current manager
* @return A producer Web Bean
*/
public static <T> ProducerFieldBean<T>
createProducerFieldBean(Class<T> type, Field field, AbstractClassBean<?>
declaringBean, ManagerImpl manager)
@@ -104,7 +104,7 @@
*
* @param field The underlying method abstraction
* @param declaringBean The declaring bean abstraction
- * @param manager TODO
+ * @param manager the current manager
* @return A producer Web Bean
*/
public static <T> ProducerFieldBean<T>
createProducerFieldBean(AnnotatedField<T> field, AbstractClassBean<?>
declaringBean, ManagerImpl manager)
@@ -117,7 +117,7 @@
*
* @param method The underlying method abstraction
* @param declaringBean The declaring bean abstraction
- * @param manager TODO
+ * @param manager the current manager
* @return A producer Web Bean
*/
public static <T> ProducerMethodBean<T>
createProducerMethodBean(AnnotatedMethod<T> method, AbstractClassBean<?>
declaringBean, ManagerImpl manager)
@@ -129,7 +129,7 @@
* Creates an event Web Bean
*
* @param field The event injection point abstraction
- * @param manager TODO
+ * @param manager the current manager
* @param declaringBean The declaring bean abstraction
* @return An event Web Bean
*/
@@ -142,7 +142,7 @@
* Creates an instance Web Bean
*
* @param field The instance injection point abstraction
- * @param manager TODO
+ * @param manager the current manager
* @param declaringBean The declaring bean abstraction
* @return An event Web Bean
*/
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java 2008-12-14
21:28:58 UTC (rev 522)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java 2008-12-14
21:32:14 UTC (rev 523)
@@ -5,7 +5,6 @@
import javax.webbeans.Production;
import javax.webbeans.Standard;
-import org.jboss.webbeans.bootstrap.WebBeansBootstrap;
import org.jboss.webbeans.contexts.ApplicationContext;
import org.jboss.webbeans.contexts.RequestContext;
import org.jboss.webbeans.contexts.SessionContext;
@@ -20,7 +19,7 @@
{
protected MockManagerImpl manager;
- protected WebBeansBootstrap webBeansBootstrap;
+ protected MockBootstrap webBeansBootstrap;
@BeforeMethod
public final void before()
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java 2008-12-14
21:28:58 UTC (rev 522)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java 2008-12-14
21:32:14 UTC (rev 523)
@@ -1,6 +1,11 @@
package org.jboss.webbeans.test.mock;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.bean.AbstractBean;
import org.jboss.webbeans.bootstrap.WebBeansBootstrap;
public class MockBootstrap extends WebBeansBootstrap
@@ -11,4 +16,17 @@
super(manager);
}
+ /**
+ * Discover any beans defined by the provided classes
+ *
+ * Beans discovered are not registered with the manager
+ *
+ * @param classes The classes to create Web Beans from
+ * @return A set of Web Beans that represents the classes
+ */
+ public Set<AbstractBean<?, ?>> createBeans(Class<?>... classes)
+ {
+ return createBeans(new HashSet<Class<?>>(Arrays.asList(classes)));
+ }
+
}