The arquillian persistence extension does not work

I am trying to check my web service. This web service uses ejb with jpa to retrieve its data. So I want to use the arquillian extension to do this.

This is my arquillian test class:

@RunWith(Arquillian.class)
public class PersonWebServiceIT {

    private PersonWebService service;

    @Deployment(testable = false)
    public static Archive<?> createDeployment() {
        return ShrinkWrap
                .create(ZipImporter.class, "test.ear")
                .importFrom(new File("simple-webservice-ear-1.0.0-SNAPSHOT.ear"))
                .as(EnterpriseArchive.class);
    }

    @Test
    @UsingDataSet("dataset.yml")
    @SneakyThrows
    public void testFindPersons(@ArquillianResource final URL deploymentUrl) {
        loadService(deploymentUrl);

        Assert.assertEquals(2, service.findPersons().size());
    }

    private void loadService(final URL deploymentUrl)
        //load webservice
    }

}

This is my datasets / dataset.yml file:

person:
  - id: 1
    firstName: "stijn"
  - id: 2
    firstName: "cremers"

my arquillian.xml:

<?xml version="1.0" encoding="UTF-8"?>
<arquillian xmlns="http://jboss.com/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
    http://jboss.org/schema/arquillian
    http://jboss.org/schema/arquillian/arquillian-1.0.xsd">

 <extension qualifier="persistence">
        <property name="defaultDataSource">java:/DefaultDS</property>
    </extension>

</arquillian>

My test data is never loaded. I even tried with an incorrectly formatted yml file, but even then I get no error.

0
source share
2 answers

The problem is your test mode. When you define your own @Deploymentwith an attribute testable=false, all tests run in client mode, i.e. They do not start in the container.

Arquillian ( 1.0.0.Alpha5) ; . APE .

0
<property name="defaultDataSource">java:/DefaultDS</property>

U , .

(.. JVM)

, , arquillian.

jdbc url datasource arquillian.xml. u

0

All Articles