dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #43835
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 22227: more tests for program (noreg), changes import order of PS / PSDE
------------------------------------------------------------
revno: 22227
committer: Morten Olav Hansen <morten@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2016-03-10 15:29:00 +0700
message:
more tests for program (noreg), changes import order of PS / PSDE
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/descriptors/ProgramStageDataElementSchemaDescriptor.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/descriptors/ProgramStageSchemaDescriptor.java
dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceProgramTest.java
dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/program_noreg.json
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/descriptors/ProgramStageDataElementSchemaDescriptor.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/descriptors/ProgramStageDataElementSchemaDescriptor.java 2016-03-10 03:41:51 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/descriptors/ProgramStageDataElementSchemaDescriptor.java 2016-03-10 08:29:00 +0000
@@ -53,7 +53,7 @@
{
Schema schema = new Schema( ProgramStageDataElement.class, SINGULAR, PLURAL );
schema.setRelativeApiEndpoint( API_ENDPOINT );
- schema.setOrder( 1509 );
+ schema.setOrder( 1510 );
schema.getAuthorities().add( new Authority( AuthorityType.CREATE, Lists.newArrayList( "F_PROGRAMSTAGE_ADD" ) ) );
schema.getAuthorities().add( new Authority( AuthorityType.DELETE, Lists.newArrayList( "F_PROGRAMSTAGE_DELETE" ) ) );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/descriptors/ProgramStageSchemaDescriptor.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/descriptors/ProgramStageSchemaDescriptor.java 2016-03-10 03:41:51 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/descriptors/ProgramStageSchemaDescriptor.java 2016-03-10 08:29:00 +0000
@@ -53,7 +53,7 @@
{
Schema schema = new Schema( ProgramStage.class, SINGULAR, PLURAL );
schema.setRelativeApiEndpoint( API_ENDPOINT );
- schema.setOrder( 1510 );
+ schema.setOrder( 1509 );
schema.getAuthorities().add( new Authority( AuthorityType.CREATE, Lists.newArrayList( "F_PROGRAMSTAGE_ADD" ) ) );
schema.getAuthorities().add( new Authority( AuthorityType.DELETE, Lists.newArrayList( "F_PROGRAMSTAGE_DELETE" ) ) );
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceProgramTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceProgramTest.java 2016-03-10 07:49:05 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceProgramTest.java 2016-03-10 08:29:00 +0000
@@ -37,6 +37,7 @@
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramStage;
+import org.hisp.dhis.program.ProgramStageDataElement;
import org.hisp.dhis.render.RenderFormat;
import org.hisp.dhis.render.RenderService;
import org.hisp.dhis.user.User;
@@ -98,6 +99,7 @@
List<ValidationRule> validationRules = manager.getAll( ValidationRule.class );
List<Program> programs = manager.getAll( Program.class );
List<ProgramStage> programStages = manager.getAll( ProgramStage.class );
+ List<ProgramStageDataElement> programStageDataElements = manager.getAll( ProgramStageDataElement.class );
assertFalse( dataSets.isEmpty() );
assertFalse( organisationUnits.isEmpty() );
@@ -107,5 +109,9 @@
assertEquals( 1, validationRules.size() );
assertEquals( 1, programs.size() );
assertEquals( 1, programStages.size() );
+ assertEquals( 3, programStageDataElements.size() );
+
+ ProgramStage programStage = programStages.get( 0 );
+ assertEquals( 3, programStage.getProgramStageDataElements().size() );
}
}
\ No newline at end of file
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/program_noreg.json'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/program_noreg.json 2016-03-10 07:49:05 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/program_noreg.json 2016-03-10 08:29:00 +0000
@@ -81,30 +81,6 @@
"trackedEntityInstanceReminders": [ ]
}
],
- "trackedEntityAttributes": [
- {
- "searchScope": "SEARCH_ORG_UNITS",
- "confidential": false,
- "unique": false,
- "displayOnVisitSchedule": false,
- "displayInListNoProgram": false,
- "shortName": "TrackedEntityAttributeA",
- "attributeValues": [ ],
- "lastUpdated": "2016-03-10T07:26:32.131+0000",
- "user": {
- "id": "ZK1wkC59FCw"
- },
- "inherit": false,
- "name": "TrackedEntityAttributeA",
- "id": "CXsesjOaSzr",
- "programScope": false,
- "publicAccess": "rw------",
- "orgunitScope": false,
- "userGroupAccesses": [ ],
- "valueType": "TEXT",
- "created": "2016-03-10T07:25:57.406+0000"
- }
- ],
"validationRules": [
{
"rightSide": {
@@ -309,20 +285,6 @@
"shortName": "DataElementShortF"
}
],
- "trackedEntityAttributeGroups": [
- {
- "trackedEntityAttributes": [
- {
- "id": "CXsesjOaSzr"
- }
- ],
- "name": "TrackedEntityAttributeGroupA",
- "lastUpdated": "2016-03-10T07:26:43.665+0000",
- "created": "2016-03-10T07:26:43.664+0000",
- "id": "VUd5jP8cbjQ",
- "description": "TrackedEntityAttributeGroupA"
- }
- ],
"users": [
{
"lastUpdated": "2016-03-10T05:01:28.993+0000",