dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #15941
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5896: added unit test for getDataElementCategoryOptionCombo( Collection<DataElementCategoryOption> cate...
------------------------------------------------------------
revno: 5896
committer: bobjolliffe <bobjolliffe@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-02-08 22:29:28 +0000
message:
added unit test for getDataElementCategoryOptionCombo( Collection<DataElementCategoryOption> categoryOptions )
modified:
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementCategoryOptionComboServiceTest.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-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementCategoryOptionComboServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementCategoryOptionComboServiceTest.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementCategoryOptionComboServiceTest.java 2012-02-08 22:29:28 +0000
@@ -33,6 +33,7 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.LinkedList;
import java.util.List;
import org.hisp.dhis.DhisSpringTest;
@@ -127,6 +128,22 @@
assertEquals( categoryComboA, categoryOptionComboA.getCategoryCombo() );
assertEquals( categoryOptions, categoryOptionComboA.getCategoryOptions() );
}
+
+ @Test
+ public void testGetDataElementCategoryOptionCombo()
+ {
+ categoryService.generateOptionCombos( categoryComboA );
+
+ DataElementCategoryOption catopt1 = new DataElementCategoryOption("Male");
+ DataElementCategoryOption catopt2 = new DataElementCategoryOption("0-20");
+
+ Collection<DataElementCategoryOption> catopts = new LinkedList<DataElementCategoryOption>();
+ catopts.add( catopt1 );
+ catopts.add( catopt2 );
+
+ DataElementCategoryOptionCombo catoptcombo = categoryService.getDataElementCategoryOptionCombo( catopts );
+ assertNotNull(catoptcombo);
+ }
@Test
public void testUpdateGetDataElementCategoryOptionCombo()