Author: pete.muir(a)jboss.org
Date: 2008-12-18 14:37:12 -0500 (Thu, 18 Dec 2008)
New Revision: 551
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.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/BoostrapTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Leopard.java
ri/trunk/webbeans-ri/testng.xml
Log:
Fix loads of enterprise bean tests and actually enable them!
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-18
17:13:35 UTC (rev 550)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2008-12-18
19:37:12 UTC (rev 551)
@@ -58,7 +58,6 @@
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.contexts.DependentContext;
import org.jboss.webbeans.ejb.DefaultEnterpriseBeanLookup;
-import org.jboss.webbeans.ejb.EjbDescriptorCache;
import org.jboss.webbeans.event.ObserverImpl;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedItem;
@@ -155,7 +154,7 @@
Set<AbstractBean<?, ?>> beans = new HashSet<AbstractBean<?,
?>>();
for (Class<?> clazz : classes)
{
- if (EjbDescriptorCache.instance().containsKey(clazz))
+ if (manager.getEjbDescriptorCache().containsKey(clazz))
{
createBean(createEnterpriseBean(clazz, manager), beans);
}
@@ -239,7 +238,7 @@
*
* @param webBeanDiscovery The discovery implementation
*/
- public void boot(WebBeanDiscovery webBeanDiscovery)
+ public synchronized void boot(WebBeanDiscovery webBeanDiscovery)
{
log.info("Starting Web Beans RI " + getVersion());
if (webBeanDiscovery == null)
@@ -247,7 +246,7 @@
throw new IllegalStateException("No WebBeanDiscovery provider found, you
need to implement the org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery interface, and
tell the RI to use it by specifying -D" +
WebBeansBootstrap.WEB_BEAN_DISCOVERY_PROPERTY_NAME + "=<classname>");
}
// Must populate EJB cache first, as we need it to detect whether a bean is an
EJB!
- EjbDescriptorCache.instance().addAll(webBeanDiscovery.discoverEjbs());
+ manager.getEjbDescriptorCache().addAll(webBeanDiscovery.discoverEjbs());
registerBeans(webBeanDiscovery.discoverWebBeanClasses());
log.info("Validing Web Bean injection points");
manager.getResolver().resolveInjectionPoints();
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2008-12-18
17:13:35 UTC (rev 550)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2008-12-18
19:37:12 UTC (rev 551)
@@ -510,7 +510,7 @@
// TODO Cache?
for (AnnotatedMethod<Object> annotatedMethod : methods)
{
- if (annotatedMethod.getName().equals(methodDescriptor.getMethodName())
&&
annotatedMethod.getParameterTypesAsArray().equals(methodDescriptor.getMethodParameterTypes()))
+ if (annotatedMethod.getName().equals(methodDescriptor.getMethodName())
&& Arrays.equals(annotatedMethod.getParameterTypesAsArray(),
methodDescriptor.getMethodParameterTypes()))
{
return annotatedMethod;
}
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-18
17:13:35 UTC (rev 550)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java 2008-12-18
19:37:12 UTC (rev 551)
@@ -12,6 +12,7 @@
import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
import org.jboss.webbeans.test.annotations.HornedAnimalDeploymentType;
import org.jboss.webbeans.test.mock.MockBootstrap;
+import org.jboss.webbeans.test.mock.MockEjbDescriptor;
import org.jboss.webbeans.test.mock.MockManagerImpl;
import org.testng.annotations.BeforeMethod;
@@ -46,4 +47,9 @@
manager.setEnabledDeploymentTypes(Arrays.asList(Standard.class, Production.class,
AnotherDeploymentType.class, HornedAnimalDeploymentType.class));
}
+ protected <T> void addToEjbCache(Class<T> clazz)
+ {
+ manager.getEjbDescriptorCache().add(new MockEjbDescriptor<T>(clazz));
+ }
+
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BoostrapTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BoostrapTest.java 2008-12-18
17:13:35 UTC (rev 550)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BoostrapTest.java 2008-12-18
19:37:12 UTC (rev 551)
@@ -234,7 +234,7 @@
@Test(groups="bootstrap")
public void testDiscover()
{
- webBeansBootstrap.boot(new MockWebBeanDiscovery(new
HashSet<Class<?>>(Arrays.asList(Hound.class, Elephant.class, Panther.class,
Tiger.class, Tuna.class, Salmon.class, SeaBass.class, Sole.class)), null, new
HashSet<Class<?>>()));
+ webBeansBootstrap.boot(new MockWebBeanDiscovery(new
HashSet<Class<?>>(Arrays.asList(Hound.class, Elephant.class, Panther.class,
Tiger.class, Tuna.class, Salmon.class, SeaBass.class, Sole.class))));
assert manager.getBeans().size() == 8 + MockManagerImpl.BUILT_IN_BEANS;
Map<Class<?>, Bean<?>> classes = new HashMap<Class<?>,
Bean<?>>();
@@ -268,7 +268,7 @@
public void testInitializedEvent()
{
assert !InitializedObserver.observered;
- webBeansBootstrap.boot(new MockWebBeanDiscovery(new
HashSet<Class<?>>(Arrays.asList(InitializedObserver.class)), null, new
HashSet<Class<?>>()));
+ webBeansBootstrap.boot(new MockWebBeanDiscovery(new
HashSet<Class<?>>(Arrays.asList(InitializedObserver.class))));
assert InitializedObserver.observered;
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Leopard.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Leopard.java 2008-12-18
17:13:35 UTC (rev 550)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Leopard.java 2008-12-18
19:37:12 UTC (rev 551)
@@ -1,9 +1,8 @@
package org.jboss.webbeans.test.beans;
+import javax.ejb.MessageDriven;
import javax.webbeans.Production;
-import org.jboss.webbeans.test.annotations.MessageDriven;
-
@Production
@MessageDriven
public class Leopard
Modified: ri/trunk/webbeans-ri/testng.xml
===================================================================
--- ri/trunk/webbeans-ri/testng.xml 2008-12-18 17:13:35 UTC (rev 550)
+++ ri/trunk/webbeans-ri/testng.xml 2008-12-18 19:37:12 UTC (rev 551)
@@ -1,6 +1,6 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
-<suite name="WebBeans RI" verbose="1">
+<suite name="WebBeans RI" verbose="1" >
<test name="Web Beans RI">
<groups>
@@ -36,8 +36,7 @@
<package name="org.jboss.webbeans.test"></package>
<package
name="org.jboss.webbeans.test.contexts"></package>
<package name="org.jboss.webbeans.examples"></package>
- <package
name="org.jboss.webbeans.test.ejb.lifecycle"></package>
- <package
name="org.jboss.webbeans.test.ejb.model"></package>
+ <package name="org.jboss.webbeans.test.ejb"></package>
</packages>
</test>