aslak

Untitled

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