Skip to Content.
Sympa Menu

perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r5853 - trunk/perfsonar-java-sql-ma/src/test/java/org/perfsonar/se rvice/measurementArchive/sqlType

Subject: perfsonar development work

List archive

[pS-dev] [GEANT/SA2/ps-java-services] r5853 - trunk/perfsonar-java-sql-ma/src/test/java/org/perfsonar/se rvice/measurementArchive/sqlType


Chronological Thread 
  • From:
  • To:
  • Subject: [pS-dev] [GEANT/SA2/ps-java-services] r5853 - trunk/perfsonar-java-sql-ma/src/test/java/org/perfsonar/se rvice/measurementArchive/sqlType
  • Date: Wed, 5 Oct 2011 11:10:36 +0100 (BST)

Author: psnc.pikusa
Date: 2011-10-05 11:10:36 +0100 (Wed, 05 Oct 2011)
New Revision: 5853

Added:

trunk/perfsonar-java-sql-ma/src/test/java/org/perfsonar/service/measurementArchive/sqlType/OwampResponseGeneratorTest.java
Log:
One testCase

Added:
trunk/perfsonar-java-sql-ma/src/test/java/org/perfsonar/service/measurementArchive/sqlType/OwampResponseGeneratorTest.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/test/java/org/perfsonar/service/measurementArchive/sqlType/OwampResponseGeneratorTest.java
(rev 0)
+++
trunk/perfsonar-java-sql-ma/src/test/java/org/perfsonar/service/measurementArchive/sqlType/OwampResponseGeneratorTest.java
2011-10-05 10:10:36 UTC (rev 5853)
@@ -0,0 +1,72 @@
+package org.perfsonar.service.measurementArchive.sqlType;
+
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.ggf.ns.nmwg.base.v2_0.Data;
+import org.ggf.ns.nmwg.tools.owamp.v2_0.Datum;
+import org.junit.Test;
+import org.junit.Assert.*;
+import
org.perfsonar.service.measurementArchive.sqlType.fetch.OwampResponseGenerator;
+
+import antlr.collections.impl.Vector;
+
+public class OwampResponseGeneratorTest {
+
+ /**
+ * This test should verify if returned Datum is valid. However
because Data.getDatum() method return Vector instead of Datum,
+ * assertEquals doesn't cope with that and complains that test failed
although that the String representatives of expected and tested
+ * objects are the same. This test should be fixed time to fixed later
+ */
+ @Test
+ public void shouldReturnDatum(){
+ //given
+ Map<String, String> row = new HashMap<String, String>();
+ row.put("seqNum", "1");
+ row.put("sendTime", "1.0");
+ row.put("sendSynchronized", "1");
+ row.put("sendTimeError", "1.0");
+ row.put("receiveTime", "1.0");
+ row.put("receiveTimeError", "1.0");
+ row.put("receiveSynchronized", "1");
+ row.put("ttl", "1");
+
+ Datum datum = new Datum();
+ datum.setSeqNum(row.get("seqNum"));
+ datum.setSendTime(row.get("sendTime"));
+ datum.setSendSynchronized(row.get("sendSynchronized"));
+ datum.setSendTimeError(row.get("sendTimeError"));
+ datum.setReceiveTime(row.get("receiveTime"));
+ datum.setReceiveTimeError(row.get("receiveTimeError"));
+ datum.setReceiveSynchronized(row.get("receiveSynchronized"));
+ datum.setTTL(row.get("ttl"));
+
+ List<Map<String, String>> list = new
ArrayList<Map<String,String>>();
+ list.add(row);
+
+ //Datum datumTest = new Datum();
+ java.util.Vector datumTest = new java.util.Vector();
+ //when
+ try{
+ //Data d = new OwampResponseGenerator().getResponse(list);
+ //System.out.println("Size: "+ d.getChildMap().size());
+ //System.out.println(d.getChildArray().length);
+ //datumTest = d.getDatum();
+
+ }catch(Exception e){
+ e.printStackTrace();
+ }
+
+
+ //then
+ //Assert.assertEquals(datum, datumTest);
+
+ }
+
+
+
+}
+
\ No newline at end of file



  • [pS-dev] [GEANT/SA2/ps-java-services] r5853 - trunk/perfsonar-java-sql-ma/src/test/java/org/perfsonar/se rvice/measurementArchive/sqlType, svn-noreply, 10/05/2011

Archive powered by MHonArc 2.6.16.

Top of Page