dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #04323
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1417: Improved DataElementCategoryTest
------------------------------------------------------------
revno: 1417
committer: Lars Helge Oeverland <larshelge@xxxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-02-11 15:17:13 +0100
message:
Improved DataElementCategoryTest
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementCategoryStoreTest.java
--
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-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java 2010-02-04 09:59:45 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java 2010-02-11 14:17:13 +0000
@@ -70,6 +70,13 @@
this.categoryOptions = categoryOptions;
}
+ public DataElementCategory( String name, String conceptName, List<DataElementCategoryOption> categoryOptions )
+ {
+ this.name = name;
+ this.conceptName = conceptName;
+ this.categoryOptions = categoryOptions;
+ }
+
// -------------------------------------------------------------------------
// Dimension
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementCategoryStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementCategoryStoreTest.java 2009-10-27 15:12:01 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementCategoryStoreTest.java 2010-02-11 14:17:13 +0000
@@ -93,9 +93,9 @@
@Test
public void testAddGet()
{
- categoryA = new DataElementCategory( "CategoryA", categoryOptions );
- categoryB = new DataElementCategory( "CategoryB", categoryOptions );
- categoryC = new DataElementCategory( "CategoryC", categoryOptions );
+ categoryA = new DataElementCategory( "CategoryA", "ConceptA", categoryOptions );
+ categoryB = new DataElementCategory( "CategoryB", "ConceptB", categoryOptions );
+ categoryC = new DataElementCategory( "CategoryC", "ConceptC", categoryOptions );
int idA = categoryStore.save( categoryA );
int idB = categoryStore.save( categoryB );
@@ -104,6 +104,10 @@
assertEquals( categoryA, categoryStore.get( idA ) );
assertEquals( categoryB, categoryStore.get( idB ) );
assertEquals( categoryC, categoryStore.get( idC ) );
+
+ assertEquals( categoryA.getConceptName(), categoryStore.get( idA ).getConceptName() );
+ assertEquals( categoryB.getConceptName(), categoryStore.get( idB ).getConceptName() );
+ assertEquals( categoryC.getConceptName(), categoryStore.get( idC ).getConceptName() );
assertEquals( categoryOptions, categoryStore.get( idA ).getCategoryOptions() );
assertEquals( categoryOptions, categoryStore.get( idB ).getCategoryOptions() );