public void test_metric_heartbeat_uint32(){
  final IGangliaMetadataMessage decl=new GangliaMetadataMessage("bigdata10","heartbeat",false,GangliaMessageTypeEnum.UINT32,"heartbeat","",GangliaSlopeEnum.unspecified,20,0,AbstractMetrics.getMap(IGangliaAttributes.GROUP_CORE,"heartbeat","Last heartbeat"));
  assertEncodeDecode(null,decl);
  final IGangliaMetricMessage expected=new GangliaMetricMessage(GangliaMessageTypeEnum.UINT32,"bigdata10","heartbeat",false,"%u",Long.valueOf(1326920615L));
  final byte[] actualData=assertEncodeDecode(decl,expected);
  final byte[] expectedData=new byte[]{0,0,0,-124,0,0,0,9,98,105,103,100,97,116,97,49,48,0,0,0,0,0,0,9,104,101,97,114,116,98,101,97,116,0,0,0,0,0,0,0,0,0,0,2,37,117,0,0,79,23,51,-89};
  if (!Arrays.equals(expectedData,actualData)) {
    fail("expect: " + Arrays.toString(expectedData) + ", actual="+ Arrays.toString(actualData));
  }
}

public void test_metric_heartbeat_uint32 ( ) { final IGangliaMetadataMessage decl = new GangliaMetadataMessage ( "bigdata10" , "heartbeat" , false , GangliaMessageTypeEnum . UINT32 , "heartbeat" , "" , GangliaSlopeEnum . unspecified , 20 , 0 , AbstractMetrics . getMap ( IGangliaAttributes . GROUP_CORE , "heartbeat" , "Last heartbeat" ) ) ; assertEncodeDecode ( null , decl ) ; final IGangliaMetricMessage expected = new GangliaMetricMessage ( GangliaMessageTypeEnum . UINT32 , "bigdata10" , "heartbeat" , false , "%u" , Long . valueOf ( 1326920615L ) ) ; final byte [ ] actualData = assertEncodeDecode ( decl , expected ) ; final byte [ ] expectedData = new byte [ ] { 0 , 0 , 0 , - 124 , 0 , 0 , 0 , 9 , 98 , 105 , 103 , 100 , 97 , 116 , 97 , 49 , 48 , 0 , 0 , 0 , 0 , 0 , 0 , 9 , 104 , 101 , 97 , 114 , 116 , 98 , 101 , 97 , 116 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 2 , 37 , 117 , 0 , 0 , 79 , 23 , 51 , - 89 } ; if ( ! Arrays . equals ( expectedData , actualData ) ) { fail ( "expect: " + Arrays . toString ( expectedData ) + ", actual=" + Arrays . toString ( actualData ) ) ; } }
unit test for a heartbeat message .
