Search in sources :

Example 1 with DefaultProgramIndicatorSubqueryBuilder

use of org.hisp.dhis.analytics.event.data.programindicator.DefaultProgramIndicatorSubqueryBuilder in project dhis2-core by dhis2.

the class AbstractJdbcEventAnalyticsManagerTest method setUp.

@BeforeEach
public void setUp() {
    StatementBuilder statementBuilder = new PostgreSQLStatementBuilder();
    DefaultProgramIndicatorSubqueryBuilder programIndicatorSubqueryBuilder = new DefaultProgramIndicatorSubqueryBuilder(programIndicatorService);
    subject = new JdbcEventAnalyticsManager(jdbcTemplate, statementBuilder, programIndicatorService, programIndicatorSubqueryBuilder, new EventTimeFieldSqlRenderer(statementBuilder), executionPlanStore);
    // data init
    programA = createProgram('A');
    dataElementA = createDataElement('A', ValueType.INTEGER, AggregationType.SUM);
    dataElementA.setUid("fWIAEtYVEGk");
}
Also used : PostgreSQLStatementBuilder(org.hisp.dhis.jdbc.statementbuilder.PostgreSQLStatementBuilder) StatementBuilder(org.hisp.dhis.jdbc.StatementBuilder) DefaultProgramIndicatorSubqueryBuilder(org.hisp.dhis.analytics.event.data.programindicator.DefaultProgramIndicatorSubqueryBuilder) PostgreSQLStatementBuilder(org.hisp.dhis.jdbc.statementbuilder.PostgreSQLStatementBuilder) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with DefaultProgramIndicatorSubqueryBuilder

use of org.hisp.dhis.analytics.event.data.programindicator.DefaultProgramIndicatorSubqueryBuilder in project dhis2-core by dhis2.

the class EnrollmentAnalyticsManagerTest method setUp.

@BeforeEach
public void setUp() {
    when(jdbcTemplate.queryForRowSet(anyString())).thenReturn(this.rowSet);
    StatementBuilder statementBuilder = new PostgreSQLStatementBuilder();
    DefaultProgramIndicatorSubqueryBuilder programIndicatorSubqueryBuilder = new DefaultProgramIndicatorSubqueryBuilder(programIndicatorService);
    subject = new JdbcEnrollmentAnalyticsManager(jdbcTemplate, statementBuilder, programIndicatorService, programIndicatorSubqueryBuilder, new EnrollmentTimeFieldSqlRenderer(statementBuilder), executionPlanStore);
}
Also used : PostgreSQLStatementBuilder(org.hisp.dhis.jdbc.statementbuilder.PostgreSQLStatementBuilder) StatementBuilder(org.hisp.dhis.jdbc.StatementBuilder) DefaultProgramIndicatorSubqueryBuilder(org.hisp.dhis.analytics.event.data.programindicator.DefaultProgramIndicatorSubqueryBuilder) PostgreSQLStatementBuilder(org.hisp.dhis.jdbc.statementbuilder.PostgreSQLStatementBuilder) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 3 with DefaultProgramIndicatorSubqueryBuilder

use of org.hisp.dhis.analytics.event.data.programindicator.DefaultProgramIndicatorSubqueryBuilder in project dhis2-core by dhis2.

the class EventsAnalyticsManagerTest method setUp.

@BeforeEach
public void setUp() {
    StatementBuilder statementBuilder = new PostgreSQLStatementBuilder();
    EventTimeFieldSqlRenderer timeCoordinateSelector = new EventTimeFieldSqlRenderer(statementBuilder);
    ProgramIndicatorService programIndicatorService = mock(ProgramIndicatorService.class);
    DefaultProgramIndicatorSubqueryBuilder programIndicatorSubqueryBuilder = new DefaultProgramIndicatorSubqueryBuilder(programIndicatorService);
    subject = new JdbcEventAnalyticsManager(jdbcTemplate, statementBuilder, programIndicatorService, programIndicatorSubqueryBuilder, timeCoordinateSelector, executionPlanStore);
    when(jdbcTemplate.queryForRowSet(anyString())).thenReturn(this.rowSet);
}
Also used : PostgreSQLStatementBuilder(org.hisp.dhis.jdbc.statementbuilder.PostgreSQLStatementBuilder) StatementBuilder(org.hisp.dhis.jdbc.StatementBuilder) DefaultProgramIndicatorSubqueryBuilder(org.hisp.dhis.analytics.event.data.programindicator.DefaultProgramIndicatorSubqueryBuilder) PostgreSQLStatementBuilder(org.hisp.dhis.jdbc.statementbuilder.PostgreSQLStatementBuilder) ProgramIndicatorService(org.hisp.dhis.program.ProgramIndicatorService) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

DefaultProgramIndicatorSubqueryBuilder (org.hisp.dhis.analytics.event.data.programindicator.DefaultProgramIndicatorSubqueryBuilder)3 StatementBuilder (org.hisp.dhis.jdbc.StatementBuilder)3 PostgreSQLStatementBuilder (org.hisp.dhis.jdbc.statementbuilder.PostgreSQLStatementBuilder)3 BeforeEach (org.junit.jupiter.api.BeforeEach)3 ProgramIndicatorService (org.hisp.dhis.program.ProgramIndicatorService)1