Book Image

Arquillian Testing Guide

By : John D. Ament
Book Image

Arquillian Testing Guide

By: John D. Ament

Overview of this book

<p>Integration testing sometimes involves writing complex codes. This book introduces you to the capabilities of Arquillian to enable you to write simple code with a broad range of integration tests for java applications. <br /><br />Arquillian Testing Guide serves as an introductory book to writing simple codes for testing java applications. This book will help you to develop richer test cases which can be run automatically while performing rigorous testing of the software. <br /><br />Arquillian Testing Guide introduces you to Arquillians features and capabilities. This book will help you understand the mechanism of creating deployments and test against those deployments. The book begins with basic JUnit test cases beginning with an enterprise test case, which then go on to discuss remote testing. During the course of the book, you will also learn how to mix container and non-container tests into a single test case. By the end of the book, you will have learned how to extend JUnit tests to work with Arquillian and deploy them to a container automatically.</p>
Table of Contents (17 chapters)

A jump in technology


If we fast forward a little bit (pretty much skip the rest of J2EE progression) and land in Java EE 5, we run into an interesting paradigm shift. EJB3 came out with this revision of Enterprise Edition, with a lot of cool new features. It was meant to be a simplification release, removing the need for a lot of extra interfaces, or classes implementing methods to do their work. The component programming model instead moved towards annotations (in general, annotations are considered decorations on your code, providing metadata for some runtime to use. In Java, these are CLASS, RUNTIME, and SOURCE. RUNTIME allows you to access the annotation after compilation while CLASS and SOURCE are typically only compile time).

Since we switched to annotations, we no longer needed the EJB container libraries on our classpath to test. The annotation would be ignored, as long as it is not used, by the testing runtime. You can more easily test these objects, as long as they are coded correctly...