Author: jlmonteiro
Date: Thu Nov 8 22:16:02 2012
New Revision: 1407292
URL: http://svn.apache.org/viewvc?rev=1407292&view=rev
Log:
Filling up some arquillian stuff
Added:
openejb/site/trunk/content/arquillian-available-adapters.mdtext
- copied, changed from r1407283,
openejb/site/trunk/content/arquillian-available-adapter.mdtext
Removed:
openejb/site/trunk/content/arquillian-available-adapter.mdtext
Modified:
openejb/site/trunk/content/arquillian-getting-started.mdtext
Copied: openejb/site/trunk/content/arquillian-available-adapters.mdtext (from
r1407283, openejb/site/trunk/content/arquillian-available-adapter.mdtext)
URL:
http://svn.apache.org/viewvc/openejb/site/trunk/content/arquillian-available-adapters.mdtext?p2=openejb/site/trunk/content/arquillian-available-adapters.mdtext&p1=openejb/site/trunk/content/arquillian-available-adapter.mdtext&r1=1407283&r2=1407292&rev=1407292&view=diff
==============================================================================
--- openejb/site/trunk/content/arquillian-available-adapter.mdtext (original)
+++ openejb/site/trunk/content/arquillian-available-adapters.mdtext Thu Nov 8
22:16:02 2012
@@ -1,15 +1,13 @@
Title: TomEE and Arquillian
-{info
-See [Arquillian.org](http://arquillian.org) for some great quickstart
information on Arquillian itself.
-}
+Check out the [Getting started](arquillian-getting-started.html) page if you
are not familiar with Arquillian.
All the Aqruillian Adapters for TomEE support the following configuration
options in the arquillian.xml:
<container qualifier="tomee" default="true">
<configuration>
- <property name="httpPort">0</property>
- <property name="stopPort">0</property>
+ <property name="httpPort">-1</property>
+ <property name="stopPort">-1</property>
</configuration>
</container>
@@ -22,21 +20,26 @@ The above can also be set as system prop
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
- <tomee.httpPort>0</tomee.httpPort>
- <tomee.stopPort>0</tomee.stopPort>
+ <tomee.httpPort>-1</tomee.httpPort>
+ <tomee.stopPort>-1</tomee.stopPort>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
-When a port is set to zero, a random port will be chosen. This is key to
avoiding port conflicts on CI systems or for just plain clean testing.
+When a port is set to -1, a random port will be chosen. This is key to
avoiding port conflicts on CI systems or for just plain clean testing.
The TomEE Arquillian adapters will export the actual port chosen back as a
system propert using the same name. The test case can use the property to
retrieve the port and contact the server.
URL url = new URL("http://localhost:" +
System.getProperty("tomee.httpPort");
// use the URL to connect to the server
+When you are actually using a test on the client side, you can use instead
+
+ @Arquillian private URL url;
+
+The url will get injected by Arquillian. Be careful, that injection only works
if your are on the client side (it does not make sense in the server side). So,
if for a specific need to need it, just use the system property.
# TomEE Embedded Adapter
Modified: openejb/site/trunk/content/arquillian-getting-started.mdtext
URL:
http://svn.apache.org/viewvc/openejb/site/trunk/content/arquillian-getting-started.mdtext?rev=1407292&r1=1407291&r2=1407292&view=diff
==============================================================================
--- openejb/site/trunk/content/arquillian-getting-started.mdtext (original)
+++ openejb/site/trunk/content/arquillian-getting-started.mdtext Thu Nov 8
22:16:02 2012
@@ -1,5 +1,18 @@
Title: Getting started with Arquillian and TomEE
+Arquillian is a testing framework on top of JUnit (or TestNG if you prefer).
It makes it easier to do integration tests in a managed environment (JEE
environment here after).
+
+In an managed environment, it's usually quite difficult to do unit tests,
cause most of the time you have to mock almost all the world. It's really time
consuming and does not prevent to write integration tests to reflect the
production environment. Hence, unit tests become pretty useless.
+
+JEE always got seen as an heavy technology, impossible to test and to use in
development. OpenEJB always fight against that idea and proved that it's really
possible.
+
+As David Blevins say:
+> "Don't blame EJBs (ie. Java EE) because your server isn't testable."
+
+With latest Java EE specifications (5 and especially 6), it becomes a reality.
Arquillian typically adresses that area. It basically a framework that aims at
helping managing server/container in an agnostic way. Arquillian is responsible
for the lifecycle of the container (start, deploy, undeploy, stop, etc).
+
+TomEE community heavily invested on that framework to prove it's really useful
and can really help testing Java EE application. That's also an opportunity to
get the most of TomEE (lightweight, fast, featureful, etc).
+
{info
-See [Arquillian.org](http://arquillian.org) for some great quickstart
information on Arquillian itself.
+See also [Arquillian.org](http://arquillian.org) for some great quickstart
information on Arquillian itself.
}