Search in sources :

Example 1 with AllocationSchemeService

use of org.finos.waltz.service.allocation_schemes.AllocationSchemeService in project waltz by khartec.

the class AllocationHarness method main.

public static void main(String[] args) {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    DSLContext dsl = ctx.getBean(DSLContext.class);
    AllocationSchemeService schemesService = ctx.getBean(AllocationSchemeService.class);
    MeasurableService measurableService = ctx.getBean(MeasurableService.class);
    MeasurableCategoryDao categoryDao = ctx.getBean(MeasurableCategoryDao.class);
    MeasurableRatingService ratingService = ctx.getBean(MeasurableRatingService.class);
    ApplicationService applicationService = ctx.getBean(ApplicationService.class);
    Tuple4<Application, MeasurableCategory, List<Measurable>, AllocationScheme> stuff = setup(dsl, schemesService, measurableService, categoryDao, applicationService);
    addRating(ratingService, stuff, 0);
    addRating(ratingService, stuff, 1);
    // addRating(ratingService, stuff, 2);
    // addAllocation(dsl, stuff, 0, 50);
    addAllocation(dsl, stuff, 1, 20);
    Long measurableCategory = stuff.v2.id().get();
    dumpRatings(dsl, stuff.v4);
    dumpAllocs(dsl, stuff.v4);
    doDiff(dsl, measurableCategory);
    System.out.println(ratingService.findByCategory(measurableCategory));
}
Also used : MeasurableRatingService(org.finos.waltz.service.measurable_rating.MeasurableRatingService) ImmutableAllocationScheme(org.finos.waltz.model.allocation_scheme.ImmutableAllocationScheme) AllocationScheme(org.finos.waltz.model.allocation_scheme.AllocationScheme) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) MeasurableService(org.finos.waltz.service.measurable.MeasurableService) MeasurableCategoryDao(org.finos.waltz.data.measurable_category.MeasurableCategoryDao) AllocationSchemeService(org.finos.waltz.service.allocation_schemes.AllocationSchemeService) MeasurableCategory(org.finos.waltz.model.measurable_category.MeasurableCategory) List(java.util.List) ApplicationService(org.finos.waltz.service.application.ApplicationService)

Aggregations

List (java.util.List)1 MeasurableCategoryDao (org.finos.waltz.data.measurable_category.MeasurableCategoryDao)1 AllocationScheme (org.finos.waltz.model.allocation_scheme.AllocationScheme)1 ImmutableAllocationScheme (org.finos.waltz.model.allocation_scheme.ImmutableAllocationScheme)1 MeasurableCategory (org.finos.waltz.model.measurable_category.MeasurableCategory)1 AllocationSchemeService (org.finos.waltz.service.allocation_schemes.AllocationSchemeService)1 ApplicationService (org.finos.waltz.service.application.ApplicationService)1 MeasurableService (org.finos.waltz.service.measurable.MeasurableService)1 MeasurableRatingService (org.finos.waltz.service.measurable_rating.MeasurableRatingService)1 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)1