dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #37313
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19102: minor test fix
------------------------------------------------------------
revno: 19102
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-05-07 14:36:20 +0700
message:
minor test fix
modified:
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/merge/Simple.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:19:20 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata/MergeServiceTest.java 2015-05-07 07:36:20 +0000
@@ -59,7 +59,7 @@
public void simpleReplace()
{
Date date = new Date();
- Simple source = new Simple( "string", 10, date, false );
+ Simple source = new Simple( "string", 10, date, false, 123, 2.5f );
Simple target = new Simple();
mergeService.merge( source, target, MergeStrategy.REPLACE );
@@ -68,14 +68,15 @@
assertEquals( 10, (int) target.getInteger() );
assertEquals( date, target.getDate() );
assertEquals( false, target.getBool() );
+ assertEquals( 123, target.getAnInt() );
}
@Test
public void simpleMerge()
{
Date date = new Date();
- Simple source = new Simple( null, 10, date, null );
- Simple target = new Simple( "hello", 20, date, true );
+ Simple source = new Simple( null, 10, date, null, 123, 2.5f );
+ Simple target = new Simple( "hello", 20, date, true, 123, 2.5f );
mergeService.merge( source, target, MergeStrategy.MERGE );
@@ -91,9 +92,9 @@
Date date = new Date();
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 ) );
+ source.getSimples().add( new Simple( "simple", 10, date, false, 123, 2.5f ) );
+ source.getSimples().add( new Simple( "simple", 20, date, false, 123, 2.5f ) );
+ source.getSimples().add( new Simple( "simple", 30, date, false, 123, 2.5f ) );
SimpleCollection target = new SimpleCollection( "target" );
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata/merge/Simple.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata/merge/Simple.java 2015-05-07 06:27:49 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata/merge/Simple.java 2015-05-07 07:36:20 +0000
@@ -46,16 +46,22 @@
private Boolean bool;
+ private int anInt;
+
+ private float aFloat;
+
public Simple()
{
}
- public Simple( String string, Integer integer, Date date, Boolean bool )
+ public Simple( String string, Integer integer, Date date, Boolean bool, int anInt, float aFloat )
{
this.string = string;
this.integer = integer;
this.date = date;
this.bool = bool;
+ this.anInt = anInt;
+ this.aFloat = aFloat;
}
@JsonProperty
@@ -105,4 +111,28 @@
{
this.bool = bool;
}
+
+ @JsonProperty
+ @JacksonXmlProperty
+ public int getAnInt()
+ {
+ return anInt;
+ }
+
+ public void setAnInt( int anInt )
+ {
+ this.anInt = anInt;
+ }
+
+ @JsonProperty
+ @JacksonXmlProperty
+ public float getaFloat()
+ {
+ return aFloat;
+ }
+
+ public void setaFloat( float aFloat )
+ {
+ this.aFloat = aFloat;
+ }
}