Author: reto
Date: Mon Mar 1 15:00:27 2010
New Revision: 917555
URL: http://svn.apache.org/viewvc?rev=917555&view=rev
Log:
explicitely stopping TestWebServer
Modified:
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.jaxrs.utils/src/test/java/org/apache/clerezza/jaxrs/utils/TrailingSlashTest.java
Modified:
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.jaxrs.utils/src/test/java/org/apache/clerezza/jaxrs/utils/TrailingSlashTest.java
URL:
http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.jaxrs.utils/src/test/java/org/apache/clerezza/jaxrs/utils/TrailingSlashTest.java?rev=917555&r1=917554&r2=917555&view=diff
==============================================================================
---
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.jaxrs.utils/src/test/java/org/apache/clerezza/jaxrs/utils/TrailingSlashTest.java
(original)
+++
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.jaxrs.utils/src/test/java/org/apache/clerezza/jaxrs/utils/TrailingSlashTest.java
Mon Mar 1 15:00:27 2010
@@ -66,7 +66,8 @@
@Test
public void testEnforceSlash() throws IOException {
- int port = createTestWebServer(new MyResource()).getPort();
+ final TestWebServer testWebServer = createTestWebServer(new
MyResource());
+ int port = testWebServer.getPort();
URL serverURL = new URL("http://localhost:" + port +
"/foo/bar");
HttpURLConnection connection = (HttpURLConnection)
serverURL.openConnection();
connection = (HttpURLConnection) serverURL.openConnection();
@@ -74,12 +75,13 @@
connection.addRequestProperty("Accept", "text/html, */*;
q=.2");
Assert.assertEquals(204, connection.getResponseCode());
Assert.assertTrue(path.endsWith("/"));
+ testWebServer.stop();
}
@Test
public void testEnforceNoSlash() throws IOException {
-
- int port = createTestWebServer(new MyResource2()).getPort();
+ final TestWebServer testWebServer = createTestWebServer(new
MyResource2());
+ int port = testWebServer.getPort();
URL serverURL = new URL("http://localhost:" + port +
"/one/two/");
HttpURLConnection connection = (HttpURLConnection)
serverURL.openConnection();
connection = (HttpURLConnection) serverURL.openConnection();
@@ -88,6 +90,7 @@
connection.addRequestProperty("Accept", "text/html, */*; q=.2");
Assert.assertEquals(204, connection.getResponseCode());
Assert.assertFalse(path.endsWith("/"));
+ testWebServer.stop();
}