Java Reference
In-Depth Information
Arquillian Warp
The last Arquillian extension that we will discuss here is Warp . Authors say that it allows
you to write client-side tests that assert server-side logic. To be more descriptive, it allows
for execution of client side requests, and then to execute server side tests. This fills the gap
between client-side and server-side testing.
In order to fully understand the Warp, we have to introduce the @RunAsClient annota-
tion. It can be placed on a test class or test method and it mentions that tests will be ex-
ecuted on the client side and not on the server side. The second important annotation is
@Deployment , which you have already met on method creating the archives. However, it
can take some parameters that are Boolean value testable. If a testable is false , it is also
executes on the client side, not repacking the deployment and so on. However, Warp mixes
these two modes and requires @Deployment(testable=true) and @RunAsCli-
ent annotations. The test class has to be annotated additionally with @WarpTest :
@RunWith(Arquillian.class)
@WarpTest
@RunAsClient
public class BasicWarpTest {
@Deployment(testable = true)
public static WebArchive createDeployment() {
...
}
@Test
public void test() {
// Warp test
}
}
Every Warp test uses the following construction:
Warp
.initiate(Activity)
.inspect(Inspection);
Search WWH ::




Custom Search