deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r907140 - in /websites/staging/deltaspike/trunk/content: ./ container-control.html core.html documentation.html jsf.html test-control.html
Date Mon, 28 Apr 2014 10:56:23 GMT
Author: buildbot
Date: Mon Apr 28 10:56:22 2014
New Revision: 907140

Log:
Staging update by buildbot for deltaspike

Modified:
    websites/staging/deltaspike/trunk/content/   (props changed)
    websites/staging/deltaspike/trunk/content/container-control.html
    websites/staging/deltaspike/trunk/content/core.html
    websites/staging/deltaspike/trunk/content/documentation.html
    websites/staging/deltaspike/trunk/content/jsf.html
    websites/staging/deltaspike/trunk/content/test-control.html

Propchange: websites/staging/deltaspike/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon Apr 28 10:56:22 2014
@@ -1 +1 @@
-1586702
+1590599

Modified: websites/staging/deltaspike/trunk/content/container-control.html
==============================================================================
--- websites/staging/deltaspike/trunk/content/container-control.html (original)
+++ websites/staging/deltaspike/trunk/content/container-control.html Mon Apr 28 10:56:22 2014
@@ -95,7 +95,25 @@
 <li>The <strong>ContextControl</strong> interface allows to control the
life-cycle of the built-in contexts of the CDI container.</li>
 </ul>
 <h2 id="cdicontainer">CdiContainer</h2>
-<p>See the Java SE part <a href="#start-a-cdi-container-using-java-se">above</a>.</p>
+<p>You can use the CdiContainerLoader as a simple factory to gain access to the underlying
CdiContainer implementation. This is of little interest for Java EE applications since the
CDI Container 
+already gets properly booted and shut down by the Servlet container integration.</p>
+<div class="codehilite"><pre><span class="c1">// this will give you a CdiContainer
for Weld or OWB, depending on the jar you added</span>
+<span class="n">CdiContainer</span> <span class="n">cdiContainer</span>
<span class="o">=</span> <span class="n">CdiContainerLoader</span><span
class="o">.</span><span class="na">getCdiContainer</span><span class="o">();</span>
+
+<span class="c1">// now we gonna boot the CDI container. This will trigger the classpath
scan, etc</span>
+   <span class="n">cdiContainer</span><span class="o">.</span><span
class="na">boot</span><span class="o">();</span>
+
+<span class="c1">// and finally we like to start all built-in contexts</span>
+<span class="n">cdiContainer</span><span class="o">.</span><span
class="na">getContextControl</span><span class="o">().</span><span
class="na">startContexts</span><span class="o">();</span>
+
+<span class="c1">// now we can use CDI in our SE application.</span>
+<span class="c1">// And there is not a single line of OWB or Weld specific code in
your project!</span>
+
+<span class="c1">// finally we gonna stop the container</span>
+<span class="n">cdiContainer</span><span class="o">.</span><span
class="na">shutdown</span><span class="o">();</span>
+</pre></div>
+
+
 <h2 id="contextcontrol-usage">ContextControl usage</h2>
 <p>The <code>ContextControl</code> interface allows you to start and stop
built-in standard Contexts like <code>@RequestScoped</code>, <code>@ConversationScoped</code>,
<code>@SessionScoped</code>, etc. It is provided as <code>@Dependent</code>
bean and can get injected in the classic CDI way. This is not only usable in Java SE projects
but also very helpful in Servlets and Java EE containers.</p>
 <p><strong>Restarting the RequestContext in unit tests</strong></p>

Modified: websites/staging/deltaspike/trunk/content/core.html
==============================================================================
--- websites/staging/deltaspike/trunk/content/core.html (original)
+++ websites/staging/deltaspike/trunk/content/core.html Mon Apr 28 10:56:22 2014
@@ -78,7 +78,24 @@
               <div class="page-title">
                 <h1>Core</h1>
               </div>
-              <div class="toc">
+              <p>Title: Core
+Notice:    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.</p>
+<div class="toc">
 <ul>
 <li><a href="#core-api">Core - API</a><ul>
 <li><a href="#deltaspike-configuration">DeltaSpike Configuration</a></li>
@@ -125,7 +142,16 @@
 <li><a href="#scopes">Scopes</a></li>
 </ul>
 </li>
-<li><a href="#core-utils">Core - Utils</a></li>
+<li><a href="#core-utils">Core - Utils</a><ul>
+<li><a href="#arraysutils">ArraysUtils</a></li>
+<li><a href="#beanutils">BeanUtils</a></li>
+<li><a href="#classdeactivationutils">ClassDeactivationUtils</a></li>
+<li><a href="#exceptionutils">ExceptionUtils</a></li>
+<li><a href="#propertyfileutils">PropertyFileUtils</a></li>
+<li><a href="#proxyutils">ProxyUtils</a></li>
+<li><a href="#stringutils">StringUtils</a></li>
+</ul>
+</li>
 </ul>
 </div>
 <hr />
@@ -238,7 +264,7 @@ server environment you currently run on.
 </pre></div>
 
 
-<p>The following usage allows to exclude a bean based on a configured value (see the
supported config sources [TODO]).</p>
+<p>The following usage allows to exclude a bean based on a configured value (see the
<a href="configuration.html#configsources-provided-by-default">supported config sources</a>).</p>
 <p>Excluding a bean based on an expression which eval. to true:</p>
 <div class="codehilite"><pre><span class="nd">@Exclude</span><span
class="o">(</span><span class="n">onExpression</span> <span class="o">=</span>
<span class="s">&quot;db==prodDB&quot;</span><span class="o">)</span>
 <span class="kd">public</span> <span class="kd">class</span> <span
class="nc">DevDbBean</span>
@@ -318,7 +344,33 @@ For such cases a custom ExpressionInterp
 <h2 id="type-safe-view-config">Type-safe View-Config</h2>
 <p>TODO (Overview)</p>
 <h2 id="literals">Literals</h2>
-<p>TODO</p>
+<p>Literals allow the instantiation of annotations by extending the abstract class
'javax.enterprise.util.AnnotationLiteral'</p>
+<p><strong>Example</strong></p>
+<div class="codehilite"><pre><span class="kd">public</span> <span
class="kd">abstract</span> <span class="kd">class</span> <span class="nc">PayByQualifier</span>

+       <span class="kd">extends</span> <span class="n">AnnotationLiteral</span><span
class="o">&lt;</span><span class="n">PayBy</span><span class="o">&gt;</span>
+       <span class="kd">implements</span> <span class="n">PayBy</span>
<span class="o">{}</span>
+
+ <span class="n">PayBy</span> <span class="n">paybyCheque</span>
<span class="o">=</span> <span class="k">new</span> <span class="n">PayByQualifier</span><span
class="o">()</span> <span class="o">{</span> <span class="kd">public</span>
<span class="n">PaymentMethod</span> <span class="n">value</span><span
class="o">()</span> <span class="o">{</span> <span class="k">return</span>
<span class="n">CHEQUE</span><span class="o">;</span> <span class="o">}</span>
<span class="o">};</span>
+</pre></div>
+
+
+<p>DeltaSpike provides many annotation literals that you can use - e.g.:</p>
+<ul>
+<li>AlternativeLiteral</li>
+<li>AnyLiteral</li>
+<li>ApplicationScopedLiteral</li>
+<li>ConversationScopedLiteral</li>
+<li>DefaultLiteral</li>
+<li>DependentScopeLiteral</li>
+<li>ModelLiteral</li>
+<li>NamedLiteral</li>
+<li>NewLiteral</li>
+<li>RequestedScopeLiteral</li>
+<li>SessionScopeLiteral</li>
+<li>Singleton</li>
+<li>SpecializesLiteral</li>
+<li>TypedLiteral</li>
+</ul>
 <h2 id="messages-i18n">Messages &amp; I18n</h2>
 <p>The following implementation is the minimal effort to use type-safe messages (which
are hardcoded in this case).</p>
 <p><strong>Simple type-safe message</strong></p>
@@ -396,23 +448,86 @@ For such cases a custom ExpressionInterp
 <h2 id="dynamic-message-builder">Dynamic Message Builder</h2>
 <h3 id="creating-message-instances">Creating message instances</h3>
 <p>The following implementation creates an instance of <code>Message</code>
for the key <code>hello</code>. The final text will be resolved and interpolated
lazily. Later on it might be supported to provide a different <code>MessageContext</code>
via <code>#toString(MessageContext)</code> like it is in MyFaces CODI right now.</p>
-<p>[TODO]</p>
+<p>You can use <code>#argument(String)</code> to pass these arguments to
the message template specified on <code>#template(String)</code> method. The template
pattern uses printf-style format strings.</p>
+<div class="codehilite"><pre><span class="kd">public</span> <span
class="kd">class</span> <span class="nc">MyBean</span>
+<span class="o">{</span>
+
+    <span class="nd">@Inject</span>
+    <span class="kd">private</span> <span class="n">MessageContext</span>
<span class="n">messageContext</span><span class="o">;</span>
+
+    <span class="kd">public</span> <span class="kt">void</span> <span
class="nf">action</span><span class="o">()</span>
+    <span class="o">{</span>
+        <span class="n">Message</span> <span class="n">message</span>
<span class="o">=</span> <span class="k">this</span><span class="o">.</span><span
class="na">messageContext</span><span class="o">.</span><span class="na">message</span><span
class="o">();</span>
+        <span class="n">write</span><span class="o">(</span><span
class="n">message</span><span class="o">.</span><span class="na">template</span><span
class="o">(</span><span class="s">&quot;Hello %s from %s&quot;</span><span
class="o">).</span><span class="na">argument</span><span class="o">(</span><span
class="s">&quot;World&quot;</span><span class="o">).</span><span
class="na">argument</span><span class="o">(</span><span class="s">&quot;DeltaSpike&quot;</span><span
class="o">));</span>
+    <span class="o">}</span>
+    <span class="c1">//...</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>Besides the static config via <code>@MessageContextConfig#messageSource</code>,
you can also specify the message sources dynamically.</p>
+<div class="codehilite"><pre><span class="nd">@Inject</span>
+<span class="kd">private</span> <span class="n">MessageContext</span>
<span class="n">messageContext</span><span class="o">;</span>
+
+<span class="kd">public</span> <span class="kt">void</span> <span
class="nf">action</span><span class="o">()</span>
+<span class="o">{</span>
+    <span class="n">Message</span> <span class="n">message</span>
<span class="o">=</span> <span class="k">this</span><span class="o">.</span><span
class="na">messageContext</span><span class="o">.</span><span class="na">messageSource</span><span
class="o">(</span><span class="s">&quot;org.apache.deltaspike.example.message.Messages&quot;</span><span
class="o">).</span><span class="na">message</span><span class="o">();</span>
+    <span class="n">write</span><span class="o">(</span><span
class="n">message</span><span class="o">.</span><span class="na">template</span><span
class="o">(</span><span class="s">&quot;{hello}&quot;</span><span
class="o">).</span><span class="na">argument</span><span class="o">(</span><span
class="s">&quot;World&quot;</span><span class="o">).</span><span
class="na">argument</span><span class="o">(</span><span class="s">&quot;DeltaSpike&quot;</span><span
class="o">));</span>
+<span class="o">}</span>
+<span class="c1">//...</span>
+<span class="o">-&gt;</span>
+
+<span class="n">org</span><span class="o">/</span><span class="n">apache</span><span
class="o">/</span><span class="n">deltaspike</span><span class="o">/</span><span
class="n">example</span><span class="o">/</span><span class="n">message</span><span
class="o">/</span><span class="n">Messages</span><span class="o">.</span><span
class="na">properties</span>
+<span class="n">org</span><span class="o">/</span><span class="n">apache</span><span
class="o">/</span><span class="n">deltaspike</span><span class="o">/</span><span
class="n">example</span><span class="o">/</span><span class="n">message</span><span
class="o">/</span><span class="n">Messages_en</span><span class="o">.</span><span
class="na">properties</span>
+<span class="n">org</span><span class="o">/</span><span class="n">apache</span><span
class="o">/</span><span class="n">deltaspike</span><span class="o">/</span><span
class="n">example</span><span class="o">/</span><span class="n">message</span><span
class="o">/</span><span class="n">Messages_de</span><span class="o">.</span><span
class="na">properties</span>
+<span class="o">...</span>
+
+<span class="c1">//content (as usual) in message bundle files:</span>
+<span class="n">hello</span><span class="o">=</span><span class="n">Hello</span>
<span class="o">%</span><span class="n">s</span> <span class="n">from</span>
<span class="o">%</span><span class="n">s</span>
+</pre></div>
+
+
 <h3 id="customizing-the-message-context">Customizing the message context</h3>
 <h4 id="messageresolver">MessageResolver</h4>
 <p>A message-resolver is responsible for creating the message-text based on the message-descriptor
(key or inline-text), the current locale (and in some cases the message-payload).
 (The supported format e.g. if it's required to escape a key, if inline-text is supported,...
depends on the concrete implementation.)
 In case of a message-key, the message-resolver has to transform it to the message-text by
looking it up in a message source like a resource-bundle.</p>
 <p><strong>Configuration of a message-resolver</strong></p>
-<p>[TODO]</p>
+<p>Besides the static config via <code>@MessageContextConfig#messageResolver</code>,
you can use it dynamically via passing a custom message-resolver instance to the current messageContext:</p>
+<div class="codehilite"><pre><span class="nd">@Inject</span>
+<span class="kd">private</span> <span class="n">MessageContext</span>
<span class="n">messageContext</span><span class="o">;</span>
+
+<span class="c1">//...</span>
+
+<span class="n">Message</span> <span class="n">message</span> <span
class="o">=</span> <span class="k">this</span><span class="o">.</span><span
class="na">messageContext</span><span class="o">.</span><span class="na">messageResolver</span><span
class="o">(</span><span class="k">new</span> <span class="n">CustomMessageResolver</span><span
class="o">()).</span><span class="na">message</span><span class="o">();</span>
+</pre></div>
+
+
 <p>The result of a <code>MessageResolver</code> is the message-text. The
text might contain placeholders which are processed by a <code>MessageInterpolator</code></p>
 <h4 id="messageinterpolator">MessageInterpolator</h4>
 <p>A <code>MessageInterpolator</code> replaces the placeholders in a message-text
with the arguments of the message.</p>
 <p><strong>Configuration of a message-interpolator</strong></p>
-<p>[TODO]</p>
+<p>Besides the static config via `@MessageContextConfig#messageInterpolator, you can
use it dynamically via passing a custom message-interpolator instance to the current messageContext:</p>
+<div class="codehilite"><pre><span class="nd">@Inject</span>
+<span class="kd">private</span> <span class="n">MessageContext</span>
<span class="n">messageContext</span><span class="o">;</span>
+
+<span class="c1">//...</span>
+<span class="n">Message</span> <span class="n">message</span> <span
class="o">=</span> <span class="k">this</span><span class="o">.</span><span
class="na">messageContext</span><span class="o">.</span><span class="na">messageInterpolator</span><span
class="o">(</span><span class="k">new</span> <span class="n">CustomMessageInterpolator</span><span
class="o">()).</span><span class="na">message</span><span class="o">();</span>
+</pre></div>
+
+
 <h4 id="localeresolver">LocaleResolver</h4>
 <p>A locale resolver provides the current locale. The locale is e.g. used to by a <code>MessageResolver</code>
to choose the correct language for the message-text.</p>
 <p><strong>Configuration of a locale-resolver</strong></p>
-<p>[TODO]</p>
+<p>Besides the static config via `@MessageContextConfig#localeResolver, you can use
it dynamically via passing a custom locale-resolver instance to the current messageContext:</p>
+<div class="codehilite"><pre><span class="nd">@Inject</span>
+<span class="kd">private</span> <span class="n">MessageContext</span>
<span class="n">messageContext</span><span class="o">;</span>
+
+<span class="c1">//...</span>
+<span class="n">Message</span> <span class="n">message</span> <span
class="o">=</span> <span class="k">this</span><span class="o">.</span><span
class="na">messageContext</span><span class="o">.</span><span class="na">localeResolver</span><span
class="o">(</span><span class="k">new</span> <span class="n">CustomLocaleResolver</span><span
class="o">()).</span><span class="na">message</span><span class="o">();</span>
+</pre></div>
+
+
 <h2 id="injecting-resources">Injecting Resources</h2>
 <p>DeltaSpike has simple APIs for performing basic resource loading and property file
reading.</p>
 <div class="codehilite"><pre><span class="nd">@Inject</span>
@@ -711,7 +826,49 @@ that exception chain, unless it's explic
 <code>unmute()</code> method on <code>ExceptionEvent</code>.</p>
 <h2 id="scopes">Scopes</h2>
 <h1 id="core-utils">Core - Utils</h1>
-<p>TODO</p>
+<p>DeltaSpike provides many utility-classes (no constructor / static methods) that
can be useful for your project.</p>
+<p>Below you can find an information about these classes.</p>
+<h2 id="arraysutils">ArraysUtils</h2>
+<p>A collection of utilities for working with Arrays</p>
+<ul>
+<li><code>#asSet</code> - Create a set from an array. If the array contains
duplicate objects, the last object in the array will be placed in resultant set.</li>
+</ul>
+<h2 id="beanutils">BeanUtils</h2>
+<p>A set of utility methods for working with beans.</p>
+<ul>
+<li><code>#getQualifiers</code> - Extract the qualifiers from a set of
annotations.</li>
+<li><code>#extractAnnotation</code> - Extract the annotations.</li>
+<li><code>#createInjectionPoints</code> - Given a method, and the bean
on which the method is declared, create a collection of injection points representing the
parameters of the method.</li>
+</ul>
+<h2 id="classdeactivationutils">ClassDeactivationUtils</h2>
+<p>Helper methods for <code>ClassDeactivator</code></p>
+<ul>
+<li><code>#isActivated</code> - Evaluates if the given <code>Deactivatable</code>
is active.</li>
+</ul>
+<h2 id="exceptionutils">ExceptionUtils</h2>
+<p>Helper methods to deal with Exceptions</p>
+<ul>
+<li><code>#throwAsRuntimeException</code> - helper which allows to use
a trick to throw a catched checked exception without a wrapping exception.</li>
+<li><code>#changeAndThrowException</code> - helper which allows to use
a trick to throw a cached checked exception without a wrapping exception.</li>
+</ul>
+<h2 id="propertyfileutils">PropertyFileUtils</h2>
+<p>Helper methods for Property files</p>
+<ul>
+<li><code>#resolvePropertyFiles</code> - Allows to lookup for resource
bundle files.</li>
+<li><code>#loadProperties</code> - Load a Properties file from the given
URL.</li>
+<li><code>#getResourceBundle</code> - Return the ResourceBundle for the
current default Locale.</li>
+</ul>
+<h2 id="proxyutils">ProxyUtils</h2>
+<p>Helper for CDI proxies</p>
+<ul>
+<li><code>#getUnproxiedClass</code> - Return class of the real implementation.</li>
+<li><code>#isProxiedClass</code> - Analyses if the given class is a generated
proxy class.</li>
+</ul>
+<h2 id="stringutils">StringUtils</h2>
+<p>A collection of utilities for working with Strings.</p>
+<ul>
+<li><code>#isEmpty</code> - return true if the String is null or empty
( <code>string.trim().isEmpty()</code> )</li>
+</ul>
           </div>
       </div>
 

Modified: websites/staging/deltaspike/trunk/content/documentation.html
==============================================================================
--- websites/staging/deltaspike/trunk/content/documentation.html (original)
+++ websites/staging/deltaspike/trunk/content/documentation.html Mon Apr 28 10:56:22 2014
@@ -130,6 +130,8 @@
 </li>
 <li><a href="#external">External</a><ul>
 <li><a href="#blogs">Blogs</a></li>
+<li><a href="#add-ons">Add-ons</a></li>
+<li><a href="#project-templates">Project Templates</a></li>
 </ul>
 </li>
 </ul>
@@ -519,6 +521,17 @@ The resolved bean is a normal CDI bean w
 <ul>
 <li><a href="http://os890.blogspot.com/search/label/deltaspike">http://os890.blogspot.com/search/label/deltaspike</a></li>
 </ul>
+<h2 id="add-ons">Add-ons</h2>
+<ul>
+<li><a href="https://github.com/os890/ds-monitoring-addon">Monitoring- and Auditing
Add-on</a></li>
+<li><a href="https://github.com/os890/ds-spring-bridge-addon">CDI/Spring Bridge
Add-on</a></li>
+</ul>
+<h2 id="project-templates">Project Templates</h2>
+<ul>
+<li><a href="https://github.com/os890/javase-cdi-ds-project-template">Java SE
+ CDI + DS</a></li>
+<li><a href="https://github.com/os890/javaweb-cdi-ds-project-template">JSF +
CDI + DS</a></li>
+<li><a href="https://github.com/os890/javaee-cdi-ejb-ds-project-template">EJB
+ CDI + DS</a></li>
+</ul>
           </div>
       </div>
 

Modified: websites/staging/deltaspike/trunk/content/jsf.html
==============================================================================
--- websites/staging/deltaspike/trunk/content/jsf.html (original)
+++ websites/staging/deltaspike/trunk/content/jsf.html Mon Apr 28 10:56:22 2014
@@ -791,6 +791,26 @@ All parts which inherit from <code>Secur
 </pre></div>
 
 
+<p>Since v0.7 it's possible to observe exceptions thrown by a @PreRenderView callback
and use your configured Default-Error-View to display the exception.</p>
+<p>Example:</p>
+<div class="codehilite"><pre><span class="nd">@ExceptionHandler</span>
+<span class="kd">public</span> <span class="kd">class</span> <span
class="nc">ErrorViewAwareExceptionHandler</span> <span class="o">{</span>
+    <span class="nd">@Inject</span>
+    <span class="kd">private</span> <span class="n">ViewConfigResolver</span>
<span class="n">viewConfigResolver</span><span class="o">;</span>
+
+    <span class="kd">public</span> <span class="kt">void</span> <span
class="nf">onIllegalStateException</span><span class="o">(</span><span
class="nd">@Handles</span> <span class="n">ExceptionEvent</span><span
class="o">&lt;</span><span class="n">IllegalStateException</span><span
class="o">&gt;</span> <span class="n">e</span><span class="o">)</span>
+    <span class="o">{</span>
+        <span class="n">FacesContext</span> <span class="n">facesContext</span>
<span class="o">=</span> <span class="n">FacesContext</span><span
class="o">.</span><span class="na">getCurrentInstance</span><span
class="o">();</span>
+
+        <span class="n">String</span> <span class="n">viewId</span>
<span class="o">=</span> <span class="n">viewConfigResolver</span><span
class="o">.</span><span class="na">getDefaultErrorViewConfigDescriptor</span><span
class="o">().</span><span class="na">getViewId</span><span class="o">();</span>
+        <span class="n">UIViewRoot</span> <span class="n">viewRoot</span>
<span class="o">=</span> <span class="n">facesContext</span><span
class="o">.</span><span class="na">getApplication</span><span class="o">().</span><span
class="na">getViewHandler</span><span class="o">().</span><span class="na">createView</span><span
class="o">(</span><span class="n">facesContext</span><span class="o">,</span>
<span class="n">viewId</span><span class="o">);</span>
+        <span class="n">facesContext</span><span class="o">.</span><span
class="na">setViewRoot</span><span class="o">(</span><span class="n">viewRoot</span><span
class="o">);</span>
+        <span class="c1">//... - e.g.: store the exception in a page-bean for the default-error-view</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
 <h3 id="referencing-views-via-viewref">Referencing Views via @ViewRef</h3>
 <p>With <code>@ViewControllerRef#value</code> you can annotate a view-config
class to bind (/reference) a controller to it. <code>@ViewRef#config</code> allows
the same in the other direction.
 Use an existing view-config to reference one or many view/s.</p>

Modified: websites/staging/deltaspike/trunk/content/test-control.html
==============================================================================
--- websites/staging/deltaspike/trunk/content/test-control.html (original)
+++ websites/staging/deltaspike/trunk/content/test-control.html Mon Apr 28 10:56:22 2014
@@ -81,6 +81,11 @@
               <div class="toc">
 <ul>
 <li><a href="#intro">Intro</a></li>
+<li><a href="#setup">Setup</a><ul>
+<li><a href="#openwebbeans">OpenWebBeans</a></li>
+<li><a href="#weld">Weld</a></li>
+</ul>
+</li>
 <li><a href="#cditestrunner">CdiTestRunner</a></li>
 <li><a href="#testcontrol">@TestControl</a></li>
 <li><a href="#cditestsuiterunner">CdiTestSuiteRunner</a></li>
@@ -101,6 +106,45 @@
 <hr />
 <h1 id="intro">Intro</h1>
 <p>This module is available since version 0.6 and allows to write CDI based tests easily.</p>
+<h1 id="setup">Setup</h1>
+<p>Setup for the CDI implementation of your choice and the following test-dependencies:</p>
+<div class="codehilite"><pre><span class="nt">&lt;dependency&gt;</span>
+    <span class="nt">&lt;groupId&gt;</span>org.apache.deltaspike.modules<span
class="nt">&lt;/groupId&gt;</span>
+    <span class="nt">&lt;artifactId&gt;</span>deltaspike-test-control-module-api<span
class="nt">&lt;/artifactId&gt;</span>
+    <span class="nt">&lt;version&gt;</span><span class="cp">${</span><span
class="n">ds</span><span class="o">.</span><span class="n">version</span><span
class="cp">}</span><span class="nt">&lt;/version&gt;</span>
+    <span class="nt">&lt;scope&gt;</span>test<span class="nt">&lt;/scope&gt;</span>
+<span class="nt">&lt;/dependency&gt;</span>
+<span class="nt">&lt;dependency&gt;</span>
+    <span class="nt">&lt;groupId&gt;</span>org.apache.deltaspike.modules<span
class="nt">&lt;/groupId&gt;</span>
+    <span class="nt">&lt;artifactId&gt;</span>deltaspike-test-control-module-impl<span
class="nt">&lt;/artifactId&gt;</span>
+    <span class="nt">&lt;version&gt;</span><span class="cp">${</span><span
class="n">ds</span><span class="o">.</span><span class="n">version</span><span
class="cp">}</span><span class="nt">&lt;/version&gt;</span>
+    <span class="nt">&lt;scope&gt;</span>test<span class="nt">&lt;/scope&gt;</span>
+<span class="nt">&lt;/dependency&gt;</span>
+</pre></div>
+
+
+<h2 id="openwebbeans">OpenWebBeans</h2>
+<p>If you are using OpenWebBeans also add the following test-dependency</p>
+<div class="codehilite"><pre> <span class="nt">&lt;dependency&gt;</span>
+     <span class="nt">&lt;groupId&gt;</span>org.apache.deltaspike.cdictrl<span
class="nt">&lt;/groupId&gt;</span>
+     <span class="nt">&lt;artifactId&gt;</span>deltaspike-cdictrl-owb<span
class="nt">&lt;/artifactId&gt;</span>
+     <span class="nt">&lt;version&gt;</span><span class="cp">${</span><span
class="n">ds</span><span class="o">.</span><span class="n">version</span><span
class="cp">}</span><span class="nt">&lt;/version&gt;</span>
+     <span class="nt">&lt;scope&gt;</span>test<span class="nt">&lt;/scope&gt;</span>
+ <span class="nt">&lt;/dependency&gt;</span>
+</pre></div>
+
+
+<h2 id="weld">Weld</h2>
+<p>If you are using Weld also add the following test-dependency</p>
+<div class="codehilite"><pre><span class="nt">&lt;dependency&gt;</span>
+    <span class="nt">&lt;groupId&gt;</span>org.apache.deltaspike.cdictrl<span
class="nt">&lt;/groupId&gt;</span>
+    <span class="nt">&lt;artifactId&gt;</span>deltaspike-cdictrl-weld<span
class="nt">&lt;/artifactId&gt;</span>
+    <span class="nt">&lt;version&gt;</span><span class="cp">${</span><span
class="n">ds</span><span class="o">.</span><span class="n">version</span><span
class="cp">}</span><span class="nt">&lt;/version&gt;</span>
+    <span class="nt">&lt;scope&gt;</span>runtime<span class="nt">&lt;/scope&gt;</span>
+<span class="nt">&lt;/dependency&gt;</span>
+</pre></div>
+
+
 <h1 id="cditestrunner">CdiTestRunner</h1>
 <p>JUnit Test-Runner to start/stop the CDI-Container autom. (per test-class) and one
request and session per test-method:</p>
 <div class="codehilite"><pre><span class="nd">@RunWith</span><span
class="o">(</span><span class="n">CdiTestRunner</span><span class="o">.</span><span
class="na">class</span><span class="o">)</span>
@@ -167,6 +211,7 @@
 <p>It's possible to set "deltaspike.testcontrol.stop_container" to "false" (via the
std. DeltaSpike config). With that the CDI-Container will be started just once for all tests.</p>
 <h1 id="hints">Hints</h1>
 <p>Don't forget to add a beans.xml in the test-module (e.g. src/test/resources/META-INF/beans.xml).</p>
+<p>If you are using OpenWebBeans as CDI implementation and you need to test EJBs as
well, you can use deltaspike-cdictrl-openejb + org.apache.openejb:openejb-core (instead of
deltaspike-cdictrl-owb).</p>
 <h1 id="optional-integrations">Optional Integrations</h1>
 <h2 id="jsf-via-myfaces-test">JSF (via MyFaces-Test)</h2>
 <p>add:</p>



Mime
View raw message