[
https://issues.apache.org/jira/browse/MYFACESTEST-66?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13881334#comment-13881334
]
Leonardo Uribe commented on MYFACESTEST-66:
-------------------------------------------
I have committed a class in 1.2, 2.0 and 2.1 called
org.apache.myfaces.test.mock.MockedJsfTestContainer. It has the same mocked
environment as with org.apache.myfaces.test.base.junit4.AbstractJsfTestCase.
Basically it is the same as in deltaspike, but it does not have the part to
start and stop the bean container, because that is CDI specific testing stuff.
The suggestion is extend a class from MockedJsfTestContainer and include those
method if necessary.
Other difference is a new MockHttpSession is created when the request is
started, because this has no effect on the mocked container. Note in a real
servlet, the session is created indirectly, but since the mocked container does
not aim to simulate the lifecycle this difference is not relevant.
If no objections I'll close this issue as fixed soon.
> pre-configured containers
> -------------------------
>
> Key: MYFACESTEST-66
> URL: https://issues.apache.org/jira/browse/MYFACESTEST-66
> Project: MyFaces Test
> Issue Type: New Feature
> Components: Mock Objects
> Affects Versions: 1.0.5
> Reporter: Gerhard Petracek
> Assignee: Leonardo Uribe
>
> currently other frameworks like deltaspike have to use mocked containers for
> every version of jsf (one example can be found at
> https://git-wip-us.apache.org/repos/asf?p=deltaspike.git;a=blob;f=deltaspike/modules/test-control/impl/src/main/java/org/apache/deltaspike/testcontrol/impl/jsf/MockedJsf2TestContainer.java;h=e6e2b2bec6cf443c141035643cb5816e1118e6d6;hb=HEAD
> ). in a lot of cases it's just required to have a simple control over the
> mocked container (methods like #addConfigEntry, #boot, #shutdown,
> #activateView, #startScope, #stopScope). those methods are independent of the
> jsf-api. -> if every new version of myfaces-test provides a correctly mocked
> container with such independent methods, frameworks like deltaspike could
> delegate to it (instead of hosting a correctly mocked container for every
> version of the jsf-api).
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)