aslak

Arquillian - WeldCoreTests - Before

Apr 27th, 2010
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.06 KB | None | 0 0
  1. package org.jboss.weld.tests.decorators.resolution;
  2.  
  3. import org.jboss.testharness.impl.packaging.Artifact;
  4. import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
  5. import org.jboss.weld.test.AbstractWeldTest;
  6. import org.testng.annotations.Test;
  7.  
  8. import javax.enterprise.inject.spi.Decorator;
  9. import javax.enterprise.util.AnnotationLiteral;
  10.  
  11. import java.util.*;
  12.  
  13. @Artifact
  14. @BeansXml("beans-basic.xml")
  15. public class BasicDecoratorResolutionTest extends AbstractWeldTest
  16. {
  17.  
  18.    @Test
  19.    public void testBasicDecoratorInvocation()
  20.    {
  21.       SimpleBean simpleBean = getReference(SimpleBean.class, new AnnotationLiteral<Simple>(){});
  22.       String result = simpleBean.hello("world");
  23.       assert "simple-Hello, world-simple".equals(result);
  24.    }
  25.  
  26.    @Test
  27.    public void testComplexDecoratorInvocation()
  28.    {
  29.       ComplexBean complexBean = getReference(ComplexBean.class, new AnnotationLiteral<Complex>(){});
  30.       String result = complexBean.hello("world");
  31.       assert "simple-complex-Sophisticated Hello, world-complex-simple".equals(result);
  32.    }
  33. }
Add Comment
Please, Sign In to add comment