Search in sources :

Example 6 with PartnerResult

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

the class GetPartnersDimensionHandlerTest method testIndicatorValues.

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

Example 7 with PartnerResult

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

the class GetPartnersDimensionHandlerTest method testIndicatorLinked1.

@Test
@OnDataSet("/dbunit/sites-linked.db.xml")
public void testIndicatorLinked1() throws CommandException {
    // NRC, NRC2
    PartnerResult result = execute(DimensionType.Indicator, 1);
    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)

Example 8 with PartnerResult

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

the class GetPartnersDimensionHandlerTest method testIndicatorLinked100.

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

Example 9 with PartnerResult

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

the class GetPartnersDimensionHandlerTest method execute.

private PartnerResult execute(DimensionType type, Integer... params) {
    setUser(1);
    Filter filter = new Filter();
    if (type != null) {
        filter.addRestriction(type, Arrays.asList(params));
    }
    PartnerResult results = execute(filter);
    System.out.println(results.getData());
    return results;
}
Also used : PartnerResult(org.activityinfo.legacy.shared.command.result.PartnerResult)

Example 10 with PartnerResult

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

the class GetPartnersDimensionHandlerTest method testEmptyFilter.

// empty
@Test
@OnDataSet("/dbunit/sites-simple1.db.xml")
public void testEmptyFilter() throws CommandException {
    PartnerResult result = this.execute();
    assertThat(result.getData().size(), equalTo(0));
}
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