Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/Account.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.jboss.weld.tests.decorators.multidelegate; | ||
|
||
import java.math.BigDecimal; | ||
|
||
public interface Account { | ||
|
||
public String withdraw(BigDecimal amount); | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/Account1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.jboss.weld.tests.decorators.multidelegate; | ||
|
||
import java.math.BigDecimal; | ||
|
||
public class Account1 implements Account { | ||
|
||
public String withdraw(BigDecimal amount) { | ||
return "Account1 withdraw"; | ||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/Account2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.jboss.weld.tests.decorators.multidelegate; | ||
|
||
import java.math.BigDecimal; | ||
|
||
public class Account2 implements Account { | ||
|
||
public String withdraw(BigDecimal amount) { | ||
return "Account2 withdraw"; | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/AccountDecorator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.jboss.weld.tests.decorators.multidelegate; | ||
|
||
import java.math.BigDecimal; | ||
|
||
import javax.decorator.Decorator; | ||
import javax.decorator.Delegate; | ||
import javax.enterprise.inject.Any; | ||
import javax.inject.Inject; | ||
|
||
@Decorator | ||
public class AccountDecorator implements Account { | ||
|
||
@Inject @Delegate @Any Account account; | ||
|
||
public String withdraw(BigDecimal amount) { | ||
System.out.println("AccountDecorator withdraw " + account.toString()); | ||
return account.withdraw(amount); | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/TestMultiDelegate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.jboss.weld.tests.decorators.multidelegate; | ||
|
||
import org.jboss.testharness.impl.packaging.Artifact; | ||
import org.jboss.testharness.impl.packaging.jsr299.BeansXml; | ||
import org.jboss.weld.test.AbstractWeldTest; | ||
import org.testng.annotations.Test; | ||
|
||
@Artifact | ||
@BeansXml("beans.xml") | ||
public class TestMultiDelegate extends AbstractWeldTest | ||
{ | ||
|
||
@Test(description="http://seamframework.org/Community/SerializableDecorators") | ||
public void go() { | ||
} | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
tests/src/test/resources/org/jboss/weld/tests/decorators/multidelegate/beans.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<beans> | ||
<decorators> | ||
<class>org.jboss.weld.tests.decorators.multidelegate.AccountDecorator</class> | ||
</decorators> | ||
</beans> |