Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r2673 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: . test test/ippm test/ma

Subject: perfsonar development work

List archive

perfsonar: r2673 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: . test test/ippm test/ma


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r2673 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: . test test/ippm test/ma
  • Date: Sun, 19 Aug 2007 13:06:51 -0400

Author: nina
Date: 2007-08-19 13:06:51 -0400 (Sun, 19 Aug 2007)
New Revision: 2673

Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/NMWGHelper.java.bak
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/PerfsonarTest.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ippm/

branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ippm/IPPMRequestTest.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ippm/IPPMServicesTest.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ippm/MDKRequest.xml

branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ippm/MDKResponse.xml
Removed:

branches/perfsonarui/src/org/perfsonar/perfsonarui/test/IPPMRequestTest.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/test/IPPMServicesTest.java
Modified:

branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ma/MARequest_ErrorsTest.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ma/SDResponse1.xml
Log:
updated junit tests

Added: branches/perfsonarui/src/org/perfsonar/perfsonarui/NMWGHelper.java.bak

Deleted:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/IPPMRequestTest.java

Deleted:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/IPPMServicesTest.java

Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/PerfsonarTest.java

Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ippm/IPPMRequestTest.java

Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ippm/IPPMServicesTest.java

Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ippm/MDKRequest.xml

Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ippm/MDKResponse.xml

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ma/MARequest_ErrorsTest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ma/MARequest_ErrorsTest.java
2007-08-19 17:04:42 UTC (rev 2672)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ma/MARequest_ErrorsTest.java
2007-08-19 17:06:51 UTC (rev 2673)
@@ -29,13 +29,6 @@

package org.perfsonar.perfsonarui.test.ma;

-import java.io.InputStream;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import junit.framework.TestCase;
-
import org.perfsonar.perfsonarui.AbstractMARequest;
import org.perfsonar.perfsonarui.AbstractUserData;
import org.perfsonar.perfsonarui.MetadataListResponseListener;
@@ -49,9 +42,10 @@
import org.perfsonar.perfsonarui.plugins.IPerfsonarRequest;
import org.perfsonar.perfsonarui.plugins.MAEndpoint;
import org.perfsonar.perfsonarui.plugins.MetaDataList;
+import org.perfsonar.perfsonarui.test.PerfsonarTest;
import org.w3c.dom.Document;

-public class MARequest_ErrorsTest extends TestCase {
+public class MARequest_ErrorsTest extends PerfsonarTest {
protected MARequest_Errors ma_errors;
protected void setUp() throws Exception {
super.setUp();
@@ -332,16 +326,6 @@

}

- protected Document docFromFile(String name) throws Exception {
- DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(true);
-
- DocumentBuilder builder = factory.newDocumentBuilder();
- InputStream stream =
this.getClass().getClassLoader().getResourceAsStream(name);
-
- return builder.parse(stream);
-
- }
/*
* TODO chaining not supported yet
*/
@@ -354,7 +338,9 @@
MetaDataList list = new MetaDataList(null);
MetadataListResponseListener listener = new
MetadataListResponseListener(list);
ma_errors.processMetadataKeyRequest(mdk_response, listener,
queryData);
- assertEquals(2,list.size());
+ assertEquals(1,list.size());
+
assertEquals("192.168.0.202",list.get(0).getResponse("ifAddress"));
+ assertEquals("mead",list.get(0).getResponse("hostName"));
System.out.println(list);
} catch (Exception x) {
fail(x.getMessage());
@@ -369,9 +355,11 @@
ma_errors.presentDataFromResponse(sd_response, listener,uData);

System.out.print(uData);
- assertEquals(5,Long.parseLong(uData.getResponse("Eps")));
+ assertEquals("192.168.0.203",uData.getResponse("ifAddress"));
+ assertEquals(6,Long.parseLong(uData.getResponse("Eps")));
System.out.println();
} catch (Exception x) {
+ x.printStackTrace();
fail(x.getMessage());
}
}
@@ -384,12 +372,14 @@
TimeValueResponseListener listener = new
TimeValueResponseListener(response);
ma_errors.presentDataFromResponse(sd_response, listener,uData);

- /*
+
System.out.print(uData);
+ /*
assertEquals(5,Long.parseLong(uData.getResponse("Eps")));
*/
- assertEquals(6,response.size());
System.out.println(response);
+ assertEquals(6,response.size());
+
} catch (Exception x) {
fail(x.getMessage());
}
@@ -411,20 +401,24 @@
uData1.setResponse(UserData.C_HOSTNAME, "mead");
uData1.makeQueryFromResponse();

- MetaDataList list = new MetaDataList(null);
+ MetaDataList list = new MAMetadataList();
list.add(uData);
list.add(uData1);
assertEquals(2,list.size());

TimeValueListResponseListener listener = new
TimeValueListResponseListener(list);
- ma_errors.presentDataFromResponse(sd_response, listener,uData);
+ listener.process(ma_errors, null,sd_response);
+ //ma_errors.presentDataFromResponse(sd_response, listener,null);

/*
System.out.print(uData);
assertEquals(5,Long.parseLong(uData.getResponse("Eps")));
*/
- System.out.println(list.get(0).getResponse("Eps"));
- System.out.println(list.get(1).getResponse("Eps"));
+ System.out.println(list.get(0));
+ System.out.println(list.get(1));
+ assertEquals("20000000003",list.get(0).getResponse("Eps"));
+
+ assertEquals("6",list.get(1).getResponse("Eps"));
} catch (Exception x) {
fail(x.getMessage());
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ma/SDResponse1.xml
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ma/SDResponse1.xml
2007-08-19 17:04:42 UTC (rev 2672)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ma/SDResponse1.xml
2007-08-19 17:06:51 UTC (rev 2673)
@@ -28,7 +28,7 @@

<nmwg:metadata xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/";
id="meta.543543" metadataIdRef="m1">
<errors:subject
xmlns:errors="http://ggf.org/ns/nmwg/characteristic/errors/2.0/"; id="mead1">
- <nmwgt:interface xmlns:nmwgt="http://ggf.org/ns/nmwg/topology/2.0/";>
+ <nmwgt:interface xmlns:nmwgt="http://ggf.org/ns/nmwg/topology/2.0/";
id="test1">
<nmwgt:ifAddress type="ipv4">192.168.0.202</nmwgt:ifAddress>
<nmwgt:hostName>mead</nmwgt:hostName>
<nmwgt:ifName>eth0</nmwgt:ifName>
@@ -92,8 +92,8 @@
</nmwg:metadata>

<nmwg:metadata xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/";
id="meta.77834" metadataIdRef="m1">
- <errors:subject
xmlns:errors="http://ggf.org/ns/nmwg/characteristic/errors/2.0/"; id="mead1">
- <nmwgt:interface xmlns:nmwgt="http://ggf.org/ns/nmwg/topology/2.0/";>
+ <errors:subject
xmlns:errors="http://ggf.org/ns/nmwg/characteristic/errors/2.0/"; id="mead2">
+ <nmwgt:interface xmlns:nmwgt="http://ggf.org/ns/nmwg/topology/2.0/";
id="test2">
<nmwgt:ifAddress type="ipv4">192.168.0.203</nmwgt:ifAddress>
<nmwgt:hostName>mead</nmwgt:hostName>
<nmwgt:ifName>eth1</nmwgt:ifName>
@@ -109,7 +109,7 @@
</nmwg:metadata>

<nmwg:data id="data.4386" metadataIdRef="meta.9879"
xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/";>
- <errors:datum value="2" valueUnits="Eps" timeType="unix"
timeValue="1021119880"/>
+ <errors:datum value="3" valueUnits="Eps" timeType="unix"
timeValue="1021119880"/>

<errors:datum value="2" valueUnits="Eps">
<nmtm:time type="unix" value="1021119880"
xmlns:nmtm="http://ggf.org/ns/nmwg/time/2.0/"/>



  • perfsonar: r2673 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: . test test/ippm test/ma, svnlog, 08/19/2007

Archive powered by MHonArc 2.6.16.

Top of Page