You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by gp...@apache.org on 2014/11/01 14:37:22 UTC

git commit: DELTASPIKE-762 added hint about enabling the mock-support

Repository: deltaspike
Updated Branches:
  refs/heads/master ad3e0607c -> 8f98608a9


DELTASPIKE-762 added hint about enabling the mock-support


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/8f98608a
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/8f98608a
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/8f98608a

Branch: refs/heads/master
Commit: 8f98608a98d819d47f490774263a0826c6c4cbd6
Parents: ad3e060
Author: gpetracek <gp...@apache.org>
Authored: Sat Nov 1 14:36:21 2014 +0100
Committer: gpetracek <gp...@apache.org>
Committed: Sat Nov 1 14:36:21 2014 +0100

----------------------------------------------------------------------
 documentation/src/main/asciidoc/test-control.adoc | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/8f98608a/documentation/src/main/asciidoc/test-control.adoc
----------------------------------------------------------------------
diff --git a/documentation/src/main/asciidoc/test-control.adoc b/documentation/src/main/asciidoc/test-control.adoc
index ba6cbc5..809f50b 100644
--- a/documentation/src/main/asciidoc/test-control.adoc
+++ b/documentation/src/main/asciidoc/test-control.adoc
@@ -164,11 +164,25 @@ org.apache.openejb:openejb-core (instead of deltaspike-cdictrl-owb).
 
 === Mock Frameworks
 
-With v0.8+ it's possible to mock CDI-Beans. Usually @Exclude (+
+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 `DynamicMockManager`.
 
+*Attention:*
+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
+
+`deltaspike.testcontrol.mock-support.allow_mocked_beans=true`
+and/or
+`deltaspike.testcontrol.mock-support.allow_mocked_producers=true`
+
+to `/META-INF/apache-deltaspike.properties` in your test-folder.
+
 If you need dependency-injection in the mocked instances, you can use
 `BeanProvider.injectFields(myMockedBean);`.