Question:
- Is there any plan to move the JPA to use Arquillian? It would be fantastic if JPA, NoSQL, and Data specs followed some guidance.
- Is there any guide to help a new TCK explore Arquillian, such as the most straightforward way, without thousand of XML and Java, to write a single test?
This is a pretty basic example:
It contains the test:
@RunWith(Arquillian.class)
@RunAsClient
public class WebServletServletIT {
@ArquillianResource
private URL baseUrl;
@Deployment
public static WebArchive createDeployment() {
return create(ZipImporter.class, getProperty("finalName") + ".war")
.importFrom(new File("target/" + getProperty("finalName") + ".war"))
.as(WebArchive.class);
}
/**
* Test the @WebServlet.
*
* @throws Exception when a serious error occurs.
*/
@Test
public void testWebServlet() throws Exception {
String content = ClientBuilder.newClient()
.target(baseUrl.toString())
.request()
.get(String.class);
assertTrue(content.contains("And we called an @WebServlet servlet"));
}
}
And the configuration in pom.xml essentially boils down to:
<!--
The Arquillian connector for GlassFish.
This lets Arquillian start and stop GlassFish, and deploy and undeploy war files to it.
-->
<dependency>
<groupId>org.omnifaces.arquillian</groupId>
<artifactId>arquillian-glassfish-server-managed</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
And
<!--
FailSafe config for running the Integration Tests (IT) that just tells the GF Arquillian container
where to find GlassFish.
-->
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<glassfish.home>${session.executionRootDirectory}/target/glassfish7</glassfish.home>
</systemPropertyVariables>
</configuration>
</plugin>
Kind regards,
Arjan Tijms