=== modified file 'dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java' --- dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java 2014-04-25 10:44:39 +0000 +++ dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java 2014-04-25 10:57:34 +0000 @@ -409,6 +409,7 @@ public static DataElement createDataElement( char uniqueCharacter ) { DataElement dataElement = new DataElement(); + dataElement.setAutoFields(); dataElement.setUid( BASE_DE_UID + uniqueCharacter ); dataElement.setName( "DataElement" + uniqueCharacter ); @@ -482,6 +483,7 @@ { DataElementCategoryCombo categoryCombo = new DataElementCategoryCombo( "CategoryCombo" + categoryComboUniqueIdentifier, new ArrayList() ); + categoryCombo.setAutoFields(); for ( DataElementCategory category : categories ) { @@ -502,6 +504,7 @@ char... categoryOptionUniqueIdentifiers ) { DataElementCategoryOptionCombo categoryOptionCombo = new DataElementCategoryOptionCombo(); + categoryOptionCombo.setAutoFields(); categoryOptionCombo.setCategoryCombo( new DataElementCategoryCombo( "CategoryCombo" + categoryComboUniqueIdentifier ) ); @@ -527,6 +530,7 @@ DataElementCategoryOption... categoryOptions ) { DataElementCategoryOptionCombo categoryOptionCombo = new DataElementCategoryOptionCombo(); + categoryOptionCombo.setAutoFields(); categoryOptionCombo.setCategoryCombo( dataElementCategoryCombo ); @@ -549,6 +553,7 @@ DataElementCategoryOption... categoryOptions ) { DataElementCategoryOptionCombo categoryOptionCombo = new DataElementCategoryOptionCombo(); + categoryOptionCombo.setAutoFields(); categoryOptionCombo.setCategoryCombo( categoryCombo ); @@ -643,6 +648,7 @@ public static DataElementGroup createDataElementGroup( char uniqueCharacter ) { DataElementGroup group = new DataElementGroup(); + group.setAutoFields(); group.setUid( BASE_UID + uniqueCharacter ); group.setName( "DataElementGroup" + uniqueCharacter ); @@ -658,6 +664,7 @@ public static DataElementGroupSet createDataElementGroupSet( char uniqueCharacter ) { DataElementGroupSet groupSet = new DataElementGroupSet(); + groupSet.setAutoFields(); groupSet.setUid( BASE_UID + uniqueCharacter ); groupSet.setName( "DataElementGroupSet" + uniqueCharacter ); @@ -671,6 +678,7 @@ public static DataDictionary createDataDictionary( char uniqueCharacter ) { DataDictionary dictionary = new DataDictionary(); + dictionary.setAutoFields(); dictionary.setName( "DataDictionary" + uniqueCharacter ); dictionary.setDescription( "Description" + uniqueCharacter ); @@ -685,6 +693,7 @@ public static IndicatorType createIndicatorType( char uniqueCharacter ) { IndicatorType type = new IndicatorType(); + type.setAutoFields(); type.setName( "IndicatorType" + uniqueCharacter ); type.setFactor( 100 ); @@ -699,6 +708,7 @@ public static Indicator createIndicator( char uniqueCharacter, IndicatorType type ) { Indicator indicator = new Indicator(); + indicator.setAutoFields(); indicator.setUid( BASE_IN_UID + uniqueCharacter ); indicator.setName( "Indicator" + uniqueCharacter ); @@ -721,6 +731,7 @@ public static IndicatorGroup createIndicatorGroup( char uniqueCharacter ) { IndicatorGroup group = new IndicatorGroup(); + group.setAutoFields(); group.setUid( BASE_UID + uniqueCharacter ); group.setName( "IndicatorGroup" + uniqueCharacter ); @@ -734,6 +745,7 @@ public static IndicatorGroupSet createIndicatorGroupSet( char uniqueCharacter ) { IndicatorGroupSet groupSet = new IndicatorGroupSet(); + groupSet.setAutoFields(); groupSet.setUid( BASE_UID + uniqueCharacter ); groupSet.setName( "IndicatorGroupSet" + uniqueCharacter ); @@ -748,6 +760,7 @@ public static DataSet createDataSet( char uniqueCharacter, PeriodType periodType ) { DataSet dataSet = new DataSet(); + dataSet.setAutoFields(); dataSet.setUid( BASE_DS_UID + uniqueCharacter ); dataSet.setName( "DataSet" + uniqueCharacter ); @@ -764,6 +777,7 @@ public static OrganisationUnit createOrganisationUnit( char uniqueCharacter ) { OrganisationUnit unit = new OrganisationUnit(); + unit.setAutoFields(); unit.setUid( BASE_OU_UID + uniqueCharacter ); unit.setName( "OrganisationUnit" + uniqueCharacter ); @@ -797,6 +811,7 @@ public static OrganisationUnitGroup createOrganisationUnitGroup( char uniqueCharacter ) { OrganisationUnitGroup group = new OrganisationUnitGroup(); + group.setAutoFields(); group.setUid( BASE_UID + uniqueCharacter ); group.setName( "OrganisationUnitGroup" + uniqueCharacter ); @@ -812,6 +827,7 @@ public static OrganisationUnitGroupSet createOrganisationUnitGroupSet( char uniqueCharacter ) { OrganisationUnitGroupSet groupSet = new OrganisationUnitGroupSet(); + groupSet.setAutoFields(); groupSet.setName( "OrganisationUnitGroupSet" + uniqueCharacter ); groupSet.setDescription( "Description" + uniqueCharacter ); @@ -828,6 +844,7 @@ public static Period createPeriod( PeriodType type, Date startDate, Date endDate ) { Period period = new Period(); + period.setAutoFields(); period.setPeriodType( type ); period.setStartDate( startDate ); @@ -851,6 +868,7 @@ public static Period createPeriod( Date startDate, Date endDate ) { Period period = new Period(); + period.setAutoFields(); period.setPeriodType( new MonthlyPeriodType() ); period.setStartDate( startDate ); @@ -950,6 +968,7 @@ Expression rightSide, PeriodType periodType ) { ValidationRule validationRule = new ValidationRule(); + validationRule.setAutoFields(); validationRule.setName( "ValidationRule" + uniqueCharacter ); validationRule.setDescription( "Description" + uniqueCharacter ); @@ -984,6 +1003,7 @@ int annualSampleCount, int highOutliers, int lowOutliers ) { ValidationRule validationRule = new ValidationRule(); + validationRule.setAutoFields(); validationRule.setName( "MonitoringRule" + uniqueCharacter ); validationRule.setDescription( "Description" + uniqueCharacter ); @@ -1009,6 +1029,7 @@ public static ValidationRuleGroup createValidationRuleGroup( char uniqueCharacter ) { ValidationRuleGroup group = new ValidationRuleGroup(); + group.setAutoFields(); group.setName( "ValidationRuleGroup" + uniqueCharacter ); group.setDescription( "Description" + uniqueCharacter ); @@ -1064,6 +1085,7 @@ public static MapLegend createMapLegend( char uniqueCharacter, Double startValue, Double endValue ) { MapLegend legend = new MapLegend(); + legend.setAutoFields(); legend.setName( "MapLegend" + uniqueCharacter ); legend.setStartValue( startValue ); @@ -1076,6 +1098,7 @@ public static MapLegendSet createMapLegendSet( char uniqueCharacter ) { MapLegendSet legendSet = new MapLegendSet(); + legendSet.setAutoFields(); legendSet.setName( "MapLegendSet" + uniqueCharacter ); @@ -1086,6 +1109,7 @@ List units ) { Chart chart = new Chart(); + chart.setAutoFields(); chart.setName( "Chart" + uniqueCharacter ); chart.setIndicators( indicators ); @@ -1119,6 +1143,7 @@ public static UserGroup createUserGroup( char uniqueCharacter, Set users ) { UserGroup userGroup = new UserGroup(); + userGroup.setAutoFields(); userGroup.setName( "UserGroup" + uniqueCharacter ); userGroup.setMembers( users ); @@ -1130,6 +1155,7 @@ OrganisationUnit organisationUnit ) { Program program = new Program(); + program.setAutoFields(); program.setName( "Program" + uniqueCharacter ); program.setDescription( "Description" + uniqueCharacter ); @@ -1159,6 +1185,7 @@ public static ProgramStage createProgramStage( char uniqueCharacter, int minDays, boolean irregular ) { ProgramStage programStage = new ProgramStage(); + programStage.setAutoFields(); programStage.setName( "ProgramStage" + uniqueCharacter ); programStage.setDescription( "description" + uniqueCharacter ); @@ -1221,6 +1248,7 @@ public static TrackedEntityAttribute createTrackedEntityAttribute( char uniqueChar ) { TrackedEntityAttribute attribute = new TrackedEntityAttribute(); + attribute.setAutoFields(); attribute.setName( "Attribute" + uniqueChar ); attribute.setDescription( "Attribute" + uniqueChar ); @@ -1236,6 +1264,7 @@ public static TrackedEntityAttribute createTrackedEntityAttribute( char uniqueChar, String type ) { TrackedEntityAttribute attribute = new TrackedEntityAttribute(); + attribute.setAutoFields(); attribute.setName( "Attribute" + uniqueChar ); attribute.setDescription( "Attribute" + uniqueChar ); @@ -1251,6 +1280,7 @@ public static TrackedEntityAttributeGroup createTrackedEntityAttributeGroup( char uniqueChar, List attributes ) { TrackedEntityAttributeGroup attributeGroup = new TrackedEntityAttributeGroup(); + attributeGroup.setAutoFields(); attributeGroup.setName( "TrackedEntityAttributeGroup" + uniqueChar ); attributeGroup.setDescription( "TrackedEntityAttributeGroup" + uniqueChar ); @@ -1267,6 +1297,7 @@ String value ) { ValidationCriteria validationCriteria = new ValidationCriteria(); + validationCriteria.setAutoFields(); validationCriteria.setName( "ValidationCriteria" + uniqueCharacter ); validationCriteria.setDescription( "Description" + uniqueCharacter ); @@ -1284,6 +1315,7 @@ public static RelationshipType createRelationshipType( char uniqueChar ) { RelationshipType relationshipType = new RelationshipType(); + relationshipType.setAutoFields(); relationshipType.setaIsToB( "aIsToB" ); relationshipType.setbIsToA( "bIsToA" ); @@ -1300,6 +1332,7 @@ protected static SqlView createSqlView( char uniqueCharacter, String sql ) { SqlView sqlView = new SqlView(); + sqlView.setAutoFields(); sqlView.setName( "SqlView" + uniqueCharacter ); sqlView.setDescription( "Description" + uniqueCharacter ); @@ -1315,6 +1348,7 @@ protected static Concept createConcept( char uniqueCharacter ) { Concept concept = new Concept(); + concept.setAutoFields(); concept.setName( "Concept" + uniqueCharacter ); @@ -1329,6 +1363,7 @@ protected static Constant createConstant( char uniqueCharacter, double value ) { Constant constant = new Constant(); + constant.setAutoFields(); constant.setName( "Constant" + uniqueCharacter ); constant.setValue( value );