aslak

Arquillian - WeldCoreTests - New @Deployment

Apr 27th, 2010
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.94 KB | None | 0 0
  1. public class DefaultConfiguration {
  2.  
  3.    public static BeanArchive create() {
  4.       return ShrinkWrap.create("test.jar", BeanArchive.class)
  5.          .addCurrentPackage();
  6.    }
  7.  
  8. }
  9.  
  10. public class BasicDecoratorResolutionTest extends Arquillian
  11. {
  12.    @Deployment()
  13.    public static Archive<?> deploy()
  14.    {
  15.       return DefaultConfiguration.create().decorate(SimpleDecorator.class, ComplexDecorator.class);
  16.    }
  17.  
  18.    @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER)
  19.    public void testBasicDecoratorInvocation(@Simple SimpleBean simpleBean)
  20.    {
  21.       String result = simpleBean.hello("world");
  22.       assert "simple-Hello, world-simple".equals(result);
  23.    }
  24.  
  25.    @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER)
  26.    public void testComplexDecoratorInvocation(@Complex ComplexBean complexBean)
  27.    {
  28.       String result = complexBean.hello("world");
  29.       assert "simple-complex-Sophisticated Hello, world-complex-simple".equals(result);
  30.    }
  31. }
Add Comment
Please, Sign In to add comment