Author: marius.bogoevici
Date: 2010-04-12 22:26:13 -0400 (Mon, 12 Apr 2010)
New Revision: 6098
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/extend/ExtendDecoratorTest.java
Log:
WELD-488 + Unit test expansion
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java 2010-04-13
01:58:16 UTC (rev 6097)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java 2010-04-13
02:26:13 UTC (rev 6098)
@@ -178,7 +178,9 @@
protected void checkDelegateType()
{
- for (Type decoratedType : getDecoratedTypes())
+ Set<Type> mostSpecificDecoratedTypes = new
HashSet<Type>(Arrays.asList(getWeldAnnotated().getJavaClass().getGenericInterfaces()));
+ mostSpecificDecoratedTypes.remove(Serializable.class);
+ for (Type decoratedType : mostSpecificDecoratedTypes)
{
if (decoratedType instanceof Class<?>)
{
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/extend/ExtendDecoratorTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/extend/ExtendDecoratorTest.java 2010-04-13
01:58:16 UTC (rev 6097)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/extend/ExtendDecoratorTest.java 2010-04-13
02:26:13 UTC (rev 6098)
@@ -21,6 +21,7 @@
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.Assert;
import org.testng.annotations.Test;
/**
@@ -31,8 +32,13 @@
public class ExtendDecoratorTest extends AbstractWeldTest
{
- @Test(groups = "broken")
- public void testExtendedDecoratorDeploys()
+ @Test
+ public void testExtendedDecorator()
{
+ ExtendsDecorated instance = getReference(ExtendsDecorated.class);
+
+ String result = instance.decoratedEcho("hello");
+ Assert.assertEquals(result, "decorated-hello-decorated");
+
}
}
\ No newline at end of file