1
votes

I used to have the following maven dependencies to use arquillian glassfish container:

 <dependency> 
     <groupId>org.jboss.arquillian</groupId>
     <artifactId>arquillian-junit</artifactId> 
 <scope>test</scope>
     <version>1.0.0.Alpha5</version>
 </dependency>  
 <dependency> 
     <groupId>org.jboss.arquillian.container</groupId> 
 <artifactId>arquillian-glassfish-embedded-3.1</artifactId>
     <version>1.0.0.Alpha5</version>
 </dependency> 

I was able to run my tests successfully until I wanted to inject specific resources, that could not be looked up through JNDI.

I improved my domain.xml to have the relevant resources I wanted. But for now, I am not sure arquillian load successfully all the domain.xml (look up failed on "jca/Neo4j/resource").

My arquillian.xml (in src/test/resources):

<?xml version="1.0" encoding="UTF-8"?>
<arquillian xmlns="http://jboss.com/arquillian"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:glassfish="urn:arq:org.jboss.arquillian.container.glassfish.embedded_3">
    <glassfish:container>
        <glassfish:instanceRoot>src/test/resources/glassfish</glassfish:instanceRoot>
        <glassfish:bindPort>9090</glassfish:bindPort>
        <glassfish:autoDelete>false</glassfish:autoDelete>
    </glassfish:container>

My domain.xml (in src/test/resources/glassfish/config/):

<domain log-root="${com.sun.aas.instanceRoot}/logs" applicationroot="${com.sun.aas.instanceRoot}/applications" version="10.0">
    <resources>
        <connector-connection-pool name="jca/Neo4j/pool" resource-adapter-name="neo4j-connector-0.1-SNAPSHOT" connection-definition-name="com.netoprise.neo4j.connection.Neo4JConnectionFactory">
            <property name="dir" value="${com.sun.aas.instanceRoot}/lib/databases/neo4j"></property>
            <property name="xa" value="true"></property>
        </connector-connection-pool>
        <connector-resource pool-name="jca/Neo4j/pool" jndi-name="jca/Neo4j/resource"></connector-resource>
    </resources>
    <servers>
        <server name="server" config-ref="server-config">
            <application-ref ref="neo4j-connector-0.1-SNAPSHOT" virtual-servers="server"></application-ref>
            <resource-ref ref="jca/Neo4j/resource"></resource-ref>
        </server>
    </servers>
...
</domain>

Thanks, Alex

1

1 Answers

0
votes

The Alpha5 was a bit hard to handle :) Stuff changed a bit and if you like to give the latest 1.0.0.Final-SNAPSHOT a try, you could have a more detailed look at a configuration here: http://blog.eisele.net/2012/01/arquillian-with-netbeans-glassfish.html

Thanks, M