Wiki

Clone wiki

MagDownloads / Arquillian - Listing 7

@RunWith(Arquillian.class)
public class CustomerFacadeTest {

    @EJB
    private CustomerFacade customerFacade;

    @Deployment
    public static WebArchive createDeployment() {
        return ShrinkWrap.create(WebArchive.class, "CustomerFacadeTest.war")
                .addClass(CustomerController.class)
                .addClass(CustomerFacade.class)
                .addClass(org.javamagazine.arquillianexample.session.AbstractFacade.class)
                .addClass(org.javamagazine.arquillianexample.entity.Customer.class)
                .addAsResource("test-persistence.xml", "META-INF/persistence.xml")
                .addAsManifestResource(EmptyAsset.INSTANCE,"beans.xml");
    }


    @Test
    public void test_customer_list() {
        Assert.assertTrue(customerFacade.findAllCustomers()!= null);
    }
}

Updated