Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…lidity
  • Loading branch information
nickarls committed Apr 12, 2010
1 parent 99432a0 commit 14b0fbc
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 0 deletions.
@@ -0,0 +1,9 @@
package org.jboss.weld.tests.decorators.multidelegate;

import java.math.BigDecimal;

public interface Account {

public String withdraw(BigDecimal amount);

}
@@ -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";
}

}
@@ -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";
}

}
@@ -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);
}

}
@@ -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() {
}

}
@@ -0,0 +1,5 @@
<beans>
<decorators>
<class>org.jboss.weld.tests.decorators.multidelegate.AccountDecorator</class>
</decorators>
</beans>

0 comments on commit 14b0fbc

Please sign in to comment.