Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r2200 - in trunk/functional-testing/LS: . Doc SingleRequests SingleRequests/SingleRequest SingleRequests/SingleResponse ant conf lib src/ls/Echo

Subject: perfsonar development work

List archive

perfsonar: r2200 - in trunk/functional-testing/LS: . Doc SingleRequests SingleRequests/SingleRequest SingleRequests/SingleResponse ant conf lib src/ls/Echo


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r2200 - in trunk/functional-testing/LS: . Doc SingleRequests SingleRequests/SingleRequest SingleRequests/SingleResponse ant conf lib src/ls/Echo
  • Date: Fri, 9 Mar 2007 02:29:13 -0500

Author: michalis
Date: 2007-03-09 02:29:13 -0500 (Fri, 09 Mar 2007)
New Revision: 2200

Added:
trunk/functional-testing/LS/Doc/
trunk/functional-testing/LS/Doc/Readme.txt
trunk/functional-testing/LS/SingleRequests/
trunk/functional-testing/LS/SingleRequests/SingleRequest/
trunk/functional-testing/LS/SingleRequests/SingleRequest/request.xml
trunk/functional-testing/LS/SingleRequests/SingleResponse/
trunk/functional-testing/LS/SingleRequests/SingleResponse/response.xml
trunk/functional-testing/LS/ant/LSEchoFunctionalTest.xml
trunk/functional-testing/LS/ant/LSUtilities.xml
trunk/functional-testing/LS/conf/
trunk/functional-testing/LS/conf/test.properties.txt
trunk/functional-testing/LS/lib/repository/
Modified:
trunk/functional-testing/LS/ant/build.xml
trunk/functional-testing/LS/src/ls/Echo/EchoRequests.java
trunk/functional-testing/LS/src/ls/Echo/EchoResponseParser.java
Log:
An update of the LS functional tests, featuring restructuring of the ant
scripts and adding one additional functionality

Added: trunk/functional-testing/LS/Doc/Readme.txt


Property changes on: trunk/functional-testing/LS/Doc/Readme.txt
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native

Added: trunk/functional-testing/LS/SingleRequests/SingleRequest/request.xml


Property changes on:
trunk/functional-testing/LS/SingleRequests/SingleRequest/request.xml
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native

Added: trunk/functional-testing/LS/SingleRequests/SingleResponse/response.xml


Property changes on:
trunk/functional-testing/LS/SingleRequests/SingleResponse/response.xml
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native

Added: trunk/functional-testing/LS/ant/LSEchoFunctionalTest.xml


Property changes on: trunk/functional-testing/LS/ant/LSEchoFunctionalTest.xml
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native

Added: trunk/functional-testing/LS/ant/LSUtilities.xml


Property changes on: trunk/functional-testing/LS/ant/LSUtilities.xml
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native

Modified: trunk/functional-testing/LS/ant/build.xml
===================================================================
--- trunk/functional-testing/LS/ant/build.xml 2007-03-08 13:47:03 UTC (rev
2199)
+++ trunk/functional-testing/LS/ant/build.xml 2007-03-09 07:29:13 UTC (rev
2200)
@@ -6,12 +6,13 @@
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
+<property file="conf/test.properties.txt"/>

-<input message="Enter the location of the perfSONAR
classpath[$PERFSONAR/lib/repository]:"
+<!--<input message="Enter the location of the perfSONAR
classpath[$PERFSONAR/lib/repository]:"
addproperty="classpath"
- defaultvalue="C:\Documents and Settings\IBM\My
Documents\Cynet_SVN\FunctionalTests\lib\repository"
- />
-<echo message="Class path is: ${classpath}"/>
+ defaultvalue="C:\Documents and Settings\IBM\My
Documents\Cynet_SVN\FunctionalTests\ls\lib\repository"
+ /> -->
+<!--<echo message="Class path is: ${classpath}"/>-->

<target name="init">
<!-- Create the time stamp -->
@@ -23,14 +24,15 @@
<mkdir dir="Responses"/>
<mkdir dir="Test"/>
<mkdir dir="Timestamps"/>
- <input message="Enter the location of the LS
[http://194.42.2.68/axis/services/LookupService]:";
+
+ <!--<input message="Enter the location of the LS
[http://192.168.10.86:8080/LookupService/services/LookupService]:";
addproperty="ls.location"
- defaultvalue="http://194.42.2.68/axis/services/LookupService";
+
defaultvalue="http://192.168.10.86:8080/LookupService/services/LookupService";
/>
- <input message="Enter the location of the eXist DB
[//194.42.2.68:21/exist/xmlrpc/db/ls]:"
+ <input message="Enter the location of the eXist DB
[//192.168.10.86:21/exist/xmlrpc/db/ls]:"
addproperty="exist.location"
- defaultvalue="//194.42.2.68:21/exist/xmlrpc/db/ls"
- />
+ defaultvalue="//192.168.10.86:21/exist/xmlrpc/db/ls"
+ />-->

</target>

@@ -66,6 +68,14 @@
<import file="LSDeregisterFunctionalTest.xml"/>
<import file="LSQueryFunctionalTest.xml"/>
<import file="LSKeepaliveFunctionalTest.xml"/>
+<import file="LSEchoFunctionalTest.xml"/>
+<import file="LSUtilities.xml"/>
+<target name="showconf"
+ description="clean up" >
+ <echo message="eXist location is: ${exist.location}"/>
+ <echo message="eXist user name is: ${exist.username}"/>
+ <echo message="eXist password is: ${exist.password}"/>
+</target>


<target name="clean"

Added: trunk/functional-testing/LS/conf/test.properties.txt


Property changes on: trunk/functional-testing/LS/conf/test.properties.txt
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native

Modified: trunk/functional-testing/LS/src/ls/Echo/EchoRequests.java
===================================================================
--- trunk/functional-testing/LS/src/ls/Echo/EchoRequests.java 2007-03-08
13:47:03 UTC (rev 2199)
+++ trunk/functional-testing/LS/src/ls/Echo/EchoRequests.java 2007-03-09
07:29:13 UTC (rev 2200)
@@ -175,7 +175,7 @@
switch (testCase) {
// A valid echo request
case 1:
- Element eventType = createEventType("echo.ls");
+ Element eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/2.0";);
Element metadata = createMetadata("meta");
metadata.addContent(eventType);
doc.getRootElement().addContent(metadata);
@@ -188,7 +188,7 @@
"value", "yes"));
parameterList.add(createParameter("name",
"testDBSchema", "value",
"yes"));
- eventType = createEventType("echo.ls");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/ls/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
metadata.addContent(createParameters(parameterList));
@@ -202,7 +202,7 @@
"value", "no"));
parameterList.add(createParameter("name",
"testDBSchema", "value",
"yes"));
- eventType = createEventType("echo.ls");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/ls/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
metadata.addContent(createParameters(parameterList));
@@ -214,7 +214,7 @@
parameterList.clear();
parameterList.add(createParameter("name",
"testDBConnection",
"value", "yes"));
- eventType = createEventType("echo.ls");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/ls/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
metadata.addContent(createParameters(parameterList));
@@ -228,7 +228,7 @@
"value", "no"));
parameterList.add(createParameter("name",
"testDBSchema", "value",
"no"));
- eventType = createEventType("echo.ls");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/ls/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
metadata.addContent(createParameters(parameterList));
@@ -237,7 +237,7 @@
break;
// A request with just the parameter element
case 6:
- eventType = createEventType("echo");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
metadata.addContent(createParameters(null));
@@ -267,7 +267,7 @@
break;
// A request with no metadata id.
case 10:
- eventType = createEventType("echo");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/2.0";);
metadata = createMetadata("");
metadata.addContent(eventType);
doc.getRootElement().addContent(metadata);
@@ -277,7 +277,7 @@
// as
// the metadata id attribute value.
case 11:
- eventType = createEventType("echo");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/2.0";);
metadata = createMetadata("meta1");
metadata.addContent(eventType);
doc.getRootElement().addContent(metadata);
@@ -285,7 +285,7 @@
break;
// A request with no metadata id attribute.
case 12:
- eventType = createEventType("echo");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/2.0";);
metadata = createMetadata("meta");
metadata.removeAttribute("id");
metadata.addContent(eventType);
@@ -294,7 +294,7 @@
break;
// A request without data.
case 13:
- eventType = createEventType("echo");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/2.0";);
metadata = createMetadata("meta1");
metadata.addContent(eventType);
doc.getRootElement().addContent(metadata);
@@ -305,7 +305,7 @@
break;
// A request where the type attribute has a wrong value
case 15:
- eventType = createEventType("echo");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
doc.getRootElement().addContent(metadata);
@@ -314,7 +314,7 @@
break;
// A request where the type attribute is empty.
case 16:
- eventType = createEventType("echo");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
doc.getRootElement().addContent(metadata);
@@ -323,7 +323,7 @@
break;
// A request with no type attribute
case 17:
- eventType = createEventType("echo");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
doc.getRootElement().addContent(metadata);
@@ -332,7 +332,7 @@
break;
// A request with no metadataIdRef value.
case 18:
- eventType = createEventType("echo");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
doc.getRootElement().addContent(metadata);
@@ -340,7 +340,7 @@
break;
// A request with no metadataIdRef
case 19:
- eventType = createEventType("echo");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
doc.getRootElement().addContent(metadata);
@@ -353,7 +353,7 @@
nmwg = Namespace.getNamespace("nmwg",

"http://ggf.org/ns/nmwg/base/foo/2.0/";);

- eventType = createEventType("echo");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
doc.getRootElement().addContent(metadata);
@@ -369,7 +369,7 @@
"value", "yes"));
parameterList.add(createParameter("name",
"testDBSchema", "value",
"yes"));
- eventType = createEventType("echo.ls");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/ls/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
metadata.addContent(createParameters(parameterList));
@@ -383,7 +383,7 @@
"value", "hello"));
parameterList.add(createParameter("name",
"testDBSchema", "value",
"yes"));
- eventType = createEventType("echo.ls");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/ls/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
metadata.addContent(createParameters(parameterList));
@@ -397,7 +397,7 @@
"value", "yes"));
parameterList.add(createParameter("name",
"testDBSchema", "value",
"yes"));
- eventType = createEventType("echo.ls");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/ls/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
metadata.addContent(createParameters(parameterList));
@@ -411,7 +411,7 @@
"value", "yes"));
parameterList.add(createParameter("name",
"testDBSchema", "value",
"yes"));
- eventType = createEventType("echo.ls");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/ls/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
metadata.addContent(createParameters(parameterList));
@@ -425,7 +425,7 @@
"value", "yes"));
parameterList.add(createParameter("name",
"testDBSchema", "value",
"yes"));
- eventType = createEventType("echo.ls");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/ls/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
metadata.addContent(createParameters(parameterList));
@@ -439,7 +439,7 @@
"yes"));
parameterList.add(createParameter("name",
"testDBSchema", "value",
"yes"));
- eventType = createEventType("echo.ls");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/ls/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
metadata.addContent(createParameters(parameterList));
@@ -453,7 +453,7 @@
"value", "yes"));
parameterList.add(createParameter("name",
"testSchema", "value",
"yes"));
- eventType = createEventType("echo.ls");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/ls/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
metadata.addContent(createParameters(parameterList));
@@ -466,7 +466,7 @@
parameterList.add(createParameter("name",
"testDBConnection",
"value", "yes"));
parameterList.add(createParameter("name", "",
"value", "yes"));
- eventType = createEventType("echo.ls");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/ls/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
metadata.addContent(createParameters(parameterList));
@@ -480,7 +480,7 @@
"value", "yes"));
parameterList.add(createParameter("name",
"testDBSchema", "value",
"noyes"));
- eventType = createEventType("echo.ls");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/ls/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
metadata.addContent(createParameters(parameterList));
@@ -494,7 +494,7 @@
"value", "yes"));
parameterList.add(createParameter(null,
"testDBSchema", "value",
"yes"));
- eventType = createEventType("echo.ls");
+ eventType =
createEventType("http://schemas.perfsonar.net/tools/admin/echo/ls/2.0";);
metadata = createMetadata("meta");
metadata.addContent(eventType);
metadata.addContent(createParameters(parameterList));

Modified: trunk/functional-testing/LS/src/ls/Echo/EchoResponseParser.java
===================================================================
--- trunk/functional-testing/LS/src/ls/Echo/EchoResponseParser.java
2007-03-08 13:47:03 UTC (rev 2199)
+++ trunk/functional-testing/LS/src/ls/Echo/EchoResponseParser.java
2007-03-09 07:29:13 UTC (rev 2200)
@@ -3,6 +3,8 @@
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
+import java.util.Iterator;
+import java.util.LinkedList;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -35,7 +37,13 @@
public FileWriter validatorLogWriter;

public FileWriter parserLogWriter;
+
+ private static final int NUMBER_OF_TEST_CASES = 1;

+ private static final int NUMBER_OF_SUB_CASE_1 = 30;
+
+ private static final int TOTAL_NUMBER_OF_TESTS = NUMBER_OF_SUB_CASE_1;
+
//
-----------------------------------------------------------------------
// constructors

@@ -56,7 +64,7 @@
validatorLogWriter = new FileWriter(validationLog,
false);
parserLogWriter = new FileWriter(parserLog, false);
validatorLogWriter.write("Validation results:\n");
- parserLogWriter.write("Parsing Results:\n");
+ parserLogWriter.write("Parsing Results:\n\n");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -396,19 +404,19 @@
// A case with no event type. An error response is
expected.
case 6:
parserLogWrite(testCase);
- return commonCheckCase(response,
"error.common.parse_error");
+ return commonCheckCase(response, "success.echo");
// A case with a wrong event type. An error resquest
is expected.
case 7:
parserLogWrite(testCase);
- return commonCheckCase(response,
"error.common.parse_error");
+ return commonCheckCase(response, "error.echo");
// A case with no event type element. An error
response is expected.
case 8:
parserLogWrite(testCase);
- return commonCheckCase(response,
"error.common.parse_error");
+ return commonCheckCase(response,
"error.ls.eventtype_not_supported");
// A case with no metadata id.. An error response is
expected.
case 9:
parserLogWrite(testCase);
- return commonCheckCase(response,
"warning.common.no_metadata");
+ return commonCheckCase(response, "error.request");
// A case where the metadata id ref attribute value
is not the same
// as
// the metadata id attribute value. An error response
is expected.
@@ -420,6 +428,10 @@
case 11:
parserLogWrite(testCase);
return commonCheckCase(response,
"warning.common.no_metadata");
+ //
+ case 12:
+ parserLogWrite(testCase);
+ return commonCheckCase(response,
"warning.common.no_metadata");
// A case without the data element. An error response
is expected.
case 13:
parserLogWrite(testCase);
@@ -596,52 +608,92 @@
// and validated. The results are stored to the validation
and parser
// log files
if ((directory.exists()) && (directory.isDirectory())) {
+ LinkedList failed = new LinkedList();
+ int success = 0;
+ int fail = 0;
+ int number_of_subcases = 1;
+ for (int i = 1; i < NUMBER_OF_TEST_CASES + 1; i++) {
+ if (i == 1) {
+ number_of_subcases =
NUMBER_OF_SUB_CASE_1 + 1;
+ }
+ try {
+ System.out.print("Processing no" + i
+ + " group of
responses(" + (number_of_subcases - 1)
+ + ")...");

- System.out.print("Processing the responses(30)...");
+ for (int j = 1; j <
number_of_subcases; j++) {

- for (int i = 1; i < 30; i++) {
+ File response = new
File(responseDirectory
+ +
"/Response_echo_" + j + ".xml");
+ if (response.exists()) {
+ org.w3c.dom.Document
domDoc = builder
+
.parse(response);
+ org.jdom.Document doc
= jbuilder.build(domDoc);

- File response = new File(responseDirectory +
"/Response_echo_"
- + i + ".xml");
- if (response.exists()) {
- org.w3c.dom.Document domDoc;
- try {
- domDoc =
builder.parse(response);
- org.jdom.Document doc =
jbuilder.build(domDoc);
+ if
(responseValidator(doc)) {

- if (responseValidator(doc)) {
-
-
validatorLogWrite(true, i, 0);
- if
(responseParser(doc, i)) {
- //
System.out.println("Test was
- //
successful");
-
parserLogWrite(true, i, 0);
+
validatorLogWrite(true, j, 0);
+ if
(responseParser(doc, j)) {
+ //
System.out.println("Test was
+ //
successful");
+
parserLogWrite(true, j, 0);
+
success++;
+ } else {
+
parserLogWrite(false, j, 0);
+
fail++;
+
failed.add("Test echo_" +j + "\n");
+ }
} else {
-
parserLogWrite(false, i, 0);
+ //
System.out.println("Failed");
+
validatorLogWrite(false, j, 0);
+
parserLogWrite(false, j, 1);
+ fail++;
+
failed.add("Test echo_" + j + "\n");
}
+
} else {
- //
System.out.println("Failed");
-
validatorLogWrite(false, i, 0);
-
- parserLogWrite(false,
i, 1);
+
validatorLogWrite(false, j, 1);
+ parserLogWrite(false,
j, 2);
+ fail++;
+ failed.add("Test
echo_"+ j + "\n");
}

- } catch (SAXException e) {
- // TODO Auto-generated catch
block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch
block
- e.printStackTrace();
}
+ System.out.println("Done!");
+ }

- } else {
- validatorLogWrite(false, i, 1);
- parserLogWrite(false, i, 2);
+ catch (SAXException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
}

}
- System.out.println("Done!");
+ try {
+ parserLogWriter.write("\nSummarizing parsing
results:\n\n");
+ parserLogWriter.write("TOTAL NUMBER OF TESTS:"
+ + TOTAL_NUMBER_OF_TESTS +
"\n");
+ parserLogWriter.write("SUCCESSFUL TESTS:" +
success + " ");
+ parserLogWriter.write("FAILED TESTS:" + fail
+ "\n");
+ parserLogWriter
+ .write("SUCCESS PERCENTAGE:"
+ + (((float)
(TOTAL_NUMBER_OF_TESTS - fail) / TOTAL_NUMBER_OF_TESTS) * 100)
+ + "% \n");
+ if(fail>0){
+ parserLogWriter.write("FAILED TESTS ARE:\n");
+ Iterator it = failed.iterator();
+ while (it.hasNext()) {
+ parserLogWriter.write((String)
it.next());
+ }}
+
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }

+
System.out.println("Echo responses validated and
parsed!");

System.out



  • perfsonar: r2200 - in trunk/functional-testing/LS: . Doc SingleRequests SingleRequests/SingleRequest SingleRequests/SingleResponse ant conf lib src/ls/Echo, svnlog, 03/09/2007

Archive powered by MHonArc 2.6.16.

Top of Page