You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2015/11/06 08:38:27 UTC

[jira] [Commented] (ISIS-1229) Calling nextRequest() in an integration test should clear any @RequestScoped services.

    [ https://issues.apache.org/jira/browse/ISIS-1229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14993289#comment-14993289 ] 

ASF subversion and git services commented on ISIS-1229:
-------------------------------------------------------

Commit ff1d380c712ff694277aa3554c5a2e9fd7a9256d in isis's branch refs/heads/master from [~danhaywood]
[ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=ff1d380 ]

ISIS-1229: javadoc changes only, and deprecating IntegrationTestAbstract#nextRequest()

... because nextRequest() doesn't mean next request, it just means next transaction within the same session.  This is confusing for anyone expecting that request-scoped services to be reset after calling it


> Calling nextRequest() in an integration test should clear any @RequestScoped services.
> --------------------------------------------------------------------------------------
>
>                 Key: ISIS-1229
>                 URL: https://issues.apache.org/jira/browse/ISIS-1229
>             Project: Isis
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: core-1.8.0
>            Reporter: Dan Haywood
>            Assignee: Dan Haywood
>            Priority: Minor
>             Fix For: 1.10.0
>
>
> Raised by Oscar:
> Related with this, I’m trying to test the following:
>    @Test
>     public void totalOrRatio() {
>         // given
>         kit.assignToPerson(account.getAccountOwner());
>         this.nextRequest();
>         kit.getRegisteredForPerson().setSex(Sex.Man);
> ….
> }
> Where the Kit.getRegisteredForPerson() is cached:
>     // {{ RegisteredForPerson (property)
>     @Property(editing = Editing.DISABLED, notPersisted = true)
>     @MemberOrder(sequence = "1")
>     public Person getRegisteredForPerson() {
>         return this.queryResultsCache.execute(new Callable<Person>() {
>             @Override
>             public Person call() throws Exception {
>                 return Kit.this.findRegisteredToPerson();
>             }
>         }, this.getClass(), "findRegisteredToPerson");
>     }
>     // }}
> Despite invoking “this.nextRequest()” on the integtest, seems that the cache is still alive (being it a @RequestScoped service).
> Would this also need to be improved for testing @RequestScoped services? 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)