← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19099: MergeService test with MERGE strategy

 

------------------------------------------------------------
revno: 19099
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-05-07 13:39:25 +0700
message:
  MergeService test with MERGE strategy
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 06:27:49 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata/MergeServiceTest.java	2015-05-07 06:39:25 +0000
@@ -66,4 +66,19 @@
         Assert.assertEquals( date, target.getDate() );
         Assert.assertEquals( false, target.getBool() );
     }
+
+    @Test
+    public void simpleMerge()
+    {
+        Date date = new Date();
+        Simple source = new Simple( null, 10, date, null );
+        Simple target = new Simple( "hello", 20, date, true );
+
+        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() );
+    }
 }