aslak

Untitled

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