aslak

Arquillian - DeploymentException

Jul 26th, 2010
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 KB | None | 0 0
  1. package org.jboss.arquillian.junit;
  2.  
  3. import junit.framework.Assert;
  4.  
  5. import org.jboss.arquillian.api.Deployment;
  6. import org.jboss.shrinkwrap.api.ShrinkWrap;
  7. import org.jboss.shrinkwrap.api.spec.JavaArchive;
  8. import org.junit.Test;
  9. import org.junit.runner.RunWith;
  10.  
  11. @RunWith(Arquillian.class)
  12. public class DeploymentExceptionTestCase
  13. {
  14.    @Deployment
  15.    public static JavaArchive createArchive()
  16.    {
  17.       return ShrinkWrap.create(JavaArchive.class);
  18.    }
  19.    
  20.    @Test
  21.    @DeploymentException
  22.    public static void shouldCauseInvalidDescriptorException(InvalidDescriptorException exception)
  23.    {
  24.       Assert.assertNotNull(exception);
  25.       Assert.assertEquals("Duplicate filter tag found", exception.getMessage());
  26.    }
  27.  
  28.    @Test(expected = InvalidDescriptorException.class)
  29.    @DeploymentException
  30.    public static void shouldCauseInvalidDescriptorException()
  31.    {
  32.    }
  33. }
Add Comment
Please, Sign In to add comment