perfsonar-dev - r2068 - in trunk/functional-testing/LS/src/ls: DeregisterRequest QueryRequest RegisterRequest UpdateRequest
Subject: perfsonar development work
List archive
r2068 - in trunk/functional-testing/LS/src/ls: DeregisterRequest QueryRequest RegisterRequest UpdateRequest
Chronological Thread
- From:
- To:
- Subject: r2068 - in trunk/functional-testing/LS/src/ls: DeregisterRequest QueryRequest RegisterRequest UpdateRequest
- Date: Wed, 14 Feb 2007 04:02:35 -0500
Author: michalis
Date: 2007-02-14 04:02:35 -0500 (Wed, 14 Feb 2007)
New Revision: 2068
Modified:
trunk/functional-testing/LS/src/ls/DeregisterRequest/LSDeregisterResponseParser.java
trunk/functional-testing/LS/src/ls/QueryRequest/LSQueryResponseParser.java
trunk/functional-testing/LS/src/ls/RegisterRequest/LSRegisterResponseParser.java
trunk/functional-testing/LS/src/ls/UpdateRequest/LSUpdateResponseParser.java
Log:
Some changes on the parsing classes
Modified:
trunk/functional-testing/LS/src/ls/DeregisterRequest/LSDeregisterResponseParser.java
===================================================================
---
trunk/functional-testing/LS/src/ls/DeregisterRequest/LSDeregisterResponseParser.java
2007-02-13 19:48:13 UTC (rev 2067)
+++
trunk/functional-testing/LS/src/ls/DeregisterRequest/LSDeregisterResponseParser.java
2007-02-14 09:02:35 UTC (rev 2068)
@@ -349,7 +349,7 @@
meta_It = result1.getIterator();
data_It = result2.getIterator();
// Is the result code what is
supposed to be?
- if
(resultCode.equals("error.ls.no_key")) {
+ if
(resultCode.equals("error.ls.key_not_found")) {
// Are metadata and data
still there?
if
((meta_It.hasMoreResources())
&&
(data_It.hasMoreResources())) {
Modified:
trunk/functional-testing/LS/src/ls/QueryRequest/LSQueryResponseParser.java
===================================================================
---
trunk/functional-testing/LS/src/ls/QueryRequest/LSQueryResponseParser.java
2007-02-13 19:48:13 UTC (rev 2067)
+++
trunk/functional-testing/LS/src/ls/QueryRequest/LSQueryResponseParser.java
2007-02-14 09:02:35 UTC (rev 2068)
@@ -729,7 +729,7 @@
String resultCode =
response.getRootElement().getChild(
"metadata",
nmwg).getChild("eventType", nmwg).getText();
// Checking if the result code is the
apropriate one
- if
(resultCode.equals("error.common.storage.xmldb.wrong_Query")) {
+ if
(resultCode.equals("error.common.storage.xmldb.query")) {
return true;
} else {
return false;
@@ -739,7 +739,7 @@
resultCode =
response.getRootElement().getChild("metadata",
nmwg).getChild("eventType",
nmwg).getText();
// Checking if the result code is the
apropriate one
- if
(resultCode.equals("error.common.storage.xmldb.wrong_Query")) {
+ if
(resultCode.equals("error.common.storage.xmldb.query")) {
return true;
} else {
return false;
@@ -749,7 +749,7 @@
resultCode =
response.getRootElement().getChild("metadata",
nmwg).getChild("eventType",
nmwg).getText();
// Checking if the result code is the
apropriate one
- if
(resultCode.equals("error.common.storage.xmldb.wrong_Query")) {
+ if
(resultCode.equals("error.common.storage.xmldb.query")) {
return true;
} else {
return false;
@@ -759,7 +759,7 @@
resultCode =
response.getRootElement().getChild("metadata",
nmwg).getChild("eventType",
nmwg).getText();
// Checking if the result code is the
apropriate one
- if
(resultCode.equals("error.common.storage.xmldb.wrong_Query")) {
+ if
(resultCode.equals("error.common.storage.xmldb.query")) {
return true;
} else {
return false;
@@ -770,7 +770,7 @@
resultCode =
response.getRootElement().getChild("metadata",
nmwg).getChild("eventType",
nmwg).getText();
// Checking if the result code is the
apropriate one
- if
(resultCode.equals("error.common.storage.xmldb.wrong_Query")) {
+ if
(resultCode.equals("error.common.storage.xmldb.query")) {
return true;
} else {
return false;
@@ -781,7 +781,7 @@
resultCode =
response.getRootElement().getChild("metadata",
nmwg).getChild("eventType",
nmwg).getText();
// Checking if the result code is the
apropriate one
- if
(resultCode.equals("error.common.storage.xmldb.wrong_Query")) {
+ if
(resultCode.equals("error.common.storage.xmldb.query")) {
return true;
} else {
return false;
@@ -892,7 +892,7 @@
resultCode =
response.getRootElement().getChild("metadata",
nmwg).getChild("eventType",
nmwg).getText();
// Checking if the result code is the
apropriate one
- if
(resultCode.equals("error.common.storage.xmldb.wrong_query")) {
+ if
(resultCode.equals("error.common.storage.xmldb.query")) {
return true;
} else {
return false;
@@ -947,7 +947,7 @@
resultCode =
response.getRootElement().getChild("metadata",
nmwg).getChild("eventType",
nmwg).getText();
// Checking if the result code is the
apropriate one
- if
(resultCode.equals("error.common.storage.xmldb.wrong_query")) {
+ if
(resultCode.equals("error.common.storage.xmldb.query")) {
return true;
} else {
return false;
@@ -1073,7 +1073,7 @@
resultCode =
response.getRootElement().getChild("metadata",
nmwg).getChild("eventType",
nmwg).getText();
// Checking if the result code is the
apropriate one
- if
(resultCode.equals("error.ls.no_metadata")) {
+ if
(resultCode.equals("warning.common.no_metadata")) {
return true;
} else {
return false;
@@ -1085,7 +1085,7 @@
resultCode =
response.getRootElement().getChild("metadata",
nmwg).getChild("eventType",
nmwg).getText();
// Checking if the result code is the
apropriate one
- if
(resultCode.equals("error.common.storage.xmldb.empty_query")) {
+ if
(resultCode.equals("error.common.storage.xmldb.query")) {
return true;
} else {
return false;
@@ -1097,7 +1097,7 @@
resultCode =
response.getRootElement().getChild("metadata",
nmwg).getChild("eventType",
nmwg).getText();
// Checking if the result code is the
apropriate one
- if
(resultCode.equals("error.common.storage.xmldb.wrong_query")) {
+ if
(resultCode.equals("error.common.storage.xmldb.query")) {
return true;
} else {
return false;
@@ -1176,7 +1176,7 @@
resultCode =
response.getRootElement().getChild("metadata",
nmwg).getChild("eventType",
nmwg).getText();
// Checking if the result code is the
apropriate one
- if
(resultCode.equals("error.ls.no_data_trigger")) {
+ if
(resultCode.equals("warning.common.no_metadata")) {
return true;
} else {
return false;
@@ -1277,7 +1277,7 @@
resultCode =
response.getRootElement().getChild("metadata",
nmwg).getChild("eventType",
nmwg).getText();
// Checking if the result code is the
apropriate one
- if
(resultCode.equals("error.ls.no_data_trigger")) {
+ if
(resultCode.equals("warning.common.no_metadata")) {
return true;
} else {
return false;
@@ -1289,7 +1289,7 @@
resultCode =
response.getRootElement().getChild("metadata",
nmwg).getChild("eventType",
nmwg).getText();
// Checking if the result code is the
apropriate one
- if
(resultCode.equals("error.ls.no_data_trigger")) {
+ if
(resultCode.equals("warning.common.no_metadata")) {
return true;
} else {
return false;
@@ -1301,7 +1301,7 @@
resultCode =
response.getRootElement().getChild("metadata",
nmwg).getChild("eventType",
nmwg).getText();
// Checking if the result code is the
apropriate one
- if
(resultCode.equals("error.ls.no_data_trigger")) {
+ if
(resultCode.equals("warning.common.no_metadata")) {
return true;
} else {
return false;
Modified:
trunk/functional-testing/LS/src/ls/RegisterRequest/LSRegisterResponseParser.java
===================================================================
---
trunk/functional-testing/LS/src/ls/RegisterRequest/LSRegisterResponseParser.java
2007-02-13 19:48:13 UTC (rev 2067)
+++
trunk/functional-testing/LS/src/ls/RegisterRequest/LSRegisterResponseParser.java
2007-02-14 09:02:35 UTC (rev 2068)
@@ -86,7 +86,7 @@
logwriter = new FileWriter(validationLog, false);
parserLogWriter = new FileWriter(parserLog, false);
logwriter.write("Validation results:\n");
- parserLogWriter.write("Parsing Results\n");
+ parserLogWriter.write("Parsing Results:\n");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -106,8 +106,8 @@
nmtm = Namespace.getNamespace("nmtm",
"http://ggf.org/ns/nmwg/time/2.0/");
dbClient = new xmlDBClient(xmlDBInetAddress, "lookupservice",
"sonar");
- // LSRegisterRequests request = new LSRegisterRequests();
- data = "<metadata xmlns=\"http://ggf.org/ns/nmwg/base/2.0/\"
id=\"meta1\">\n"
+
+ data = "<nmwg:metadata
xmlns:nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\" id=\"meta1\">\n"
+ " <netutil:subject
xmlns:netutil=\"http://ggf.org/ns/nmwg/characteristic/utilization/2.0/\"
id=\"subj1\">\n"
+ " <nmwgt:interface
xmlns:nmwgt=\"http://ggf.org/ns/nmwg/topology/2.0/\">\n"
+ "
<nmwgt:hostName>xyz.sdf.edf.edu</nmwgt:hostName>\n"
@@ -118,7 +118,7 @@
+ "
<nmwgt:capacity>1000000000</nmwgt:capacity>\n"
+ " </nmwgt:interface>\n"
+ " </netutil:subject>\n"
- + " <eventType>utilization</eventType>\n"
+ "</metadata>";
+ + "
<nmwg:eventType>utilization</nmwg:eventType>\n" + "</nmwg:metadata>";
data.trim();
@@ -315,7 +315,7 @@
return true;
} else {
//
System.out.println(data);
- //
System.out.println(getResult(result2));
+
//ystem.out.println(getResult(result2));
return false;
}
} else {
@@ -500,7 +500,7 @@
ResourceIterator it =
result.getIterator();
// checking to see if the response
code is the appropriate
// one and if no registry was made
- if
(resultCode.equals("error.ls.no_key")
+ if
(resultCode.equals("error.ls.no_access_point")
&&
(!it.hasMoreResources())) {
return true;
@@ -734,7 +734,7 @@
ResourceIterator it =
result.getIterator();
// checking to see if the response
code is the appropriate
// one and if no access point is
registered
- if
(resultCode.equals("error.ls.no_key")
+ if
(resultCode.equals("error.ls.no_access_point")
&&
(!it.hasMoreResources())) {
return true;
@@ -751,7 +751,7 @@
// A response from a request with no service
Type value. A
// successful response expected
case 4:
- // accessing result code
+ //accessing result code
resultCode =
((response.getRootElement()).getChild("metadata",
nmwg)).getChild("eventType",
nmwg).getText();
// creating access point
@@ -761,57 +761,30 @@
query = "for $a in
/nmwg:store/nmwg:metadata//psservice:service[psservice:accessPoint='"
+ accessPoint
+ "'] let $metadata_id :=
/nmwg:store/nmwg:metadata/@id let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$metadata_id]
return $a/psservice:accessPoint/child::text()";
- dataquery = "for $a in
/nmwg:store/nmwg:metadata let $metadata_id:= $a/@id let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$metadata_id]"
- + " where
$a/perfsonar:subject/psservice:service[psservice:accessPoint='"
- + accessPoint + "'] return
$data/nmwg:metadata";
result = dbClient.queryDB(query);
- resultData = dbClient.queryDB(dataquery);
- if (resultCode.equals("success.ls.register"))
{
- // is the access point there?
- try {
+ try {
+ ResourceIterator it =
result.getIterator();
+ // checking to see if the response
code is the appropriate
+ // one and if no access point is
registered
+ if
(resultCode.equals("error.ls.no_service_type")
+ &&
(!it.hasMoreResources())) {
- if (result.getResource(0) !=
null) {
+ return true;
- Resource resource1 =
result.getResource(0);
- String
remoteAccessPoint = (String) resource1
-
.getContent();
- // is it equal to the
access point in the request?
- if
(remoteAccessPoint.equals(accessPoint)) {
-
- // do the
registry data exist?
- //Are they
the same as the original data?
- if
(resultData.getResource(0).getContent() != null) {
- if
(data.equals(getResult(resultData))) {
-
return true;
- }
else {
-
// System.out.println(data);
-
// System.out.println(getResult(result2));
-
return false;
- }
- } else {
-
return false;
- }
- } else {
- return false;
- }
- } else {
- return false;
- }
-
- } catch (XMLDBException e) {
- // TODO Auto-generated catch
block
- e.printStackTrace();
+ } else {
+ return false;
}
- } else {
- return false;
+ } catch (XMLDBException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
}
// A response from a request without a
service name value. A
// successful response is expected
case 5:
- // accessing result code
+// accessing result code
resultCode =
((response.getRootElement()).getChild("metadata",
nmwg)).getChild("eventType",
nmwg).getText();
// creating access point
@@ -821,52 +794,24 @@
query = "for $a in
/nmwg:store/nmwg:metadata//psservice:service[psservice:accessPoint='"
+ accessPoint
+ "'] let $metadata_id :=
/nmwg:store/nmwg:metadata/@id let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$metadata_id]
return $a/psservice:accessPoint/child::text()";
- dataquery = "for $a in
/nmwg:store/nmwg:metadata let $metadata_id:= $a/@id let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$metadata_id]"
- + " where
$a/perfsonar:subject/psservice:service[psservice:accessPoint='"
- + accessPoint + "'] return
$data/nmwg:metadata";
result = dbClient.queryDB(query);
- resultData = dbClient.queryDB(dataquery);
-
- if (resultCode.equals("success.ls.register"))
{
- // is the access point there?
- try {
+ try {
+ ResourceIterator it =
result.getIterator();
+ // checking to see if the response
code is the appropriate
+ // one and if no access point is
registered
+ if
(resultCode.equals("error.ls.no_service_name")
+ &&
(!it.hasMoreResources())) {
- if (result.getResource(0) !=
null) {
+ return true;
- Resource resource1 =
result.getResource(0);
- String
remoteAccessPoint = (String) resource1
-
.getContent();
- // is it equal to the
access point in the request?
- if
(remoteAccessPoint.equals(accessPoint)) {
-
- // do the
registry data exist?
- //Are they
the same as the original data?
- if
(resultData.getResource(0).getContent() != null) {
- if
(data.equals(getResult(resultData))) {
-
return true;
- }
else {
-
// System.out.println(data);
-
// System.out.println(getResult(result2));
-
return false;
- }
- } else {
-
return false;
- }
- } else {
- return false;
- }
- } else {
- return false;
- }
-
- } catch (XMLDBException e) {
- // TODO Auto-generated catch
block
- e.printStackTrace();
+ } else {
+ return false;
}
- } else {
- return false;
+ } catch (XMLDBException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
}
// A response with no service description
value. A successful
// response is expected
@@ -1072,7 +1017,7 @@
ResourceIterator it =
result.getIterator();
// checking to see if the response
code is the appropriate
// one and if no access point is
registered
- if
(resultCode.equals("error.ls.no_key")
+ if
(resultCode.equals("error.ls.no_access_point")
&&
(!it.hasMoreResources())) {
return true;
@@ -1102,47 +1047,23 @@
+ " where
$a/perfsonar:subject/psservice:service[psservice:accessPoint='"
+ accessPoint + "'] return
$data/nmwg:metadata";
result = dbClient.queryDB(query);
- resultData = dbClient.queryDB(dataquery);
- if (resultCode.equals("success.ls.register"))
{
- // is the access point there?
- try {
+ try {
+ ResourceIterator it =
result.getIterator();
+ // checking to see if the response
code is the appropriate
+ // one and if no access point is
registered
+ if
(resultCode.equals("error.ls.no_service_type")
+ &&
(!it.hasMoreResources())) {
- if (result.getResource(0) !=
null) {
+ return true;
- Resource resource1 =
result.getResource(0);
- String
remoteAccessPoint = (String) resource1
-
.getContent();
- // is it equal to the
access point in the request?
- if
(remoteAccessPoint.equals(accessPoint)) {
+ } else {
+ return false;
- // do the
registry data exist?
- //Are they
the same as the original data?
- if
(resultData.getResource(0).getContent() != null) {
- if
(data.equals(getResult(resultData))) {
-
return true;
- }
else {
-
// System.out.println(data);
-
// System.out.println(getResult(result2));
-
return false;
- }
- } else {
-
return false;
- }
- } else {
- return false;
- }
- } else {
- return false;
- }
-
- } catch (XMLDBException e) {
- // TODO Auto-generated catch
block
- e.printStackTrace();
}
-
- } else {
- return false;
+ } catch (XMLDBException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
}
// A response from a request with no service
name element ata
// all. A successful response is expected.
@@ -1161,47 +1082,23 @@
+ " where
$a/perfsonar:subject/psservice:service[psservice:accessPoint='"
+ accessPoint + "'] return
$data/nmwg:metadata";
result = dbClient.queryDB(query);
- resultData = dbClient.queryDB(dataquery);
- if (resultCode.equals("success.ls.register"))
{
- // is the access point there?
- try {
+ try {
+ ResourceIterator it =
result.getIterator();
+ // checking to see if the response
code is the appropriate
+ // one and if no access point is
registered
+ if
(resultCode.equals("error.ls.no_service_name")
+ &&
(!it.hasMoreResources())) {
- if (result.getResource(0) !=
null) {
+ return true;
- Resource resource1 =
result.getResource(0);
- String
remoteAccessPoint = (String) resource1
-
.getContent();
- // is it equal to the
access point in the request?
- if
(remoteAccessPoint.equals(accessPoint)) {
+ } else {
+ return false;
- // do the
registry data exist?
- //Are they
the same as the original data?
- if
(resultData.getResource(0).getContent() != null) {
- if
(data.equals(getResult(resultData))) {
-
return true;
- }
else {
-
// System.out.println(data);
-
// System.out.println(getResult(result2));
-
return false;
- }
- } else {
-
return false;
- }
- } else {
- return false;
- }
- } else {
- return false;
- }
-
- } catch (XMLDBException e) {
- // TODO Auto-generated catch
block
- e.printStackTrace();
}
-
- } else {
- return false;
+ } catch (XMLDBException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
}
// A response from a request with no service
description element
// at all. A successful response is expected.
@@ -1311,7 +1208,7 @@
try {
if (i == 1) {
for (int j = 1; j < 2; j++) {
-
+
org.w3c.dom.Document
domDoc = builder
.parse(new File(responseDirectory
+ "/Response_a_" + i + "_" + j
Modified:
trunk/functional-testing/LS/src/ls/UpdateRequest/LSUpdateResponseParser.java
===================================================================
---
trunk/functional-testing/LS/src/ls/UpdateRequest/LSUpdateResponseParser.java
2007-02-13 19:48:13 UTC (rev 2067)
+++
trunk/functional-testing/LS/src/ls/UpdateRequest/LSUpdateResponseParser.java
2007-02-14 09:02:35 UTC (rev 2068)
@@ -108,7 +108,7 @@
"http://ggf.org/ns/nmwg/time/2.0/");
dbClient = new xmlDBClient(xmlDBInetAddress, "lookupservice",
"sonar");
- data = "<metadata xmlns=\"http://ggf.org/ns/nmwg/base/2.0/\"
id=\"meta1\">\n"
+ data = "<nmwg:metadata
xmlns:nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\" id=\"meta1\">\n"
+ " <netutil:subject
xmlns:netutil=\"http://ggf.org/ns/nmwg/characteristic/utilization/2.0/\"
id=\"subj1\">\n"
+ " <nmwgt:interface
xmlns:nmwgt=\"http://ggf.org/ns/nmwg/topology/2.0/\">\n"
+ "
<nmwgt:hostName>xyz.sdf.edf.edu</nmwgt:hostName>\n"
@@ -119,9 +119,9 @@
+ "
<nmwgt:capacity>1000000000</nmwgt:capacity>\n"
+ " </nmwgt:interface>\n"
+ " </netutil:subject>\n"
- + " <eventType>utilization</eventType>\n"
+ "</metadata>";
+ + "
<nmwg:eventType>utilization</nmwg:eventType>\n" + "</nmwg:metadata>";
data.trim();
- dataOld = "<metadata
xmlns=\"http://ggf.org/ns/nmwg/base/2.0/\" id=\"meta1\">\n"
+ dataOld = "<nmwg:metadata
xmlns:nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\" id=\"meta1\">\n"
+ " <netutil:subject
xmlns:netutil=\"http://ggf.org/ns/nmwg/characteristic/utilization/2.0/\"
id=\"subj1\">\n"
+ " <nmwgt:interface
xmlns:nmwgt=\"http://ggf.org/ns/nmwg/topology/2.0/\">\n"
+ "
<nmwgt:hostName>xyz.sdf.edf.edu</nmwgt:hostName>\n"
@@ -132,7 +132,7 @@
+ "
<nmwgt:capacity>1000000000</nmwgt:capacity>\n"
+ " </nmwgt:interface>\n"
+ " </netutil:subject>\n"
- + " <eventType>utilization</eventType>\n"
+ "</metadata>";
+ + "
<nmwg:eventType>utilization</nmwg:eventType>\n" + "</nmwg:metadata>";
dataOld.trim();
}
@@ -470,37 +470,31 @@
e.printStackTrace();
}
// A response from a request with no key but
with an access
- // point. A successful response is expected.
+ // point. An error response is expected.
case 3:
- // Retrieving result code
+ //Retrieving result code
resultCode =
((response.getRootElement()).getChild("metadata",
nmwg)).getChild("eventType",
nmwg).getText();
// Creating access point
- accessPoint = "http://update_request_" +
testCase + "_"
- + subCase +
"_0.net:8080/axis/services/MA";
+ accessPoint =
"http://not_existing_key.net:8080/axis/services/MA";
// creating query to check the registry
access point
- metadataQuery = "for $a in
/nmwg:store/nmwg:metadata//psservice:service[psservice:accessPoint='"
+ metadataQuery = "for $a in
/nmwg:store/nmwg:metadata//psservice:service[psservice:accessPoint='"
+ accessPoint
+ "'] return
$a/psservice:accessPoint/child::text()";
// creating query to check the registry data
- dataQuery = "for $a in
/nmwg:store/nmwg:metadata let $metadata_id:= $a/@id let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$metadata_id]"
- + " where
$a/perfsonar:subject/psservice:service[psservice:accessPoint='"
- + accessPoint + "'] return
$data/nmwg:metadata";
+ dataQuery = "for $a in
/nmwg:store/nmwg:metadata let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$a/@id]
where $a//psservice:service[psservice:accessPoint='"
+ + accessPoint
+ + "'] return
$data//nmwgt:ifDescription/child::text()";
+
try {
meta_It =
dbClient.queryDB(metadataQuery).getIterator();
data_It =
dbClient.queryDB(dataQuery).getIterator();
// checking result code if its the
appropriate one
- if
(resultCode.equals("success.ls.register")) {
- // do we have metadata?
- if
(meta_It.hasMoreResources()) {
- if
(data_It.hasMoreResources()) {
- // are the
data changed?
- //Are the
stored data the updated data?
- if
(data.equals(getResult(data_It))) {
-
return true;
- } else {
-
return false;
- }
+ if
(resultCode.equals("error.ls.update.key_not_found")) {
+ // no metadata or data should
be present
+ if
(!meta_It.hasMoreResources()) {
+ if
(!data_It.hasMoreResources()) {
+ return true;
} else {
return false;
}
@@ -514,44 +508,36 @@
// TODO Auto-generated catch block
e.printStackTrace();
}
- // A response from a request with no service
element. A
- // successful response is expected
+ // A response from a request with no service
element. An
+ // error response is expected
case 4:
- // Retrieving result code
+// Retrieving result code
resultCode =
((response.getRootElement()).getChild("metadata",
nmwg)).getChild("eventType",
nmwg).getText();
// Creating access point
- accessPoint = "http://update_request_" +
testCase + "_"
- + subCase +
"_0.net:8080/axis/services/MA";
+ accessPoint =
"http://not_existing_key.net:8080/axis/services/MA";
// creating query to check the registry
access point
- metadataQuery = "for $a in
/nmwg:store/nmwg:metadata//psservice:service[psservice:accessPoint='"
+ metadataQuery = "for $a in
/nmwg:store/nmwg:metadata//psservice:service[psservice:accessPoint='"
+ accessPoint
+ "'] return
$a/psservice:accessPoint/child::text()";
// creating query to check the registry data
- dataQuery = "for $a in
/nmwg:store/nmwg:metadata let $metadata_id:= $a/@id let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$metadata_id]"
- + " where
$a/perfsonar:subject/psservice:service[psservice:accessPoint='"
- + accessPoint + "'] return
$data/nmwg:metadata";
-
+ dataQuery = "for $a in
/nmwg:store/nmwg:metadata let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$a/@id]
where $a//psservice:service[psservice:accessPoint='"
+ + accessPoint
+ + "'] return
$data//nmwgt:ifDescription/child::text()";
+
try {
meta_It =
dbClient.queryDB(metadataQuery).getIterator();
data_It =
dbClient.queryDB(dataQuery).getIterator();
// checking result code if its the
appropriate one
- if
(resultCode.equals("success.ls.register")) {
- // do we have metadata?
- if
(meta_It.hasMoreResources()) {
- if
(data_It.hasMoreResources()) {
- // are the
data changed?
- //Are the
stored data the updated data?
- if
(data.equals(getResult(data_It))) {
-
return true;
- } else {
-
return false;
- }
+ if
(resultCode.equals("error.ls.no_access_point")) {
+ // no metadata or data should
be present
+ if
(!meta_It.hasMoreResources()) {
+ if
(!data_It.hasMoreResources()) {
+ return true;
} else {
return false;
}
} else {
- //
System.out.println("no meta");
return false;
}
} else {
@@ -671,49 +657,36 @@
// TODO Auto-generated catch block
e.printStackTrace();
}
- // A response from a request with no access
point value. A
- // successful response is expected
+ // A response from a request with no access
point value. An
+ // error response is expected
case 3:
- // Retrieving result code
+// Retrieving result code
resultCode =
((response.getRootElement()).getChild("metadata",
nmwg)).getChild("eventType",
nmwg).getText();
// Creating access point
- accessPoint = "http://update_request_" +
testCase + "_"
- + subCase +
"_0.net:8080/axis/services/MA";
+ accessPoint =
"http://not_existing_key.net:8080/axis/services/MA";
// creating query to check the registry
access point
- metadataQuery = "for $a in
/nmwg:store/nmwg:metadata//psservice:service[psservice:accessPoint='"
+ metadataQuery = "for $a in
/nmwg:store/nmwg:metadata//psservice:service[psservice:accessPoint='"
+ accessPoint
+ "'] return
$a/psservice:accessPoint/child::text()";
// creating query to check the registry data
- dataQuery = "for $a in
/nmwg:store/nmwg:metadata let $metadata_id:= $a/@id let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$metadata_id]"
- + " where
$a/perfsonar:subject/psservice:service[psservice:accessPoint='"
- + accessPoint + "'] return
$data/nmwg:metadata";
-
+ dataQuery = "for $a in
/nmwg:store/nmwg:metadata let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$a/@id]
where $a//psservice:service[psservice:accessPoint='"
+ + accessPoint
+ + "'] return
$data//nmwgt:ifDescription/child::text()";
+
try {
meta_It =
dbClient.queryDB(metadataQuery).getIterator();
data_It =
dbClient.queryDB(dataQuery).getIterator();
// checking result code if its the
appropriate one
- if
(resultCode.equals("success.ls.register")) {
- // checking to see if we have
metadata
- if
(meta_It.hasMoreResources()) {
- String key = (String)
meta_It.nextResource()
-
.getContent();
- if
(data_It.hasMoreResources()) {
- // Are the
data changed?
- //Are the
stored data the updated data?
- if
((data.equals(data_It))
-
&& (key.equals(accessPoint))) {
-
return true;
- } else {
- //
System.out.println(key);
-
return false;
- }
+ if
(resultCode.equals("error.ls.no_access_point")) {
+ // no metadata or data should
be present
+ if
(!meta_It.hasMoreResources()) {
+ if
(!data_It.hasMoreResources()) {
+ return true;
} else {
- //
System.out.println(key);
return false;
}
} else {
- //
System.out.println("no metadata");
return false;
}
} else {
@@ -723,39 +696,32 @@
// TODO Auto-generated catch block
e.printStackTrace();
}
- // A response from a request with no service
Type value. A
- // successful response expected
+ // A response from a request with no service
Type value. An
+ // error response expected
case 4:
- // Retrieving result code
+// Retrieving result code
resultCode =
((response.getRootElement()).getChild("metadata",
nmwg)).getChild("eventType",
nmwg).getText();
// Creating access point
- accessPoint = "http://update_request_" +
testCase + "_"
- + subCase +
"_0.net:8080/axis/services/MA";
+ accessPoint =
"http://not_existing_key.net:8080/axis/services/MA";
// creating query to check the registry
access point
- metadataQuery = "for $a in
/nmwg:store/nmwg:metadata//psservice:service[psservice:accessPoint='"
+ metadataQuery = "for $a in
/nmwg:store/nmwg:metadata//psservice:service[psservice:accessPoint='"
+ accessPoint
+ "'] return
$a/psservice:accessPoint/child::text()";
// creating query to check the registry data
- dataQuery = "for $a in
/nmwg:store/nmwg:metadata let $metadata_id:= $a/@id let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$metadata_id]"
- + " where
$a/perfsonar:subject/psservice:service[psservice:accessPoint='"
- + accessPoint + "'] return
$data/nmwg:metadata";
-
+ dataQuery = "for $a in
/nmwg:store/nmwg:metadata let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$a/@id]
where $a//psservice:service[psservice:accessPoint='"
+ + accessPoint
+ + "'] return
$data//nmwgt:ifDescription/child::text()";
+
try {
meta_It =
dbClient.queryDB(metadataQuery).getIterator();
data_It =
dbClient.queryDB(dataQuery).getIterator();
// checking result code if its the
appropriate one
- if
(resultCode.equals("success.ls.register")) {
- // checking to see if we have
metadata
- if
(meta_It.hasMoreResources()) {
- if
(data_It.hasMoreResources()) {
- //Are the
data changed?
- //Are the
stored data the updated data?
- if
(data.equals(getResult(data_It))) {
-
return true;
- } else {
-
return false;
- }
+ if
(resultCode.equals("error.ls.no_service_type")) {
+ // no metadata or data should
be present
+ if
(!meta_It.hasMoreResources()) {
+ if
(!data_It.hasMoreResources()) {
+ return true;
} else {
return false;
}
@@ -769,39 +735,32 @@
// TODO Auto-generated catch block
e.printStackTrace();
}
- // A response from a request without a
service name value. A
- // successful response is expected
+ // A response from a request without a
service name value. An
+ // error response is expected
case 5:
- // Retrieving result code
+// Retrieving result code
resultCode =
((response.getRootElement()).getChild("metadata",
nmwg)).getChild("eventType",
nmwg).getText();
// Creating access point
- accessPoint = "http://update_request_" +
testCase + "_"
- + subCase +
"_0.net:8080/axis/services/MA";
+ accessPoint =
"http://not_existing_key.net:8080/axis/services/MA";
// creating query to check the registry
access point
- metadataQuery = "for $a in
/nmwg:store/nmwg:metadata//psservice:service[psservice:accessPoint='"
+ metadataQuery = "for $a in
/nmwg:store/nmwg:metadata//psservice:service[psservice:accessPoint='"
+ accessPoint
+ "'] return
$a/psservice:accessPoint/child::text()";
// creating query to check the registry data
- dataQuery = "for $a in
/nmwg:store/nmwg:metadata let $metadata_id:= $a/@id let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$metadata_id]"
- + " where
$a/perfsonar:subject/psservice:service[psservice:accessPoint='"
- + accessPoint + "'] return
$data/nmwg:metadata";
-
+ dataQuery = "for $a in
/nmwg:store/nmwg:metadata let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$a/@id]
where $a//psservice:service[psservice:accessPoint='"
+ + accessPoint
+ + "'] return
$data//nmwgt:ifDescription/child::text()";
+
try {
meta_It =
dbClient.queryDB(metadataQuery).getIterator();
data_It =
dbClient.queryDB(dataQuery).getIterator();
// checking result code if its the
appropriate one
- if
(resultCode.equals("success.ls.register")) {
- // checking to see if we have
metadata
- if
(meta_It.hasMoreResources()) {
- if
(data_It.hasMoreResources()) {
- // Are the
data changed?
- //Are the
stored data the updated data?
- if
(data.equals(getResult(data_It))) {
-
return true;
- } else {
-
return false;
- }
+ if
(resultCode.equals("error.ls.no_service_name")) {
+ // no metadata or data should
be present
+ if
(!meta_It.hasMoreResources()) {
+ if
(!data_It.hasMoreResources()) {
+ return true;
} else {
return false;
}
@@ -1004,46 +963,35 @@
e.printStackTrace();
}
// A resposne from a request with no access
point element at
- // all. A succesful response is expected.
+ // all. An error response is expected.
case 10:
- // Retrieving result code
+// Retrieving result code
resultCode =
((response.getRootElement()).getChild("metadata",
nmwg)).getChild("eventType",
nmwg).getText();
// Creating access point
- accessPoint = "http://update_request_" +
testCase + "_"
- + subCase +
"_0.net:8080/axis/services/MA";
+ accessPoint =
"http://not_existing_key.net:8080/axis/services/MA";
// creating query to check the registry
access point
- metadataQuery = "for $a in
/nmwg:store/nmwg:metadata//psservice:service[psservice:accessPoint='"
+ metadataQuery = "for $a in
/nmwg:store/nmwg:metadata//psservice:service[psservice:accessPoint='"
+ accessPoint
+ "'] return
$a/psservice:accessPoint/child::text()";
// creating query to check the registry data
- dataQuery = "for $a in
/nmwg:store/nmwg:metadata let $metadata_id:= $a/@id let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$metadata_id]"
- + " where
$a/perfsonar:subject/psservice:service[psservice:accessPoint='"
- + accessPoint + "'] return
$data/nmwg:metadata";
-
+ dataQuery = "for $a in
/nmwg:store/nmwg:metadata let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$a/@id]
where $a//psservice:service[psservice:accessPoint='"
+ + accessPoint
+ + "'] return
$data//nmwgt:ifDescription/child::text()";
+
try {
meta_It =
dbClient.queryDB(metadataQuery).getIterator();
data_It =
dbClient.queryDB(dataQuery).getIterator();
// checking result code if its the
appropriate one
- if
(resultCode.equals("success.ls.register")) {
- // checking to see if we have
metadata
- if
(meta_It.hasMoreResources()) {
- String key = (String)
meta_It.nextResource()
-
.getContent();
- if
(data_It.hasMoreResources()) {
- //Are the
data changed?
- //Are the
stored data the updated data?
- if
(data.equals(getResult(data_It))) {
-
return true;
- } else {
-
return false;
- }
+ if
(resultCode.equals("error.ls.no_access_point")) {
+ // no metadata or data should
be present
+ if
(!meta_It.hasMoreResources()) {
+ if
(!data_It.hasMoreResources()) {
+ return true;
} else {
- //
System.out.println(key);
return false;
}
} else {
- //
System.out.println("no metadata");
return false;
}
} else {
@@ -1054,37 +1002,31 @@
e.printStackTrace();
}
// A response from a request with no service
type element at
- // all. A successful response is expected.
+ // all. An error response is expected.
case 11:
- // Retrieving result code
+// Retrieving result code
resultCode =
((response.getRootElement()).getChild("metadata",
nmwg)).getChild("eventType",
nmwg).getText();
// Creating access point
- accessPoint = "http://update_request_" +
testCase + "_"
- + subCase +
"_0.net:8080/axis/services/MA";
+ accessPoint =
"http://not_existing_key.net:8080/axis/services/MA";
// creating query to check the registry
access point
- metadataQuery = "for $a in
/nmwg:store/nmwg:metadata//psservice:service[psservice:accessPoint='"
+ metadataQuery = "for $a in
/nmwg:store/nmwg:metadata//psservice:service[psservice:accessPoint='"
+ accessPoint
+ "'] return
$a/psservice:accessPoint/child::text()";
// creating query to check the registry data
- dataQuery = "for $a in
/nmwg:store/nmwg:metadata let $metadata_id:= $a/@id let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$metadata_id]"
- + " where
$a/perfsonar:subject/psservice:service[psservice:accessPoint='"
- + accessPoint + "'] return
$data/nmwg:metadata";
+ dataQuery = "for $a in
/nmwg:store/nmwg:metadata let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$a/@id]
where $a//psservice:service[psservice:accessPoint='"
+ + accessPoint
+ + "'] return
$data//nmwgt:ifDescription/child::text()";
+
try {
meta_It =
dbClient.queryDB(metadataQuery).getIterator();
data_It =
dbClient.queryDB(dataQuery).getIterator();
// checking result code if its the
appropriate one
- if
(resultCode.equals("success.ls.register")) {
- // checking to see if we have
metadata
- if
(meta_It.hasMoreResources()) {
- if
(data_It.hasMoreResources()) {
- // Are the
data changed?
- //Are the
stored data the updated data?
- if
(data.equals(getResult(data_It))) {
-
return true;
- } else {
-
return false;
- }
+ if
(resultCode.equals("error.ls.no_service_type")) {
+ // no metadata or data should
be present
+ if
(!meta_It.hasMoreResources()) {
+ if
(!data_It.hasMoreResources()) {
+ return true;
} else {
return false;
}
@@ -1099,37 +1041,31 @@
e.printStackTrace();
}
// A response from a request with no service
name element ata
- // all. A successful response is expected.
+ // all. An error response is expected.
case 12:
- // Retrieving result code
+// Retrieving result code
resultCode =
((response.getRootElement()).getChild("metadata",
nmwg)).getChild("eventType",
nmwg).getText();
// Creating access point
- accessPoint = "http://update_request_" +
testCase + "_"
- + subCase +
"_0.net:8080/axis/services/MA";
+ accessPoint =
"http://not_existing_key.net:8080/axis/services/MA";
// creating query to check the registry
access point
- metadataQuery = "for $a in
/nmwg:store/nmwg:metadata//psservice:service[psservice:accessPoint='"
+ metadataQuery = "for $a in
/nmwg:store/nmwg:metadata//psservice:service[psservice:accessPoint='"
+ accessPoint
+ "'] return
$a/psservice:accessPoint/child::text()";
// creating query to check the registry data
- dataQuery = "for $a in
/nmwg:store/nmwg:metadata let $metadata_id:= $a/@id let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$metadata_id]"
- + " where
$a/perfsonar:subject/psservice:service[psservice:accessPoint='"
- + accessPoint + "'] return
$data/nmwg:metadata";
+ dataQuery = "for $a in
/nmwg:store/nmwg:metadata let $data :=
/nmwg:store/nmwg:data[@metadataIdRef=$a/@id]
where $a//psservice:service[psservice:accessPoint='"
+ + accessPoint
+ + "'] return
$data//nmwgt:ifDescription/child::text()";
+
try {
meta_It =
dbClient.queryDB(metadataQuery).getIterator();
data_It =
dbClient.queryDB(dataQuery).getIterator();
// checking result code if its the
appropriate one
- if
(resultCode.equals("success.ls.register")) {
- // checking to see if we have
metadata
- if
(meta_It.hasMoreResources()) {
- //Are the data
changed?
- //Are the stored data
the updated data?
- if
(data_It.hasMoreResources()) {
- if
(data.equals(getResult(data_It))) {
-
return true;
- } else {
-
return false;
- }
+ if
(resultCode.equals("error.ls.no_service_name")) {
+ // no metadata or data should
be present
+ if
(!meta_It.hasMoreResources()) {
+ if
(!data_It.hasMoreResources()) {
+ return true;
} else {
return false;
}
- r2068 - in trunk/functional-testing/LS/src/ls: DeregisterRequest QueryRequest RegisterRequest UpdateRequest, svnlog, 02/14/2007
Archive powered by MHonArc 2.6.16.