perfsonar-dev - r1438 - trunk/perfsonar/src/org/perfsonar/client/testHarness
Subject: perfsonar development work
List archive
- From:
- To:
- Subject: r1438 - trunk/perfsonar/src/org/perfsonar/client/testHarness
- Date: Tue, 18 Jul 2006 08:56:33 -0400
Author: mac
Date: 2006-07-18 08:56:33 -0400 (Tue, 18 Jul 2006)
New Revision: 1438
Modified:
trunk/perfsonar/src/org/perfsonar/client/testHarness/LSTestClient.java
Log:
Removed some old unnecessary code for testing LS Service Engine
Modified:
trunk/perfsonar/src/org/perfsonar/client/testHarness/LSTestClient.java
===================================================================
--- trunk/perfsonar/src/org/perfsonar/client/testHarness/LSTestClient.java
2006-07-18 11:53:11 UTC (rev 1437)
+++ trunk/perfsonar/src/org/perfsonar/client/testHarness/LSTestClient.java
2006-07-18 12:56:33 UTC (rev 1438)
@@ -69,63 +69,6 @@
} catch (IndexOutOfBoundsException ex) {
System.out.println("For [RequestHandler] filename is required,
"+ex.getMessage());
}
-
-
-// if (requestType.equals("query")) {
-//
-// if (component.equals("ServiceEngine")) {
-//
-// try {
-// //Test XmlTypeLSServiceEngine, Query
-// lsTest.testServiceEngine(
-// lsTest.getQueryMessage(),
-// ActionType.LS_LOOKUP,
-// new XmlTypeLSServiceEngine()
-// );
-// } catch (SystemException e) {
-// e.printStackTrace();
-// }
-//
-// } else if (component.equals("MessageHandler")) {
-//
-// //Test LSQueryRequest MessageHandler
-// try {
-// lsTest.testMessageHandler(lsTest.getQueryMessage(), new
LSQueryRequest());
-// } catch (SystemException e) {
-// e.printStackTrace();
-// }
-//
-// } else if (component.equals("MessageHandlerFactory")) {
-//
-// //Test Query
-//
lsTest.testMessageHandlerFromFactory(lsTest.getQueryMessage());
-//
-// } else if (component.equals("RequestHandler")) {
-//
-// //Test Query
-// try {
-// String filename = args[2];
-// //"/projects/sonar/LSQueryRequest.xml";
-// lsTest.testRequestHandler("file://"+filename);
-//
-// } catch (NullPointerException ex) {
-// System.out.println("For [RequestHandler] filename is
required, "+ex.getMessage());
-// } catch (IndexOutOfBoundsException ex) {
-// System.out.println("For [RequestHandler] filename is
required, "+ex.getMessage());
-// }
-//
-//
-// }
-//
-// } else if (requestType.equals("register")) {
-//
-// System.out.println("Not implemented!");
-//
-// } else if (requestType.equals("deregister")) {
-//
-// System.out.println("Not implemented!");
-//
-// }
}
@@ -138,49 +81,7 @@
// ------------------------------------------------------ Private
methods
- /**
- * LSQueryRequest Message
- */
- private Message getQueryMessage() {
- //create request
-
- LookupInformationXQueryExpression queryExpression =
- new LookupInformationXQueryExpression("aaa");
- queryExpression.addCondition(
- LookupInformationXQueryExpression.METADATA+
- "//perfsonar:serviceType",
- "MA");
-
- String query = queryExpression.generateExpression();
-
- /* build metadata up from subject/eventtype/parameters */
- Subject subject = new Subject();
- subject.addAttr("id","SUBJ1", null);
- subject.setSubject(query);
- System.out.println("***"+subject+"***\n\n");
-
- EventType eventType = new EventType();
- eventType.setEventType("service.lookup.xquery");
-
- Metadata metadata = new Metadata();
- metadata.addAttr("id","META1", null);
- metadata.setSubject(subject);
- metadata.setEventType(eventType);
- /* trigger */
- Data data = new Data();
- data.setMetadataIdRef(metadata.getMetadataIdRef());
-
- /* add data/metadata into a message */
- Message m = new Message();
- m.setId("MSG");
- m.setType("LSQueryRequest");
- m.addChild(metadata);
- m.addChild(data);
-
- return m;
- }
-
private void showQueryResults(Message message) {
System.out.println("Result:");
@@ -273,15 +174,24 @@
format.setLineSeparator("\n");
StringWriter stringOut = new StringWriter();
-
+
XMLSerializer serial = new XMLSerializer( stringOut, format );
serial.asDOMSerializer();
serial.serialize( result.getDocumentElement() );
- String xmlresult = XMLUtils.convertEntitiesToCharacters(
- stringOut.toString());
+ String xmlresult = stringOut.toString();
+// String xmlresult =
XMLUtils.convertEntitiesToCharacters(stringOut.toString());
+
+
+
+ System.out.println("Output ["+xmlresult.length()+"b]: "+
+ ((xmlresult.length()<800)?
+ xmlresult
+ :
+ xmlresult.substring(0,800)+"..."));
- System.out.println("Test:
[RESULT]\n-------------------------------------\n"+xmlresult+"-------------------------------------");
+
+// System.out.println("Test:
[RESULT]\n-------------------------------------\n"+xmlresult+"-------------------------------------");
}
catch (Exception e) {
- r1438 - trunk/perfsonar/src/org/perfsonar/client/testHarness, svnlog, 07/18/2006
Archive powered by MHonArc 2.6.16.