Author: psharples
Date: Fri Mar  9 13:18:39 2012
New Revision: 1298822

URL: http://svn.apache.org/viewvc?rev=1298822&view=rev
Log:
Updated references to set the request header to "accepts" into "Accept".  
'accepts' does not work on tomcat 6.0.32 and the tests fail

Modified:
    
incubator/wookie/trunk/src-tests/org/apache/wookie/tests/functional/PoliciesControllerTest.java
    
incubator/wookie/trunk/src-tests/org/apache/wookie/tests/functional/WidgetsControllerTest.java

Modified: 
incubator/wookie/trunk/src-tests/org/apache/wookie/tests/functional/PoliciesControllerTest.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/src-tests/org/apache/wookie/tests/functional/PoliciesControllerTest.java?rev=1298822&r1=1298821&r2=1298822&view=diff
==============================================================================
--- 
incubator/wookie/trunk/src-tests/org/apache/wookie/tests/functional/PoliciesControllerTest.java
 (original)
+++ 
incubator/wookie/trunk/src-tests/org/apache/wookie/tests/functional/PoliciesControllerTest.java
 Fri Mar  9 13:18:39 2012
@@ -76,7 +76,8 @@ public class PoliciesControllerTest exte
     HttpClient client = new HttpClient();
     setAuthenticationCredentials(client);    
     GetMethod get = new GetMethod(TEST_POLICIES_SERVICE_URL_VALID);
-    get.setRequestHeader("accepts", "text/xml");    
+    //this needs to be Accept rather than accepts which fails on tomcat
+    get.setRequestHeader("Accept", "text/xml");
     client.executeMethod(get);
     try {
       Element policies = processPolicies(get.getResponseBodyAsStream());
@@ -103,7 +104,8 @@ public class PoliciesControllerTest exte
     // We should have a policy setup from above
     //
     GetMethod get = new GetMethod(TEST_POLICIES_SERVICE_URL_VALID + "/" + 
POLICY_TEST_SCOPE);
-    get.setRequestHeader("accepts", "text/xml");
+    //this needs to be Accept rather than accepts which fails on tomcat
+    get.setRequestHeader("Accept", "text/xml");
     client.executeMethod(get);
     try {
       Element policies = processPolicies(get.getResponseBodyAsStream());
@@ -119,7 +121,8 @@ public class PoliciesControllerTest exte
     HttpClient client = new HttpClient();
     setAuthenticationCredentials(client);    
     GetMethod get = new GetMethod(TEST_POLICIES_SERVICE_URL_VALID + 
"/nosuchscope");
-    get.setRequestHeader("accepts", "text/xml");    
+    //this needs to be Accept rather than accepts which fails on tomcat   
+    get.setRequestHeader("Accept", "text/xml");
     client.executeMethod(get);
     try {
       Element policies = processPolicies(get.getResponseBodyAsStream());

Modified: 
incubator/wookie/trunk/src-tests/org/apache/wookie/tests/functional/WidgetsControllerTest.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/src-tests/org/apache/wookie/tests/functional/WidgetsControllerTest.java?rev=1298822&r1=1298821&r2=1298822&view=diff
==============================================================================
--- 
incubator/wookie/trunk/src-tests/org/apache/wookie/tests/functional/WidgetsControllerTest.java
 (original)
+++ 
incubator/wookie/trunk/src-tests/org/apache/wookie/tests/functional/WidgetsControllerTest.java
 Fri Mar  9 13:18:39 2012
@@ -488,9 +488,9 @@ public class WidgetsControllerTest exten
            //
       HttpClient client = new HttpClient();
       setAuthenticationCredentials(client);
-      // tomcat seems to need the "?format=xml" at the end (works without it 
for jetty, but tomcat 6.0.32 fails - empty xml response)
-           GetMethod get = new GetMethod(TEST_POLICIES_SERVICE_URL_VALID + 
encodeString("/" + WIDGET_ID_ACCESS_TEST)+"?format=xml");
-           get.setRequestHeader("accepts","text/xml");
+           GetMethod get = new GetMethod(TEST_POLICIES_SERVICE_URL_VALID + 
encodeString("/" + WIDGET_ID_ACCESS_TEST));
+           //this needs to be Accept rather than accepts which fails on tomcat
+           get.setRequestHeader("Accept","text/xml");
            client.executeMethod(get);
            
assertEquals(1,PoliciesControllerTest.processPolicies(get.getResponseBodyAsStream()).getChildren("policy").size());
 


Reply via email to