Search in sources :

Example 11 with PartnerResult

use of org.activityinfo.legacy.shared.command.result.PartnerResult in project activityinfo by bedatadriven.

the class GetPartnersDimensionHandlerTest method testSiteCountIndicators.

@Test
@OnDataSet("/dbunit/sites-simple1.db.xml")
public void testSiteCountIndicators() throws CommandException {
    /*
        Activity #1
        Indicator #103 (site count)
        Indicator #675 (site count)
        
        Site #1: Partner #1
        Site #2: Partner #1
        Site #3: partner #2
        */
    // empty
    PartnerResult result = execute(DimensionType.Indicator, 103, 675);
    // indicators 103 and 675 are site count indicators, so all sites of activity #1
    // should have a non empty value and be considered present
    assertThat(result.getData().size(), equalTo(2));
}
Also used : PartnerResult(org.activityinfo.legacy.shared.command.result.PartnerResult) OnDataSet(org.activityinfo.server.database.OnDataSet) Test(org.junit.Test)

Example 12 with PartnerResult

use of org.activityinfo.legacy.shared.command.result.PartnerResult in project activityinfo by bedatadriven.

the class GetPartnersDimensionHandlerTest method testIndicatorLinked2.

@Test
@OnDataSet("/dbunit/sites-linked.db.xml")
public void testIndicatorLinked2() throws CommandException {
    /*
        Database #1 > Activity #1 (once)
        Site #2: Partner #1 
        I1=400
        
        Database #2 > Activity #2 (once)
        Site #1: Partner #1
        I3=1500
        
        Links
        I3 -> I2
        */
    // NRC
    PartnerResult result = execute(DimensionType.Indicator, 2);
    assertThat(result.getData().size(), equalTo(1));
    assertThat(result.getData().get(0).getName(), equalTo("NRC"));
}
Also used : PartnerResult(org.activityinfo.legacy.shared.command.result.PartnerResult) OnDataSet(org.activityinfo.server.database.OnDataSet) Test(org.junit.Test)

Example 13 with PartnerResult

use of org.activityinfo.legacy.shared.command.result.PartnerResult in project activityinfo by bedatadriven.

the class GetPartnersDimensionHandlerTest method testIndicatorLinked12100.

@Test
@OnDataSet("/dbunit/sites-linked.db.xml")
public void testIndicatorLinked12100() throws CommandException {
    // NRC, NRC2
    PartnerResult result = execute(DimensionType.Indicator, 1, 2, 100);
    assertThat(result.getData().size(), equalTo(2));
    assertThat(result.getData().get(0).getName(), equalTo("NRC"));
    assertThat(result.getData().get(1).getName(), equalTo("NRC2"));
}
Also used : PartnerResult(org.activityinfo.legacy.shared.command.result.PartnerResult) OnDataSet(org.activityinfo.server.database.OnDataSet) Test(org.junit.Test)

Aggregations

PartnerResult (org.activityinfo.legacy.shared.command.result.PartnerResult)13 OnDataSet (org.activityinfo.server.database.OnDataSet)9 Test (org.junit.Test)9 GetPartnersDimension (org.activityinfo.legacy.shared.command.GetPartnersDimension)3 PartnerDTO (org.activityinfo.legacy.shared.model.PartnerDTO)3 Filter (org.activityinfo.legacy.shared.command.Filter)2 LocalDate (com.bedatadriven.rebar.time.calendar.LocalDate)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Set (java.util.Set)1 PivotSites (org.activityinfo.legacy.shared.command.PivotSites)1 Bucket (org.activityinfo.legacy.shared.command.result.Bucket)1 EntityCategory (org.activityinfo.legacy.shared.reports.content.EntityCategory)1 Dimension (org.activityinfo.legacy.shared.reports.model.Dimension)1