Search in sources :

Example 6 with FixtureScript

use of org.apache.isis.applib.fixturescripts.FixtureScript in project estatio by estatio.

the class LeaseModuleIntegTestAbstract method bootstrapAndSetupIfRequired.

@Override
public void bootstrapAndSetupIfRequired() {
    super.bootstrapAndSetupIfRequired();
    // TODO: push down to subclasses that need this... at the moment this fixture is hidden away and not obvious
    runFixtureScript(new FixtureScript() {

        @Override
        protected void execute(final ExecutionContext ec) {
            ec.executeChildren(this, // demo
            DocFragment_demo_enum.InvoicePreliminaryLetterDescription_DemoGbr, DocFragment_demo_enum.InvoicePreliminaryLetterDescription_DemoNld, DocFragment_demo_enum.InvoiceDescription_DemoGbr, DocFragment_demo_enum.InvoiceDescription_DemoNld, DocFragment_demo_enum.InvoiceItemDescription_DemoGbr, DocFragment_demo_enum.InvoiceItemDescription_DemoNld);
        }
    });
}
Also used : FixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript)

Example 7 with FixtureScript

use of org.apache.isis.applib.fixturescripts.FixtureScript in project estatio by estatio.

the class AgreementRepository_IntegTest method setupData.

@Before
public void setupData() {
    runFixtureScript(new FixtureScript() {

        @Override
        protected void execute(ExecutionContext executionContext) {
            // 5 oxford leases, 1 kal
            executionContext.executeChild(this, Lease_enum.OxfTopModel001Gb.builder());
            executionContext.executeChild(this, Lease_enum.OxfMediaX002Gb.builder());
            executionContext.executeChild(this, Lease_enum.OxfPoison003Gb.builder());
            executionContext.executeChild(this, Lease_enum.OxfPret004Gb.builder());
            executionContext.executeChild(this, Lease_enum.OxfMiracl005Gb.builder());
            executionContext.executeChild(this, Lease_enum.KalPoison001Nl.builder());
        }
    });
    lease = Lease_enum.OxfTopModel001Gb.findUsing(serviceRegistry);
}
Also used : FixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript) Before(org.junit.Before)

Example 8 with FixtureScript

use of org.apache.isis.applib.fixturescripts.FixtureScript in project estatio by estatio.

the class EstatioBaseModule method getRefDataSetupFixture.

@Override
public FixtureScript getRefDataSetupFixture() {
    if (refData.get()) {
        return null;
    }
    // else
    refData.set(true);
    return new FixtureScript() {

        @Override
        protected void execute(final ExecutionContext executionContext) {
            executionContext.executeChild(this, new TickingClockFixture().setDate("2014-05-18"));
            executionContext.executeChild(this, new ApplicationTenancy_enum.PersistAll());
            // set up 3 estatio roles
            executionContext.executeChild(this, new EstatioRolesAndPermissions());
            // estatio-admin user with the estatio-admin role + superuser
            executionContext.executeChild(this, new EstatioAdmin());
            executionContext.executeChild(this, new EstatioAdmin_Has_EstatioSuperuserRole());
            // bunch of users with estatio-user role
            executionContext.executeChild(this, new EstatioUser());
            executionContext.executeChild(this, new EstatioUserInFrance());
            executionContext.executeChild(this, new EstatioUserInGreatBritain());
            executionContext.executeChild(this, new EstatioUserInItaly());
            executionContext.executeChild(this, new EstatioUserInNetherlands());
            executionContext.executeChild(this, new EstatioUserInSweden());
        }
    };
}
Also used : TickingClockFixture(org.apache.isis.applib.fixturescripts.clock.TickingClockFixture) ApplicationTenancy_enum(org.incode.module.apptenancy.fixtures.enums.ApplicationTenancy_enum) EstatioAdmin_Has_EstatioSuperuserRole(org.estatio.module.base.fixtures.security.userrole.personas.EstatioAdmin_Has_EstatioSuperuserRole) EstatioAdmin(org.estatio.module.base.fixtures.security.users.personas.EstatioAdmin) EstatioUserInSweden(org.estatio.module.base.fixtures.security.users.personas.EstatioUserInSweden) EstatioUserInGreatBritain(org.estatio.module.base.fixtures.security.users.personas.EstatioUserInGreatBritain) EstatioRolesAndPermissions(org.estatio.module.base.fixtures.security.perms.personas.EstatioRolesAndPermissions) FixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript) EstatioUserInNetherlands(org.estatio.module.base.fixtures.security.users.personas.EstatioUserInNetherlands) EstatioUser(org.estatio.module.base.fixtures.security.users.personas.EstatioUser) EstatioUserInFrance(org.estatio.module.base.fixtures.security.users.personas.EstatioUserInFrance) EstatioUserInItaly(org.estatio.module.base.fixtures.security.users.personas.EstatioUserInItaly)

Example 9 with FixtureScript

use of org.apache.isis.applib.fixturescripts.FixtureScript in project estatio by estatio.

the class BudgetCalculationResultLinkRepository_IntegTest method setupData.

@Before
public void setupData() {
    runFixtureScript(new FixtureScript() {

        @Override
        protected void execute(final ExecutionContext executionContext) {
            executionContext.executeChild(this, Budget_enum.OxfBudget2015.builder());
            executionContext.executeChild(this, Budget_enum.OxfBudget2016.builder());
            executionContext.executeChild(this, Lease_enum.OxfTopModel001Gb.builder());
        }
    });
    propertyOxf = Property_enum.OxfGb.findUsing(serviceRegistry);
    budget2015 = budgetRepository.findByPropertyAndStartDate(propertyOxf, Budget_enum.OxfBudget2015.getStartDate());
    charge = Charge_enum.GbServiceCharge.findUsing(serviceRegistry);
    leaseTopModel = Lease_enum.OxfTopModel001Gb.findUsing(serviceRegistry);
    run = budgetCalculationRunRepository.createBudgetCalculationRun(leaseTopModel, budget2015, BudgetCalculationType.BUDGETED, Status.NEW);
    leaseItem = leaseTopModel.newItem(LeaseItemType.SERVICE_CHARGE_BUDGETED, LeaseAgreementRoleTypeEnum.LANDLORD, charge, InvoicingFrequency.MONTHLY_IN_ADVANCE, PaymentMethod.DIRECT_DEBIT, leaseTopModel.getStartDate());
}
Also used : FixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript) Before(org.junit.Before)

Example 10 with FixtureScript

use of org.apache.isis.applib.fixturescripts.FixtureScript in project estatio by estatio.

the class BudgetCalculationRunRepository_IntegTest method setupData.

@Before
public void setupData() {
    runFixtureScript(new FixtureScript() {

        @Override
        protected void execute(final ExecutionContext executionContext) {
            executionContext.executeChild(this, Budget_enum.OxfBudget2015.builder());
            executionContext.executeChild(this, Budget_enum.OxfBudget2016.builder());
            executionContext.executeChild(this, Lease_enum.OxfTopModel001Gb.builder());
        }
    });
    propertyOxf = Property_enum.OxfGb.findUsing(serviceRegistry);
    budgetsForOxf = budgetRepository.findByProperty(propertyOxf);
    budget2015 = budgetRepository.findByPropertyAndStartDate(propertyOxf, Budget_enum.OxfBudget2015.getStartDate());
}
Also used : FixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript) Before(org.junit.Before)

Aggregations

FixtureScript (org.apache.isis.applib.fixturescripts.FixtureScript)18 Before (org.junit.Before)16 DocumentTypesAndTemplatesForCapexFixture (org.estatio.module.capex.seed.DocumentTypesAndTemplatesForCapexFixture)4 CapexChargeHierarchyXlsxFixture (org.estatio.module.charge.fixtures.incoming.builders.CapexChargeHierarchyXlsxFixture)3 TickingClockFixture (org.apache.isis.applib.fixturescripts.clock.TickingClockFixture)1 Blob (org.apache.isis.applib.value.Blob)1 PersonAndRolesBuilder (org.estatio.module.asset.fixtures.person.builders.PersonAndRolesBuilder)1 EstatioRolesAndPermissions (org.estatio.module.base.fixtures.security.perms.personas.EstatioRolesAndPermissions)1 EstatioAdmin_Has_EstatioSuperuserRole (org.estatio.module.base.fixtures.security.userrole.personas.EstatioAdmin_Has_EstatioSuperuserRole)1 EstatioAdmin (org.estatio.module.base.fixtures.security.users.personas.EstatioAdmin)1 EstatioUser (org.estatio.module.base.fixtures.security.users.personas.EstatioUser)1 EstatioUserInFrance (org.estatio.module.base.fixtures.security.users.personas.EstatioUserInFrance)1 EstatioUserInGreatBritain (org.estatio.module.base.fixtures.security.users.personas.EstatioUserInGreatBritain)1 EstatioUserInItaly (org.estatio.module.base.fixtures.security.users.personas.EstatioUserInItaly)1 EstatioUserInNetherlands (org.estatio.module.base.fixtures.security.users.personas.EstatioUserInNetherlands)1 EstatioUserInSweden (org.estatio.module.base.fixtures.security.users.personas.EstatioUserInSweden)1 Person (org.estatio.module.party.dom.Person)1 ApplicationTenancy_enum (org.incode.module.apptenancy.fixtures.enums.ApplicationTenancy_enum)1 Document (org.incode.module.document.dom.impl.docs.Document)1 LocalDate (org.joda.time.LocalDate)1