You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@tomee.apache.org by bu...@apache.org on 2012/11/09 16:58:13 UTC

svn commit: r837790 - in /websites/staging/openejb/trunk: cgi-bin/ content/ content/examples-trunk/ content/examples-trunk/rest-xml-json/ content/examples-trunk/rest-xml-json/src/ content/examples-trunk/rest-xml-json/src/main/ content/examples-trunk/re...

Author: buildbot
Date: Fri Nov  9 15:58:10 2012
New Revision: 837790

Log:
Staging update by buildbot for openejb

Added:
    websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/
    websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/README.html
    websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/pom.xml   (with props)
    websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/
    websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/main/
    websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/main/java/
    websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/main/java/org/
    websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/main/java/org/superbiz/
    websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/main/java/org/superbiz/rest/
    websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/main/java/org/superbiz/rest/GreetingService.java
    websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/main/java/org/superbiz/rest/Request.java
    websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/main/java/org/superbiz/rest/Response.java
    websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/test/
    websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/test/java/
    websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/test/java/org/
    websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/test/java/org/superbiz/
    websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/test/java/org/superbiz/rest/
    websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/test/java/org/superbiz/rest/GreetingServiceTest.java
    websites/staging/openejb/trunk/content/examples-trunk/simple-rest/
    websites/staging/openejb/trunk/content/examples-trunk/simple-rest/README.html
    websites/staging/openejb/trunk/content/examples-trunk/simple-rest/pom.xml   (with props)
    websites/staging/openejb/trunk/content/examples-trunk/simple-rest/src/
    websites/staging/openejb/trunk/content/examples-trunk/simple-rest/src/main/
    websites/staging/openejb/trunk/content/examples-trunk/simple-rest/src/main/java/
    websites/staging/openejb/trunk/content/examples-trunk/simple-rest/src/main/java/org/
    websites/staging/openejb/trunk/content/examples-trunk/simple-rest/src/main/java/org/superbiz/
    websites/staging/openejb/trunk/content/examples-trunk/simple-rest/src/main/java/org/superbiz/rest/
    websites/staging/openejb/trunk/content/examples-trunk/simple-rest/src/main/java/org/superbiz/rest/GreetingService.java
    websites/staging/openejb/trunk/content/examples-trunk/simple-rest/src/test/
    websites/staging/openejb/trunk/content/examples-trunk/simple-rest/src/test/java/
    websites/staging/openejb/trunk/content/examples-trunk/simple-rest/src/test/java/org/
    websites/staging/openejb/trunk/content/examples-trunk/simple-rest/src/test/java/org/superbiz/
    websites/staging/openejb/trunk/content/examples-trunk/simple-rest/src/test/java/org/superbiz/rest/
    websites/staging/openejb/trunk/content/examples-trunk/simple-rest/src/test/java/org/superbiz/rest/GreetingServiceTest.java
Modified:
    websites/staging/openejb/trunk/cgi-bin/   (props changed)
    websites/staging/openejb/trunk/content/   (props changed)
    websites/staging/openejb/trunk/content/examples-trunk/index.html
    websites/staging/openejb/trunk/content/examples-trunk/pom.xml

Propchange: websites/staging/openejb/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Fri Nov  9 15:58:10 2012
@@ -1 +1 @@
-1407292
+1407511

Propchange: websites/staging/openejb/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Fri Nov  9 15:58:10 2012
@@ -1 +1 @@
-1407292
+1407511

Modified: websites/staging/openejb/trunk/content/examples-trunk/index.html
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/index.html (original)
+++ websites/staging/openejb/trunk/content/examples-trunk/index.html Fri Nov  9 15:58:10 2012
@@ -193,9 +193,11 @@ All the examples show code, but some are
 <div class="span-one-third"></p>
 
 <h3>REST</h3></li>
-<li><a href="rest-example-with-application/README.html">rest-example-with-application</a></li>
+<li><a href="simple-rest/README.html">simple-rest</a></li>
 <li><a href="rest-example/README.html">rest-example</a></li>
-<li><a href="rest-on-ejb/README.html">rest-on-ejb</a></div>
+<li><a href="rest-example-with-application/README.html">rest-example-with-application</a></li>
+<li><a href="rest-on-ejb/README.html">rest-on-ejb</a></li>
+<li><a href="rest-example/README.html">rest-xml-json</a></div>
 <div class="span-one-third"></p>
 
 <h3>Web Services</h3></li>

Modified: websites/staging/openejb/trunk/content/examples-trunk/pom.xml
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/pom.xml (original)
+++ websites/staging/openejb/trunk/content/examples-trunk/pom.xml Fri Nov  9 15:58:10 2012
@@ -17,7 +17,7 @@
     limitations under the License.
 -->
 <!--test 2-->
-<!-- $Rev: 1404128 $ $Date: 2012-10-31 13:20:40 +0000 (Wed, 31 Oct 2012) $ -->
+<!-- $Rev: 1407511 $ $Date: 2012-11-09 15:57:46 +0000 (Fri, 09 Nov 2012) $ -->
 
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
@@ -38,16 +38,17 @@
     <module>async-methods</module>
     <module>bean-validation-design-by-contract</module>
     <module>cdi-alternative-and-stereotypes</module>
+    <module>cdi-application-scope</module>
     <module>cdi-basic</module>
     <module>cdi-ejbcontext-jaas</module>
     <module>cdi-events</module>
     <module>cdi-interceptors</module>
-    <module>cdi-request-scope</module>
-    <module>cdi-application-scope</module>
     <module>cdi-produces-disposes</module>
     <module>cdi-produces-field</module>
     <module>cdi-query</module>
     <module>cdi-realm</module>
+    <module>cdi-request-scope</module>
+    <module>cdi-session-scope</module>
     <module>change-jaxws-url</module>
     <module>component-interfaces</module>
     <module>client-resource-lookup-preview</module>
@@ -103,6 +104,7 @@
     <module>rest-on-ejb</module>
     <module>rest-example</module>
     <module>rest-example-with-application</module>
+    <module>rest-xml-json</module>
     <module>scala-basic</module>
     <module>schedule-expression</module>
     <module>schedule-events</module>
@@ -115,6 +117,7 @@
     <module>simple-mdb</module>
     <module>simple-mdb-with-descriptor</module>
     <module>simple-osgi</module>
+    <module>simple-rest</module>
     <module>simple-singleton</module>
     <module>simple-stateful</module>
     <module>simple-stateful-callbacks</module>
@@ -122,6 +125,7 @@
     <module>simple-stateless-callbacks</module>
     <module>simple-stateless-with-descriptor</module>
     <module>simple-webservice</module>
+    <module>simple-webservice-without-interface</module>
     <module>spring-data-proxy</module>
     <module>spring-data-proxy-meta</module>
     <module>struts</module>

Added: websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/README.html
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/README.html (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/README.html Fri Nov  9 15:58:10 2012
@@ -0,0 +1,587 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+
+    <meta charset="utf-8">
+      <title>Simple REST</title>
+    <meta name="description" content="">
+    <meta name="author" content="">
+
+    <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+    <!--[if lt IE 9]>
+      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+
+    <!-- Le styles -->
+    <link href="./../../bootstrap.css" rel="stylesheet">
+    <link href="./../../prettify.css" rel="stylesheet">
+    <link href="./../../bootstrap-mods.css" rel="stylesheet">
+
+    <style type="text/css">
+        body {
+          padding-top: 60px;
+        }
+        .sprite {
+            display: inline-block;
+            height: 20px;
+            margin: 0 auto 4px;
+            outline: medium none;
+            text-indent: -999em;
+            width: 24px;
+            background-image: url('./../../images/sprites.png');
+            background-repeat: no-repeat;
+            overflow: hidden;
+            cursor: pointer;
+        }
+        .edit-page {
+            display: inline-block;
+            height: 20px;
+            margin: 0 auto 4px;
+            outline: medium none;
+            text-indent: -999em;
+            width: 24px;
+            background-image: url('./../../images/edit.png');
+            background-repeat: no-repeat;
+            overflow: hidden;
+            cursor: pointer;
+        }
+        .fb-share {
+            background-position: 0px -40px;
+        }
+        .gp-share {
+            background-position: 0px 0px;
+        }
+        .tw-share {
+            background-position: 0px -80px;
+        }
+    </style>
+    <script type="text/javascript">
+      function fbshare () {
+          window.open(
+                  "http://www.facebook.com/sharer/sharer.php?u="+document.URL,
+                  'Share on Facebook',
+                  'width=640,height=426');
+      };
+      function gpshare () {
+          window.open(
+                  "https://plus.google.com/share?url="+document.URL,
+                  'Share on Google+',
+                  'width=584,height=385');
+      };
+      function twshare () {
+          window.open(
+                  "https://twitter.com/intent/tweet?url="+document.URL+"&text=Simple REST",
+                  'Share on Twitter',
+                  'width=800,height=526');
+      };
+    </script>
+
+    <!-- Le fav and touch icons -->
+    <link rel="shortcut icon" href="./../../images/favicon.ico">
+    <link rel="apple-touch-icon" href="./../../images/apple-touch-icon.png">
+    <link rel="apple-touch-icon" sizes="72x72" href="./../../images/apple-touch-icon-72x72.png">
+    <link rel="apple-touch-icon" sizes="114x114" href="./../../images/apple-touch-icon-114x114.png">
+
+    <script src="./../../javascript/prettify.js" type="text/javascript"></script>
+    <script src="./../../javascript/jquery-latest.js"></script>
+    <script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
+    <script src="./../../javascript/common.js"></script>
+    <script src="./../../javascript/prettyprint.js"></script>
+
+    <script type="text/javascript">
+
+      var _gaq = _gaq || [];
+      _gaq.push(['_setAccount', 'UA-2717626-1']);
+      _gaq.push(['_setDomainName', 'apache.org']);
+      _gaq.push(['_trackPageview']);
+
+      (function() {
+        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+      })();
+
+    </script>
+
+
+  </head>
+
+  <body>
+
+    <div class="topbar">
+      <div class="fill">
+        <div class="container">
+          <a class="brand" href="./../../index.html">Apache TomEE</a>
+          <ul class="nav">
+            <li><a href="./../../index.html">Home</a></li>
+            <li><a href="./../../downloads.html">Downloads</a></li>
+            <li><a href="./../../documentation.html">Documentation</a></li>
+            <li><a href="./../../support.html">Support</a></li>
+          </ul>
+
+            <!-- Google CSE Search Box Begins  -->
+            <FORM class="pull-right" id="searchbox_010475492895890475512:_t4iqjrgx90" action="http://www.google.com/cse">
+                <INPUT type="hidden" name="cx" value="010475492895890475512:_t4iqjrgx90">
+                <INPUT type="hidden" name="cof" value="FORID:0">
+                <INPUT name="q" type="text" placeholder="Search">
+            </FORM>
+            <!--<SCRIPT type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_010475492895890475512:_t4iqjrgx90"></SCRIPT>-->
+            <!-- Google CSE Search Box Ends -->
+        </div>
+      </div>
+    </div>
+
+    <div class="container">
+    
+
+<div class="row">
+    <div class="span8">
+        <small><a href="./../../index.html">Home</a>&nbsp;&raquo&nbsp;<a href="./../../examples-trunk/">Examples Trunk</a>&nbsp;&raquo&nbsp;<a href="./../../examples-trunk/rest-xml-json/">Rest Xml Json</a></small><br>
+    </div>
+    <div class="span8">
+    </div>
+</div>
+&nbsp;
+<div class="page-header">
+<h1>Simple REST
+
+    <div style="float: right; position: relative; bottom: -10px; ">
+        <a onclick="javascript:gpshare()" class="gp-share sprite" title="share on Google+">share [gp]</a>
+        <a onclick="javascript:fbshare()" class="fb-share sprite" title="share on Facebook">share [fb]</a>
+        <a onclick="javascript:twshare()" class="tw-share sprite" title="share on Twitter">share [tw]</a>
+        <a data-toggle="modal" href="#edit" class="edit-page" title="Contribute to this Page">contribute</a>
+    </div>
+</h1>
+</div>
+
+<p>Defining a REST service is pretty easy, simply ad @Path annotation to a class then define on methods
+the HTTP method to use (@GET, @POST, ...).</p>
+
+<h1>The Code</h1>
+
+<h2>The REST service: @Path, @Produces, @Consumes</h2>
+
+<p>Here we see a bean that uses the Bean-Managed Concurrency option as well as the @Startup annotation which causes the bean to be instantiated by the container when the application starts. Singleton beans with @ConcurrencyManagement(BEAN) are responsible for their own thread-safety. The bean shown is a simple properties "registry" and provides a place where options could be set and retrieved by all beans in the application.</p>
+
+<p>Actually lines:</p>
+
+<pre><code>@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+</code></pre>
+
+<p>are optional since it is the default configuration. And these lines can be configured by method too
+if you need to be more precise.</p>
+
+<pre><code>@Path("/greeting")
+@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+public class GreetingService {
+    @GET
+    public Response message() {
+        return new Response("Hi REST!");
+    }
+
+    @POST
+    public Response lowerCase(final Request message) {
+        return new Response(message.getValue().toLowerCase());
+    }
+}
+</code></pre>
+
+<h1>Testing</h1>
+
+<h2>Test for the JAXRS service</h2>
+
+<p>The test uses the OpenEJB ApplicationComposer to make it trivial.</p>
+
+<p>The idea is first to activate the jaxrs services. This is done using @EnableServices annotation.</p>
+
+<p>Then we create on the fly the application simply returning an object representing the web.xml. Here we simply
+use it to define the context root but you can use it to define your REST Application too. And to complete the
+application definition we add @Classes annotation to define the set of classes to use in this app.</p>
+
+<p>Finally to test it we use cxf client API to call the REST service in get() and post() methods.</p>
+
+<p>Side note: to show we use JSON or XML depending on the test method we activated on EnableServices the attribute httpDebug
+which prints the http messages in the logs.</p>
+
+<pre><code>package org.superbiz.rest;
+
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.junit.ApplicationComposer;
+import org.apache.openejb.junit.Classes;
+import org.apache.openejb.junit.EnableServices;
+import org.apache.openejb.junit.Module;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.ws.rs.core.MediaType;
+import java.io.IOException;
+
+import static org.junit.Assert.assertEquals;
+
+@EnableServices(value = "jaxrs", httpDebug = true)
+@RunWith(ApplicationComposer.class)
+public class GreetingServiceTest {
+    @Module
+    @Classes(GreetingService.class)
+    public WebApp app() {
+        return new WebApp().contextRoot("test");
+    }
+
+    @Test
+    public void getXml() throws IOException {
+        final String message = WebClient.create("http://localhost:4204").path("/test/greeting/")
+                .accept(MediaType.APPLICATION_XML_TYPE)
+                .get(Response.class).getValue();
+        assertEquals("Hi REST!", message);
+    }
+
+    @Test
+    public void postXml() throws IOException {
+        final String message = WebClient.create("http://localhost:4204").path("/test/greeting/")
+                .accept(MediaType.APPLICATION_XML_TYPE)
+                .post(new Request("Hi REST!"), Response.class).getValue();
+        assertEquals("hi rest!", message);
+    }
+
+    @Test
+    public void getJson() throws IOException {
+        final String message = WebClient.create("http://localhost:4204").path("/test/greeting/")
+                .accept(MediaType.APPLICATION_JSON_TYPE)
+                .get(Response.class).getValue();
+        assertEquals("Hi REST!", message);
+    }
+
+    @Test
+    public void postJson() throws IOException {
+        final String message = WebClient.create("http://localhost:4204").path("/test/greeting/")
+                .accept(MediaType.APPLICATION_JSON_TYPE)
+                .post(new Request("Hi REST!"), Response.class).getValue();
+        assertEquals("hi rest!", message);
+    }
+}
+</code></pre>
+
+<h1>Running</h1>
+
+<p>Running the example is fairly simple. In the "rest-xml-json" directory run:</p>
+
+<pre><code>$ mvn clean install
+</code></pre>
+
+<p>Which should create output like the following.</p>
+
+<pre><code>/opt/softs/java/jdk1.6.0_30/bin/java -ea -Didea.launcher.port=7534 -Didea.launcher.bin.path=/opt/softs/idea/bin -Dfile.encoding=UTF-8 -classpath /opt/softs/idea/lib/idea_rt.jar:/opt/softs/idea/plugins/junit/lib/junit-rt.jar:/opt/softs/java/jdk1.6.0_30/jre/lib/plugin.jar:/opt/softs/java/jdk1.6.0_30/jre/lib/javaws.jar:/opt/softs/java/jdk1.6.0_30/jre/lib/jce.jar:/opt/softs/java/jdk1.6.0_30/jre/lib/charsets.jar:/opt/softs/java/jdk1.6.0_30/jre/lib/resources.jar:/opt/softs/java/jdk1.6.0_30/jre/lib/deploy.jar:/opt/softs/java/jdk1.6.0_30/jre/lib/management-agent.jar:/opt/softs/java/jdk1.6.0_30/jre/lib/jsse.jar:/opt/softs/java/jdk1.6.0_30/jre/lib/rt.jar:/opt/softs/java/jdk1.6.0_30/jre/lib/ext/localedata.jar:/opt/softs/java/jdk1.6.0_30/jre/lib/ext/sunjce_provider.jar:/opt/softs/java/jdk1.6.0_30/jre/lib/ext/sunpkcs11.jar:/opt/softs/java/jdk1.6.0_30/jre/lib/ext/dnsns.jar:/opt/dev/openejb/openejb-trunk/examples/rest-xml-json/target/test-classes:/opt/dev/openejb/openejb-trunk/e
 xamples/rest-xml-json/target/classes:/home/rmannibucau/.m2/repository/org/apache/openejb/javaee-api/6.0-4/javaee-api-6.0-4.jar:/home/rmannibucau/.m2/repository/junit/junit/4.10/junit-4.10.jar:/home/rmannibucau/.m2/repository/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar:/home/rmannibucau/.m2/repository/org/apache/openejb/openejb-cxf-rs/4.5.1-SNAPSHOT/openejb-cxf-rs-4.5.1-SNAPSHOT.jar:/home/rmannibucau/.m2/repository/org/apache/openejb/openejb-http/4.5.1-SNAPSHOT/openejb-http-4.5.1-SNAPSHOT.jar:/home/rmannibucau/.m2/repository/org/apache/openejb/openejb-core/4.5.1-SNAPSHOT/openejb-core-4.5.1-SNAPSHOT.jar:/home/rmannibucau/.m2/repository/org/apache/openejb/mbean-annotation-api/4.5.1-SNAPSHOT/mbean-annotation-api-4.5.1-SNAPSHOT.jar:/home/rmannibucau/.m2/repository/org/apache/openejb/openejb-jpa-integration/4.5.1-SNAPSHOT/openejb-jpa-integration-4.5.1-SNAPSHOT.jar:/home/rmannibucau/.m2/repository/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar:/home/rmannibucau
 /.m2/repository/org/apache/openejb/openejb-api/4.5.1-SNAPSHOT/openejb-api-4.5.1-SNAPSHOT.jar:/home/rmannibucau/.m2/repository/org/apache/openejb/openejb-loader/4.5.1-SNAPSHOT/openejb-loader-4.5.1-SNAPSHOT.jar:/home/rmannibucau/.m2/repository/org/apache/openejb/openejb-javaagent/4.5.1-SNAPSHOT/openejb-javaagent-4.5.1-SNAPSHOT.jar:/home/rmannibucau/.m2/repository/org/apache/openejb/openejb-jee/4.5.1-SNAPSHOT/openejb-jee-4.5.1-SNAPSHOT.jar:/home/rmannibucau/.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.13/jaxb-impl-2.1.13.jar:/home/rmannibucau/.m2/repository/commons-cli/commons-cli/1.2/commons-cli-1.2.jar:/home/rmannibucau/.m2/repository/org/apache/activemq/activemq-ra/5.7.0/activemq-ra-5.7.0.jar:/home/rmannibucau/.m2/repository/org/apache/activemq/activemq-core/5.7.0/activemq-core-5.7.0.jar:/home/rmannibucau/.m2/repository/org/slf4j/slf4j-api/1.7.2/slf4j-api-1.7.2.jar:/home/rmannibucau/.m2/repository/org/apache/activemq/kahadb/5.7.0/kahadb-5.7.0.jar:/home/rmannibucau/.m2/repos
 itory/org/apache/activemq/protobuf/activemq-protobuf/1.1/activemq-protobuf-1.1.jar:/home/rmannibucau/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar:/home/rmannibucau/.m2/repository/commons-net/commons-net/3.1/commons-net-3.1.jar:/home/rmannibucau/.m2/repository/org/apache/geronimo/components/geronimo-connector/3.1.1/geronimo-connector-3.1.1.jar:/home/rmannibucau/.m2/repository/org/apache/geronimo/components/geronimo-transaction/3.1.1/geronimo-transaction-3.1.1.jar:/home/rmannibucau/.m2/repository/org/apache/geronimo/specs/geronimo-j2ee-connector_1.6_spec/1.0/geronimo-j2ee-connector_1.6_spec-1.0.jar:/home/rmannibucau/.m2/repository/org/objectweb/howl/howl/1.0.1-1/howl-1.0.1-1.jar:/home/rmannibucau/.m2/repository/org/apache/geronimo/javamail/geronimo-javamail_1.4_mail/1.8.2/geronimo-javamail_1.4_mail-1.8.2.jar:/home/rmannibucau/.m2/repository/org/apache/xbean/xbean-asm-shaded/3.12/xbean-asm-shaded-3.12.jar:/home/rmannibucau/.m2/repository/org/ap
 ache/xbean/xbean-finder-shaded/3.12/xbean-finder-shaded-3.12.jar:/home/rmannibucau/.m2/repository/org/apache/xbean/xbean-reflect/3.12/xbean-reflect-3.12.jar:/home/rmannibucau/.m2/repository/org/apache/xbean/xbean-naming/3.12/xbean-naming-3.12.jar:/home/rmannibucau/.m2/repository/org/apache/xbean/xbean-bundleutils/3.12/xbean-bundleutils-3.12.jar:/home/rmannibucau/.m2/repository/org/hsqldb/hsqldb/2.2.8/hsqldb-2.2.8.jar:/home/rmannibucau/.m2/repository/commons-dbcp/commons-dbcp/1.4/commons-dbcp-1.4.jar:/home/rmannibucau/.m2/repository/commons-pool/commons-pool/1.5.7/commons-pool-1.5.7.jar:/home/rmannibucau/.m2/repository/org/codehaus/swizzle/swizzle-stream/1.6.1/swizzle-stream-1.6.1.jar:/home/rmannibucau/.m2/repository/wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar:/home/rmannibucau/.m2/repository/org/quartz-scheduler/quartz/2.1.6/quartz-2.1.6.jar:/home/rmannibucau/.m2/repository/org/slf4j/slf4j-jdk14/1.7.2/slf4j-jdk14-1.7.2.jar:/home/rmannibucau/.m2/repository/org/apache/openwebbeans/op
 enwebbeans-impl/1.1.6/openwebbeans-impl-1.1.6.jar:/home/rmannibucau/.m2/repository/org/apache/openwebbeans/openwebbeans-spi/1.1.6/openwebbeans-spi-1.1.6.jar:/home/rmannibucau/.m2/repository/org/apache/openwebbeans/openwebbeans-ejb/1.1.6/openwebbeans-ejb-1.1.6.jar:/home/rmannibucau/.m2/repository/org/apache/openwebbeans/openwebbeans-ee/1.1.6/openwebbeans-ee-1.1.6.jar:/home/rmannibucau/.m2/repository/org/apache/openwebbeans/openwebbeans-ee-common/1.1.6/openwebbeans-ee-common-1.1.6.jar:/home/rmannibucau/.m2/repository/org/apache/openwebbeans/openwebbeans-web/1.1.6/openwebbeans-web-1.1.6.jar:/home/rmannibucau/.m2/repository/org/javassist/javassist/3.15.0-GA/javassist-3.15.0-GA.jar:/home/rmannibucau/.m2/repository/org/apache/openjpa/openjpa/2.2.0/openjpa-2.2.0.jar:/home/rmannibucau/.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar:/home/rmannibucau/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar:/home/rmannibucau/.m2/repo
 sitory/net/sourceforge/serp/serp/1.13.1/serp-1.13.1.jar:/home/rmannibucau/.m2/repository/asm/asm/3.2/asm-3.2.jar:/home/rmannibucau/.m2/repository/org/apache/bval/bval-core/0.5/bval-core-0.5.jar:/home/rmannibucau/.m2/repository/commons-beanutils/commons-beanutils-core/1.8.3/commons-beanutils-core-1.8.3.jar:/home/rmannibucau/.m2/repository/org/apache/bval/bval-jsr303/0.5/bval-jsr303-0.5.jar:/home/rmannibucau/.m2/repository/org/fusesource/jansi/jansi/1.8/jansi-1.8.jar:/home/rmannibucau/.m2/repository/org/apache/openejb/openejb-server/4.5.1-SNAPSHOT/openejb-server-4.5.1-SNAPSHOT.jar:/home/rmannibucau/.m2/repository/org/apache/openejb/openejb-client/4.5.1-SNAPSHOT/openejb-client-4.5.1-SNAPSHOT.jar:/home/rmannibucau/.m2/repository/org/apache/openejb/openejb-ejbd/4.5.1-SNAPSHOT/openejb-ejbd-4.5.1-SNAPSHOT.jar:/home/rmannibucau/.m2/repository/org/apache/openejb/openejb-rest/4.5.1-SNAPSHOT/openejb-rest-4.5.1-SNAPSHOT.jar:/home/rmannibucau/.m2/repository/org/apache/openejb/openejb-cxf
 -transport/4.5.1-SNAPSHOT/openejb-cxf-transport-4.5.1-SNAPSHOT.jar:/home/rmannibucau/.m2/repository/org/apache/cxf/cxf-rt-transports-http/2.7.0/cxf-rt-transports-http-2.7.0.jar:/home/rmannibucau/.m2/repository/org/apache/cxf/cxf-api/2.7.0/cxf-api-2.7.0.jar:/home/rmannibucau/.m2/repository/org/apache/ws/xmlschema/xmlschema-core/2.0.3/xmlschema-core-2.0.3.jar:/home/rmannibucau/.m2/repository/org/apache/cxf/cxf-rt-core/2.7.0/cxf-rt-core-2.7.0.jar:/home/rmannibucau/.m2/repository/org/apache/cxf/cxf-rt-frontend-jaxrs/2.7.0/cxf-rt-frontend-jaxrs-2.7.0.jar:/home/rmannibucau/.m2/repository/javax/ws/rs/javax.ws.rs-api/2.0-m10/javax.ws.rs-api-2.0-m10.jar:/home/rmannibucau/.m2/repository/org/apache/cxf/cxf-rt-bindings-xml/2.7.0/cxf-rt-bindings-xml-2.7.0.jar:/home/rmannibucau/.m2/repository/org/apache/cxf/cxf-rt-rs-extension-providers/2.7.0/cxf-rt-rs-extension-providers-2.7.0.jar:/home/rmannibucau/.m2/repository/org/apache/cxf/cxf-rt-rs-extension-search/2.7.0/cxf-rt-rs-extension-search-
 2.7.0.jar:/home/rmannibucau/.m2/repository/org/apache/cxf/cxf-rt-rs-security-cors/2.7.0/cxf-rt-rs-security-cors-2.7.0.jar:/home/rmannibucau/.m2/repository/org/apache/cxf/cxf-rt-rs-security-oauth2/2.7.0/cxf-rt-rs-security-oauth2-2.7.0.jar:/home/rmannibucau/.m2/repository/org/codehaus/jettison/jettison/1.3/jettison-1.3.jar:/home/rmannibucau/.m2/repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar com.intellij.rt.execution.application.AppMain com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 org.superbiz.rest.GreetingServiceTest
+INFO - Cannot find the configuration file [conf/openejb.xml].  Will attempt to create one for the beans deployed.
+INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
+INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+INFO - Creating TransactionManager(id=Default Transaction Manager)
+INFO - Creating SecurityService(id=Default Security Service)
+INFO - Initializing network services
+INFO - Creating ServerService(id=httpejbd)
+INFO - Using 'print=true'
+INFO - Using 'indent.xml=true'
+INFO - Creating ServerService(id=cxf-rs)
+INFO - Initializing network services
+INFO - Starting service httpejbd
+INFO - Started service httpejbd
+INFO - Starting service cxf-rs
+INFO - Started service cxf-rs
+INFO -   ** Bound Services **
+INFO -   NAME                 IP              PORT  
+INFO -   httpejbd             127.0.0.1       4204  
+INFO - -------
+INFO - Ready!
+INFO - Configuring enterprise application: /opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest
+INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
+INFO - Auto-creating a container for bean org.superbiz.rest.GreetingServiceTest: Container(type=MANAGED, id=Default Managed Container)
+INFO - Creating Container(id=Default Managed Container)
+INFO - Using directory /tmp for stateful session passivation
+INFO - Enterprise application "/opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest" loaded.
+INFO - Assembling app: /opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest
+INFO - Existing thread singleton service in SystemInstance() null
+INFO - Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@54128635
+INFO - Succeeded in installing singleton service
+INFO - OpenWebBeans Container is starting...
+INFO - Adding OpenWebBeansPlugin : [CdiPlugin]
+INFO - All injection points are validated successfully.
+INFO - OpenWebBeans Container has started, it took 102 ms.
+INFO - Deployed Application(path=/opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest)
+INFO - Setting the server's publish address to be http://127.0.0.1:4204/test
+INFO - REST Service: http://127.0.0.1:4204/test/greeting/.*  -&gt; Pojo org.superbiz.rest.GreetingService
+FINE - ******************* REQUEST ******************
+GET http://localhost:4204/test/greeting/
+Host=localhost:4204
+User-Agent=Apache CXF 2.7.0
+Connection=keep-alive
+Accept=application/xml
+Content-Type=*/*
+Pragma=no-cache
+Cache-Control=no-cache
+
+
+**********************************************
+
+FINE - HTTP/1.1 200 OK
+Date: Fri, 09 Nov 2012 11:59:00 GMT
+Content-Length: 44
+Set-Cookie: EJBSESSIONID=fc5037fa-641c-495d-95ca-0755cfa50beb; Path=/
+Content-Type: application/xml
+Connection: close
+Server: OpenEJB/4.5.1-SNAPSHOT Linux/3.2.0-23-generic (amd64)
+
+&lt;response&gt;&lt;value&gt;Hi REST!&lt;/value&gt;&lt;/response&gt;
+INFO - Undeploying app: /opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest
+INFO - Stopping network services
+INFO - Stopping server services
+INFO - Cannot find the configuration file [conf/openejb.xml].  Will attempt to create one for the beans deployed.
+INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
+INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+INFO - Creating TransactionManager(id=Default Transaction Manager)
+INFO - Creating SecurityService(id=Default Security Service)
+INFO - Initializing network services
+INFO - Creating ServerService(id=httpejbd)
+INFO - Using 'print=true'
+INFO - Using 'indent.xml=true'
+INFO - Creating ServerService(id=cxf-rs)
+INFO - Initializing network services
+INFO - Starting service httpejbd
+INFO - Started service httpejbd
+INFO - Starting service cxf-rs
+INFO - Started service cxf-rs
+INFO -   ** Bound Services **
+INFO -   NAME                 IP              PORT  
+INFO -   httpejbd             127.0.0.1       4204  
+INFO - -------
+INFO - Ready!
+INFO - Configuring enterprise application: /opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest
+INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
+INFO - Auto-creating a container for bean org.superbiz.rest.GreetingServiceTest: Container(type=MANAGED, id=Default Managed Container)
+INFO - Creating Container(id=Default Managed Container)
+INFO - Using directory /tmp for stateful session passivation
+INFO - Enterprise application "/opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest" loaded.
+INFO - Assembling app: /opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest
+INFO - Existing thread singleton service in SystemInstance() null
+INFO - Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@54128635
+INFO - Succeeded in installing singleton service
+INFO - OpenWebBeans Container is starting...
+INFO - Adding OpenWebBeansPlugin : [CdiPlugin]
+INFO - All injection points are validated successfully.
+INFO - OpenWebBeans Container has started, it took 11 ms.
+INFO - Deployed Application(path=/opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest)
+INFO - Setting the server's publish address to be http://127.0.0.1:4204/test
+INFO - REST Service: http://127.0.0.1:4204/test/greeting/.*  -&gt; Pojo org.superbiz.rest.GreetingService
+FINE - ******************* REQUEST ******************
+POST http://localhost:4204/test/greeting/
+Host=localhost:4204
+Content-Length=97
+User-Agent=Apache CXF 2.7.0
+Connection=keep-alive
+Accept=application/xml
+Content-Type=application/xml
+Pragma=no-cache
+Cache-Control=no-cache
+
+&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;&lt;request&gt;&lt;value&gt;Hi REST!&lt;/value&gt;&lt;/request&gt;
+**********************************************
+
+FINE - HTTP/1.1 200 OK
+Date: Fri, 09 Nov 2012 11:59:00 GMT
+Content-Length: 44
+Set-Cookie: EJBSESSIONID=7cb2246d-5738-4a85-aac5-c0fb5340d36a; Path=/
+Content-Type: application/xml
+Connection: close
+Server: OpenEJB/4.5.1-SNAPSHOT Linux/3.2.0-23-generic (amd64)
+
+&lt;response&gt;&lt;value&gt;hi rest!&lt;/value&gt;&lt;/response&gt;
+INFO - Undeploying app: /opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest
+INFO - Stopping network services
+INFO - Stopping server services
+INFO - Cannot find the configuration file [conf/openejb.xml].  Will attempt to create one for the beans deployed.
+INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
+INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+INFO - Creating TransactionManager(id=Default Transaction Manager)
+INFO - Creating SecurityService(id=Default Security Service)
+INFO - Initializing network services
+INFO - Creating ServerService(id=httpejbd)
+INFO - Using 'print=true'
+INFO - Using 'indent.xml=true'
+INFO - Creating ServerService(id=cxf-rs)
+INFO - Initializing network services
+INFO - Starting service httpejbd
+INFO - Started service httpejbd
+INFO - Starting service cxf-rs
+INFO - Started service cxf-rs
+INFO -   ** Bound Services **
+INFO -   NAME                 IP              PORT  
+INFO -   httpejbd             127.0.0.1       4204  
+INFO - -------
+INFO - Ready!
+INFO - Configuring enterprise application: /opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest
+INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
+INFO - Auto-creating a container for bean org.superbiz.rest.GreetingServiceTest: Container(type=MANAGED, id=Default Managed Container)
+INFO - Creating Container(id=Default Managed Container)
+INFO - Using directory /tmp for stateful session passivation
+INFO - Enterprise application "/opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest" loaded.
+INFO - Assembling app: /opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest
+INFO - Existing thread singleton service in SystemInstance() null
+INFO - Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@54128635
+INFO - Succeeded in installing singleton service
+INFO - OpenWebBeans Container is starting...
+INFO - Adding OpenWebBeansPlugin : [CdiPlugin]
+INFO - All injection points are validated successfully.
+INFO - OpenWebBeans Container has started, it took 10 ms.
+INFO - Deployed Application(path=/opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest)
+INFO - Setting the server's publish address to be http://127.0.0.1:4204/test
+INFO - REST Service: http://127.0.0.1:4204/test/greeting/.*  -&gt; Pojo org.superbiz.rest.GreetingService
+FINE - ******************* REQUEST ******************
+GET http://localhost:4204/test/greeting/
+Host=localhost:4204
+User-Agent=Apache CXF 2.7.0
+Connection=keep-alive
+Accept=application/json
+Content-Type=*/*
+Pragma=no-cache
+Cache-Control=no-cache
+
+
+**********************************************
+
+FINE - HTTP/1.1 200 OK
+Date: Fri, 09 Nov 2012 11:59:00 GMT
+Content-Length: 33
+Set-Cookie: EJBSESSIONID=7112a057-fc4c-4f52-a556-1617320d2275; Path=/
+Content-Type: application/json
+Connection: close
+Server: OpenEJB/4.5.1-SNAPSHOT Linux/3.2.0-23-generic (amd64)
+
+{"response":{"value":"Hi REST!"}}
+INFO - Undeploying app: /opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest
+INFO - Stopping network services
+INFO - Stopping server services
+INFO - Cannot find the configuration file [conf/openejb.xml].  Will attempt to create one for the beans deployed.
+INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
+INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+INFO - Creating TransactionManager(id=Default Transaction Manager)
+INFO - Creating SecurityService(id=Default Security Service)
+INFO - Initializing network services
+INFO - Creating ServerService(id=httpejbd)
+INFO - Using 'print=true'
+INFO - Using 'indent.xml=true'
+INFO - Creating ServerService(id=cxf-rs)
+INFO - Initializing network services
+INFO - Starting service httpejbd
+INFO - Started service httpejbd
+INFO - Starting service cxf-rs
+INFO - Started service cxf-rs
+INFO -   ** Bound Services **
+INFO -   NAME                 IP              PORT  
+INFO -   httpejbd             127.0.0.1       4204  
+INFO - -------
+INFO - Ready!
+INFO - Configuring enterprise application: /opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest
+INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
+INFO - Auto-creating a container for bean org.superbiz.rest.GreetingServiceTest: Container(type=MANAGED, id=Default Managed Container)
+INFO - Creating Container(id=Default Managed Container)
+INFO - Using directory /tmp for stateful session passivation
+INFO - Enterprise application "/opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest" loaded.
+INFO - Assembling app: /opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest
+INFO - Existing thread singleton service in SystemInstance() null
+INFO - Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@54128635
+INFO - Succeeded in installing singleton service
+INFO - OpenWebBeans Container is starting...
+INFO - Adding OpenWebBeansPlugin : [CdiPlugin]
+INFO - All injection points are validated successfully.
+INFO - OpenWebBeans Container has started, it took 10 ms.
+INFO - Deployed Application(path=/opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest)
+INFO - Setting the server's publish address to be http://127.0.0.1:4204/test
+INFO - REST Service: http://127.0.0.1:4204/test/greeting/.*  -&gt; Pojo org.superbiz.rest.GreetingService
+FINE - ******************* REQUEST ******************
+POST http://localhost:4204/test/greeting/
+Host=localhost:4204
+Content-Length=97
+User-Agent=Apache CXF 2.7.0
+Connection=keep-alive
+Accept=application/json
+Content-Type=application/xml
+Pragma=no-cache
+Cache-Control=no-cache
+
+&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;&lt;request&gt;&lt;value&gt;Hi REST!&lt;/value&gt;&lt;/request&gt;
+**********************************************
+
+FINE - HTTP/1.1 200 OK
+Date: Fri, 09 Nov 2012 11:59:01 GMT
+Content-Length: 33
+Set-Cookie: EJBSESSIONID=50cf1d2b-a940-4afb-8993-fff7f9cc6d83; Path=/
+Content-Type: application/json
+Connection: close
+Server: OpenEJB/4.5.1-SNAPSHOT Linux/3.2.0-23-generic (amd64)
+
+{"response":{"value":"hi rest!"}}
+INFO - Undeploying app: /opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest
+INFO - Stopping network services
+INFO - Stopping server services
+</code></pre>
+
+
+<div class="page-header">&nbsp;</div>
+<h4>APIs Used</h4>
+<ul><li><a href="http://docs.oracle.com/javaee/6/api/javax/ws/rs/Consumes.html">javax.ws.rs.Consumes</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/ws/rs/GET.html">javax.ws.rs.GET</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/ws/rs/POST.html">javax.ws.rs.POST</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/ws/rs/Path.html">javax.ws.rs.Path</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/ws/rs/Produces.html">javax.ws.rs.Produces</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/ws/rs/core/MediaType.html">javax.ws.rs.core.MediaType</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/xml/bind/annotation/XmlRootElement.html">javax.xml.bind.annotation.XmlRootElement</a></li>
+</ul>
+
+<h3>Source</h3>
+  <ul>
+      <li>Apache <a href="http://svn.apache.org/repos/asf/openejb/trunk/openejb/examples/rest-xml-json">rest-xml-json</a></li>
+      <li>Github <a href="https://github.com/apache/openejb/tree/trunk/openejb/examples/rest-xml-json">rest-xml-json</a></li>
+  </ul>
+<pre>
+svn co http://svn.apache.org/repos/asf/openejb/trunk/openejb/examples/rest-xml-json
+cd rest-xml-json
+mvn clean install
+</pre>
+
+
+        <div id="edit" class="modal hide fade in" style="display: none; ">
+            <div class="modal-header">
+                <a class="close" data-dismiss="modal">x</a>
+
+                <h3>Thank you for contributing to the documention!</h3>
+            </div>
+            <div class="modal-body">
+                <h4>Any help with the documentation is greatly appreciated.</h4>
+                <p>All edits are reviewed before going live, so feel free to do much more than fix typos or links.  If you see a page that could benefit from an entire rewrite, we'd be thrilled to review it.  Don't be surprised if we like it so much we ask you for help with other pages :)</p>
+                <small>NOTICE: unless indicated otherwise on the pages in question, all editable content available from apache.org is presumed to be licensed under the Apache License (AL) version 2.0 and hence all submissions to apache.org treated as formal Contributions under the license terms.</small>
+                <!--[if gt IE 6]>
+                <h4>Internet Explorer Users</h4>
+                <p>If you are not an Apache committer, click the Yes link and enter a <i>anonymous</i> for the username and leave the password empty</p>
+                <![endif]-->
+
+            </div>
+            <div class="modal-footer">
+                Do you have an Apache ID?
+                <a href="javascript:void(location.href='https://cms.apache.org/redirect?uri='+escape(location.href))" class="btn">Yes</a>
+                <a href="javascript:void(location.href='https://anonymous:@cms.apache.org/redirect?uri='+escape(location.href))" class="btn">No</a>
+            </div>
+        </div>
+        <script src="./../../javascript/bootstrap-modal.js"></script>
+
+      <footer>
+        <p>
+        Copyright &copy; 2011 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.
+        Apache and the Apache feather logo are trademarks of The Apache Software Foundation.
+        </p>
+      </footer>
+
+    </div> <!-- /container -->
+
+  </body>
+</html>

Added: websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/pom.xml
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Added: websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/main/java/org/superbiz/rest/GreetingService.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/main/java/org/superbiz/rest/GreetingService.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/main/java/org/superbiz/rest/GreetingService.java Fri Nov  9 15:58:10 2012
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.superbiz.rest;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+@Path("/greeting")
+@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+public class GreetingService {
+    @GET
+    public Response message() {
+        return new Response("Hi REST!");
+    }
+
+    @POST
+    public Response lowerCase(final Request message) {
+        return new Response(message.getValue().toLowerCase());
+    }
+}

Added: websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/main/java/org/superbiz/rest/Request.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/main/java/org/superbiz/rest/Request.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/main/java/org/superbiz/rest/Request.java Fri Nov  9 15:58:10 2012
@@ -0,0 +1,24 @@
+package org.superbiz.rest;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class Request {
+    private String value;
+
+    public Request() {
+        //no-op
+    }
+
+    public Request(final String s) {
+        value = s;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+}

Added: websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/main/java/org/superbiz/rest/Response.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/main/java/org/superbiz/rest/Response.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/main/java/org/superbiz/rest/Response.java Fri Nov  9 15:58:10 2012
@@ -0,0 +1,24 @@
+package org.superbiz.rest;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class Response {
+    private String value;
+
+    public Response() {
+        // no-op
+    }
+
+    public Response(final String s) {
+        value = s;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+}

Added: websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/test/java/org/superbiz/rest/GreetingServiceTest.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/test/java/org/superbiz/rest/GreetingServiceTest.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/rest-xml-json/src/test/java/org/superbiz/rest/GreetingServiceTest.java Fri Nov  9 15:58:10 2012
@@ -0,0 +1,73 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.superbiz.rest;
+
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.junit.ApplicationComposer;
+import org.apache.openejb.junit.Classes;
+import org.apache.openejb.junit.EnableServices;
+import org.apache.openejb.junit.Module;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.ws.rs.core.MediaType;
+import java.io.IOException;
+
+import static org.junit.Assert.assertEquals;
+
+@EnableServices(value = "jaxrs", httpDebug = true)
+@RunWith(ApplicationComposer.class)
+public class GreetingServiceTest {
+    @Module
+    @Classes(GreetingService.class)
+    public WebApp app() {
+        return new WebApp().contextRoot("test");
+    }
+
+    @Test
+    public void getXml() throws IOException {
+        final String message = WebClient.create("http://localhost:4204").path("/test/greeting/")
+                .accept(MediaType.APPLICATION_XML_TYPE)
+                .get(Response.class).getValue();
+        assertEquals("Hi REST!", message);
+    }
+
+    @Test
+    public void postXml() throws IOException {
+        final String message = WebClient.create("http://localhost:4204").path("/test/greeting/")
+                .accept(MediaType.APPLICATION_XML_TYPE)
+                .post(new Request("Hi REST!"), Response.class).getValue();
+        assertEquals("hi rest!", message);
+    }
+
+    @Test
+    public void getJson() throws IOException {
+        final String message = WebClient.create("http://localhost:4204").path("/test/greeting/")
+                .accept(MediaType.APPLICATION_JSON_TYPE)
+                .get(Response.class).getValue();
+        assertEquals("Hi REST!", message);
+    }
+
+    @Test
+    public void postJson() throws IOException {
+        final String message = WebClient.create("http://localhost:4204").path("/test/greeting/")
+                .accept(MediaType.APPLICATION_JSON_TYPE)
+                .post(new Request("Hi REST!"), Response.class).getValue();
+        assertEquals("hi rest!", message);
+    }
+}

Added: websites/staging/openejb/trunk/content/examples-trunk/simple-rest/README.html
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/simple-rest/README.html (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/simple-rest/README.html Fri Nov  9 15:58:10 2012
@@ -0,0 +1,344 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+
+    <meta charset="utf-8">
+      <title>Simple REST</title>
+    <meta name="description" content="">
+    <meta name="author" content="">
+
+    <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+    <!--[if lt IE 9]>
+      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+
+    <!-- Le styles -->
+    <link href="./../../bootstrap.css" rel="stylesheet">
+    <link href="./../../prettify.css" rel="stylesheet">
+    <link href="./../../bootstrap-mods.css" rel="stylesheet">
+
+    <style type="text/css">
+        body {
+          padding-top: 60px;
+        }
+        .sprite {
+            display: inline-block;
+            height: 20px;
+            margin: 0 auto 4px;
+            outline: medium none;
+            text-indent: -999em;
+            width: 24px;
+            background-image: url('./../../images/sprites.png');
+            background-repeat: no-repeat;
+            overflow: hidden;
+            cursor: pointer;
+        }
+        .edit-page {
+            display: inline-block;
+            height: 20px;
+            margin: 0 auto 4px;
+            outline: medium none;
+            text-indent: -999em;
+            width: 24px;
+            background-image: url('./../../images/edit.png');
+            background-repeat: no-repeat;
+            overflow: hidden;
+            cursor: pointer;
+        }
+        .fb-share {
+            background-position: 0px -40px;
+        }
+        .gp-share {
+            background-position: 0px 0px;
+        }
+        .tw-share {
+            background-position: 0px -80px;
+        }
+    </style>
+    <script type="text/javascript">
+      function fbshare () {
+          window.open(
+                  "http://www.facebook.com/sharer/sharer.php?u="+document.URL,
+                  'Share on Facebook',
+                  'width=640,height=426');
+      };
+      function gpshare () {
+          window.open(
+                  "https://plus.google.com/share?url="+document.URL,
+                  'Share on Google+',
+                  'width=584,height=385');
+      };
+      function twshare () {
+          window.open(
+                  "https://twitter.com/intent/tweet?url="+document.URL+"&text=Simple REST",
+                  'Share on Twitter',
+                  'width=800,height=526');
+      };
+    </script>
+
+    <!-- Le fav and touch icons -->
+    <link rel="shortcut icon" href="./../../images/favicon.ico">
+    <link rel="apple-touch-icon" href="./../../images/apple-touch-icon.png">
+    <link rel="apple-touch-icon" sizes="72x72" href="./../../images/apple-touch-icon-72x72.png">
+    <link rel="apple-touch-icon" sizes="114x114" href="./../../images/apple-touch-icon-114x114.png">
+
+    <script src="./../../javascript/prettify.js" type="text/javascript"></script>
+    <script src="./../../javascript/jquery-latest.js"></script>
+    <script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
+    <script src="./../../javascript/common.js"></script>
+    <script src="./../../javascript/prettyprint.js"></script>
+
+    <script type="text/javascript">
+
+      var _gaq = _gaq || [];
+      _gaq.push(['_setAccount', 'UA-2717626-1']);
+      _gaq.push(['_setDomainName', 'apache.org']);
+      _gaq.push(['_trackPageview']);
+
+      (function() {
+        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+      })();
+
+    </script>
+
+
+  </head>
+
+  <body>
+
+    <div class="topbar">
+      <div class="fill">
+        <div class="container">
+          <a class="brand" href="./../../index.html">Apache TomEE</a>
+          <ul class="nav">
+            <li><a href="./../../index.html">Home</a></li>
+            <li><a href="./../../downloads.html">Downloads</a></li>
+            <li><a href="./../../documentation.html">Documentation</a></li>
+            <li><a href="./../../support.html">Support</a></li>
+          </ul>
+
+            <!-- Google CSE Search Box Begins  -->
+            <FORM class="pull-right" id="searchbox_010475492895890475512:_t4iqjrgx90" action="http://www.google.com/cse">
+                <INPUT type="hidden" name="cx" value="010475492895890475512:_t4iqjrgx90">
+                <INPUT type="hidden" name="cof" value="FORID:0">
+                <INPUT name="q" type="text" placeholder="Search">
+            </FORM>
+            <!--<SCRIPT type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_010475492895890475512:_t4iqjrgx90"></SCRIPT>-->
+            <!-- Google CSE Search Box Ends -->
+        </div>
+      </div>
+    </div>
+
+    <div class="container">
+    
+
+<div class="row">
+    <div class="span8">
+        <small><a href="./../../index.html">Home</a>&nbsp;&raquo&nbsp;<a href="./../../examples-trunk/">Examples Trunk</a>&nbsp;&raquo&nbsp;<a href="./../../examples-trunk/simple-rest/">Simple Rest</a></small><br>
+    </div>
+    <div class="span8">
+    </div>
+</div>
+&nbsp;
+<div class="page-header">
+<h1>Simple REST
+
+    <div style="float: right; position: relative; bottom: -10px; ">
+        <a onclick="javascript:gpshare()" class="gp-share sprite" title="share on Google+">share [gp]</a>
+        <a onclick="javascript:fbshare()" class="fb-share sprite" title="share on Facebook">share [fb]</a>
+        <a onclick="javascript:twshare()" class="tw-share sprite" title="share on Twitter">share [tw]</a>
+        <a data-toggle="modal" href="#edit" class="edit-page" title="Contribute to this Page">contribute</a>
+    </div>
+</h1>
+</div>
+
+<p>Defining a REST service is pretty easy, simply ad @Path annotation to a class then define on methods
+the HTTP method to use (@GET, @POST, ...).</p>
+
+<h1>The Code</h1>
+
+<h2>The REST service: @Path, @GET, @POST</h2>
+
+<p>Here we see a bean that uses the Bean-Managed Concurrency option as well as the @Startup annotation which causes the bean to be instantiated by the container when the application starts. Singleton beans with @ConcurrencyManagement(BEAN) are responsible for their own thread-safety. The bean shown is a simple properties "registry" and provides a place where options could be set and retrieved by all beans in the application.</p>
+
+<pre><code>package org.superbiz.rest;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+
+@Path("/greeting")
+public class GreetingService {
+    @GET
+    public String message() {
+        return "Hi REST!";
+    }
+
+    @POST
+    public String lowerCase(final String message) {
+        return "Hi REST!".toLowerCase();
+    }
+}
+</code></pre>
+
+<h1>Testing</h1>
+
+<h2>Test for the JAXRS service</h2>
+
+<p>The test uses the OpenEJB ApplicationComposer to make it trivial.</p>
+
+<p>The idea is first to activate the jaxrs services. This is done using @EnableServices annotation.</p>
+
+<p>Then we create on the fly the application simply returning an object representing the web.xml. Here we simply
+use it to define the context root but you can use it to define your REST Application too. And to complete the
+application definition we add @Classes annotation to define the set of classes to use in this app.</p>
+
+<p>Finally to test it we use cxf client API to call the REST service in get() and post() methods.</p>
+
+<pre><code>package org.superbiz.rest;
+
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.openejb.jee.SingletonBean;
+import org.apache.openejb.junit.ApplicationComposer;
+import org.apache.openejb.junit.EnableServices;
+import org.apache.openejb.junit.Module;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.io.IOException;
+
+import static org.junit.Assert.assertEquals;
+
+@EnableServices(value = "jaxrs")
+@RunWith(ApplicationComposer.class)
+public class GreetingServiceTest {
+    @Module
+    public SingletonBean app() {
+        return (SingletonBean) new SingletonBean(GreetingService.class).localBean();
+    }
+
+    @Test
+    public void get() throws IOException {
+        final String message = WebClient.create("http://localhost:4204").path("/GreetingServiceTest/greeting/").get(String.class);
+        assertEquals("Hi REST!", message);
+    }
+
+    @Test
+    public void post() throws IOException {
+        final String message = WebClient.create("http://localhost:4204").path("/GreetingServiceTest/greeting/").post("Hi REST!", String.class);
+        assertEquals("hi rest!", message);
+    }
+}
+</code></pre>
+
+<h1>Running</h1>
+
+<p>Running the example is fairly simple. In the "simple-rest" directory run:</p>
+
+<pre><code>$ mvn clean install
+</code></pre>
+
+<p>Which should create output like the following.</p>
+
+<pre><code>INFO - Cannot find the configuration file [conf/openejb.xml].  Will attempt to create one for the beans deployed.
+INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
+INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+INFO - Creating TransactionManager(id=Default Transaction Manager)
+INFO - Creating SecurityService(id=Default Security Service)
+INFO - Initializing network services
+INFO - Creating ServerService(id=httpejbd)
+INFO - Creating ServerService(id=cxf-rs)
+INFO - Initializing network services
+INFO - Starting service httpejbd
+INFO - Started service httpejbd
+INFO - Starting service cxf-rs
+INFO - Started service cxf-rs
+INFO -   ** Bound Services **
+INFO -   NAME                 IP              PORT
+INFO -   httpejbd             127.0.0.1       4204
+INFO - -------
+INFO - Ready!
+INFO - Configuring enterprise application: /opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest
+INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
+INFO - Auto-creating a container for bean org.superbiz.rest.GreetingServiceTest: Container(type=MANAGED, id=Default Managed Container)
+INFO - Creating Container(id=Default Managed Container)
+INFO - Using directory /tmp for stateful session passivation
+INFO - Enterprise application "/opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest" loaded.
+INFO - Assembling app: /opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest
+INFO - Existing thread singleton service in SystemInstance() null
+INFO - Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@12c9b196
+INFO - Succeeded in installing singleton service
+INFO - OpenWebBeans Container is starting...
+INFO - Adding OpenWebBeansPlugin : [CdiPlugin]
+INFO - All injection points are validated successfully.
+INFO - OpenWebBeans Container has started, it took 11 ms.
+INFO - Deployed Application(path=/opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest)
+INFO - Setting the server's publish address to be http://127.0.0.1:4204/test
+INFO - REST Service: http://127.0.0.1:4204/test/greeting/.*  -&gt; Pojo org.superbiz.rest.GreetingService
+INFO - Undeploying app: /opt/dev/openejb/openejb-trunk/examples/GreetingServiceTest
+INFO - Stopping network services
+INFO - Stopping server services
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 sec
+
+Results :
+
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
+</code></pre>
+
+
+<div class="page-header">&nbsp;</div>
+<h4>APIs Used</h4>
+<ul><li><a href="http://docs.oracle.com/javaee/6/api/javax/ws/rs/GET.html">javax.ws.rs.GET</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/ws/rs/POST.html">javax.ws.rs.POST</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/ws/rs/Path.html">javax.ws.rs.Path</a></li>
+</ul>
+
+<h3>Source</h3>
+  <ul>
+      <li>Apache <a href="http://svn.apache.org/repos/asf/openejb/trunk/openejb/examples/simple-rest">simple-rest</a></li>
+      <li>Github <a href="https://github.com/apache/openejb/tree/trunk/openejb/examples/simple-rest">simple-rest</a></li>
+  </ul>
+<pre>
+svn co http://svn.apache.org/repos/asf/openejb/trunk/openejb/examples/simple-rest
+cd simple-rest
+mvn clean install
+</pre>
+
+
+        <div id="edit" class="modal hide fade in" style="display: none; ">
+            <div class="modal-header">
+                <a class="close" data-dismiss="modal">x</a>
+
+                <h3>Thank you for contributing to the documention!</h3>
+            </div>
+            <div class="modal-body">
+                <h4>Any help with the documentation is greatly appreciated.</h4>
+                <p>All edits are reviewed before going live, so feel free to do much more than fix typos or links.  If you see a page that could benefit from an entire rewrite, we'd be thrilled to review it.  Don't be surprised if we like it so much we ask you for help with other pages :)</p>
+                <small>NOTICE: unless indicated otherwise on the pages in question, all editable content available from apache.org is presumed to be licensed under the Apache License (AL) version 2.0 and hence all submissions to apache.org treated as formal Contributions under the license terms.</small>
+                <!--[if gt IE 6]>
+                <h4>Internet Explorer Users</h4>
+                <p>If you are not an Apache committer, click the Yes link and enter a <i>anonymous</i> for the username and leave the password empty</p>
+                <![endif]-->
+
+            </div>
+            <div class="modal-footer">
+                Do you have an Apache ID?
+                <a href="javascript:void(location.href='https://cms.apache.org/redirect?uri='+escape(location.href))" class="btn">Yes</a>
+                <a href="javascript:void(location.href='https://anonymous:@cms.apache.org/redirect?uri='+escape(location.href))" class="btn">No</a>
+            </div>
+        </div>
+        <script src="./../../javascript/bootstrap-modal.js"></script>
+
+      <footer>
+        <p>
+        Copyright &copy; 2011 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.
+        Apache and the Apache feather logo are trademarks of The Apache Software Foundation.
+        </p>
+      </footer>
+
+    </div> <!-- /container -->
+
+  </body>
+</html>

Added: websites/staging/openejb/trunk/content/examples-trunk/simple-rest/pom.xml
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/openejb/trunk/content/examples-trunk/simple-rest/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Added: websites/staging/openejb/trunk/content/examples-trunk/simple-rest/src/main/java/org/superbiz/rest/GreetingService.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/simple-rest/src/main/java/org/superbiz/rest/GreetingService.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/simple-rest/src/main/java/org/superbiz/rest/GreetingService.java Fri Nov  9 15:58:10 2012
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.superbiz.rest;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+
+@Path("/greeting")
+public class GreetingService {
+    @GET
+    public String message() {
+        return "Hi REST!";
+    }
+
+    @POST
+    public String lowerCase(final String message) {
+        return "Hi REST!".toLowerCase();
+    }
+}

Added: websites/staging/openejb/trunk/content/examples-trunk/simple-rest/src/test/java/org/superbiz/rest/GreetingServiceTest.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/simple-rest/src/test/java/org/superbiz/rest/GreetingServiceTest.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/simple-rest/src/test/java/org/superbiz/rest/GreetingServiceTest.java Fri Nov  9 15:58:10 2012
@@ -0,0 +1,52 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.superbiz.rest;
+
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.junit.ApplicationComposer;
+import org.apache.openejb.junit.Classes;
+import org.apache.openejb.junit.EnableServices;
+import org.apache.openejb.junit.Module;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.io.IOException;
+
+import static org.junit.Assert.assertEquals;
+
+@EnableServices(value = "jaxrs")
+@RunWith(ApplicationComposer.class)
+public class GreetingServiceTest {
+    @Module
+    @Classes(GreetingService.class)
+    public WebApp app() {
+        return new WebApp().contextRoot("test");
+    }
+
+    @Test
+    public void get() throws IOException {
+        final String message = WebClient.create("http://localhost:4204").path("/test/greeting/").get(String.class);
+        assertEquals("Hi REST!", message);
+    }
+
+    @Test
+    public void post() throws IOException {
+        final String message = WebClient.create("http://localhost:4204").path("/test/greeting/").post("Hi REST!", String.class);
+        assertEquals("hi rest!", message);
+    }
+}