Arquillian Container Undertow 1.0.0.Alpha1 Released

Since we wrote this post we didn't laze around. Check our latest announcement.

The Arquillian team is proud to announce the 1.0.0.Alpha1 release of the Arquillian Container Undertow component!

Aliens are conquering Undertow.

Undertow is a flexible performant web server written in java, providing both a blocking and a non-blocking API’s based on NIO.

This extension enables us to write Arquillian tests for Undertow.

To simplify the development of tests on Undertow we have created two Shrinkwrap extensions:

  • Embedded Servlet Deployment
  • Non-blocking handler

Embedded Servlet Deployment

When you want to deploy a servlet(s) inside Undertow, you need to create a DeploymentInfo class and provide all the required information. For this, Arquillian-Container-Undertow provide a Shrinkwrap extension named UndertowWebArchive.

UndertowServletTest.java
@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(
					servlet("MessageServlet", MessageServlet.class)
						.addInitParam("message", "Hello World")
						.addMapping(SERVLET_MAPPING)));
}

@Test
public void shouldBeAbleToInvokeServletInDeployedWebApp(
		@ArquillianResource URL url) throws Exception {

	String body = readAllAndClose(new URL(url, "myservlet").openStream());
		
	assertThat(body, is("Hello World"));
}

We are creating the deployment using the Fluent-API provided by Undertow.

Non-blocking handler

With Undertow you can also write non-blocking handlers. For creating a non-blocking handler in Undertow you create a class that implements the HttpHandler interface and register it. For this, Arquillian-Container-Undertow provide a Shrinkwrap extension named UndertowHttpHandlerArchive.

UndertowNoneBlockTest.java
@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");
           }
       });
}

@Test
public void shouldBeAbleToInvokeHandlers(@ArquillianResource URL url) throws Exception {

	String body = readAllAndClose(url.openStream());

	assertThat(body, is("Hello World"));
}

We are using the HttpHandler interface provided by Undertow.

Configuration

You can configure the bind address and port of Undertow. By default Undertow is started on localhost:8080.

arquillian.xml
<container qualifier="undertow" default="true">
	<configuration>
		<property name="bindAddress">localhost</property>
		<property name="bindHttpPort">9090</property> 
	</configuration>
</container>

If the bindHttpPort is set to -1, a random port between 1024 and 49151 is used.

What is Arquillian?

Arquillian is open source software that empowers you to test JVM-based applications more effectively. Created to defend the software galaxy from bugs, Arquillian brings your test to the runtime so you can focus on testing your application's behavior rather than managing the runtime. Using Arquillian, you can develop a comprehensive suite of tests from the convenience of your IDE and run them in any IDE, build tool or continuous integration environment.

Release details

Component Arquillian Container Undertow
Version 1.0.0.Alpha1 view tag
Release date 2014-02-13
Released by Aslak Knutsen
Compiled against

Published artifacts org.jboss.arquillian.container

  • org.jboss.arquillian.container » shrinkwrap-container-undertow jar javadoc pom
  • org.jboss.arquillian.container » undertow-embedded jar javadoc pom

Thanks to the following list of contributors: Alex Soto, Aslak Knutsen

Arquillian OSGi 2.1.0.CR10 Released

Since we wrote this post we didn't laze around. Check our latest announcement.

The Arquillian team is proud to announce the 2.1.0.CR10 release of the Arquillian OSGi component!

What is Arquillian OSGi?

ShrinkWrap is the simplest way to create archives in Java. Using the fluent and intuitive ShrinkWrap API, developers may assemble JARs, WARs, and EARs to be deployed directly by Arquillian during testing.

Release details

Component Arquillian OSGi
Modules
Version 2.1.0.CR10 view tag
Release date 2014-02-13
Released by Thomas Diesler
Compiled against

Published artifacts org.jboss.arquillian.protocol

  • org.jboss.arquillian.protocol » arquillian-protocol-osgi jar javadoc pom
  • org.jboss.arquillian.testenricher » arquillian-testenricher-osgi jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-osgi jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-jbosgi-embedded jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-felix-embedded jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-karaf-embedded jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-karaf-managed jar javadoc pom

Thanks to the following list of contributors: Thomas Diesler

Arquillian Container Weld Root POM 1.0.0.CR8 Released

Since we wrote this post we didn't laze around. Check our latest announcement.

The Arquillian team is proud to announce the 1.0.0.CR8 release of the Arquillian Container Weld Root POM component!

What is Arquillian?

Arquillian is open source software that empowers you to test JVM-based applications more effectively. Created to defend the software galaxy from bugs, Arquillian brings your test to the runtime so you can focus on testing your application's behavior rather than managing the runtime. Using Arquillian, you can develop a comprehensive suite of tests from the convenience of your IDE and run them in any IDE, build tool or continuous integration environment.

Release details

Component Arquillian Container Weld Root POM
Modules
Version 1.0.0.CR8 view tag
Release date 2014-02-11
Released by Aslak Knutsen
Compiled against

Published artifacts org.jboss.arquillian.container

  • org.jboss.arquillian.container » arquillian-weld-ee-embedded-1.1 jar javadoc pom
  • org.jboss.arquillian.container » arquillian-weld-se-embedded-1 jar javadoc pom
  • org.jboss.arquillian.container » arquillian-weld-se-embedded-1.1 jar javadoc pom

Release notes and resolved issues 2

Feature Request
  • ARQ-1448 - Weld embedded container - add CDI.current() support
Bug
  • ARQ-1637 - Gracefully deactivate context when creation fails

Thanks to the following list of contributors: Aslak Knutsen, Matej Briskar, Martin Kouba

Arquillian OSGi 2.1.0.CR9 Released

Since we wrote this post we didn't laze around. Check our latest announcement.

The Arquillian team is proud to announce the 2.1.0.CR9 release of the Arquillian OSGi component!

What is Arquillian OSGi?

ShrinkWrap is the simplest way to create archives in Java. Using the fluent and intuitive ShrinkWrap API, developers may assemble JARs, WARs, and EARs to be deployed directly by Arquillian during testing.

Release details

Component Arquillian OSGi
Modules
Version 2.1.0.CR9 view tag
Release date 2014-02-03
Released by Thomas Diesler
Compiled against

Published artifacts org.jboss.arquillian.protocol

  • org.jboss.arquillian.protocol » arquillian-protocol-osgi jar javadoc pom
  • org.jboss.arquillian.testenricher » arquillian-testenricher-osgi jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-osgi jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-jbosgi-embedded jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-felix-embedded jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-karaf-embedded jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-karaf-managed jar javadoc pom

Thanks to the following list of contributors: Thomas Diesler

Arquillian OSGi 2.1.0.CR8 Released

Since we wrote this post we didn't laze around. Check our latest announcement.

The Arquillian team is proud to announce the 2.1.0.CR8 release of the Arquillian OSGi component!

What is Arquillian OSGi?

ShrinkWrap is the simplest way to create archives in Java. Using the fluent and intuitive ShrinkWrap API, developers may assemble JARs, WARs, and EARs to be deployed directly by Arquillian during testing.

Release details

Component Arquillian OSGi
Modules
Version 2.1.0.CR8 view tag
Release date 2014-01-31
Released by Thomas Diesler
Compiled against

Published artifacts org.jboss.arquillian.protocol

  • org.jboss.arquillian.protocol » arquillian-protocol-osgi jar javadoc pom
  • org.jboss.arquillian.testenricher » arquillian-testenricher-osgi jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-osgi jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-jbosgi-embedded jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-felix-embedded jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-karaf-embedded jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-karaf-managed jar javadoc pom

Thanks to the following list of contributors: Thomas Diesler