Skip to content

Commit

Permalink
Merge pull request #1626 from dhis2/1.4.3-rc
Browse files Browse the repository at this point in the history
feat: [1.4.3] Release 1.4.3
  • Loading branch information
vgarciabnz committed Sep 10, 2021
2 parents 476b5be + fce6978 commit 490e60c
Show file tree
Hide file tree
Showing 593 changed files with 23,629 additions and 4,443 deletions.
4 changes: 2 additions & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ ext {
buildToolsVersion: "29.0.3",
minSdkVersion : 19,
targetSdkVersion : 29,
versionCode : 242,
versionName : "1.4.2"
versionCode : 243,
versionName : "1.4.3"
]

libraries = [
Expand Down
2 changes: 1 addition & 1 deletion core/config/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ complexity:
ComplexMethod:
active: true
threshold: 15
ignoreSingleWhenExpression: false
ignoreSingleWhenExpression: true
ignoreSimpleWhenEntries: false
ignoreNestingFunctions: false
nestingFunctions: [run, let, apply, with, also, use, forEach, isNotNull, ifNull]
Expand Down
4 changes: 2 additions & 2 deletions core/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
# Properties which are consumed by plugins/gradle-mvn-push.gradle plugin.
# They are used for publishing artifact to snapshot repository.

VERSION_NAME=1.4.2
VERSION_CODE=242
VERSION_NAME=1.4.3
VERSION_CODE=243

GROUP=org.hisp.dhis

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/*
* Copyright (c) 2004-2021, University of Oslo
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of the HISP project nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void response_successful_on_sync_meta_data_once() throws Exception {
d2.userModule().logIn(username, password, url).blockingGet();

d2.metadataModule().blockingDownload();


//TODO: add additional sync + break point.
//when debugger stops at the new break point manually change metadata online & resume.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/*
* Copyright (c) 2004-2021, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of the HISP project nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.hisp.dhis.android.core.analytics.aggregated.internal.evaluator

import com.google.common.truth.Truth.assertThat
import org.hisp.dhis.android.core.analytics.aggregated.Dimension
import org.hisp.dhis.android.core.analytics.aggregated.DimensionItem
import org.hisp.dhis.android.core.common.RelativeOrganisationUnit
import org.hisp.dhis.android.core.utils.integration.mock.BaseMockIntegrationTestFullDispatcher
import org.junit.Test

class AnalyticsVisualizationRepositoryIntegrationShould : BaseMockIntegrationTestFullDispatcher() {

private val visualizationUid = "FAFa11yFeFe"

@Test
fun evaluate_visualization() {
val result = d2.analyticsModule().visualizations()
.withVisualization(visualizationUid)
.blockingEvaluate()

assertThat(result.dimensions.columns.size).isEqualTo(1)
assertThat(result.dimensions.rows.size).isEqualTo(1)
assertThat(result.dimensionItems[Dimension.Data]!!.size).isEqualTo(1)
assertThat(result.dimensionItems[Dimension.OrganisationUnit]!!.size).isEqualTo(1)
assertThat(result.dimensionItems[Dimension.Period]!!.size).isEqualTo(3)
assertThat(result.metadata).isNotEmpty()
assertThat(result.values.size).isEqualTo(3)
}

@Test
fun evaluate_visualization_wit_periods() {
val result = d2.analyticsModule().visualizations()
.withVisualization(visualizationUid)
.withPeriods(listOf(DimensionItem.PeriodItem.Absolute("2018")))
.blockingEvaluate()

assertThat(result.dimensions.columns.size).isEqualTo(1)
assertThat(result.dimensions.rows.size).isEqualTo(1)
assertThat(result.dimensionItems[Dimension.Data]!!.size).isEqualTo(1)
assertThat(result.dimensionItems[Dimension.OrganisationUnit]!!.size).isEqualTo(1)
assertThat(result.dimensionItems[Dimension.Period]).isEqualTo(
listOf(
DimensionItem.PeriodItem.Absolute("2018")
)
)
assertThat(result.metadata).isNotEmpty()
assertThat(result.values.size).isEqualTo(1)
}

@Test
fun evaluate_visualization_wit_organisation_units() {
val result = d2.analyticsModule().visualizations()
.withVisualization(visualizationUid)
.withOrganisationUnits(
listOf(
DimensionItem.OrganisationUnitItem.Relative(RelativeOrganisationUnit.USER_ORGUNIT)
)
)
.blockingEvaluate()

assertThat(result.dimensions.columns.size).isEqualTo(1)
assertThat(result.dimensions.rows.size).isEqualTo(1)
assertThat(result.dimensionItems[Dimension.Data]!!.size).isEqualTo(1)
assertThat(result.dimensionItems[Dimension.OrganisationUnit]).isEqualTo(
listOf(
DimensionItem.OrganisationUnitItem.Relative(RelativeOrganisationUnit.USER_ORGUNIT)
)
)
assertThat(result.dimensionItems[Dimension.Period]!!.size).isEqualTo(3)
assertThat(result.metadata).isNotEmpty()
assertThat(result.values.size).isEqualTo(3)
}
}
Loading

0 comments on commit 490e60c

Please sign in to comment.