← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19101: minor fixes

 

------------------------------------------------------------
revno: 19101
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-05-07 14:19:20 +0700
message:
  minor fixes
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata/MergeServiceTest.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-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata/MergeServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata/MergeServiceTest.java	2015-05-07 07:12:52 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata/MergeServiceTest.java	2015-05-07 07:19:20 +0000
@@ -32,12 +32,14 @@
 import org.hisp.dhis.common.MergeStrategy;
 import org.hisp.dhis.dxf2.metadata.merge.Simple;
 import org.hisp.dhis.dxf2.metadata.merge.SimpleCollection;
-import org.junit.Assert;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import java.util.Date;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
@@ -62,10 +64,10 @@
 
         mergeService.merge( source, target, MergeStrategy.REPLACE );
 
-        Assert.assertEquals( "string", target.getString() );
-        Assert.assertEquals( 10, (int) target.getInteger() );
-        Assert.assertEquals( date, target.getDate() );
-        Assert.assertEquals( false, target.getBool() );
+        assertEquals( "string", target.getString() );
+        assertEquals( 10, (int) target.getInteger() );
+        assertEquals( date, target.getDate() );
+        assertEquals( false, target.getBool() );
     }
 
     @Test
@@ -77,10 +79,10 @@
 
         mergeService.merge( source, target, MergeStrategy.MERGE );
 
-        Assert.assertEquals( "hello", target.getString() );
-        Assert.assertEquals( 10, (int) target.getInteger() );
-        Assert.assertEquals( date, target.getDate() );
-        Assert.assertEquals( true, target.getBool() );
+        assertEquals( "hello", target.getString() );
+        assertEquals( 10, (int) target.getInteger() );
+        assertEquals( date, target.getDate() );
+        assertEquals( true, target.getBool() );
     }
 
     @Test
@@ -88,7 +90,7 @@
     {
         Date date = new Date();
 
-        SimpleCollection source = new SimpleCollection( "source" );
+        SimpleCollection source = new SimpleCollection( "name" );
         source.getSimples().add( new Simple( "simple", 10, date, false ) );
         source.getSimples().add( new Simple( "simple", 20, date, false ) );
         source.getSimples().add( new Simple( "simple", 30, date, false ) );
@@ -97,6 +99,11 @@
 
         mergeService.merge( source, target, MergeStrategy.MERGE );
 
-        Assert.assertEquals( 3, target.getSimples().size() );
+        assertEquals( "name", target.getName() );
+        assertEquals( 3, target.getSimples().size() );
+
+        assertTrue( target.getSimples().contains( source.getSimples().get( 0 ) ) );
+        assertTrue( target.getSimples().contains( source.getSimples().get( 1 ) ) );
+        assertTrue( target.getSimples().contains( source.getSimples().get( 2 ) ) );
     }
 }