Skip to Content.
Sympa Menu

perfsonar-dev - [GEANT/SA2/ps-java-services] r5661 - in trunk/servlet-context-redirector/src: . test test/java test/java/net test/java/net/geant test/java/net/geant/perfsonar test/java/net/geant/perfsonar/filters

Subject: perfsonar development work

List archive

[GEANT/SA2/ps-java-services] r5661 - in trunk/servlet-context-redirector/src: . test test/java test/java/net test/java/net/geant test/java/net/geant/perfsonar test/java/net/geant/perfsonar/filters


Chronological Thread 
  • From:
  • To:
  • Subject: [GEANT/SA2/ps-java-services] r5661 - in trunk/servlet-context-redirector/src: . test test/java test/java/net test/java/net/geant test/java/net/geant/perfsonar test/java/net/geant/perfsonar/filters
  • Date: Wed, 19 May 2010 15:59:09 +0100

Author: psnc.trzaszczka
Date: 2010-05-19 15:59:09 +0100 (Wed, 19 May 2010)
New Revision: 5661

Added:
trunk/servlet-context-redirector/src/test/
trunk/servlet-context-redirector/src/test/java/
trunk/servlet-context-redirector/src/test/java/net/
trunk/servlet-context-redirector/src/test/java/net/geant/
trunk/servlet-context-redirector/src/test/java/net/geant/perfsonar/
trunk/servlet-context-redirector/src/test/java/net/geant/perfsonar/filters/

trunk/servlet-context-redirector/src/test/java/net/geant/perfsonar/filters/RedirectionFilterTestCase.java
Log:


Added:
trunk/servlet-context-redirector/src/test/java/net/geant/perfsonar/filters/RedirectionFilterTestCase.java
===================================================================
---
trunk/servlet-context-redirector/src/test/java/net/geant/perfsonar/filters/RedirectionFilterTestCase.java
(rev 0)
+++
trunk/servlet-context-redirector/src/test/java/net/geant/perfsonar/filters/RedirectionFilterTestCase.java
2010-05-19 14:59:09 UTC (rev 5661)
@@ -0,0 +1,42 @@
+package net.geant.perfsonar.filters;
+
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.net.URL;
+import java.net.URLConnection;
+
+import junit.framework.TestCase;
+
+public class RedirectionFilterTestCase extends TestCase {
+
+ private final String
SERVICE_URL="http://localhost:8080/servlet-context-redirector";;
+ private final String REDIRECTION_CONTEXT="perfsonar-java-xml-ls";
+
+ public void testRedirection() throws IOException {
+
+ URL url = new URL(SERVICE_URL);
+ URLConnection conn = url.openConnection();
+ conn.setDoOutput(true);
+ OutputStreamWriter wr = new
OutputStreamWriter(conn.getOutputStream());
+ wr.flush();
+ BufferedReader rd=null;
+ try {
+ rd = new BufferedReader(new InputStreamReader(conn
+ .getInputStream()));
+ fail();
+ } catch (FileNotFoundException ex) {
+
assertTrue(ex.getMessage().endsWith(REDIRECTION_CONTEXT));
+ }finally{
+ if(wr!=null){
+ wr.close();
+ }
+ if(rd!=null){
+ rd.close();
+ }
+ }
+
+ }
+}



  • [GEANT/SA2/ps-java-services] r5661 - in trunk/servlet-context-redirector/src: . test test/java test/java/net test/java/net/geant test/java/net/geant/perfsonar test/java/net/geant/perfsonar/filters, svn-noreply, 05/19/2010

Archive powered by MHonArc 2.6.16.

Top of Page