Arquillian In-Container URL Extension

An extension for Arquillian that allows you to reference the base URL of your test deployment from within the container.

License

License

Categories

Categories

Arquillian Application Testing & Monitoring Container
GroupId

GroupId

com.handcraftedbits.arquillian
ArtifactId

ArtifactId

arquillian-incontainerurl-extension
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Arquillian In-Container URL Extension
An extension for Arquillian that allows you to reference the base URL of your test deployment from within the container.
Project URL

Project URL

https://github.com/handcraftedbits/arquillian-incontainerurl-extension
Project Organization

Project Organization

HandcraftedBits
Source Code Management

Source Code Management

https://github.com/handcraftedbits/arquillian-incontainerurl-extension

Download arquillian-incontainerurl-extension

How to add to project

<!-- https://jarcasting.com/artifacts/com.handcraftedbits.arquillian/arquillian-incontainerurl-extension/ -->
<dependency>
    <groupId>com.handcraftedbits.arquillian</groupId>
    <artifactId>arquillian-incontainerurl-extension</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.handcraftedbits.arquillian/arquillian-incontainerurl-extension/
implementation 'com.handcraftedbits.arquillian:arquillian-incontainerurl-extension:1.0.1'
// https://jarcasting.com/artifacts/com.handcraftedbits.arquillian/arquillian-incontainerurl-extension/
implementation ("com.handcraftedbits.arquillian:arquillian-incontainerurl-extension:1.0.1")
'com.handcraftedbits.arquillian:arquillian-incontainerurl-extension:jar:1.0.1'
<dependency org="com.handcraftedbits.arquillian" name="arquillian-incontainerurl-extension" rev="1.0.1">
  <artifact name="arquillian-incontainerurl-extension" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.handcraftedbits.arquillian', module='arquillian-incontainerurl-extension', version='1.0.1')
)
libraryDependencies += "com.handcraftedbits.arquillian" % "arquillian-incontainerurl-extension" % "1.0.1"
[com.handcraftedbits.arquillian/arquillian-incontainerurl-extension "1.0.1"]

Dependencies

compile (2)

Group / Artifact Type Version
org.jboss.arquillian.container : arquillian-container-test-spi jar
org.jboss.arquillian.core : arquillian-core-spi jar

provided (3)

Group / Artifact Type Version
javax.servlet : javax.servlet-api jar 3.0.1
org.jboss.spec : jboss-javaee-7.0 pom 1.0.3.Final
org.jboss.shrinkwrap : shrinkwrap-api jar 1.2.2

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
org.jboss.arquillian.junit : arquillian-junit-container jar
org.wildfly : wildfly-arquillian-container-embedded jar 8.2.0.Final

Project Modules

There are no modules declared in this project.

Arquillian In-container URL Extension Build Status

An extension for Arquillian that allows you to reference the base URL of your test deployment from within the container. This makes it easy to e.g. test a REST service and check its effect on backend components in the same test case.

Deprecation Notice

This extension is officially deprecated since ARQ-540 has been resolved. You can now use @ArquillianResource from within the container!

Usage

Add the extension in your pom.xml file:

<dependency>
  <groupId>com.handcraftedbits.arquillian</groupId>
  <artifactId>arquillian-incontainerurl-extension</artifactId>
  <version>1.0.1</version>
  <scope>test</scope>
</dependency>

Then add the @InContainerResource annotation to a URL field or test method parameter:

@InContainerResource
private URL url;

or

@Test
public void testService (@InContainerResource URL url) {
     ...
}

That's it! All your container-based tests will now have access to the URL where your test archive has been deployed. For client-based tests (i.e., those annotated with @RunAsClient or where the deployment has been marked testable = false), this field or method parameter will be null; you should use @ArquillianResource instead.

Notes

  • This extension will only work for WAR archives supporting Servlet 3.0 or an EAR archive containing a WAR archive that supports Servlet 3.0.
  • This extension will only work on real Java EE application server containers (e.g. Wildfly, Glassfish, etc.). It will not work with the Weld container.
  • Though it may be tempting, don't use @ArquillianResource and @InContainerResource on the same field or test method parameter; your tests will fail.

Versions

Version
1.0.1
1.0.0