hi alexandr,

you can use myfaces-test to mock jsf for your unit-tests + add e.g.
org.apache.deltaspike.testcontrol.impl.jsf.MyFacesContainerAdapter in
META-INF/services/org.apache.deltaspike.testcontrol.spi.ExternalContainer -
see e.g. [1].

however, other scopes like @WindowScoped are easier to test.

regards,
gerhard

[1] https://github.com/os890/ee6-ds-demo



2014-10-23 13:48 GMT+02:00 Alexandr Denisenko <
[email protected]>:

> Hello! I was very sorry, but we have a problem when using Deltaspike. In
> our project, we decided to go out on the EJB to CDI, for easier testing. We
> are using JSF 2.0 and most beans we javax.faces.bean.ViewScoped. We plugged
> deltaspike-test-control-module-api and if you use standard Cdi Scoped
> everything is fine, but as soon as we include deltaspike-jsf-module-api and
> use ViewScoped tests are not carried out because of this error:
> "javax.enterprise.context .ContextNotActiveException: WebBeans context with
> scope type annotationViewScoped does not exist within current thread ". The
> error occurs because FacesContext = null. Is there a way to get around this
> problem by using standard solutions?
>
> Confidentiality of content: This transmission contains information which
> may be confidential and/or privileged. The information is intended to be
> for the exclusive use of the planned recipient. If you are not the intended
> recipient, be advised that any disclosure, copying, distribution or other
> use of this information is strictly prohibited. If you have received this
> transmission in error, please notify the sender immediately.
>

Reply via email to