[webbeans-commits] Webbeans SVN: r246 - in ri/trunk/webbeans-ri/src: test/java/org/jboss/webbeans/test and 1 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Wed Nov 5 09:15:46 EST 2008
Author: nickarls
Date: 2008-11-05 09:15:45 -0500 (Wed, 05 Nov 2008)
New Revision: 246
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/GreaterDane.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ProxyPool.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ManagerTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NormalContextTest.java
Log:
fix tests
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ProxyPool.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ProxyPool.java 2008-11-05 13:07:06 UTC (rev 245)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ProxyPool.java 2008-11-05 14:15:45 UTC (rev 246)
@@ -2,9 +2,9 @@
import java.io.Serializable;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import javassist.util.proxy.ProxyFactory;
import javassist.util.proxy.ProxyObject;
@@ -20,7 +20,7 @@
{
public Pool()
{
- super(new HashMap<Bean<?>, Object>());
+ super(new ConcurrentHashMap<Bean<?>, Object>());
}
public <T> T get(Bean<T> key)
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanModelTest.java 2008-11-05 13:07:06 UTC (rev 245)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanModelTest.java 2008-11-05 14:15:45 UTC (rev 246)
@@ -7,6 +7,7 @@
import org.jboss.webbeans.model.bean.EnterpriseBeanModel;
import org.jboss.webbeans.test.beans.Giraffe;
import org.jboss.webbeans.test.beans.GreatDane;
+import org.jboss.webbeans.test.beans.GreaterDane;
import org.jboss.webbeans.test.beans.Laika;
import org.jboss.webbeans.test.beans.Leopard;
import org.jboss.webbeans.test.beans.Pitbull;
@@ -34,7 +35,7 @@
import org.jboss.webbeans.test.util.Util;
import org.testng.annotations.Test;
- at SuppressWarnings( { "unchecked", "unused" })
+ at SuppressWarnings("unused")
@SpecVersion("PDR")
public class EnterpriseBeanModelTest extends AbstractTest
{
@@ -354,11 +355,18 @@
@Test(expectedExceptions=DefinitionException.class, groups={"specialization", "enterpriseBeans"})
@SpecAssertion(section = "3.3.6")
- public void testSpecializingNotExtendingSpecializedBeanDirectlyFailes()
+ public void testAnnotationDefinedSpecializingEnterpriseBeanNotDirectlyExtendingAnnotationDefinedEnterpriseBeanFails()
{
- assert false;
+ EnterpriseBeanModel<GreaterDane> greaterDane = Util.createEnterpriseBeanModel(GreaterDane.class, manager);
}
+ @Test(expectedExceptions=DefinitionException.class, groups={"specialization", "enterpriseBeans"})
+ @SpecAssertion(section = "3.3.6")
+ public void testXMLDefinedSpecializingEnterpriseBeanNotImplementingAnnotationDefinedEnterpriseBeanFails()
+ {
+ assert false;
+ }
+
@Test(groups={"specialization", "enterpriseBeans"})
@SpecAssertion(section = "3.3.6")
public void testSpecializingBeanInheritsBindingTypes()
@@ -415,100 +423,6 @@
{
assert false;
}
-/*
+*/
- /*
- * @Test public void testStateless() { EnterpriseBeanModel<Lion> lion = new
- * EnterpriseBeanModel<Lion>(new SimpleAnnotatedType<Lion>(Lion.class),
- * getEmptyAnnotatedType(Lion.class), manager); assert
- * lion.getScopeType().equals(Dependent.class);
- * Reflections.annotationSetMatches(lion.getBindingTypes(), Current.class);
- * assert lion.getName().equals("lion"); }
- *
- * @Test @SpecAssertion(section="3.3") public void
- * testStatelessWithDependentScopeOK() { EnterpriseBeanModel<Giraffe> giraffe
- * = Util.createEnterpriseBeanModel(Giraffe.class, manager); assert
- * giraffe.getScopeType().equals(Dependent.class); assert
- * Reflections.annotationSetMatches(giraffe.getBindingTypes(),
- * Current.class); }
- *
- * @Test(expectedExceptions = RuntimeException.class)
- * @SpecAssertion(section="3.3") public void
- * testStatelessWithRequestScopeFails() { EnterpriseBeanModel<Bear> bear =
- * Util.createEnterpriseBeanModel(Bear.class, manager); }
- *
- * @Test(expectedExceptions = RuntimeException.class)
- * @SpecAssertion(section="3.3") public void
- * testStatelessWithApplicationScopeFails() { assert false; }
- *
- * @Test(expectedExceptions = RuntimeException.class)
- * @SpecAssertion(section="3.3") public void
- * testStatelessWithSessionScopeFails() { assert false; }
- *
- * @Test(expectedExceptions = RuntimeException.class)
- * @SpecAssertion(section="3.3") public void
- * testStatelessWithConversationScopeFails() { assert false; }
- *
- * public void testSingletonWithDependentScopeOK() { assert false; }
- *
- * @Test(expectedExceptions = RuntimeException.class)
- * @SpecAssertion(section="3.3") public void
- * testSingletonWithRequestScopeFails() { assert false; }
- *
- * @Test(expectedExceptions = RuntimeException.class)
- * @SpecAssertion(section="3.3") public void
- * testSingletonWithApplicationScopeOK() { assert false; }
- *
- * @Test(expectedExceptions = RuntimeException.class)
- * @SpecAssertion(section="3.3") public void
- * testSingletonWithSessionScopeFails() { assert false; }
- *
- * @Test(expectedExceptions = RuntimeException.class)
- * @SpecAssertion(section="3.3") public void
- * testSingletonWithConversationScopeFails() { assert false; }
- *
- * @Test public void testStateful() { EnterpriseBeanModel<Tiger> tiger =
- * Util.createEnterpriseBeanModel(Tiger.class, manager); assert
- * Reflections.annotationSetMatches(tiger.getBindingTypes(),
- * Synchronous.class); assert
- * tiger.getRemoveMethod().getAnnotatedItem().getDelegate
- * ().getName().equals("remove"); assert tiger.getName() == null; }
- *
- * @Test public void testMultipleRemoveMethodsWithDestroys() {
- * EnterpriseBeanModel<Elephant> elephant =
- * Util.createEnterpriseBeanModel(Elephant.class, manager); assert
- * elephant.getRemoveMethod
- * ().getAnnotatedItem().getDelegate().getName().equals("remove2"); }
- *
- * @Test(expectedExceptions=RuntimeException.class) public void
- * testMultipleRemoveMethodsWithoutDestroys() { EnterpriseBeanModel<Puma>
- * puma = Util.createEnterpriseBeanModel(Puma.class, manager); }
- *
- * @Test(expectedExceptions=RuntimeException.class) public void
- * testMultipleRemoveMethodsWithMultipleDestroys() {
- * EnterpriseBeanModel<Cougar> cougar =
- * Util.createEnterpriseBeanModel(Cougar.class, manager); }
- *
- * @Test(expectedExceptions=RuntimeException.class) public void
- * testNonStatefulEnterpriseBeanWithDestroys() { EnterpriseBeanModel<Cheetah>
- * cheetah = Util.createEnterpriseBeanModel(Cheetah.class, manager); }
- *
- * @Test public void testRemoveMethodWithDefaultBinding() {
- * EnterpriseBeanModel<Panther> panther =
- * Util.createEnterpriseBeanModel(Panther.class, manager); assert
- * panther.getRemoveMethod
- * ().getAnnotatedItem().getDelegate().getName().equals("remove"); assert
- * panther.getRemoveMethod().getParameters().size() == 1; assert
- * panther.getRemoveMethod
- * ().getParameters().get(0).getType().equals(String.class); assert
- * panther.getRemoveMethod().getParameters().get(0).getBindingTypes().size()
- * == 1; assert
- * Reflections.annotationSetMatches(panther.getRemoveMethod().getParameters
- * ().get(0).getBindingTypes(), Current.class); }
- *
- * @Test public void testMessageDriven() { EnterpriseBeanModel<Leopard>
- * leopard = Util.createEnterpriseBeanModel(Leopard.class, manager); assert
- * Reflections.annotationSetMatches(leopard.getBindingTypes(),
- * Current.class); }
- */
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ManagerTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ManagerTest.java 2008-11-05 13:07:06 UTC (rev 245)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ManagerTest.java 2008-11-05 14:15:45 UTC (rev 246)
@@ -61,12 +61,6 @@
assert false;
}
- @Test(groups="manager")
- public void testWrappingOfBeanCollection()
- {
- // TODO stub
- assert false;
- }
/*
Modified: 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-11-05 13:07:06 UTC (rev 245)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NormalContextTest.java 2008-11-05 14:15:45 UTC (rev 246)
@@ -83,11 +83,5 @@
((AbstractContext)context).destroy(manager);
assert context.get(tunaBean, false) == null;
}
-
- @Test(groups="contexts")
- public void testThreadSafety() {
- //TODO stub
- assert false;
- }
}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/GreaterDane.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/GreaterDane.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/GreaterDane.java 2008-11-05 14:15:45 UTC (rev 246)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Specializes;
+
+ at Specializes
+public class GreaterDane extends GreatDane
+{
+
+}
More information about the weld-commits
mailing list