Search in sources :

Example 1 with ClockService

use of org.apache.isis.applib.services.clock.ClockService in project estatio by estatio.

the class DocFragments_for_Invoicing_Test method setUp.

@Before
public void setUp() throws Exception {
    clockService = new ClockService();
    fake = new FakeDataService();
    ReflectUtils.inject(fake, clockService);
    fake.init();
    freeMarkerService = new FreeMarkerService();
    ReflectUtils.inject(freeMarkerService, "configurationService", mockConfigurationService);
    final ImmutableMap<String, String> props = ImmutableMap.of();
    freeMarkerService.init(props);
    templateName = "Template name";
}
Also used : FakeDataService(org.isisaddons.module.fakedata.dom.FakeDataService) FreeMarkerService(org.isisaddons.module.freemarker.dom.service.FreeMarkerService) ClockService(org.apache.isis.applib.services.clock.ClockService) Before(org.junit.Before)

Example 2 with ClockService

use of org.apache.isis.applib.services.clock.ClockService in project estatio by estatio.

the class LeaseStatusService_Test method setUp.

@Before
public void setUp() throws Exception {
    lease = new Lease();
    service = new LeaseStatusService();
    service.clockService = new ClockService() {

        @Override
        public LocalDate now() {
            // TODO Auto-generated method stub
            return new LocalDate(2014, 4, 1);
        }
    };
}
Also used : Lease(org.estatio.module.lease.dom.Lease) LeaseStatusService(org.estatio.module.lease.dom.status.LeaseStatusService) ClockService(org.apache.isis.applib.services.clock.ClockService) LocalDate(org.joda.time.LocalDate) Before(org.junit.Before)

Example 3 with ClockService

use of org.apache.isis.applib.services.clock.ClockService 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)

Aggregations

ClockService (org.apache.isis.applib.services.clock.ClockService)3 Before (org.junit.Before)3 List (java.util.List)1 FixedAssetForTesting (org.estatio.module.asset.dom.FixedAssetForTesting)1 Property (org.estatio.module.asset.dom.Property)1 Lease (org.estatio.module.lease.dom.Lease)1 LeaseStatusService (org.estatio.module.lease.dom.status.LeaseStatusService)1 FinderInteraction (org.incode.module.unittestsupport.dom.repo.FinderInteraction)1 FakeDataService (org.isisaddons.module.fakedata.dom.FakeDataService)1 FreeMarkerService (org.isisaddons.module.freemarker.dom.service.FreeMarkerService)1 LocalDate (org.joda.time.LocalDate)1