wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r915910 - in /incubator/wink/trunk/wink-itests/wink-itest: wink-itest-context/src/main/java/org/apache/wink/itest/request/ wink-itest-context/src/test/java/org/apache/wink/itest/request/ wink-itest-context/src/test/java/org/apache/wink/ites...
Date Wed, 24 Feb 2010 18:19:13 GMT
Author: rott
Date: Wed Feb 24 18:19:13 2010
New Revision: 915910

URL: http://svn.apache.org/viewvc?rev=915910&view=rev
Log:
use server time and timezone to set last modified date in itests, also ensure servernames
match up by .toLowerCase on strings

Modified:
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/request/RequestResource.java
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/test/java/org/apache/wink/itest/request/RequestMethodsTest.java
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/test/java/org/apache/wink/itest/request/WinkRequestMethodsTest.java
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/test/java/org/apache/wink/itest/uriinfo/WinkURIInfoNormalizationTest.java
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-params/src/main/java/org/apache/wink/itest/newcookie/CookieResource.java
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-params/src/test/java/org/apache/wink/itest/CookieFieldsTest.java

Modified: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/request/RequestResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/request/RequestResource.java?rev=915910&r1=915909&r2=915910&view=diff
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/request/RequestResource.java
(original)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/request/RequestResource.java
Wed Feb 24 18:19:13 2010
@@ -25,6 +25,7 @@
 import java.util.Date;
 import java.util.List;
 import java.util.Locale;
+import java.util.TimeZone;
 
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
@@ -55,6 +56,12 @@
                                                             new SimpleDateFormat(
                                                                                  "EEE, dd
MMM yyyy HH:mm:ss zzz",
                                                                                  Locale.ENGLISH);
+    
+    @GET
+    @Path("timezone")
+    public String getTimeZone() {
+        return TimeZone.getDefault().getDisplayName(false, TimeZone.SHORT);
+    }
 
     @GET
     @Path("date")

Modified: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/test/java/org/apache/wink/itest/request/RequestMethodsTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/test/java/org/apache/wink/itest/request/RequestMethodsTest.java?rev=915910&r1=915909&r2=915910&view=diff
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/test/java/org/apache/wink/itest/request/RequestMethodsTest.java
(original)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/test/java/org/apache/wink/itest/request/RequestMethodsTest.java
Wed Feb 24 18:19:13 2010
@@ -125,11 +125,26 @@
     private void checkIfModifiedSinceUsingSuppliedDateFormat(SimpleDateFormat formatter)
         throws IOException, HttpException {
         HttpClient client = new HttpClient();
+        
+        /*
+         * get the time zone for the server
+         */
+        GetMethod getMethod = new GetMethod(getBaseURI() + "/context/request/timezone");
+        String serverTimeZone = null;
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            serverTimeZone = getMethod.getResponseBodyAsString();
+        } finally {
+            getMethod.releaseConnection();
+        }
 
         PutMethod putMethod = new PutMethod(getBaseURI() + "/context/request/date");
         Date d2 = new Date(System.currentTimeMillis() - 120000);
         Date d = new Date(System.currentTimeMillis() - 60000);
-        String date = DateFormat.getDateTimeInstance().format(d);
+        DateFormat dateFormat = DateFormat.getDateTimeInstance();
+        dateFormat.setTimeZone(TimeZone.getTimeZone(serverTimeZone));
+        String date = dateFormat.format(d);
         putMethod.setRequestEntity(new StringRequestEntity(date, "text/string", "UTF-8"));
         try {
             /*
@@ -141,7 +156,8 @@
             putMethod.releaseConnection();
         }
 
-        GetMethod getMethod = new GetMethod(getBaseURI() + "/context/request/date");
+        formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
+        getMethod = new GetMethod(getBaseURI() + "/context/request/date");
         getMethod.setRequestHeader("If-Modified-Since", formatter.format(d));
         try {
             /*
@@ -164,8 +180,10 @@
              */
             client.executeMethod(getMethod);
             assertEquals(200, getMethod.getStatusCode());
+            rfc1123Format.setTimeZone(TimeZone.getTimeZone(serverTimeZone));
             assertEquals("the date: " + rfc1123Format.format(d), getMethod
                 .getResponseBodyAsString());
+            rfc1123Format.setTimeZone(TimeZone.getDefault());
 
             rfc1123Format.setTimeZone(TimeZone.getTimeZone("GMT"));
             assertEquals(rfc1123Format.format(d), getMethod.getResponseHeader("Last-Modified")
@@ -190,6 +208,7 @@
             getMethod.releaseConnection();
         }
 
+        formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
         getMethod = new GetMethod(getBaseURI() + "/context/request/date");
         getMethod.setRequestHeader("If-Modified-Since", formatter.format(d2));
         try {
@@ -200,8 +219,10 @@
              */
             client.executeMethod(getMethod);
             assertEquals(200, getMethod.getStatusCode());
+            rfc1123Format.setTimeZone(TimeZone.getTimeZone(serverTimeZone));
             assertEquals("the date: " + rfc1123Format.format(d), getMethod
                 .getResponseBodyAsString());
+            rfc1123Format.setTimeZone(TimeZone.getDefault());
 
             rfc1123Format.setTimeZone(TimeZone.getTimeZone("GMT"));
             assertEquals(rfc1123Format.format(d), getMethod.getResponseHeader("Last-Modified")
@@ -211,6 +232,7 @@
             getMethod.releaseConnection();
         }
 
+        formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
         getMethod = new GetMethod(getBaseURI() + "/context/request/date");
         getMethod.setRequestHeader("If-Modified-Since", formatter.format(new Date()));
         try {
@@ -265,11 +287,26 @@
     private void checkIfUnmodifiedSinceUsingSuppliedDateFormat(SimpleDateFormat formatter)
         throws IOException, HttpException {
         HttpClient client = new HttpClient();
+        
+        /*
+         * get the time zone for the server
+         */
+        GetMethod getMethod = new GetMethod(getBaseURI() + "/context/request/timezone");
+        String serverTimeZone = null;
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            serverTimeZone = getMethod.getResponseBodyAsString();
+        } finally {
+            getMethod.releaseConnection();
+        }
 
         PutMethod putMethod = new PutMethod(getBaseURI() + "/context/request/date");
         Date d2 = new Date(System.currentTimeMillis() - 120000);
         Date d = new Date(System.currentTimeMillis() - 60000);
-        String date = DateFormat.getDateTimeInstance().format(d);
+        DateFormat dateFormat = DateFormat.getDateTimeInstance();
+        dateFormat.setTimeZone(TimeZone.getTimeZone(serverTimeZone));
+        String date = dateFormat.format(d);
         putMethod.setRequestEntity(new StringRequestEntity(date, "text/string", "UTF-8"));
         try {
             /*
@@ -281,7 +318,8 @@
             putMethod.releaseConnection();
         }
 
-        GetMethod getMethod = new GetMethod(getBaseURI() + "/context/request/date");
+        formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
+        getMethod = new GetMethod(getBaseURI() + "/context/request/date");
         getMethod.setRequestHeader("If-Unmodified-Since", formatter.format(d));
         try {
             /*
@@ -291,8 +329,10 @@
              */
             client.executeMethod(getMethod);
             assertEquals(200, getMethod.getStatusCode());
+            rfc1123Format.setTimeZone(TimeZone.getTimeZone(serverTimeZone));
             assertEquals("the date: " + rfc1123Format.format(d), getMethod
                 .getResponseBodyAsString());
+            rfc1123Format.setTimeZone(TimeZone.getDefault());
 
             rfc1123Format.setTimeZone(TimeZone.getTimeZone("GMT"));
             assertEquals(rfc1123Format.format(d), getMethod.getResponseHeader("Last-Modified")
@@ -311,8 +351,10 @@
              */
             client.executeMethod(getMethod);
             assertEquals(200, getMethod.getStatusCode());
+            rfc1123Format.setTimeZone(TimeZone.getTimeZone(serverTimeZone));
             assertEquals("the date: " + rfc1123Format.format(d), getMethod
                 .getResponseBodyAsString());
+            rfc1123Format.setTimeZone(TimeZone.getDefault());
 
             rfc1123Format.setTimeZone(TimeZone.getTimeZone("GMT"));
             assertEquals(rfc1123Format.format(d), getMethod.getResponseHeader("Last-Modified")
@@ -334,8 +376,10 @@
              */
             client.executeMethod(getMethod);
             assertEquals(200, getMethod.getStatusCode());
+            rfc1123Format.setTimeZone(TimeZone.getTimeZone(serverTimeZone));
             assertEquals("the date: " + rfc1123Format.format(d), getMethod
                 .getResponseBodyAsString());
+            rfc1123Format.setTimeZone(TimeZone.getDefault());
 
             rfc1123Format.setTimeZone(TimeZone.getTimeZone("GMT"));
             assertEquals(rfc1123Format.format(d), getMethod.getResponseHeader("Last-Modified")
@@ -345,6 +389,7 @@
             getMethod.releaseConnection();
         }
 
+        formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
         getMethod = new GetMethod(getBaseURI() + "/context/request/date");
         getMethod.setRequestHeader("If-Unmodified-Since", formatter.format(d2));
         try {
@@ -359,6 +404,7 @@
             getMethod.releaseConnection();
         }
 
+        formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
         getMethod = new GetMethod(getBaseURI() + "/context/request/date");
         getMethod.setRequestHeader("If-Unmodified-Since", formatter.format(new Date()));
         try {
@@ -369,8 +415,10 @@
              */
             client.executeMethod(getMethod);
             assertEquals(200, getMethod.getStatusCode());
+            rfc1123Format.setTimeZone(TimeZone.getTimeZone(serverTimeZone));
             assertEquals("the date: " + rfc1123Format.format(d), getMethod
                 .getResponseBodyAsString());
+            rfc1123Format.setTimeZone(TimeZone.getDefault());
 
             rfc1123Format.setTimeZone(TimeZone.getTimeZone("GMT"));
             assertEquals(rfc1123Format.format(d), getMethod.getResponseHeader("Last-Modified")

Modified: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/test/java/org/apache/wink/itest/request/WinkRequestMethodsTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/test/java/org/apache/wink/itest/request/WinkRequestMethodsTest.java?rev=915910&r1=915909&r2=915910&view=diff
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/test/java/org/apache/wink/itest/request/WinkRequestMethodsTest.java
(original)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/test/java/org/apache/wink/itest/request/WinkRequestMethodsTest.java
Wed Feb 24 18:19:13 2010
@@ -129,14 +129,25 @@
         throws IOException, HttpException {
         Date d2 = new Date(System.currentTimeMillis() - 120000);
         Date d = new Date(System.currentTimeMillis() - 60000);
-        String date = DateFormat.getDateTimeInstance().format(d);
+       
+        /*
+         * get the time zone for the server
+         */
+        Resource dateResource = client.resource(getBaseURI() + "/context/request/timezone");
+        ClientResponse response = dateResource.get();
+        assertEquals(200, response.getStatusCode());
+        String serverTimeZone = response.getEntity(String.class);
+        
         /*
          * sets a last modified date
          */
-        Resource dateResource = client.resource(getBaseURI() + "/context/request/date");
-        ClientResponse response = dateResource.contentType("text/string").put(date);
+        dateResource = client.resource(getBaseURI() + "/context/request/date");
+        DateFormat dateFormat = DateFormat.getDateTimeInstance();
+        dateFormat.setTimeZone(TimeZone.getTimeZone(serverTimeZone));
+        response = dateResource.contentType("text/string").put(dateFormat.format(d));
         assertEquals(204, response.getStatusCode());
 
+        formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
         response = dateResource.header(HttpHeaders.IF_MODIFIED_SINCE, formatter.format(d)).get();
         /*
          * verifies that if the exact date is sent in and used in
@@ -152,7 +163,9 @@
         dateResource = client.resource(getBaseURI() + "/context/request/date");
         response = dateResource.get();
         assertEquals(200, response.getStatusCode());
+        rfc1123Format.setTimeZone(TimeZone.getTimeZone(serverTimeZone));
         assertEquals("the date: " + rfc1123Format.format(d), response.getEntity(String.class));
+        rfc1123Format.setTimeZone(TimeZone.getDefault());
 
         rfc1123Format.setTimeZone(TimeZone.getTimeZone("GMT"));
         assertEquals(rfc1123Format.format(d), response.getHeaders()
@@ -173,10 +186,13 @@
          * Last-Modified response header sent by server then the server will
          * return a 200 with entity
          */
+        formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
         dateResource = client.resource(getBaseURI() + "/context/request/date");
         response = dateResource.header(HttpHeaders.IF_MODIFIED_SINCE, formatter.format(d2)).get();
         assertEquals(200, response.getStatusCode());
+        rfc1123Format.setTimeZone(TimeZone.getTimeZone(serverTimeZone));
         assertEquals("the date: " + rfc1123Format.format(d), response.getEntity(String.class));
+        rfc1123Format.setTimeZone(TimeZone.getDefault());
 
         rfc1123Format.setTimeZone(TimeZone.getTimeZone("GMT"));
         assertEquals(rfc1123Format.format(d), response.getHeaders()
@@ -187,6 +203,7 @@
          * verifies that using a If-Modified-Since later than the Last-Modified
          * response header sent by server, then the server will return a 304
          */
+        formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
         dateResource = client.resource(getBaseURI() + "/context/request/date");
         response =
             dateResource.header(HttpHeaders.IF_MODIFIED_SINCE, formatter.format(new Date())).get();
@@ -233,10 +250,19 @@
         throws IOException, HttpException {
         Date d2 = new Date(System.currentTimeMillis() - 120000);
         Date d = new Date(System.currentTimeMillis() - 60000);
-        String date = DateFormat.getDateTimeInstance().format(d);
-        ClientResponse response =
+        
+        /*
+         * get the time zone for the server
+         */
+        ClientResponse response = client.resource(getBaseURI() + "/context/request/timezone").get();
+        assertEquals(200, response.getStatusCode());
+        String serverTimeZone = response.getEntity(String.class);
+        
+        DateFormat dateFormat = DateFormat.getDateTimeInstance();
+        dateFormat.setTimeZone(TimeZone.getTimeZone(serverTimeZone));
+        response =
             client.resource(getBaseURI() + "/context/request/date").contentType("text/string")
-                .put(date);
+                .put(dateFormat.format(d));
         assertEquals(204, response.getStatusCode());
 
         /*
@@ -244,11 +270,14 @@
          * If-Unmodified-Since header, then the server will be ok and that it
          * will return 200
          */
+        formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
         response =
             client.resource(getBaseURI() + "/context/request/date")
                 .header(HttpHeaders.IF_UNMODIFIED_SINCE, formatter.format(d)).get();
         assertEquals(200, response.getStatusCode());
+        rfc1123Format.setTimeZone(TimeZone.getTimeZone(serverTimeZone));
         assertEquals("the date: " + rfc1123Format.format(d), response.getEntity(String.class));
+        rfc1123Format.setTimeZone(TimeZone.getDefault());
 
         rfc1123Format.setTimeZone(TimeZone.getTimeZone("GMT"));
         assertEquals(rfc1123Format.format(d), response.getHeaders().getFirst("Last-Modified"));
@@ -261,7 +290,9 @@
         response = client.resource(getBaseURI() + "/context/request/date").get();
 
         assertEquals(200, response.getStatusCode());
+        rfc1123Format.setTimeZone(TimeZone.getTimeZone(serverTimeZone));
         assertEquals("the date: " + rfc1123Format.format(d), response.getEntity(String.class));
+        rfc1123Format.setTimeZone(TimeZone.getDefault());
 
         rfc1123Format.setTimeZone(TimeZone.getTimeZone("GMT"));
         assertEquals(rfc1123Format.format(d), response.getHeaders()
@@ -279,7 +310,9 @@
                 .header(HttpHeaders.IF_UNMODIFIED_SINCE, lastModified).get();
 
         assertEquals(200, response.getStatusCode());
+        rfc1123Format.setTimeZone(TimeZone.getTimeZone(serverTimeZone));
         assertEquals("the date: " + rfc1123Format.format(d), response.getEntity(String.class));
+        rfc1123Format.setTimeZone(TimeZone.getDefault());
 
         rfc1123Format.setTimeZone(TimeZone.getTimeZone("GMT"));
         assertEquals(rfc1123Format.format(d), response.getHeaders()
@@ -291,11 +324,13 @@
          * Last-Modified response header sent by server then the server will
          * return a 412
          */
+        formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
         response =
             client.resource(getBaseURI() + "/context/request/date")
                 .header(HttpHeaders.IF_UNMODIFIED_SINCE, formatter.format(d2)).get();
         assertEquals(412, response.getStatusCode());
 
+        formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
         response =
             client.resource(getBaseURI() + "/context/request/date")
                 .header(HttpHeaders.IF_UNMODIFIED_SINCE, formatter.format(new Date())).get();
@@ -305,7 +340,9 @@
          * return 200 and the entity
          */
         assertEquals(200, response.getStatusCode());
+        rfc1123Format.setTimeZone(TimeZone.getTimeZone(serverTimeZone));
         assertEquals("the date: " + rfc1123Format.format(d), response.getEntity(String.class));
+        rfc1123Format.setTimeZone(TimeZone.getDefault());
 
         rfc1123Format.setTimeZone(TimeZone.getTimeZone("GMT"));
         assertEquals(rfc1123Format.format(d), response.getHeaders()

Modified: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/test/java/org/apache/wink/itest/uriinfo/WinkURIInfoNormalizationTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/test/java/org/apache/wink/itest/uriinfo/WinkURIInfoNormalizationTest.java?rev=915910&r1=915909&r2=915910&view=diff
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/test/java/org/apache/wink/itest/uriinfo/WinkURIInfoNormalizationTest.java
(original)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/test/java/org/apache/wink/itest/uriinfo/WinkURIInfoNormalizationTest.java
Wed Feb 24 18:19:13 2010
@@ -67,6 +67,7 @@
      * @throws Exception
      */
     public void testRemoveResourcePathThenAddItBack() throws Exception {
+        
         ClientResponse response =
             client.resource(getBaseURI() + "/uriinfo/../uriinfo" + "?info=path").get();
         assertEquals(200, response.getStatusCode());
@@ -106,6 +107,7 @@
      * @throws Exception
      */
     public void testAddPathThenRemoveIt() throws Exception {
+        
         ClientResponse response =
             client.resource(getBaseURI() + "/uriinfo/something/../" + "?info=path").get();
         assertEquals(200, response.getStatusCode());
@@ -134,6 +136,7 @@
      * @throws Exception
      */
     public void testCapitalization() throws Exception {
+        
         String contextRoot = ServerEnvironmentInfo.getContextRoot();
         if (!"".equals(contextRoot)) {
             contextRoot = "/" + contextRoot;
@@ -196,6 +199,7 @@
      * @throws Exception
      */
     public void testPercentEncoding() throws Exception {
+        
         /*
          * regular query
          */

Modified: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-params/src/main/java/org/apache/wink/itest/newcookie/CookieResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-params/src/main/java/org/apache/wink/itest/newcookie/CookieResource.java?rev=915910&r1=915909&r2=915910&view=diff
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-params/src/main/java/org/apache/wink/itest/newcookie/CookieResource.java
(original)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-params/src/main/java/org/apache/wink/itest/newcookie/CookieResource.java
Wed Feb 24 18:19:13 2010
@@ -64,7 +64,7 @@
                         + ","
                         + c.getPath()
                         + ","
-                        + c.getDomain()
+                        + c.getDomain().toLowerCase()
                         + "\r";
             }
         }
@@ -102,11 +102,11 @@
     public Response setCookies() {
         ResponseBuilder rb = Response.ok();
         rb.cookie(new NewCookie("name", "value", uri.getBaseUri().getPath() + uri.getPath(),
uri
-            .getBaseUri().getHost(), "comment", 10, false));
+            .getBaseUri().getHost().toLowerCase(), "comment", 10, false));
         rb.cookie(new NewCookie("name2", "value2", uri.getBaseUri().getPath() + uri.getPath(),
uri
-            .getBaseUri().getHost(), "comment2", 10, false));
+            .getBaseUri().getHost().toLowerCase(), "comment2", 10, false));
         rb.cookie(new NewCookie("name3", "value3", uri.getBaseUri().getPath() + uri.getPath(),
uri
-            .getBaseUri().getHost(), "comment2", 10, false));
+            .getBaseUri().getHost().toLowerCase(), "comment2", 10, false));
         return rb.build();
     }
 

Modified: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-params/src/test/java/org/apache/wink/itest/CookieFieldsTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-params/src/test/java/org/apache/wink/itest/CookieFieldsTest.java?rev=915910&r1=915909&r2=915910&view=diff
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-params/src/test/java/org/apache/wink/itest/CookieFieldsTest.java
(original)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-params/src/test/java/org/apache/wink/itest/CookieFieldsTest.java
Wed Feb 24 18:19:13 2010
@@ -41,11 +41,11 @@
     protected HttpClient  httpclient;
 
     private static String BASE_URI   =
-                                         ServerEnvironmentInfo.getBaseURI() + "/newcookies/cookiestests";
+                                         (ServerEnvironmentInfo.getBaseURI() + "/newcookies/cookiestests").toLowerCase();
 
     static {
         if (ServerEnvironmentInfo.isRestFilterUsed()) {
-            BASE_URI = ServerEnvironmentInfo.getBaseURI() + "/cookiestests";
+            BASE_URI = (ServerEnvironmentInfo.getBaseURI() + "/cookiestests").toLowerCase();
         }
     }
 
@@ -92,22 +92,25 @@
             while (t.hasMoreTokens()) {
                 next = t.nextToken();
                 if (next.startsWith("name3")) {
+                    System.out.println("name3: " + next);
                     assertEquals("name3,value3," + contextRoot
                         + servletPath
                         + "/cookiestests,"
-                        + ServerEnvironmentInfo.getHostname(), next);
+                        + ServerEnvironmentInfo.getHostname().toLowerCase(), next);
                     name3Found = true;
                 } else if (next.startsWith("name2")) {
+                    System.out.println("name2: " + next);
                     assertEquals("name2,value2," + contextRoot
                         + servletPath
                         + "/cookiestests,"
-                        + ServerEnvironmentInfo.getHostname(), next);
+                        + ServerEnvironmentInfo.getHostname().toLowerCase(), next);
                     name2Found = true;
                 } else if (next.startsWith("name")) {
+                    System.out.println("name: " + next);
                     assertEquals("name,value," + contextRoot
                         + servletPath
                         + "/cookiestests,"
-                        + ServerEnvironmentInfo.getHostname(), next);
+                        + ServerEnvironmentInfo.getHostname().toLowerCase(), next);
                     nameFound = true;
                 } else
                     fail("Received an unexpected cookie: " + next);



Mime
View raw message