Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r5443 - in branches/new-structure-with-base2/ps-mdm-web-admin: ant src/main/java/org/perfsonar/webadmin/base2/servlet src/main/java/org/perfsonar/webadmin/base2/test tomcat/classes/perfsonar/conf

Subject: perfsonar development work

List archive

perfsonar: r5443 - in branches/new-structure-with-base2/ps-mdm-web-admin: ant src/main/java/org/perfsonar/webadmin/base2/servlet src/main/java/org/perfsonar/webadmin/base2/test tomcat/classes/perfsonar/conf


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r5443 - in branches/new-structure-with-base2/ps-mdm-web-admin: ant src/main/java/org/perfsonar/webadmin/base2/servlet src/main/java/org/perfsonar/webadmin/base2/test tomcat/classes/perfsonar/conf
  • Date: Wed, 30 Dec 2009 08:40:19 -0500

Author: trzaszcz
Date: 2009-12-30 08:40:19 -0500 (Wed, 30 Dec 2009)
New Revision: 5443

Modified:
branches/new-structure-with-base2/ps-mdm-web-admin/ant/build.xml

branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/servlet/SelfTestServlet.java

branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/test/SOAPClient.java

branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/test/SOAPClientException.java

branches/new-structure-with-base2/ps-mdm-web-admin/tomcat/classes/perfsonar/conf/wa.xml
Log:
selfTest improvement

Modified: branches/new-structure-with-base2/ps-mdm-web-admin/ant/build.xml
===================================================================
--- branches/new-structure-with-base2/ps-mdm-web-admin/ant/build.xml
2009-12-30 12:48:28 UTC (rev 5442)
+++ branches/new-structure-with-base2/ps-mdm-web-admin/ant/build.xml
2009-12-30 13:40:19 UTC (rev 5443)
@@ -51,6 +51,7 @@

<target name="get-repo" depends="init-lib-dependencies"
xmlns:artifact="urn:maven-artifact-ant">
<artifact:dependencies>
+
<dependency groupId="tomcat" artifactId="servlet-api"
version="5.0.28" />
<dependency groupId="Validation" artifactId="msv"
version="1.0" />
<dependency groupId="Validation" artifactId="xsdlib"
version="1.0" />
@@ -58,7 +59,10 @@
<dependency groupId="Validation"
artifactId="relaxngDatatype" version="1.0" />
<dependency groupId="xerces" artifactId="xercesImpl"
version="2.8.0" />
<dependency groupId="xalan" artifactId="xalan"
version="2.7.0" />
+ <dependency groupId="xalan" artifactId="serializer"
version="2.7.1" />
<dependency groupId="org.apache.httpcomponents"
artifactId="httpclient" version="4.0" />
+
+
<localRepository refid="local.repository" />
<remoteRepository refid="remote.repository" />
</artifact:dependencies>

Modified:
branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/servlet/SelfTestServlet.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/servlet/SelfTestServlet.java
2009-12-30 12:48:28 UTC (rev 5442)
+++
branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/servlet/SelfTestServlet.java
2009-12-30 13:40:19 UTC (rev 5443)
@@ -23,40 +23,42 @@
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
+
String path = getServletContext().getRealPath("/");
String basePath = path + "/WEB-INF";
+ String redirectURL = "index.jsp?page=selfTest";
+
ObjectMap objectMap = new ObjectMap(basePath,
ConfigurationServletHelper.WA_CONFIG_PATH,
ConfigurationServletHelper.WA_FILE_NAME);
String accessPoint = objectMap.getWA().getServiceInformation()
.getAccessPoint();
-
- System.out.println("A:C - "+accessPoint);
-
+
SOAPClient soapClient = new SOAPClient(accessPoint);
String messageContent = getFileContent(path + SELF_TEST_FILE);

if (messageContent == null) {
- getServletContext().setAttribute("errorMessage",
"Message is null");
- }else{
+ req.setAttribute("errorMessage", "Message is null");
+ } else {
String result;
try {
result =
soapClient.sendMessage(messageContent);
if (result != null) {
-
+ redirectURL = redirectURL + "&ok";
} else {
-
+ req.setAttribute("errorMessage",
"Result is null");
}
} catch (SOAPClientException e) {
-
getServletContext().setAttribute("errorMessage", e.getMessage());
+ getServletContext()
+ .setAttribute("errorMessage",
e.getMessage());
}
}
- getServletConfig().getServletContext().getRequestDispatcher(
- "/index.jsp?page=selfTest&ok").forward(req,
resp);
+
+ resp.sendRedirect(redirectURL);
}

private String getFileContent(String url) {
-
+
byte[] buffer = new byte[(int) new File(url).length()];
FileInputStream f;
try {
@@ -68,7 +70,7 @@
} catch (IOException e) {
e.printStackTrace();
}
-
+
return null;
}


Modified:
branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/test/SOAPClient.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/test/SOAPClient.java
2009-12-30 12:48:28 UTC (rev 5442)
+++
branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/test/SOAPClient.java
2009-12-30 13:40:19 UTC (rev 5443)
@@ -55,10 +55,10 @@
return httpclient.execute(httpPost,
responseHandler);
} catch (ClientProtocolException e) {
e.printStackTrace();
- throw new SOAPClientException(e.getMessage());
+ throw new SOAPClientException(e);
} catch (IOException e) {
e.printStackTrace();
- throw new SOAPClientException(e.getMessage());
+ throw new SOAPClientException(e);
} finally {
if (httpclient != null) {

httpclient.getConnectionManager().shutdown();
@@ -66,7 +66,7 @@
}
} catch (UnsupportedEncodingException e1) {
e1.printStackTrace();
- throw new SOAPClientException(e1.getMessage());
+ throw new SOAPClientException(e1);
}
}


Modified:
branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/test/SOAPClientException.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/test/SOAPClientException.java
2009-12-30 12:48:28 UTC (rev 5442)
+++
branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/test/SOAPClientException.java
2009-12-30 13:40:19 UTC (rev 5443)
@@ -3,7 +3,7 @@
@SuppressWarnings("serial")
public class SOAPClientException extends Exception{

- public SOAPClientException(String cause) {
- super(cause);
+ public SOAPClientException(Throwable throwable) {
+ super(throwable);
}
}

Modified:
branches/new-structure-with-base2/ps-mdm-web-admin/tomcat/classes/perfsonar/conf/wa.xml
===================================================================
---
branches/new-structure-with-base2/ps-mdm-web-admin/tomcat/classes/perfsonar/conf/wa.xml
2009-12-30 12:48:28 UTC (rev 5442)
+++
branches/new-structure-with-base2/ps-mdm-web-admin/tomcat/classes/perfsonar/conf/wa.xml
2009-12-30 13:40:19 UTC (rev 5443)
@@ -6,7 +6,7 @@

<!-- service information cosists of name nad version (only for
displaying purpose) and accessPoint - selfTest -->
<wa:serviceInformation>
-
<wa:accessPoint>http://localhost:9000/wa/AccessPoint</wa:accessPoint>
+
<wa:accessPoint>http://localhost:8180/geant2-java-xml-ls/services/LookupService</wa:accessPoint>
<wa:serviceName>Service Name</wa:serviceName>
<wa:version>1.23</wa:version>
</wa:serviceInformation>



  • perfsonar: r5443 - in branches/new-structure-with-base2/ps-mdm-web-admin: ant src/main/java/org/perfsonar/webadmin/base2/servlet src/main/java/org/perfsonar/webadmin/base2/test tomcat/classes/perfsonar/conf, svnlog, 12/30/2009

Archive powered by MHonArc 2.6.16.

Top of Page