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/10/23 14:09:27 UTC

[jira] [Commented] (ISIS-1215) New MultipleExecutionStrategy for fixture scripts to use value semantics for determining whether to run a fixture script invoked more than once.

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

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

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

ISIS-1215: new execution strategy for fixture scripts; implementation plus documentation.


> New MultipleExecutionStrategy for fixture scripts to use value semantics for determining whether to run a fixture script invoked more than once.
> ------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ISIS-1215
>                 URL: https://issues.apache.org/jira/browse/ISIS-1215
>             Project: Isis
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 1.9.0
>            Reporter: Dan Haywood
>            Assignee: Dan Haywood
>            Priority: Minor
>             Fix For: 1.10.0
>
>
> for fixture scripts, we can currently configure the MultipleExecutionStrategy as either IGNORE or EXECUTE, eg:
> {code:java}
>     @Override
>     public FixtureScriptsSpecification getSpecification() {
>         return FixtureScriptsSpecification
>                 .builder(DomainAppFixtureScriptsSpecificationProvider.class)
>                 .with(FixtureScripts.MultipleExecutionStrategy.EXECUTE)
>                 .build();
>     }
> {code}
> The IGNORE is for using fixture scripts that combine both the "WHAT" and the "HOW"  (a la Estatio):
> {code:java}
> 	ec.executeChild(this, new ImportEventsFromSpreadsheet());
> 	ec.executeChild(this, new ImportPeopleFromSpreadsheet());
> {code}
> where:
> {code:java}
>     static class ImportEventsFromSpreadsheet extends CreateUsingSpreadsheet<EventImport> {
>         public ImportEventsFromSpreadsheet() {
>             super(EventImport.class, "EventImport.xls");
>         }
>     }
>     static class ImportPeopleFromSpreadsheet extends CreateUsingSpreadsheet<PeopleImport> {
>         public ImportPeopleFromSpreadsheet() {
>             super(PeopleImport.class, "PeopleImportB.xls");
>         }
>     }
> {code}
> The alternative is EXECUTE, which basically switches this behaviour off. That is appropriate for general purpose fixture scripts which take care of the "HOW", but where the "WHAT" is parameterized,
> eg:
> {code:java}
>     ec.executeChild(this, new CreateUsingSpreadsheet<>(EventImport.class, "EventImport.xls"));
>     ec.executeChild(this, new CreateUsingSpreadsheet<>(PeopleImport.class, "PeopleImportB.xls"));
> {code}
> This ticket is to combine both approaches by using value-semantics rather than reference semantics, thus to ignore fixture scripts if invoked multiple times where "multiple times" is determine by invoking on equals(...) of the fixture script against all previously invoked fixture scripts.
> thus, we would skip a fixture script if
> {code:java}
>     ec.executeChild(this, new CreateUsingSpreadsheet<>(EventImport.class, "EventImport.xls"));    
>   // would invoke this:
>     ec.executeChild(this, new CreateUsingSpreadsheet<>(SomethingElseImport.class, "SomethingElseImport.xls"));    
>    // but would skip this:
>     ec.executeChild(this, new CreateUsingSpreadsheet<>(EventImport.class, "EventImport.xls"));    
> {code}



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