Author: gpetracek
Date: Sat Nov 1 19:00:45 2014
New Revision: 1636013
URL: http://svn.apache.org/r1636013
Log:
Site checkin for project Apache DeltaSpike - Documentation
Removed:
deltaspike/site/trunk/content/documentation/staging/
Modified:
deltaspike/site/trunk/content/documentation/test-control.html
Modified: deltaspike/site/trunk/content/documentation/test-control.html
URL:
http://svn.apache.org/viewvc/deltaspike/site/trunk/content/documentation/test-control.html?rev=1636013&r1=1636012&r2=1636013&view=diff
==============================================================================
--- deltaspike/site/trunk/content/documentation/test-control.html (original)
+++ deltaspike/site/trunk/content/documentation/test-control.html Sat Nov 1
19:00:45 2014
@@ -394,12 +394,29 @@ org.apache.openejb:openejb-core (instead
<div class="sect2">
<h3 id="_mock_frameworks">Mock Frameworks</h3>
<div class="paragraph">
-<p>With v0.8+ it’s possible to mock CDI-Beans. Usually @Exclude (+
+<p>Since v1 it’s possible to mock CDI-Beans. Usually @Exclude (+
project-stage) is enough, however, for some cases mocked beans might be
easier. Therefore it’s possible to create (mock-)instances manually or
via a mocking framework and add them e.g. via
<code>DynamicMockManager</code>.</p>
</div>
<div class="paragraph">
+<p><strong>Attention:</strong>
+Mocking CDI beans isn’t supported for every feature of CDI and/or
+every implementation version. E.g. we can’t mock intercepted CDI beans
and
+with some implementations mocking specialized beans fails.
+Usually all features are active per default, however,
+due to those reasons we deactivated this feature per default.
+You can enable it by adding</p>
+</div>
+<div class="paragraph">
+<p><code>deltaspike.testcontrol.mock-support.allow_mocked_beans=true</code>
+and/or
+<code>deltaspike.testcontrol.mock-support.allow_mocked_producers=true</code></p>
+</div>
+<div class="paragraph">
+<p>to <code>/META-INF/apache-deltaspike.properties</code> in your
test-folder.</p>
+</div>
+<div class="paragraph">
<p>If you need dependency-injection in the mocked instances, you can use
<code>BeanProvider.injectFields(myMockedBean);</code>.</p>
</div>