Search in sources :

Example 1 with DocumentTypesAndTemplatesForCapexFixture

use of org.estatio.module.capex.seed.DocumentTypesAndTemplatesForCapexFixture in project estatio by estatio.

the class DocumentTypesAndTemplatesSeedService method init.

@PostConstruct
public void init() {
    if (System.getProperty("isis.headless") != null) {
        return;
    }
    // If we get new versions of the templates in the future, then update this date
    // the upsert logic here should result in the new templates being inserted alongside existing
    // (with a different template date).
    // 
    // using this date to ensure that prototyping still works (epoch date set back then)
    // 
    final LocalDate templateDate = new LocalDate(2012, 1, 1);
    fixtureScripts.runFixtureScript(new DocumentTypesAndTemplatesForLeaseFixture(templateDate), null);
    fixtureScripts.runFixtureScript(new DocumentTypesAndTemplatesForCapexFixture(templateDate), null);
}
Also used : DocumentTypesAndTemplatesForCapexFixture(org.estatio.module.capex.seed.DocumentTypesAndTemplatesForCapexFixture) DocumentTypesAndTemplatesForLeaseFixture(org.estatio.module.lease.seed.DocumentTypesAndTemplatesForLeaseFixture) LocalDate(org.joda.time.LocalDate) PostConstruct(javax.annotation.PostConstruct)

Example 2 with DocumentTypesAndTemplatesForCapexFixture

use of org.estatio.module.capex.seed.DocumentTypesAndTemplatesForCapexFixture 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 3 with DocumentTypesAndTemplatesForCapexFixture

use of org.estatio.module.capex.seed.DocumentTypesAndTemplatesForCapexFixture 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 4 with DocumentTypesAndTemplatesForCapexFixture

use of org.estatio.module.capex.seed.DocumentTypesAndTemplatesForCapexFixture 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 5 with DocumentTypesAndTemplatesForCapexFixture

use of org.estatio.module.capex.seed.DocumentTypesAndTemplatesForCapexFixture 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)

Aggregations

DocumentTypesAndTemplatesForCapexFixture (org.estatio.module.capex.seed.DocumentTypesAndTemplatesForCapexFixture)6 FixtureScript (org.apache.isis.applib.fixturescripts.FixtureScript)4 CapexChargeHierarchyXlsxFixture (org.estatio.module.charge.fixtures.incoming.builders.CapexChargeHierarchyXlsxFixture)4 Before (org.junit.Before)4 DocumentTypesAndTemplatesForLeaseFixture (org.estatio.module.lease.seed.DocumentTypesAndTemplatesForLeaseFixture)2 LocalDate (org.joda.time.LocalDate)2 PostConstruct (javax.annotation.PostConstruct)1 ModuleAbstract (org.apache.isis.applib.ModuleAbstract)1 Blob (org.apache.isis.applib.value.Blob)1 OrderInvoiceImportForDemoXlsxFixture (org.estatio.module.capex.fixtures.orderinvoice.OrderInvoiceImportForDemoXlsxFixture)1 EstatioChargeModule (org.estatio.module.charge.EstatioChargeModule)1 EstatioCurrencyModule (org.estatio.module.currency.EstatioCurrencyModule)1 EstatioIndexModule (org.estatio.module.index.EstatioIndexModule)1 Person (org.estatio.module.party.dom.Person)1 EstatioTaxModule (org.estatio.module.tax.EstatioTaxModule)1 CountryModule (org.incode.module.country.CountryModule)1 Document (org.incode.module.document.dom.impl.docs.Document)1 AbstractUserAndRolesFixtureScript (org.isisaddons.module.security.seed.scripts.AbstractUserAndRolesFixtureScript)1