I'm happy to announce that we have moved the Arquillian Reference Guide out of docbook format in the source tree and over to the new JBoss Documentation Confluence instance.
https://docs.jboss.org/author/display/ARQ/Home
The old DocBook version has been imported and with a few fixes in the imported wiki code it all seems ok.
From now on, If you find any errors in the formating or content, you can simply just fix it
After a long wait we can finally give you some good news..
*drum roll*
Arquillian 1.0.0.Alpha5 has been released!
In the beginning of the cycle we came to the conclusion that the old Arquillian core just did not cut it in respect to where we were heading,
so big parts of it has been rewritten...
Some of the hightlight in this release:
Verify that a @Deployment throws the expected deployment exception using @ShouldThrowException(Exception.class)
@Deployment @ShouldThrowException(WeldException.class) public static WebArchive createTestDeployment() { }
Define as many @Deployment methods as you may need. If you need them deployed in order, use @Deployment.order. When dealing with multiple @Deployments you have to specify which deployment context a @Test method should run within by using the @OperateOnDeployment("deploymentName"). The deploymentName is specified using @Deployment.name. With this you can swap between in container testing in one deployment, @RunAsClient in the context of another deployment and back incontainer in the third.
@Deployment(order = 1, name = "dep1") public static WebArchive createTestDeployment() { } @Deployment(order = 2, name = "dep2") public static WebArchive createTestDeployment2() { } @Test @OperateOnDeployment("dep1") public void callActive1() throws Exception { } @Test @OperateOnDeployment("dep2") public void callActive1() throws Exception { }
Deploy multiple deployments to multiple containers in the same test class using @TargetsContainer("containerName") on the @Deployment methods. Combined with @OperateOnDeployment("name") individual @Test methods can now execute in different containers.
@Deployment(name = "dep1") @TargetsContainer("node-1") public static WebArchive createTestDeployment() { } @Deployment(name = "dep2") @TargetsContainer("node-2") public static WebArchive createTestDeployment2() { } @Test @OperateOnDeployment("dep1") public void callActive1() throws Exception { } @Test @OperateOnDeployment("dep2") public void callActive1() throws Exception { }
Previously the protocol was bound to the container you were running on. The container still has a default, but this can now be overwritten on a pr @Deployment method level by using the annotation @OverProtocol("protocolName").
@Deployment(name = "dep1") @TargetsContainer("node-1") @OverProtocol("Servlet 3.0") public static WebArchive createTestDeployment() { } @Deployment(name = "dep2") @TargetsContainer("node-2") @OverProtocol("EJB 3.1") public static WebArchive createTestDeployment2() { } @Test @OperateOnDeployment("dep1") // in container text execution is done over HTTP public void callActive1() throws Exception { } @Test @OperateOnDeployment("dep2") // in container text execution is done over RMI public void callActive1() throws Exception { }
Need to deploy a JMS Queue, or a DataSource? Use the Desciptor deployment. Works the same as a Archive deployment by defining a deployment method with return type Descriptor.
@Deployment public static Descriptor createTestDeployment() { }
* Arquillian Drone
A new extension for Web testing. Integrates Arquillian with Selenium, WebDriver and Arquillian Ajocado.
@RunWith(Arquillian.class) public class AjocadoTestCase { // load ajocado driver @Drone AjaxSelenium driver; }
Some changes:
Big thanks to the Arquillian and ShrinkWrap community for helping us with this release!
A extra goes out to, Karel Piwko for Arquillian Drone, Jason Porter for GlassFish Remote 3.1 container and David R Allen for other random issues
[ Arquillian ] | [ JIRA ] | [ SPI Javadoc, API Javadoc ] | [ Reference Guide ] | [ Release Notes ] | [ Maven Artifacts ]
Europe's first JUDCon is starting off in Berlin next week..
Pete Muir and I will be kick starting JUDCon with a little WarmUp on the 6. October around 19:00 at the Berlin JUG where we will be presenting Seam 3 / CDI and Arquillian to the local Berliners.
On the 7. October at JUDCon, Adrian Cole and I will present "Frictionless integration testing in the cloud" on the Cloud track at 17:30.
The 8. October at JUDCon, Michael Schuetz will present "Seam2: Real integration testing with Arquillian" on the JBossAS 6 and 7 Track at 11:00.
Join us on for these fun days... and don't forget the HackFest on the 7. from 19:00-02:00!
Welcome!
We're happy to announce that the 3. Arquillian Alpha release was just pushed out the official channels.
News in Alpha3 are:
A big note for Alpha3 is ARQ-200 : Change version scheme for containers. With this most containers changed their artifact name.
The new scheme is: arquillian-"name"-"type"-"major"[."minor"][."point"]
e.g. arquillian-jbossas-remote-60 -> arquillian-jbossas-remote-6
The version rule is: earliest working version and working up to the next artifact version.
That means arquillian-jbossas-remote-6 should work with 6.5 unless there is another container named arquillian-jbossas-remote-6.5.
See The Complete Container Reference Guide for full description of the containers and their configuration.
If you're interested in the upcoming Arquillian release Road Map, we're now keeping the Jira Road Map up to speed on planned features / releases.
Big thanks to the Arquillian and ShrinkWrap community for helping us with this release!
In alphabetical order: Dan Allen, deruelle_jean, thomas.diesler, agori, Ken Gullaksen, jharting, Sten Aksel Heien, Nicklas Karlsson, Pete Muir, The specified item was not found., Andrew Lee Rubinger, mwringe.
[ Arquillian ] | [ JIRA ] | [ SPI Javadoc, API Javadoc ] | [ Reference Guide ] | [ Release Notes ] | [ Maven Artifacts ]
For the observant viewer, you might have noticed the little colored ball in the top right corner of the Arquillian Ohloh.org badge on the Arquillian site. For the not so observant one, this is what it looked like:
The ball is the Hudson build indicator. It tells you the status of the latest Arquillian build.
We're proud to show off our latest build status, so now we're taking it one step further...
Meet Emotional Ike!
SUCCESS: Latest build was a complete success. Ike is pleased!
UNSTABLE: Latest build has failing tests, be careful. Ike is giving you a warning for this time..
FAILURE: Latest build failed. Ike is pissed! If you see this, you should run and hide.
UNKNOWN: For some reason the status of the latest build is unknown. With all the uncertainty and doubt, Ike sings the blues.
So if ever in doubt, head over to the Arquillian site to check out Ike's mood in the right side menu.
Big thanks to cheyenneweaver for the awesome graphics! She should be ennobled for all her great work... I'm not going to say to much, but just maybe one day she will...
Another mark in the calendar for the Arquillian team, 1.0.0.Alpha2 has just been released!
The Second fleet of the first wave has arrived!
(... Ooh boy, what a ride! Our transwarp speed engine went critical, had to eject the core and hustle a local merchant at a nearby tradestation for a new coil. A long story for some other time...)
Highlights of the release:
@RunWith(Arquillian.class) @Run(AS_CLIENT) public class LocalRunServletTestCase { @Deployment public static WebArchive createDeployment() { return ShrinkWrap.create("test.war", WebArchive.class) .addClass(TestServlet.class); } @Test public void shouldBeAbleToDeployWebArchive() throws Exception { String body = readAllAndClose( new URL("http://localhost:8080/test/Test").openStream()); Assert.assertEquals( "Verify that the servlet was deployed and returns expected result", "hello", body); } ... }
<?xml version="1.0"?> <arquillian xmlns="http://jboss.com/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jboss="urn:arq:org.jboss.arquillian.jbossas.local60"> <jboss:container> <jbossHome>target/jboss-6.0.0.20100429-M3</jbossHome> <bindAddress>127.0.0.1</bindAddress> <httpPort>8080</httpPort> </jboss:container> </arquillian>
The containers you can depoy to in this release:
Arquillian no longer exposes the containers dependencies transitively, so you can control which container point release v. or logging framework the Arquillian integration should use. This might sound more complex at first, but see the "Complete Container Reference" in the Reference Guide for Maven examples on how to set this up for each container.
And what's open source without the community?!
Big thanks to the Arquillian and ShrinkWrap community for helping us with this release!
In alphabetical order: Dan Allen, German Escobar, Ken Gullaksen, Sten Aksel Heien, Alejandro Montenegro, Pete Muir, Jesper Pedersen, Andrew Lee Rubinger, Juergen Zimmermann.
Today I bring good news to all the fellow Arquillians out there. We just got our own project site!
The project site is the place to go to find all information about the project. It has the typical items like:
But to keep things interesting, we've also aggregated rolling information, such as:
The Arquillian complements the project site as host of the dynamic community content--our forums (discussions), community articles and blog entries. The information on our old "wiki home page" will eventually be phased out and replaced by the community space + the project site.
See something that's missing? Want something changed? As always we would like the communities feedback on where to go from here. Please don't hesitate to let us know!
Now head over to the Arquillian project site and poke around.
Look for the link on the right to find cool Arquillian swag and a wallpaper for your desktop!
This post was syndicated from in.relation.to.
I'm happy to announce the first alpha release of Arquillian, an open source (ASL v2) framework for running tests in the container. If you want to read more about Arquillian's mission, and how it fits into our vision for testing at JBoss, read Testing Java EE the JBoss way.
It's one thing to unit test your code outside of the container, but what happens when you run it inside? Does it still behave the same? How about testing against container managed resources? This is where Arquillian comes into its own.
With Arquillian it's just as easy to write integration tests as unit tests. In fact, to minimize the burden on you, Arquillian integrates with familiar testing frameworks, allowing reuse of tools such as the JUnit/TestNG support in your favorite IDE, Maven Surefire, Ant - in fact any tool which supports TestNG or JUnit!
To show you just how simple this is, here's an example test case setup using JUnit: (we'll get to the actual test next)
@RunWith(org.jboss.arquillian.junit.Arquillian.class) public class TemperatureConverterTestCase { @Deployment public static JavaArchive createTestArchive() { return Archives.create("test.jar", JavaArchive.class) .addClasses(TemperatureConverter.class, TemperatureConverterBean.class); } }
By using JUnit's @RunWith annotation, you tell JUnit to use Arquillian as the test controller. Arquillian will then look for a static method marked with the @Deployment annotation, which creates your micro deployment. In the example above we simply deploy a session bean interface and implementation.
Arquillian hooks into your testing frameworks lifecycle and reacts to events. On the before suite and after suite events the container is started/stopped, while on the before class and after class events your micro deployment is deployed to/undeployed from the container.
The test case is started in the local JVM, and then Arquillian overrides the normal test execution and migrates the test so that it's executed inside the container. By the time the test framework calls your @Test annotated method, the test is running inside the container, giving us the possibility to work with container managed resources. Here's the complete test class with JUnit @Test methods.
@RunWith(org.jboss.arquillian.junit.Arquillian.class) public class TemperatureConverterTestCase { @Deployment public static JavaArchive createTestArchive() { return Archives.create("test.jar", JavaArchive.class) .addClasses(TemperatureConverter.class, TemperatureConverterBean.class); } @EJB private TemperatureConverter converter; @Test public void shouldConvertToCelsius() { Assert.assertEquals(converter.convertToCelsius(32d), 0d); Assert.assertEquals(converter.convertToCelsius(212d), 100d); } @Test public void shouldConvertToFarenheit() { Assert.assertEquals(converter.convertToFarenheit(0d), 32d); Assert.assertEquals(converter.convertToFarenheit(100d), 212d); } }
Note how we can use @EJB to inject the session bean from our deployment into the test case for use in our test method - neat!
The Arquillian TestEnricher SPI supports all the injection annotations from Java EE 6 - @EJB, @Resource and @Inject.
This example test case could run in GlassFish, JBoss AS or OpenEJB as there are no container specific code/configuration at all. The choice is yours. You could even test on multiple platforms!
You can follow up with some in depth usage scenarios and tests described in these articles:
We also have reference documentation which walks you through the examples from Arquillian, and shows you how to create your own Arquillian test suite. You might also find the Javadoc useful (API, SPI), especially if you plan on adding support for another container. You can also check out the forums and more articles can be found on our community site. If your interested in chatting to us, please drop by #jbosstesting on irc.freenode.net
Some of the things you can expect from Arquillian are:
@Test public void shouldWithdrawFromAccount(@EJB AccountManager manager) throws Exception { ... }
@Test @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public void shouldWithdrawFromAccount(@EJB AccountManager manager) throws Exception { ... }
// auto creation of InitialContext based on running container, remote or local. @ArquillianResource private InitialContext context; // auto creation of URL to a deployed Servlet, including http port/ip etc. @ArquillianResource(MyServlet.class) private URL myServletURL; // the bundle context of a deployed osgi bundle @ArquillianResource private BundleContext context;
Arquillian is a new framework, but it's going to be put right to work as the workhorse to test all the Seam 3 modules. It will also be our recommended solution for testing your Seam application. (We'd love to see the community try it out for testing Seam 2 applications). We'll also replace the current core of the JSR-299 CDI TCK with Arquillian, likely for the 1.1 version of the TCK. (To provide a little history, Arquillian originated from the JBoss Test Harness that was developed by Pete Muir as the foundation of the CDI TCK).
If you have any thoughts on these ideas, or would like to suggest some new avenues we should explore, please contact us on the Arquillian Development.
A big thanks to the Arquillian and ShrinkWrap community for helping out on this release by being early adopters, joining in on community meetings, general discussions and writing blogs, articles and patches. In alphabetical order: Dan Allen, Steven Boscarine, German Escobar, Jordan Ganoff, Ken Gullaksen, Pete Muir, Jason Porter, Andrew Lee Rubinger. You guys rock!
[ JIRA | SPI Javadoc, API Javadoc | Reference Guide | Release Notes | Maven Artifacts ]
See the original blog entry to view and post comments.