This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns="http://jboss.org/schema/arquillian" | |
xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd"> | |
<container qualifier="undertow" default="true"> | |
</container> | |
</arquillian> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void shouldBeAbleToInvokeHandlers(@ArquillianResource URL url) throws Exception { | |
String body = readAllAndClose(url.openStream()); | |
assertThat(body, is("Hello World")); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Deployment(testable = false) | |
public static Archive<JavaArchive> createDeployment() { | |
return ShrinkWrap.create(UndertowHttpHandlerArchive.class).from(new HttpHandler() { | |
@Override | |
public void handleRequest(final HttpServerExchange exchange) throws Exception { | |
exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/plain"); | |
exchange.getResponseSender().send("Hello World"); | |
} | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void shouldBeAbleToInvokeServletInDeployedWebApp( | |
@ArquillianResource URL url) throws Exception { | |
String body = readAllAndClose(new URL(url, "myservlet").openStream()); | |
assertThat(body, is("Hello World")); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Deployment(testable = false) | |
public static Archive<WebArchive> createDeployment() { | |
return ShrinkWrap.create(UndertowWebArchive.class).from( | |
deployment() | |
.setContextPath("/myapp") | |
.setDeploymentName("test.war") | |
.setClassLoader( | |
EmbeddedUndertowClientWebContainerTest.class | |
.getClassLoader()) | |
.addServlet( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<repository> | |
<snapshots> | |
<enabled>false</enabled> | |
</snapshots> | |
<id>central</id> | |
<name>bintray</name> | |
<url>http://dl.bintray.com/lordofthejars/maven</url> | |
</repository> | |
<dependency> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[source,java] | |
---- | |
include::{sourcedir}/MyClass.java[imports, method=void mymethod(String)] | |
---- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import foo | |
// tag::classdef[] | |
class Bar { | |
// ... | |
} | |
// end::classdef[] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:sourcedir: src/main/java | |
[source,java] | |
---- | |
include::{sourcedir}/org/asciidoctor/Asciidoctor.java[tags=classdef] | |
---- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:sourcedir: src/main/java | |
[source,java] | |
---- | |
include::{sourcedir}/org/asciidoctor/Asciidoctor.java[lines=5..10] | |
---- |