incodehq / incode-platform

Combines incode.org modules and isisaddons.org into a single set of modules.
http://platform.incode.org
Apache License 2.0
8 stars 9 forks source link

lib-excel: Cannot attempt to run the same (subclass of) ExcelFixture2 more than once. #52

Open danhaywood opened 6 years ago

danhaywood commented 6 years ago

from https://github.com/isisaddons-legacy/isis-module-excel/issues/20

Pretty sure this is because ExcelFixture2 (and maybe ExcelFixture)'s value semantics is broken.

If if try to run the same subclass of ExcelFixture2 more than once, then this code in FixtureScript.java

    //region > shouldExecute
    private boolean shouldExecute(final FixtureScript fixtureScript) {

        final boolean previouslyExecuted = this.previouslyExecuted.contains(fixtureScript);
        if(!previouslyExecuted) {
            this.previouslyExecuted.add(fixtureScript);
        }

will fail, because of the "contains" call is gonna call getBytes() on the candidate fixture script which will in turn return null because the fixture script hasn't been run (we're trying to figure out at this stage whether to run the fixture script).