You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2014/06/03 12:46:50 UTC
svn commit: r911074 - in /websites/production/cxf/content:
cache/docs.pageCache docs/jaxrs-testing.html
Author: buildbot
Date: Tue Jun 3 10:46:50 2014
New Revision: 911074
Log:
Production update by buildbot for cxf
Modified:
websites/production/cxf/content/cache/docs.pageCache
websites/production/cxf/content/docs/jaxrs-testing.html
Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/cxf/content/docs/jaxrs-testing.html
==============================================================================
--- websites/production/cxf/content/docs/jaxrs-testing.html (original)
+++ websites/production/cxf/content/docs/jaxrs-testing.html Tue Jun 3 10:46:50 2014
@@ -118,25 +118,21 @@ Apache CXF -- JAXRS Testing
<td height="100%">
<!-- Content -->
<div class="wiki-content">
-<div id="ConfluenceContent"><p></p><p></p><p></p><p><span style="font-size:2em;font-weight:bold"> JAX-RS Testing</span></p><p></p><p></p><p></p><p></p>
+<div id="ConfluenceContent"><span style="font-size:2em;font-weight:bold"> JAX-RS Testing</span><p> </p><p><style type="text/css">/*<![CDATA[*/
+div.rbtoc1401792383024 {padding: 0px;}
+div.rbtoc1401792383024 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1401792383024 li {margin-left: 0px;padding-left: 0px;}
-
-<style type="text/css">/*<![CDATA[*/
-div.rbtoc1400294782576 {padding: 0px;}
-div.rbtoc1400294782576 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1400294782576 li {margin-left: 0px;padding-left: 0px;}
-
-/*]]>*/</style><div class="toc-macro rbtoc1400294782576">
+/*]]>*/</style></p><div class="toc-macro rbtoc1401792383024">
<ul class="toc-indentation"><li><a shape="rect" href="#JAXRSTesting-EmbeddedJetty">Embedded Jetty</a></li><li><a shape="rect" href="#JAXRSTesting-LocalTransport">Local Transport</a></li></ul>
-</div>
-
-<p>JAX-RS endpoints can be easily tested using the embedded Jetty or CXF Local Transport.</p>
-
-<h1 id="JAXRSTesting-EmbeddedJetty">Embedded Jetty</h1>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-import javax.ws.rs.core.Response;
+</div><p>JAX-RS endpoints can be easily tested using the embedded Jetty or CXF Local Transport.</p><h1 id="JAXRSTesting-EmbeddedJetty">Embedded Jetty</h1><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Maven Dependency</b></div><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-http-jetty</artifactId>
+ <version>3.0.0</version>
+</dependency>]]></script>
+</div></div><p> </p><p> </p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Example</b></div><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[import javax.ws.rs.core.Response;
import org.apache.cxf.endpoint.Server;
import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
@@ -217,19 +213,14 @@ public void testGetBookWithProxy() {
}
}
]]></script>
-</div></div>
-
-<p>It is quite easy to setup a server and start testing it. The advantage of using the embedded Jetty is that a complete end-to-end round-trip can be exercised, thus stressing all the CXF runtime which comes at the cost of some added complexity to do with setting up the server.</p>
-
-<h1 id="JAXRSTesting-LocalTransport">Local Transport</h1>
-
-<p>Starting from CXF 2.6.2 it is possible to use CXF Local Transport for testing the JAX-RS endpoints and clients.<br clear="none">
-This avoids the need to start an embedded servlet container and the tests will run faster.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-
-import org.apache.cxf.endpoint.Server;
+</div></div><p>It is quite easy to setup a server and start testing it. The advantage of using the embedded Jetty is that a complete end-to-end round-trip can be exercised, thus stressing all the CXF runtime which comes at the cost of some added complexity to do with setting up the server.</p><h1 id="JAXRSTesting-LocalTransport">Local Transport</h1><p>Starting from CXF 2.6.2 it is possible to use CXF Local Transport for testing the JAX-RS endpoints and clients.<br clear="none"> This avoids the need to start an embedded servlet container and the tests will run faster.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Maven Dependency</b></div><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-local</artifactId>
+ <version>3.0.0</version>
+</dependency>]]></script>
+</div></div><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Example</b></div><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[import org.apache.cxf.endpoint.Server;
import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
import org.apache.cxf.jaxrs.client.WebClient;
import org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider;
@@ -306,20 +297,8 @@ public void testAddBookWithProxyDirectDi
}
}
]]></script>
-</div></div>
-
-<p>Note that setting a LocalConduit.DIRECT_DISPATCH property to 'true' ensures that the invocation goes immediately into the service chain after the client out chain has completed. <br clear="none">
-If this property is not set then CXF LocalConduit sets up a pipe which is initiated via an initial write on the client side.</p>
-
-<p>In the above code example Local transport is activated by using a URI "local:" scheme, for example, "local://books". </p>
-
-<p>Alternatively, the address can be set as a relative value such as "/books", with the server and client transportId attribute set to<br clear="none">
-"http://cxf.apache.org/transports/local". In this case, when creating the clients, use JAXRSClientFactoryBean:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-
-private static void startServer() throws Exception {
+</div></div><p>Note that setting a LocalConduit.DIRECT_DISPATCH property to 'true' ensures that the invocation goes immediately into the service chain after the client out chain has completed. <br clear="none"> If this property is not set then CXF LocalConduit sets up a pipe which is initiated via an initial write on the client side.</p><p>In the above code example Local transport is activated by using a URI "local:" scheme, for example, "local://books".</p><p>Alternatively, the address can be set as a relative value such as "/books", with the server and client transportId attribute set to<br clear="none"> "http://cxf.apache.org/transports/local". In this case, when creating the clients, use JAXRSClientFactoryBean:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[private static void startServer() throws Exception {
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setTransportId(LocalTransportFactory.TRANSPORT_ID);
sf.setAddress("/books");