Search in sources :

Example 11 with FixtureScript

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

the class IncomingInvoiceApprovalState_IntegTest method setupData.

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

        @Override
        protected void execute(final FixtureScript.ExecutionContext ec) {
            ec.executeChild(this, new DocumentTypesAndTemplatesForCapexFixture());
            ec.executeChild(this, new CapexChargeHierarchyXlsxFixture());
            ec.executeChildren(this, IncomingInvoice_enum.fakeInvoice2Pdf, BankAccount_enum.TopModelGb, Person_enum.EmmaTreasurerGb, Person_enum.JonathanPropertyManagerGb, Person_enum.PeterPanProjectManagerGb, Person_enum.OscarCountryDirectorGb);
        }
    });
    Person Peter = Person_enum.PeterPanProjectManagerGb.findUsing(serviceRegistry);
    Peter.addRole(ProjectRoleTypeEnum.PROJECT_MANAGER);
}
Also used : DocumentTypesAndTemplatesForCapexFixture(org.estatio.module.capex.seed.DocumentTypesAndTemplatesForCapexFixture) FixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript) Person(org.estatio.module.party.dom.Person) CapexChargeHierarchyXlsxFixture(org.estatio.module.charge.fixtures.incoming.builders.CapexChargeHierarchyXlsxFixture) Before(org.junit.Before)

Example 12 with FixtureScript

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

the class Order_2_IntegTest method setupData.

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

        @Override
        protected void execute(final FixtureScript.ExecutionContext executionContext) {
            // taken from the DocumentTypesAndTemplatesSeedService (not run in integ tests by default)
            final LocalDate templateDate = ld(2012, 1, 1);
            executionContext.executeChildren(this, new DocumentTypesAndTemplatesForCapexFixture(templateDate), new CapexChargeHierarchyXlsxFixture());
            executionContext.executeChildren(this, Order_enum.fakeOrder2Pdf, Person_enum.JonathanPropertyManagerGb);
        }
    });
    order = Order_enum.fakeOrder2Pdf.findUsing(serviceRegistry);
}
Also used : DocumentTypesAndTemplatesForCapexFixture(org.estatio.module.capex.seed.DocumentTypesAndTemplatesForCapexFixture) FixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript) LocalDate(org.joda.time.LocalDate) CapexChargeHierarchyXlsxFixture(org.estatio.module.charge.fixtures.incoming.builders.CapexChargeHierarchyXlsxFixture) Before(org.junit.Before)

Example 13 with FixtureScript

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

the class Order_withLinks_IntegTest method setupData.

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

        @Override
        protected void execute(final ExecutionContext ec) {
            ec.executeChild(this, new DocumentTypesAndTemplatesForCapexFixture());
            ec.executeChild(this, new CapexChargeHierarchyXlsxFixture());
            ec.executeChildren(this, Order_enum.fakeOrder2Pdf, Budget_enum.OxfBudget2015, Budget_enum.OxfBudget2016, IncomingInvoice_enum.fakeInvoice2Pdf, Person_enum.JonathanPropertyManagerGb);
        }
    });
    order = Order_enum.fakeOrder2Pdf.findUsing(serviceRegistry);
    orderItem = order.getItems().first();
    // given
    assertNotNull(order);
    assertNotNull(orderItem);
    assertThat(linkRepository.findByOrderItem(orderItem)).isNotEmpty();
    assertThat(order.getApprovalState()).isEqualTo(OrderApprovalState.NEW);
    // workaround: clear MeService#me cache
    queryResultsCache.resetForNextTransaction();
}
Also used : DocumentTypesAndTemplatesForCapexFixture(org.estatio.module.capex.seed.DocumentTypesAndTemplatesForCapexFixture) FixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript) CapexChargeHierarchyXlsxFixture(org.estatio.module.charge.fixtures.incoming.builders.CapexChargeHierarchyXlsxFixture) Before(org.junit.Before)

Example 14 with FixtureScript

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

the class IncomingDocumentPresentationSubscriber_IntegTest method setupData.

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

        @Override
        protected void execute(final ExecutionContext executionContext) {
            executionContext.executeChild(this, new DocumentTypesAndTemplatesForCapexFixture());
        }
    });
    List<Document> incomingDocumentsBefore = repository.findIncomingDocuments();
    assertThat(incomingDocumentsBefore).isEmpty();
    // given
    final String fileName = "1020100123.pdf";
    final byte[] pdfBytes = Resources.toByteArray(Resources.getResource(IncomingDocumentPresentationSubscriber_IntegTest.class, fileName));
    final Blob blob = new Blob(fileName, "application/pdf", pdfBytes);
    wrap(documentMenu).upload(blob);
    transactionService.nextTransaction();
}
Also used : Blob(org.apache.isis.applib.value.Blob) DocumentTypesAndTemplatesForCapexFixture(org.estatio.module.capex.seed.DocumentTypesAndTemplatesForCapexFixture) FixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript) Document(org.incode.module.document.dom.impl.docs.Document) Before(org.junit.Before)

Example 15 with FixtureScript

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

the class CommunicationChannelContributions_NewEmail_IntegTest method setup.

@Before
public void setup() {
    fs = new PersonAndRolesBuilder();
    runFixtureScript(new FixtureScript() {

        @Override
        protected void execute(ExecutionContext executionContext) {
            executionContext.executeChild(this, fs);
        }
    });
}
Also used : PersonAndRolesBuilder(org.estatio.module.asset.fixtures.person.builders.PersonAndRolesBuilder) 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