[webbeans-commits] Webbeans SVN: r3497 - ri/trunk/impl/src/main/java/org/jboss/webbeans/util and 7 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Fri Aug 14 17:12:44 EDT 2009
Author: pete.muir at jboss.org
Date: 2009-08-14 17:12:44 -0400 (Fri, 14 Aug 2009)
New Revision: 3497
Added:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/beans.xml
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/DeploymentTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/DisabledBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/useBeforeValidationFails/UseBeforeValidationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/EventTypesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/TuneSelect.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Fix a couple of tests
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-08-14 20:40:38 UTC (rev 3496)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-08-14 21:12:44 UTC (rev 3497)
@@ -875,7 +875,7 @@
public Object getReference(Bean<?> bean, Type beanType, CreationalContext<?> creationalContext)
{
- if (!Beans.isTypePresent(bean, beanType))
+ if (!Reflections.isAssignableFrom(bean.getTypes(), beanType))
{
throw new IllegalArgumentException("The given beanType is not a type " + beanType +" of the bean " + bean );
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-08-14 20:40:38 UTC (rev 3496)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-08-14 21:12:44 UTC (rev 3497)
@@ -17,7 +17,6 @@
package org.jboss.webbeans.util;
import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
@@ -336,19 +335,6 @@
return false;
}
- public static boolean isTypePresent(Bean<?> bean, Type type)
- {
- type = Types.boxedType(type);
- for (Type beanType : bean.getTypes())
- {
- if (Types.boxedType(beanType).equals(type))
- {
- return true;
- }
- }
- return false;
- }
-
/**
* Check if any of the beans is a policy
*
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java 2009-08-14 20:40:38 UTC (rev 3496)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java 2009-08-14 21:12:44 UTC (rev 3497)
@@ -1,8 +1,8 @@
package org.jboss.jsr299.tck.tests.context.application.ejb;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.Packaging;
@@ -20,7 +20,7 @@
@SpecVersion("20090625")
public class EJBApplicationContextTest extends AbstractJSR299Test
{
- @Test(groups = { "broken", "contexts", "webservice", "integration" })
+ @Test(groups = { "broken", "contexts", "webservice", "integration", "jboss-as-broken" })
@SpecAssertion(section = "6.7.3", id = "b")
public void testApplicationScopeActiveDuringWebServiceInvocation()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/DeploymentTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/DeploymentTest.java 2009-08-14 20:40:38 UTC (rev 3496)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/DeploymentTest.java 2009-08-14 21:12:44 UTC (rev 3497)
@@ -22,6 +22,7 @@
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
/**
@@ -33,6 +34,7 @@
// TODO Add extension stuff
@Test
@SpecVersion("20090625")
+ at BeansXml("beans.xml")
public class DeploymentTest extends AbstractJSR299Test
{
@Test(groups="rewrite")
@@ -58,7 +60,7 @@
assert ManagerObserver.isRequestContextActive();
}
- @Test(groups = { "broken", "rewrite" })
+ @Test(groups = {})
@SpecAssertions({
@SpecAssertion(section = "11.1", id = "f")
})
@@ -67,8 +69,6 @@
assert !getBeans(User.class).isEmpty();
assert getBeans(DataAccessAuthorizationDecorator.class).isEmpty();
assert getBeans(Interceptor1.class).isEmpty();
-
- // I have no idea how this bean is supposed to be disabled PLM
assert getBeans(DisabledBean.class).isEmpty();
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/DisabledBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/DisabledBean.java 2009-08-14 20:40:38 UTC (rev 3496)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/DisabledBean.java 2009-08-14 21:12:44 UTC (rev 3497)
@@ -1,5 +1,8 @@
package org.jboss.jsr299.tck.tests.deployment.lifecycle;
+import javax.enterprise.inject.Policy;
+
+ at Policy
class DisabledBean
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/useBeforeValidationFails/UseBeforeValidationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/useBeforeValidationFails/UseBeforeValidationTest.java 2009-08-14 20:40:38 UTC (rev 3496)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/useBeforeValidationFails/UseBeforeValidationTest.java 2009-08-14 21:12:44 UTC (rev 3497)
@@ -35,7 +35,7 @@
@SpecVersion("20090625")
public class UseBeforeValidationTest extends AbstractJSR299Test
{
- @Test(groups = {"ri-broken", "broken"})
+ @Test(groups = {"ri-broken", "rewrite"})
//Still not clear how the container should now allow this, but the RI is clearly not implementing this assertion
// TODO Needs Extension stuff adding
// WBRI-300
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-08-14 20:40:38 UTC (rev 3496)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-08-14 21:12:44 UTC (rev 3497)
@@ -75,15 +75,6 @@
assert Shop.deliveryObservedBy.equals(FarmShop.class.getName());
}
- @Test(groups = { "events", "broken" })
- @SpecAssertion(section = "10.5", id = "ca")
- public void testAsynchronousObserverThrowsExceptionIsLogged() throws InterruptedException
- {
- getCurrentManager().fireEvent('a');
- Thread.sleep(200);
- //TODO How can we assert that the exception was logged?
- }
-
@Test(groups = { "events" }, expectedExceptions = IllegalArgumentException.class)
@SpecAssertion(section = "11.3.11", id = "c")
public <T> void testEventObjectContainsTypeVariablesWhenResolvingFails()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/EventTypesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/EventTypesTest.java 2009-08-14 20:40:38 UTC (rev 3496)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/EventTypesTest.java 2009-08-14 21:12:44 UTC (rev 3497)
@@ -1,9 +1,11 @@
package org.jboss.jsr299.tck.tests.event.eventTypes;
+import javax.enterprise.inject.TypeLiteral;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -58,17 +60,15 @@
assert observer.getTotalEventsObserved() == 4;
}
- @Test(groups = { "event", "broken", "rewrite" }, expectedExceptions = IllegalArgumentException.class)
+ @Test(groups = { "event" }, expectedExceptions=IllegalArgumentException.class)
@SpecAssertion(section = "10.1", id = "cb")
- //TODO There is still no type variable involved in this test nor is there a way to write this in Java
- public void testEventTypeFiredByEventInterfaceMayNotContainTypeVariable()
+ public <T> void testEventTypeFiredByEventInterfaceMayNotContainTypeVariable()
{
- getInstanceByType(TuneSelect.class).soloArtistPlaying(new Artist<Solo>());
+ getInstanceByType(new TypeLiteral<TuneSelect<T>>(){}).soloArtistPlaying(new Artist<T>());
}
- @Test(groups = { "event", "rewrite", "broken" }, expectedExceptions = IllegalArgumentException.class)
+ @Test(groups = { "event"}, expectedExceptions = IllegalArgumentException.class)
@SpecAssertion(section = "10.1", id = "cb")
- //TODO There is still no type variable involved in this test nor is there a way to write this in Java
public void testEventTypeFiredByBeanManagerMayNotContainTypeVariable()
{
getCurrentManager().fireEvent(new Artist<Solo>());
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/TuneSelect.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/TuneSelect.java 2009-08-14 20:40:38 UTC (rev 3496)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/TuneSelect.java 2009-08-14 21:12:44 UTC (rev 3497)
@@ -3,9 +3,9 @@
import javax.enterprise.event.Event;
import javax.enterprise.inject.Any;
-class TuneSelect
+class TuneSelect<T>
{
- @Any Event<Artist<Solo>> soloArtistEvent;
+ @Any Event<Artist<T>> soloArtistEvent;
@Any Event<Song> songEvent;
@@ -21,7 +21,7 @@
broadcastEvent.fire(b);
}
- public void soloArtistPlaying(Artist<Solo> soloArtist)
+ public void soloArtistPlaying(Artist<T> soloArtist)
{
soloArtistEvent.fire(soloArtist);
}
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/beans.xml 2009-08-14 21:12:44 UTC (rev 3497)
@@ -0,0 +1,3 @@
+<beans>
+
+</beans>
Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-14 20:40:38 UTC (rev 3496)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-14 21:12:44 UTC (rev 3497)
@@ -4251,8 +4251,9 @@
<text>Any observer method called before completion of a transaction may call |setRollbackOnly()| to force a transaction rollback. An observer method may not directly initiate, commit or rollback JTA transactions.</text>
</assertion>
- <assertion id="ca">
+ <assertion id="ca" testable="false">
<text>Observers may throw exceptions. If an observer method is a transactional observer method, any exception is caught and logged by the container.</text>
+ <note>We can't verify what is logged</note>
</assertion>
<assertion id="cb">
More information about the weld-commits
mailing list