← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 990: Quickly fixed.

 

------------------------------------------------------------
revno: 990
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Fri 2009-11-06 13:10:19 +0100
message:
  Quickly fixed.
modified:
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dimension/DimensionServiceTest.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/dimension/DimensionServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dimension/DimensionServiceTest.java	2009-10-27 18:39:55 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dimension/DimensionServiceTest.java	2009-11-06 12:10:19 +0000
@@ -27,16 +27,17 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import static junit.framework.Assert.assertNotNull;
+import static junit.framework.Assert.assertTrue;
+
 import java.util.Collection;
 
 import org.hisp.dhis.DhisSpringTest;
-import org.hisp.dhis.dimension.Dimension;
+import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementGroupSet;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.junit.Test;
 
-import static junit.framework.Assert.*;
-
 /**
  * @author Lars Helge Overland
  * @version $Id$
@@ -49,6 +50,8 @@
     private DataElementGroupSet dataElementGroupSetA;
     private DataElementGroupSet dataElementGroupSetB;
     
+    private DataElement dataElementA;
+    
     @Override
     public void setUpTest()
     {
@@ -60,17 +63,22 @@
         dataElementGroupSetB = new DataElementGroupSet( "DataElementGroupSetB" );
         
         dataElementService.addDataElementGroupSet( dataElementGroupSetA );
-        dataElementService.addDataElementGroupSet( dataElementGroupSetB );        
+        dataElementService.addDataElementGroupSet( dataElementGroupSetB );
+        
+        dataElementA = createDataElement( 'A' );
+        
+        dataElementA.getGroupSets().add( dataElementGroupSetA );
+        dataElementA.getGroupSets().add( dataElementGroupSetA );
+        
+        dataElementService.addDataElement( dataElementA );
     }
     
     @Test
     public void getDimensions()
     {
-        Collection<Dimension> dimensions = dimensionService.getAllDimensions();
+        Collection<DimensionSet> dimensionSets = dimensionService.getAllDimensionSets();
         
-        assertNotNull( dimensions );
-        assertEquals( 3, dimensions.size() ); // Including default
-        assertTrue( dimensions.contains( dataElementGroupSetA ) );
-        assertTrue( dimensions.contains( dataElementGroupSetB ) );
+        assertNotNull( dimensionSets );
+        assertTrue( dimensionSets.contains( dataElementA ) );
     }
 }