use of org.hisp.dhis.period.QuarterlyPeriodType in project dhis2-core by dhis2.
the class DataSetFrequencyComparatorTest method testB.
@Test
void testB() {
DataSet dsA = new DataSet("EA: Expenditures Site Level", new QuarterlyPeriodType());
DataSet dsB = new DataSet("MER Results: Facility Based", new QuarterlyPeriodType());
DataSet dsC = new DataSet("MER Results: Facility Based - DoD ONLY", new QuarterlyPeriodType());
List<DataSet> list = Lists.newArrayList(dsB, dsC, dsA);
Collections.sort(list, DataSetFrequencyComparator.INSTANCE);
assertEquals(dsA, list.get(0));
assertEquals(dsB, list.get(1));
assertEquals(dsC, list.get(2));
}
use of org.hisp.dhis.period.QuarterlyPeriodType in project dhis2-core by dhis2.
the class DataSetApprovalFrequencyComparatorTest method testD.
@Test
void testD() {
DataSet dsA = new DataSet("EA: Expenditures Site Level", new QuarterlyPeriodType());
DataSet dsB = new DataSet("MER Results: Facility Based", new QuarterlyPeriodType());
DataSet dsC = new DataSet("MER Results: Facility Based - DoD ONLY", new QuarterlyPeriodType());
DataApprovalWorkflow workflow = new DataApprovalWorkflow("Workflow A", new QuarterlyPeriodType(), null);
dsB.assignWorkflow(workflow);
DataElement deA = new DataElement();
dsA.addDataSetElement(deA);
dsB.addDataSetElement(deA);
dsC.addDataSetElement(deA);
assertEquals(dsB, deA.getApprovalDataSet());
}
use of org.hisp.dhis.period.QuarterlyPeriodType in project dhis2-core by dhis2.
the class DataSetApprovalFrequencyComparatorTest method testA.
@Test
void testA() {
DataSet dsA = new DataSet("DataSetA", new YearlyPeriodType());
DataSet dsB = new DataSet("DataSetB", new YearlyPeriodType());
DataSet dsC = new DataSet("DataSetC", new MonthlyPeriodType());
DataSet dsD = new DataSet("DataSetD", new QuarterlyPeriodType());
DataApprovalWorkflow workflow = new DataApprovalWorkflow("Workflow A", new QuarterlyPeriodType(), null);
dsA.assignWorkflow(workflow);
dsD.assignWorkflow(workflow);
List<DataSet> list = Lists.newArrayList(dsA, dsC, dsB, dsD);
Collections.sort(list, DataSetApprovalFrequencyComparator.INSTANCE);
assertEquals(dsD, list.get(0));
assertEquals(dsA, list.get(1));
assertEquals(dsC, list.get(2));
assertEquals(dsB, list.get(3));
}
Aggregations