Search in sources :

Example 6 with FinderInteraction

use of org.incode.module.unittestsupport.dom.repo.FinderInteraction in project estatio by estatio.

the class NumeratorCollectionRepository_Test method setup.

@Before
public void setup() {
    seller = new PartyForTesting();
    buyer = new PartyForTesting();
    paymentMethod = PaymentMethod.BANK_TRANSFER;
    lease = new Lease() {

        @Override
        public Property getProperty() {
            return null;
        }
    };
    invoiceStatus = InvoiceStatus.APPROVED;
    dueDate = new LocalDate(2013, 4, 1);
    invoiceRepository = new InvoiceRepository() {

        @Override
        protected <T> T firstMatch(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderInteraction.FinderMethod.FIRST_MATCH);
            return null;
        }

        @Override
        protected List<Invoice> allInstances() {
            finderInteraction = new FinderInteraction(null, FinderInteraction.FinderMethod.ALL_INSTANCES);
            return null;
        }

        @Override
        protected <T> List<T> allMatches(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderInteraction.FinderMethod.ALL_MATCHES);
            return null;
        }
    };
    invoiceForLeaseRepository = new InvoiceForLeaseRepository() {
    };
    estatioNumeratorRepository = new NumeratorForCollectionRepository();
}
Also used : Lease(org.estatio.module.lease.dom.Lease) InvoiceRepository(org.estatio.module.invoice.dom.InvoiceRepository) List(java.util.List) PartyForTesting(org.estatio.module.party.dom.PartyForTesting) Property(org.estatio.module.asset.dom.Property) LocalDate(org.joda.time.LocalDate) FinderInteraction(org.incode.module.unittestsupport.dom.repo.FinderInteraction) Before(org.junit.Before)

Example 7 with FinderInteraction

use of org.incode.module.unittestsupport.dom.repo.FinderInteraction in project estatio by estatio.

the class OccupancyRepository_Test method setup.

@Before
public void setup() {
    lease = new Lease();
    unit = new Unit();
    startDate = new LocalDate(2013, 4, 1);
    occupancyRepository = new OccupancyRepository() {

        @Override
        protected <T> T firstMatch(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderMethod.FIRST_MATCH);
            return null;
        }

        @Override
        protected List<Occupancy> allInstances() {
            finderInteraction = new FinderInteraction(null, FinderMethod.ALL_INSTANCES);
            return null;
        }

        @Override
        protected <T> List<T> allMatches(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderMethod.ALL_MATCHES);
            return null;
        }
    };
}
Also used : OccupancyRepository(org.estatio.module.lease.dom.occupancy.OccupancyRepository) List(java.util.List) Unit(org.estatio.module.asset.dom.Unit) LocalDate(org.joda.time.LocalDate) FinderInteraction(org.incode.module.unittestsupport.dom.repo.FinderInteraction) Before(org.junit.Before)

Example 8 with FinderInteraction

use of org.incode.module.unittestsupport.dom.repo.FinderInteraction in project estatio by estatio.

the class LeaseRepository_Test method setup.

@Before
public void setup() {
    asset = new FixedAssetForTesting();
    property = new Property();
    leaseRepository = new LeaseRepository() {

        @Override
        protected <T> T uniqueMatch(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderMethod.UNIQUE_MATCH);
            return (T) new Lease();
        }

        @Override
        protected List<Lease> allInstances() {
            finderInteraction = new FinderInteraction(null, FinderMethod.ALL_INSTANCES);
            return null;
        }

        @Override
        protected <T> List<T> allMatches(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderMethod.ALL_MATCHES);
            return null;
        }
    };
    leaseRepository.clockService = new ClockService();
}
Also used : ClockService(org.apache.isis.applib.services.clock.ClockService) FixedAssetForTesting(org.estatio.module.asset.dom.FixedAssetForTesting) List(java.util.List) Property(org.estatio.module.asset.dom.Property) FinderInteraction(org.incode.module.unittestsupport.dom.repo.FinderInteraction) Before(org.junit.Before)

Example 9 with FinderInteraction

use of org.incode.module.unittestsupport.dom.repo.FinderInteraction in project estatio by estatio.

the class PropertyMenu2_Test method setup.

@Before
public void setup() {
    propertyRepository = new PropertyRepository() {

        @Override
        protected <T> T uniqueMatch(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderMethod.UNIQUE_MATCH);
            return (T) new Property();
        }

        @Override
        protected List<Property> allInstances() {
            finderInteraction = new FinderInteraction(null, FinderMethod.ALL_INSTANCES);
            return null;
        }

        @Override
        protected <T> List<T> allMatches(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderMethod.ALL_MATCHES);
            return null;
        }
    };
    propertyMenu = new PropertyMenu();
    propertyMenu.propertyRepository = propertyRepository;
}
Also used : List(java.util.List) PropertyRepository(org.estatio.module.asset.dom.PropertyRepository) Property(org.estatio.module.asset.dom.Property) EstatioApplicationTenancyRepositoryForProperty(org.estatio.module.asset.dom.EstatioApplicationTenancyRepositoryForProperty) FinderInteraction(org.incode.module.unittestsupport.dom.repo.FinderInteraction) Before(org.junit.Before)

Example 10 with FinderInteraction

use of org.incode.module.unittestsupport.dom.repo.FinderInteraction in project estatio by estatio.

the class AgreementRepository_Test method setup.

@Before
public void setup() {
    agreementType = new AgreementType();
    agreementRoleType = new AgreementRoleType();
    party = new PartyForTesting();
    agreementRepository = new AgreementRepository() {

        @Override
        protected <T> T firstMatch(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderMethod.FIRST_MATCH);
            return null;
        }

        @Override
        protected List<Agreement> allInstances() {
            finderInteraction = new FinderInteraction(null, FinderMethod.ALL_INSTANCES);
            return null;
        }

        @Override
        protected <T> List<T> allMatches(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderMethod.ALL_MATCHES);
            return null;
        }
    };
}
Also used : AgreementType(org.estatio.module.agreement.dom.type.AgreementType) AgreementRoleType(org.estatio.module.agreement.dom.role.AgreementRoleType) List(java.util.List) PartyForTesting(org.estatio.module.party.dom.PartyForTesting) FinderInteraction(org.incode.module.unittestsupport.dom.repo.FinderInteraction) Before(org.junit.Before)

Aggregations

List (java.util.List)12 FinderInteraction (org.incode.module.unittestsupport.dom.repo.FinderInteraction)12 Before (org.junit.Before)12 LocalDate (org.joda.time.LocalDate)7 Property (org.estatio.module.asset.dom.Property)4 PartyForTesting (org.estatio.module.party.dom.PartyForTesting)4 AgreementType (org.estatio.module.agreement.dom.type.AgreementType)2 InvoiceRepository (org.estatio.module.invoice.dom.InvoiceRepository)2 Lease (org.estatio.module.lease.dom.Lease)2 FixturesInstallingEvent (org.apache.isis.applib.events.system.FixturesInstallingEvent)1 Bookmark (org.apache.isis.applib.services.bookmark.Bookmark)1 ClockService (org.apache.isis.applib.services.clock.ClockService)1 FixtureScriptsDefault (org.apache.isis.applib.services.fixturespec.FixtureScriptsDefault)1 QueryResultsCache (org.apache.isis.applib.services.queryresultscache.QueryResultsCache)1 AgreementRoleType (org.estatio.module.agreement.dom.role.AgreementRoleType)1 EstatioApplicationTenancyRepositoryForProperty (org.estatio.module.asset.dom.EstatioApplicationTenancyRepositoryForProperty)1 FixedAssetForTesting (org.estatio.module.asset.dom.FixedAssetForTesting)1 PropertyRepository (org.estatio.module.asset.dom.PropertyRepository)1 Unit (org.estatio.module.asset.dom.Unit)1 FixedAssetRoleRepository (org.estatio.module.asset.dom.role.FixedAssetRoleRepository)1