Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.jboss.weld.tests.decorators.resolution;
- 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;
- import javax.enterprise.inject.spi.Decorator;
- import javax.enterprise.util.AnnotationLiteral;
- import java.util.*;
- @Artifact
- @BeansXml("beans-basic.xml")
- public class BasicDecoratorResolutionTest extends AbstractWeldTest
- {
- @Test
- public void testBasicDecoratorInvocation()
- {
- SimpleBean simpleBean = getReference(SimpleBean.class, new AnnotationLiteral<Simple>(){});
- String result = simpleBean.hello("world");
- assert "simple-Hello, world-simple".equals(result);
- }
- @Test
- public void testComplexDecoratorInvocation()
- {
- ComplexBean complexBean = getReference(ComplexBean.class, new AnnotationLiteral<Complex>(){});
- String result = complexBean.hello("world");
- assert "simple-complex-Sophisticated Hello, world-complex-simple".equals(result);
- }
- }
Add Comment
Please, Sign In to add comment