cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lmo...@apache.org
Subject svn commit: r979862 [10/19] - in /cxf/sandbox/oauth_1.0a: ./ api/ api/src/main/java/org/apache/cxf/ api/src/main/java/org/apache/cxf/endpoint/ api/src/main/java/org/apache/cxf/phase/ api/src/main/java/org/apache/cxf/ws/addressing/ api/src/main/java/org...
Date Tue, 27 Jul 2010 20:47:12 GMT
Modified: cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java Tue Jul 27 20:46:55 2010
@@ -52,31 +52,32 @@ import org.junit.Ignore;
 import org.junit.Test;
 
 public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = BookServer.PORT;
 
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly",
-                   launchServer(BookServer.class));
+                   launchServer(BookServer.class, false));
     }
     
     
     @Test
     public void testOnewayWebClient() throws Exception {
-        WebClient client = WebClient.create("http://localhost:9080/bookstore/oneway");
+        WebClient client = WebClient.create("http://localhost:" + PORT + "/bookstore/oneway");
         Response r = client.header("OnewayRequest", "true").post(null);
         assertEquals(202, r.getStatus());
     }
     
     @Test
     public void testOnewayProxy() throws Exception {
-        BookStore proxy = JAXRSClientFactory.create("http://localhost:9080", BookStore.class);
+        BookStore proxy = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
         proxy.onewayRequest();
         assertEquals(202, WebClient.client(proxy).getResponse().getStatus());
     }
     
     @Test
     public void testPropogateException() throws Exception {
-        getAndCompare("http://localhost:9080/bookstore/propogateexception",
+        getAndCompare("http://localhost:" + PORT + "/bookstore/propogateexception",
                       "", "application/xml", 500);
     }
     
@@ -86,34 +87,34 @@ public class JAXRSClientServerBookTest e
             + "<ns1:faultstring xmlns:ns1=\"http://cxf.apache.org/bindings/xformat\">"
             + "org.apache.cxf.systest.jaxrs.BookNotFoundFault: Book Exception</ns1:faultstring>"
             + "</ns1:XMLFault>";
-        getAndCompare("http://localhost:9080/bookstore/propogateexception2",
+        getAndCompare("http://localhost:" + PORT + "/bookstore/propogateexception2",
                       data, "application/xml", 500);
     }
     
     @Test
     public void testPropogateException3() throws Exception {
         String data = "<nobook/>";
-        getAndCompare("http://localhost:9080/bookstore/propogateexception3",
+        getAndCompare("http://localhost:" + PORT + "/bookstore/propogateexception3",
                       data, "application/xml", 500);
     }
     
     @Test
     public void testPropogateException4() throws Exception {
         String data = "<nobook/>";
-        getAndCompare("http://localhost:9080/bookstore/propogateexception4",
+        getAndCompare("http://localhost:" + PORT + "/bookstore/propogateexception4",
                       data, "application/xml", 500);
     }
     
     @Test
     public void testWebApplicationException() throws Exception {
-        getAndCompare("http://localhost:9080/bookstore/webappexception",
+        getAndCompare("http://localhost:" + PORT + "/bookstore/webappexception",
                       "This is a WebApplicationException",
                       "application/xml", 500);
     }
     
     @Test 
     public void testAddBookProxyResponse() {
-        BookStore store = JAXRSClientFactory.create("http://localhost:9080", BookStore.class);
+        BookStore store = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
         Book b = new Book("CXF rocks", 123L);
         Response r = store.addBook(b);
         assertNotNull(r);
@@ -127,7 +128,7 @@ public class JAXRSClientServerBookTest e
     
     @Test 
     public void testGetBookCollection() throws Exception {
-        BookStore store = JAXRSClientFactory.create("http://localhost:9080", BookStore.class);
+        BookStore store = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
         Book b1 = new Book("CXF in Action", 123L);
         Book b2 = new Book("CXF Rocks", 124L);
         List<Book> books = new ArrayList<Book>();
@@ -147,7 +148,7 @@ public class JAXRSClientServerBookTest e
     
     @Test 
     public void testGetBookArray() throws Exception {
-        BookStore store = JAXRSClientFactory.create("http://localhost:9080", BookStore.class);
+        BookStore store = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
         Book b1 = new Book("CXF in Action", 123L);
         Book b2 = new Book("CXF Rocks", 124L);
         Book[] books = new Book[2];
@@ -167,7 +168,8 @@ public class JAXRSClientServerBookTest e
     
     @Test
     public void testGetBookByURL() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/bookurl/http%3A%2F%2Ftest.com%2Frss%2F123",
+        getAndCompareAsStrings("http://localhost:" + PORT 
+                               + "/bookstore/bookurl/http%3A%2F%2Ftest.com%2Frss%2F123",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
     }
@@ -175,7 +177,8 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testHeadBookByURL() throws Exception {
         WebClient wc = 
-            WebClient.create("http://localhost:9080/bookstore/bookurl/http%3A%2F%2Ftest.com%2Frss%2F123");
+            WebClient.create("http://localhost:" + PORT 
+                             + "/bookstore/bookurl/http%3A%2F%2Ftest.com%2Frss%2F123");
         Response response = wc.head();
         assertTrue(response.getMetadata().size() != 0);
         assertEquals(0, ((InputStream)response.getEntity()).available());
@@ -185,7 +188,7 @@ public class JAXRSClientServerBookTest e
     public void testWebClientUnwrapBookWithXslt() throws Exception {
         XSLTJaxbProvider provider = new XSLTJaxbProvider();
         provider.setInTemplate("classpath:/org/apache/cxf/systest/jaxrs/resources/unwrapbook.xsl");
-        WebClient wc = WebClient.create("http://localhost:9080/bookstore/books/wrapper",
+        WebClient wc = WebClient.create("http://localhost:" + PORT + "/bookstore/books/wrapper",
                              Collections.singletonList(provider));
         wc.path("{id}", 123);
         Book book = wc.get(Book.class);
@@ -201,7 +204,7 @@ public class JAXRSClientServerBookTest e
     public void testProxyUnwrapBookWithXslt() throws Exception {
         XSLTJaxbProvider provider = new XSLTJaxbProvider();
         provider.setInTemplate("classpath:/org/apache/cxf/systest/jaxrs/resources/unwrapbook2.xsl");
-        BookStore bs = JAXRSClientFactory.create("http://localhost:9080", BookStore.class,
+        BookStore bs = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class,
                              Collections.singletonList(provider));
         Book book = bs.getWrappedBook2(123L);
         assertNotNull(book);
@@ -212,7 +215,8 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testOptions() throws Exception {
         WebClient wc = 
-            WebClient.create("http://localhost:9080/bookstore/bookurl/http%3A%2F%2Ftest.com%2Frss%2F123");
+            WebClient.create("http://localhost:" 
+                             + PORT + "/bookstore/bookurl/http%3A%2F%2Ftest.com%2Frss%2F123");
         Response response = wc.options();
         List<Object> values = response.getMetadata().get("Allow");
         assertNotNull(values);
@@ -224,7 +228,8 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testEmptyPost() throws Exception {
         WebClient wc = 
-            WebClient.create("http://localhost:9080/bookstore/emptypost");
+            WebClient.create("http://localhost:" 
+                             + PORT + "/bookstore/emptypost");
         Response response = wc.post(null);
         assertEquals(204, response.getStatus());
     }
@@ -232,7 +237,7 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testEmptyPostProxy() throws Exception {
         JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean(); 
-        bean.setAddress("http://localhost:9080");
+        bean.setAddress("http://localhost:" + PORT);
         bean.setResourceClass(BookStore.class);
         BookStore store = bean.create(BookStore.class);
         store.emptypost();
@@ -241,7 +246,7 @@ public class JAXRSClientServerBookTest e
     
     @Test
     public void testGetBookByEncodedQuery() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/bookquery?"
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/bookquery?"
                                + "urlid=http%3A%2F%2Ftest.com%2Frss%2F123",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
@@ -249,21 +254,21 @@ public class JAXRSClientServerBookTest e
     
     @Test
     public void testGetGenericBook() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/genericbooks/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/genericbooks/123",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
     }
     
     @Test
     public void testGetGenericResponseBook() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/genericresponse/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/genericresponse/123",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
     }
     
     @Test
     public void testGetBookByArrayQuery() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/bookidarray?"
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/bookidarray?"
                                + "id=1&id=2&id=3",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
@@ -271,49 +276,49 @@ public class JAXRSClientServerBookTest e
         
     @Test
     public void testNoRootResourceException() throws Exception {
-        getAndCompare("http://localhost:9080/nobookstore/webappexception",
+        getAndCompare("http://localhost:" + PORT + "/nobookstore/webappexception",
                       "",
                       "application/xml", 404);
     }
     
     @Test
     public void testNoPathMatch() throws Exception {
-        getAndCompare("http://localhost:9080/bookstore/bookqueries",
+        getAndCompare("http://localhost:" + PORT + "/bookstore/bookqueries",
                       "",
                       "application/xml", 404);
     }
     
     @Test
     public void testWriteAndFailEarly() throws Exception {
-        getAndCompare("http://localhost:9080/bookstore/books/fail-early",
+        getAndCompare("http://localhost:" + PORT + "/bookstore/books/fail-early",
                       "This is supposed to go on the wire",
                       "application/bar, text/plain", 410);
     }
     
     @Test
     public void testWriteAndFailLate() throws Exception {
-        getAndCompare("http://localhost:9080/bookstore/books/fail-late",
+        getAndCompare("http://localhost:" + PORT + "/bookstore/books/fail-late",
                       "", "application/bar", 410);
     }
     
     
     @Test
     public void testAcceptTypeMismatch() throws Exception {
-        getAndCompare("http://localhost:9080/bookstore/booknames/123",
+        getAndCompare("http://localhost:" + PORT + "/bookstore/booknames/123",
                       "",
                       "foo/bar", 406);
     }
             
     @Test
     public void testWrongHttpMethod() throws Exception {
-        getAndCompare("http://localhost:9080/bookstore/unsupportedcontenttype",
+        getAndCompare("http://localhost:" + PORT + "/bookstore/unsupportedcontenttype",
                       "",
                       "foo/bar", 405);
     }
     
     @Test
     public void testWrongQueryParameterType() throws Exception {
-        getAndCompare("http://localhost:9080/bookstore/wrongparametertype?p=1",
+        getAndCompare("http://localhost:" + PORT + "/bookstore/wrongparametertype?p=1",
                       "Parameter Class java.util.Map has no constructor with single String "
                       + "parameter, static valueOf(String) or fromString(String) methods",
                       "*/*", 500);
@@ -321,14 +326,14 @@ public class JAXRSClientServerBookTest e
     
     @Test
     public void testExceptionDuringConstruction() throws Exception {
-        getAndCompare("http://localhost:9080/bookstore/exceptionconstruction?p=1",
+        getAndCompare("http://localhost:" + PORT + "/bookstore/exceptionconstruction?p=1",
                       "",
                       "foo/bar", 404);
     }
     
     @Test
     public void testSubresourceMethodNotFound() throws Exception {
-        getAndCompare("http://localhost:9080/bookstore/interface/thesubresource",
+        getAndCompare("http://localhost:" + PORT + "/bookstore/interface/thesubresource",
                       "",
                       "foo/bar", 404);
     }
@@ -338,7 +343,7 @@ public class JAXRSClientServerBookTest e
         String msg1 = "No message body writer has been found for response class GregorianCalendar.";
         String msg2 = "No message body writer has been found for response class Calendar.";
         
-        getAndCompareStrings("http://localhost:9080/bookstore/timetable", 
+        getAndCompareStrings("http://localhost:" + PORT + "/bookstore/timetable", 
                              new String[]{msg1, msg2}, "*/*", 500);
     }
     
@@ -347,7 +352,7 @@ public class JAXRSClientServerBookTest e
     public void testNoMessageReaderFound() throws Exception {
         
         String endpointAddress =
-            "http://localhost:9080/bookstore/binarybooks";
+            "http://localhost:" + PORT + "/bookstore/binarybooks";
 
         PostMethod post = new PostMethod(endpointAddress);
         post.setRequestHeader("Content-Type", "application/octet-stream");
@@ -367,7 +372,7 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testConsumeTypeMismatch() throws Exception {
         String endpointAddress =
-            "http://localhost:9080/bookstore/unsupportedcontenttype";
+            "http://localhost:" + PORT + "/bookstore/unsupportedcontenttype";
 
         PostMethod post = new PostMethod(endpointAddress);
         post.setRequestHeader("Content-Type", "application/bar");
@@ -385,13 +390,13 @@ public class JAXRSClientServerBookTest e
     
     @Test
     public void testBookExists() throws Exception {
-        checkBook("http://localhost:9080/bookstore/books/check/123", true);
-        checkBook("http://localhost:9080/bookstore/books/check/125", false);  
+        checkBook("http://localhost:" + PORT + "/bookstore/books/check/123", true);
+        checkBook("http://localhost:" + PORT + "/bookstore/books/check/125", false);  
     }
     
     @Test
     public void testBookExists2() throws Exception {
-        BookStore proxy = JAXRSClientFactory.create("http://localhost:9080", BookStore.class);
+        BookStore proxy = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
         assertTrue(proxy.checkBook2(123L));
         assertFalse(proxy.checkBook2(125L));
     }
@@ -419,14 +424,14 @@ public class JAXRSClientServerBookTest e
     
     @Test
     public void testGetBookCustomExpression() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/books/custom/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/custom/123",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
     }
     
     @Test
     public void testGetHeadBook123WebClient() throws Exception {
-        String address = "http://localhost:9080/bookstore/getheadbook/";
+        String address = "http://localhost:" + PORT + "/bookstore/getheadbook/";
         WebClient client = WebClient.create(address);
         Response r = client.head();
         assertEquals("HEAD_HEADER_VALUE", r.getMetadata().getFirst("HEAD_HEADER"));
@@ -434,7 +439,7 @@ public class JAXRSClientServerBookTest e
     
     @Test
     public void testGetHeadBook123WebClient2() throws Exception {
-        String address = "http://localhost:9080/bookstore/getheadbook/";
+        String address = "http://localhost:" + PORT + "/bookstore/getheadbook/";
         WebClient client = WebClient.create(address);
         Book b = client.get(Book.class);
         assertEquals(b.getId(), 123L);
@@ -442,28 +447,28 @@ public class JAXRSClientServerBookTest e
     
     @Test
     public void testGetBook123WithProxy() throws Exception {
-        BookStore bs = JAXRSClientFactory.create("http://localhost:9080", BookStore.class);
+        BookStore bs = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
         Book b = bs.getBook("123");
         assertEquals(b.getId(), 123);
     }
     
     @Test
     public void testDeleteWithProxy() throws Exception {
-        BookStore bs = JAXRSClientFactory.create("http://localhost:9080", BookStore.class);
+        BookStore bs = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
         Response r = bs.deleteBook("123");
         assertEquals(200, r.getStatus());
     }
     
     @Test
     public void testCreatePutWithProxy() throws Exception {
-        BookStore bs = JAXRSClientFactory.create("http://localhost:9080", BookStore.class);
+        BookStore bs = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
         Response r = bs.createBook(777L);
         assertEquals(200, r.getStatus());
     }
     
     @Test
     public void testUpdateWithProxy() throws Exception {
-        BookStore bs = JAXRSClientFactory.create("http://localhost:9080", BookStore.class);
+        BookStore bs = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
         Book book = new Book();
         book.setId(888);
         bs.updateBook(book);
@@ -472,11 +477,11 @@ public class JAXRSClientServerBookTest e
     
     @Test
     public void testGetBookTypeAndWildcard() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/books/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/123",
                                "resources/expected_get_book123.txt",
                                "application/xml;q=0.8,*/*", 
                                "application/xml", 200);
-        getAndCompareAsStrings("http://localhost:9080/bookstore/books/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/123",
                                "resources/expected_get_book123.txt",
                                "application/*", 
                                "application/xml", 200);
@@ -484,7 +489,7 @@ public class JAXRSClientServerBookTest e
     
     @Test
     public void testSearchBook123() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/books/search"
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/search"
                                + "?_s=name==CXF*;id=ge=123;id=lt=124",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
@@ -492,28 +497,28 @@ public class JAXRSClientServerBookTest e
     
     @Test
     public void testGetBook123() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/books/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/123",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
         
-        getAndCompareAsStrings("http://localhost:9080/bookstore/books/query?bookId=123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/query?bookId=123",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
         
-        getAndCompareAsStrings("http://localhost:9080/bookstore/books/defaultquery",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/defaultquery",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
         
-        getAndCompareAsStrings("http://localhost:9080/bookstore/books/missingquery",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/missingquery",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
         
-        getAndCompareAsStrings("http://localhost:9080/bookstore/books/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/123",
                                "resources/expected_get_book123json.txt",
                                "application/json, application/xml", 
                                "application/json", 200);
         
-        getAndCompareAsStrings("http://localhost:9080/bookstore/books/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/123",
                                "resources/expected_get_book123.txt",
                                "application/xml, application/json", 
                                "application/xml", 200);
@@ -522,7 +527,7 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testGetBookXmlWildcard() throws Exception {
         
-        getAndCompareAsStrings("http://localhost:9080/bookstore/books/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/123",
                                "resources/expected_get_book123.txt",
                                "*/*", "application/xml", 200);
         
@@ -530,17 +535,17 @@ public class JAXRSClientServerBookTest e
     
     @Test
     public void testGetBookBuffer() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/books/buffer",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/buffer",
                                "resources/expected_get_book123.txt",
                                "application/bar", 200);
     }    
     
     @Test
     public void testGetBookBySegment() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/segment/matrix2;first=12;second=3",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/segment/matrix2;first=12;second=3",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
-        getAndCompareAsStrings("http://localhost:9080/bookstore;bar/segment;foo/"
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore;bar/segment;foo/"
                                + "matrix2;first=12;second=3;third",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
@@ -548,17 +553,17 @@ public class JAXRSClientServerBookTest e
     
     @Test
     public void testGetBookByListOfSegments() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/segment/list/1/2/3",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/segment/list/1/2/3",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
     }
     
     @Test
     public void testGetBookByMatrixParameters() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/segment/matrix;first=12;second=3",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/segment/matrix;first=12;second=3",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
-        getAndCompareAsStrings("http://localhost:9080/bookstore;bar;first=12/segment;foo;"
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore;bar;first=12/segment;foo;"
                                + "second=3/matrix;third",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
@@ -566,46 +571,53 @@ public class JAXRSClientServerBookTest e
     
     @Test
     public void testGetBookByHeader() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/bookheaders",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/bookheaders",
                                "resources/expected_get_book123.txt",
                                "application/xml;q=0.5,text/xml", "text/xml", 200);
     }
     
     @Test
     public void testGetBookByHeaderPerRequest() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore2/bookheaders",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore2/bookheaders",
                                "resources/expected_get_book123.txt",
                                "application/xml;q=0.5,text/xml", "text/xml", 200);
     }
     
     @Test
     public void testGetBookByHeaderDefault() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/bookheaders2",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/bookheaders2",
                                "resources/expected_get_book123.txt",
                                "application/xml;q=0.5,text/xml", "text/xml", 200);
     }
     
     @Test
     public void testGetBookElement() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/books/element",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/element",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
     }
     
     @Test
     public void testGetBookAdapter() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/books/adapter",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/adapter",
+                               "resources/expected_get_book123.txt",
+                               "application/xml", 200);
+    }
+    
+    @Test
+    public void testGetBookAdapterInterface() throws Exception {
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/interface/adapter",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
     }
     
     @Test
     public void testGetBook123FromSub() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/interface/subresource",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/interface/subresource",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
         
-        getAndCompareAsStrings("http://localhost:9080/bookstore/books/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/123",
                                "resources/expected_get_book123json.txt",
                                "application/xml;q=0.1,application/json", "application/json", 200);
     }
@@ -613,7 +625,7 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testGetBook123FromSubObject() throws Exception {
         getAndCompareAsStrings(
-            "http://localhost:9080/bookstore/booksubresourceobject/123/chaptersobject/sub/1",
+            "http://localhost:" + PORT + "/bookstore/booksubresourceobject/123/chaptersobject/sub/1",
             "resources/expected_get_chapter1.txt", "application/xml",
             "application/xml;charset=ISO-8859-1", 200);
     }
@@ -621,7 +633,7 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testGetChapter() throws Exception {
         
-        getAndCompareAsStrings("http://localhost:9080/bookstore/booksubresource/123/chapters/1",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/booksubresource/123/chapters/1",
                                "resources/expected_get_chapter1.txt",
                                "application/xml", "application/xml;charset=ISO-8859-1", 200);
     }
@@ -629,18 +641,31 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testGetChapterEncodingDefault() throws Exception {
         
-        getAndCompareAsStrings("http://localhost:9080/bookstore/booksubresource/123/chapters/badencoding/1",
+        getAndCompareAsStrings("http://localhost:" 
+                               + PORT + "/bookstore/booksubresource/123/chapters/badencoding/1",
                                "resources/expected_get_chapter1_utf.txt",
                                "application/xml", "application/xml;charset=UTF-8", 200);
     }
     
     @Test
+    public void testGetChapterAcceptEncoding() throws Exception {
+        
+        getAndCompareAsStrings("http://localhost:" 
+                               + PORT + "/bookstore/booksubresource/123/chapters/acceptencoding/1",
+                               "resources/expected_get_chapter1.txt",
+                               "application/xml;charset=ISO-8859-1", "application/xml;charset=ISO-8859-1", 
+                               200);
+    }
+    
+    @Test
     public void testGetChapterChapter() throws Exception {
         
-        getAndCompareAsStrings("http://localhost:9080/bookstore/booksubresource/123/chapters/sub/1/recurse",
+        getAndCompareAsStrings("http://localhost:" 
+                               + PORT + "/bookstore/booksubresource/123/chapters/sub/1/recurse",
                                "resources/expected_get_chapter1_utf.txt",
                                "application/xml", 200);
-        getAndCompareAsStrings("http://localhost:9080/bookstore/booksubresource/123/chapters/sub/1/recurse2",
+        getAndCompareAsStrings("http://localhost:"
+                               + PORT + "/bookstore/booksubresource/123/chapters/sub/1/recurse2",
                                "resources/expected_get_chapter1.txt",
                                "application/xml", "application/xml;charset=ISO-8859-1", 200);
     }
@@ -649,21 +674,21 @@ public class JAXRSClientServerBookTest e
     public void testGetChapterWithParentIds() throws Exception {
         
         getAndCompareAsStrings(
-            "http://localhost:9080/bookstore/booksubresource/123/chapters/sub/1/recurse2/ids",
+            "http://localhost:" + PORT + "/bookstore/booksubresource/123/chapters/sub/1/recurse2/ids",
             "resources/expected_get_chapter1.txt",
             "application/xml", "application/xml;charset=ISO-8859-1", 200);
     }
     
     @Test
     public void testGetBook123ReturnString() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/booknames/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/booknames/123",
                                "resources/expected_get_book123_returnstring.txt",
                                "text/plain", 200);
     }
     
     @Test
     public void testAddBookNoBody() throws Exception {
-        PostMethod post = new PostMethod("http://localhost:9080/bookstore/books");
+        PostMethod post = new PostMethod("http://localhost:" + PORT + "/bookstore/books");
         post.setRequestHeader("Content-Type", "application/xml");
         HttpClient httpclient = new HttpClient();
         
@@ -678,12 +703,12 @@ public class JAXRSClientServerBookTest e
     
     @Test
     public void testAddBook() throws Exception {
-        doAddBook("http://localhost:9080/bookstore/books");               
+        doAddBook("http://localhost:" + PORT + "/bookstore/books");               
     }
     
     @Test
     public void testAddBookXmlAdapter() throws Exception {
-        doAddBook("http://localhost:9080/bookstore/booksinfo");               
+        doAddBook("http://localhost:" + PORT + "/bookstore/booksinfo");               
     }
     
     private void doAddBook(String address) throws Exception {
@@ -710,19 +735,19 @@ public class JAXRSClientServerBookTest e
     
     @Test
     public void testAddBookCustomFailureStatus() throws Exception {
-        String endpointAddress = "http://localhost:9080/bookstore/books/customstatus";
+        String endpointAddress = "http://localhost:" + PORT + "/bookstore/books/customstatus";
         WebClient client = WebClient.create(endpointAddress);
         Book book = client.type("text/xml").accept("application/xml").post(new Book(), Book.class);
         assertEquals(888L, book.getId());
         Response r = client.getResponse();
         assertEquals("CustomValue", r.getMetadata().getFirst("CustomHeader"));
-        assertEquals(333, r.getStatus());
+        assertEquals(233, r.getStatus());
         assertEquals("application/xml", r.getMetadata().getFirst("Content-Type"));
     }
     
     @Test
     public void testUpdateBook() throws Exception {
-        String endpointAddress = "http://localhost:9080/bookstore/books";
+        String endpointAddress = "http://localhost:" + PORT + "/bookstore/books";
 
         File input = new File(getClass().getResource("resources/update_book.txt").toURI());
         PutMethod put = new PutMethod(endpointAddress);
@@ -740,7 +765,7 @@ public class JAXRSClientServerBookTest e
         }
 
         // Verify result
-        endpointAddress = "http://localhost:9080/bookstore/books/123";
+        endpointAddress = "http://localhost:" + PORT + "/bookstore/books/123";
         URL url = new URL(endpointAddress);
         URLConnection connect = url.openConnection();
         connect.addRequestProperty("Accept", "application/xml");
@@ -770,7 +795,7 @@ public class JAXRSClientServerBookTest e
     
     @Test
     public void testUpdateBookWithDom() throws Exception {
-        String endpointAddress = "http://localhost:9080/bookstore/bookswithdom";
+        String endpointAddress = "http://localhost:" + PORT + "/bookstore/bookswithdom";
 
         File input = new File(getClass().getResource("resources/update_book.txt").toURI());
         PutMethod put = new PutMethod(endpointAddress);
@@ -782,7 +807,10 @@ public class JAXRSClientServerBookTest e
             assertEquals(200, result);
             String resp = put.getResponseBodyAsString();
             InputStream expected = getClass().getResourceAsStream("resources/update_book.txt");
-            assertTrue(resp.indexOf(getStringFromInputStream(expected)) >= 0);
+            String s = getStringFromInputStream(expected);
+            //System.out.println(resp);
+            //System.out.println(s);            
+            assertTrue(resp.indexOf(s) >= 0);
         } finally {
             // Release current connection to the connection pool once you are
             // done
@@ -792,7 +820,7 @@ public class JAXRSClientServerBookTest e
     
     @Test
     public void testUpdateBookWithJSON() throws Exception {
-        String endpointAddress = "http://localhost:9080/bookstore/bookswithjson";
+        String endpointAddress = "http://localhost:" + PORT + "/bookstore/bookswithjson";
 
         File input = new File(getClass().getResource("resources/update_book_json.txt").toURI());
         PutMethod put = new PutMethod(endpointAddress);
@@ -810,7 +838,7 @@ public class JAXRSClientServerBookTest e
         }
 
         // Verify result
-        endpointAddress = "http://localhost:9080/bookstore/books/123";
+        endpointAddress = "http://localhost:" + PORT + "/bookstore/books/123";
         URL url = new URL(endpointAddress);
         URLConnection connection = url.openConnection();
         connection.addRequestProperty("Accept", "application/xml");
@@ -841,7 +869,7 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testUpdateBookFailed() throws Exception {
         String endpointAddress =
-            "http://localhost:9080/bookstore/books";
+            "http://localhost:" + PORT + "/bookstore/books";
 
         File input = new File(getClass().getResource("resources/update_book_not_exist.txt").toURI());         
         PutMethod post = new PutMethod(endpointAddress);
@@ -861,7 +889,7 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testGetCDs() throws Exception {
         
-        WebClient wc = WebClient.create("http://localhost:9080/bookstore/cds");
+        WebClient wc = WebClient.create("http://localhost:" + PORT + "/bookstore/cds");
         CDs cds = wc.get(CDs.class);
         Collection<CD> collection = cds.getCD();
         assertEquals(2, collection.size());
@@ -872,7 +900,7 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testGetCDJSON() throws Exception {
         
-        getAndCompareAsStrings("http://localhost:9080/bookstore/cd/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/cd/123",
                                "resources/expected_get_cdjson.txt",
                                "application/json", 200);
         
@@ -882,7 +910,7 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testGetPlainLong() throws Exception {
         String endpointAddress =
-            "http://localhost:9080/bookstore/booksplain"; 
+            "http://localhost:" + PORT + "/bookstore/booksplain"; 
 
         PostMethod post = new PostMethod(endpointAddress);
         post.addRequestHeader("Content-Type" , "text/plain");
@@ -903,7 +931,7 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testDeleteBook() throws Exception {
         String endpointAddress =
-            "http://localhost:9080/bookstore/books/123"; 
+            "http://localhost:" + PORT + "/bookstore/books/123"; 
 
         DeleteMethod post = new DeleteMethod(endpointAddress);
         HttpClient httpclient = new HttpClient();
@@ -920,7 +948,7 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testDeleteBookByQuery() throws Exception {
         String endpointAddress =
-            "http://localhost:9080/bookstore/books/id?value=123"; 
+            "http://localhost:" + PORT + "/bookstore/books/id?value=123"; 
 
         DeleteMethod post = new DeleteMethod(endpointAddress);
         HttpClient httpclient = new HttpClient();
@@ -938,7 +966,7 @@ public class JAXRSClientServerBookTest e
     public void testGetCDsJSON() throws Exception {
         
         String endpointAddress =
-            "http://localhost:9080/bookstore/cds"; 
+            "http://localhost:" + PORT + "/bookstore/cds"; 
 
         GetMethod get = new GetMethod(endpointAddress);
         get.addRequestHeader("Accept" , "application/json");
@@ -964,7 +992,7 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testGetCDXML() throws Exception {
         
-        getAndCompareAsStrings("http://localhost:9080/bookstore/cd/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/cd/123",
                                "resources/expected_get_cd.txt",
                                "application/xml", 200);
     }
@@ -973,7 +1001,7 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testGetCDWithMultiContentTypesXML() throws Exception {
         
-        getAndCompareAsStrings("http://localhost:9080/bookstore/cdwithmultitypes/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/cdwithmultitypes/123",
                                "resources/expected_get_cd.txt",
                                "application/json;q=0.8,application/xml,*/*", "application/xml", 200);
     }
@@ -981,24 +1009,24 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testGetCDWithMultiContentTypesCustomXML() throws Exception {
         
-        getAndCompareAsStrings("http://localhost:9080/bookstore/cdwithmultitypes/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/cdwithmultitypes/123",
                                "resources/expected_get_cd.txt",
                                "application/bar+xml", "application/bar+xml", 200);
     }
     
     @Test
     public void testGetCDWithMultiContentTypesJSON() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/cdwithmultitypes/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/cdwithmultitypes/123",
                                "resources/expected_get_cdjson.txt",
                                "application/json", 200);
-        getAndCompareAsStrings("http://localhost:9080/bookstore/cdwithmultitypes/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/cdwithmultitypes/123",
                                "resources/expected_get_cdjson.txt",
                                "*/*,application/xml;q=0.9,application/json", "application/json", 200);
     }
     
     @Test
     public void testUriInfoMatchedResources() throws Exception {
-        getAndCompare("http://localhost:9080/bookstore/"
+        getAndCompare("http://localhost:" + PORT + "/bookstore/"
                       + "booksubresource/123/chapters/sub/1/matched-resources", 
                       "[class org.apache.cxf.systest.jaxrs.BookStore, " 
                       + "class org.apache.cxf.systest.jaxrs.Book, "
@@ -1008,7 +1036,7 @@ public class JAXRSClientServerBookTest e
     
     @Test
     public void testUriInfoMatchedResourcesWithObject() throws Exception {
-        getAndCompare("http://localhost:9080/bookstore/"
+        getAndCompare("http://localhost:" + PORT + "/bookstore/"
                       + "booksubresource/123/chaptersobject/sub/1/matched-resources", 
                       "[class org.apache.cxf.systest.jaxrs.BookStore, " 
                       + "class org.apache.cxf.systest.jaxrs.Book, "
@@ -1021,7 +1049,7 @@ public class JAXRSClientServerBookTest e
         String expected = "[/bookstore/booksubresource/123/, "
                           + "/bookstore/booksubresource/123/chapters/sub/1/, "
                           + "/bookstore/booksubresource/123/chapters/sub/1/matched!uris]";
-        getAndCompare("http://localhost:9080/bookstore/"
+        getAndCompare("http://localhost:" + PORT + "/bookstore/"
                       + "booksubresource/123/chapters/sub/1/matched%21uris?decode=true", 
                       expected, "text/plain", "text/plain", 200);
     }
@@ -1032,7 +1060,7 @@ public class JAXRSClientServerBookTest e
         String expected = "[/bookstore/booksubresource/123/, "
             + "/bookstore/booksubresource/123/chapters/sub/1/, "
             + "/bookstore/booksubresource/123/chapters/sub/1/matched%21uris]";
-        getAndCompare("http://localhost:9080/bookstore/"
+        getAndCompare("http://localhost:" + PORT + "/bookstore/"
                       + "booksubresource/123/chapters/sub/1/matched%21uris?decode=false", 
                       expected,
                       "text/plain", "text/plain", 200);

Modified: cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerNonSpringBookTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerNonSpringBookTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerNonSpringBookTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerNonSpringBookTest.java Tue Jul 27 20:46:55 2010
@@ -32,6 +32,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class JAXRSClientServerNonSpringBookTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = BookNonSpringServer.PORT;
 
     @BeforeClass
     public static void startServers() throws Exception {
@@ -42,7 +43,7 @@ public class JAXRSClientServerNonSpringB
     
     @Test
     public void testGetBook123Singleton() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/singleton/bookstore/books/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/singleton/bookstore/books/123",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
         
@@ -50,7 +51,7 @@ public class JAXRSClientServerNonSpringB
     
     @Test
     public void testGetBook123UserModel() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/usermodel/bookstore/books/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/usermodel/bookstore/books/123",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
         
@@ -59,14 +60,14 @@ public class JAXRSClientServerNonSpringB
     @Test
     public void testGetChapterUserModel() throws Exception {
         
-        getAndCompareAsStrings("http://localhost:9080/usermodel/bookstore/books/123/chapter",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/usermodel/bookstore/books/123/chapter",
                                "resources/expected_get_chapter1_utf.txt",
                                "application/xml", 200);
     }
     
     @Test
     public void testGetBook123UserModelInterface() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/usermodel2/bookstore2/books/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/usermodel2/bookstore2/books/123",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
         
@@ -74,7 +75,7 @@ public class JAXRSClientServerNonSpringB
     
     @Test
     public void testGetBook123ApplicationSingleton() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/application/bookstore/books/123",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/application/bookstore/books/123",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
         
@@ -82,7 +83,7 @@ public class JAXRSClientServerNonSpringB
     
     @Test
     public void testGetBook123ApplicationPerRequest() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/application/bookstore2/bookheaders",
+        getAndCompareAsStrings("http://localhost:" + PORT + "/application/bookstore2/bookheaders",
                                "resources/expected_get_book123.txt",
                                "application/xml", 200);
         

Modified: cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerProxySpringBookTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerProxySpringBookTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerProxySpringBookTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerProxySpringBookTest.java Tue Jul 27 20:46:55 2010
@@ -31,6 +31,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class JAXRSClientServerProxySpringBookTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = BookServerProxySpring.PORT;
 
     @BeforeClass
     public static void startServers() throws Exception {
@@ -42,7 +43,7 @@ public class JAXRSClientServerProxySprin
     public void testGetBookNotFound() throws Exception {
         
         String endpointAddress =
-            "http://localhost:9080/test/bookstore/books/12345"; 
+            "http://localhost:" + PORT + "/test/bookstore/books/12345"; 
         URL url = new URL(endpointAddress);
         HttpURLConnection connect = (HttpURLConnection)url.openConnection();
         connect.addRequestProperty("Accept", "text/plain,application/xml");
@@ -60,43 +61,43 @@ public class JAXRSClientServerProxySprin
     
     @Test
     public void testGetThatBook123() throws Exception {
-        getBook("http://localhost:9080/test/bookstorestorage/thosebooks/123");
+        getBook("http://localhost:" + PORT + "/test/bookstorestorage/thosebooks/123");
     }
     
     @Test
     public void testGetThatBookSingleton() throws Exception {
-        getBook("http://localhost:9080/test/4/bookstore/books/123");
-        getBook("http://localhost:9080/test/4/bookstore/books/123");
+        getBook("http://localhost:" + PORT + "/test/4/bookstore/books/123");
+        getBook("http://localhost:" + PORT + "/test/4/bookstore/books/123");
     }
     
     @Test
     public void testGetThatBookInterfaceSingleton() throws Exception {
-        getBook("http://localhost:9080/test/4/bookstorestorage/thosebooks/123");
+        getBook("http://localhost:" + PORT + "/test/4/bookstorestorage/thosebooks/123");
     }
     
     @Test
     public void testGetThatBookPrototype() throws Exception {
-        getBook("http://localhost:9080/test/5/bookstore/books/123");
+        getBook("http://localhost:" + PORT + "/test/5/bookstore/books/123");
     }
     
     @Test
     public void testGetThatBookInterfacePrototype() throws Exception {
-        getBook("http://localhost:9080/test/5/bookstorestorage/thosebooks/123");
+        getBook("http://localhost:" + PORT + "/test/5/bookstorestorage/thosebooks/123");
     }
     
     @Test
     public void testGetThatBookInterface2Prototype() throws Exception {
-        getBook("http://localhost:9080/test/6/bookstorestorage/thosebooks/123");
+        getBook("http://localhost:" + PORT + "/test/6/bookstorestorage/thosebooks/123");
     }
     
     @Test
     public void testGetThatBook123UserResource() throws Exception {
-        getBook("http://localhost:9080/test/2/bookstore/books/123");
+        getBook("http://localhost:" + PORT + "/test/2/bookstore/books/123");
     }
     
     @Test
     public void testGetThatBook123UserResourceInterface() throws Exception {
-        getBook("http://localhost:9080/test/3/bookstore2/books/123");
+        getBook("http://localhost:" + PORT + "/test/3/bookstore2/books/123");
     }
     
     private void getBook(String endpointAddress) throws Exception {
@@ -113,18 +114,18 @@ public class JAXRSClientServerProxySprin
     
     @Test
     public void testGetThatBookOverloaded() throws Exception {
-        getBook("http://localhost:9080/test/bookstorestorage/thosebooks/123/123");
+        getBook("http://localhost:" + PORT + "/test/bookstorestorage/thosebooks/123/123");
     }
     
     @Test
     public void testGetThatBookOverloaded2() throws Exception {
-        getBook("http://localhost:9080/test/bookstorestorage/thosebooks");
+        getBook("http://localhost:" + PORT + "/test/bookstorestorage/thosebooks");
     }
     
     @Test
     public void testGetBook123() throws Exception {
         String endpointAddress =
-            "http://localhost:9080/test/bookstore/books/123"; 
+            "http://localhost:" + PORT + "/test/bookstore/books/123"; 
         URL url = new URL(endpointAddress);
         URLConnection connect = url.openConnection();
         connect.addRequestProperty("Accept", "application/json");

Modified: cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedOutsideBookTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedOutsideBookTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedOutsideBookTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedOutsideBookTest.java Tue Jul 27 20:46:55 2010
@@ -34,6 +34,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class JAXRSClientServerResourceCreatedOutsideBookTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = BookServerResourceCreatedOutside.PORT;
 
     @BeforeClass
     public static void startServers() throws Exception {
@@ -45,7 +46,7 @@ public class JAXRSClientServerResourceCr
     public void testGetBook123() throws Exception {
         
         String endpointAddress =
-            "http://localhost:9080/bookstore/books/123"; 
+            "http://localhost:" + PORT + "/bookstore/books/123";
         URL url = new URL(endpointAddress);
         URLConnection connect = url.openConnection();
         connect.addRequestProperty("Accept", "application/xml");
@@ -61,7 +62,7 @@ public class JAXRSClientServerResourceCr
     @Test
     public void testAddBookHTTPURL() throws Exception {        
         String endpointAddress =
-            "http://localhost:9080/bookstore/books";
+            "http://localhost:" + PORT + "/bookstore/books";
 
         URL url = new URL(endpointAddress);   
         HttpURLConnection httpUrlConnection = (HttpURLConnection)url.openConnection();  

Modified: cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringBookTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringBookTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringBookTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringBookTest.java Tue Jul 27 20:46:55 2010
@@ -30,6 +30,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class JAXRSClientServerResourceCreatedSpringBookTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = BookServerResourceCreatedSpring.PORT;
 
     @BeforeClass
     public static void startServers() throws Exception {
@@ -41,7 +42,7 @@ public class JAXRSClientServerResourceCr
     public void testGetBook123() throws Exception {
         
         String endpointAddress =
-            "http://localhost:9080/webapp/bookstore/books/123"; 
+            "http://localhost:" + PORT + "/webapp/bookstore/books/123"; 
         URL url = new URL(endpointAddress);
         URLConnection connect = url.openConnection();
         connect.addRequestProperty("Accept", "application/xml");
@@ -58,7 +59,7 @@ public class JAXRSClientServerResourceCr
     public void testPetStore() throws Exception {
         
         String endpointAddress =
-            "http://localhost:9080/webapp/petstore/pets/24"; 
+            "http://localhost:" + PORT + "/webapp/petstore/pets/24"; 
         URL url = new URL(endpointAddress);
         URLConnection connect = url.openConnection();
         connect.addRequestProperty("Accept", "text/xml");

Modified: cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java Tue Jul 27 20:46:55 2010
@@ -59,6 +59,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class JAXRSClientServerResourceCreatedSpringProviderTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = BookServerResourceCreatedSpringProviders.PORT;
 
     @BeforeClass
     public static void startServers() throws Exception {
@@ -68,8 +69,8 @@ public class JAXRSClientServerResourceCr
     
     @Test
     public void testMultipleRootsWadl() throws Exception {
-        List<Element> resourceEls = getWadlResourcesInfo("http://localhost:9080/webapp/",
-                                                         "http://localhost:9080/webapp/", 2);
+        List<Element> resourceEls = getWadlResourcesInfo("http://localhost:" + PORT + "/webapp/",
+                                                         "http://localhost:" + PORT + "/webapp/", 2);
         String path1 = resourceEls.get(0).getAttribute("path");
         int bookStoreInd = path1.contains("/bookstore") ? 0 : 1;
         int petStoreInd = bookStoreInd == 0 ? 1 : 0;
@@ -79,22 +80,22 @@ public class JAXRSClientServerResourceCr
     
     @Test
     public void testBookStoreWadl() throws Exception {
-        List<Element> resourceEls = getWadlResourcesInfo("http://localhost:9080/webapp/",
-                                                         "http://localhost:9080/webapp/bookstore", 1);
+        List<Element> resourceEls = getWadlResourcesInfo("http://localhost:" + PORT + "/webapp/",
+                                                         "http://localhost:" + PORT + "/webapp/bookstore", 1);
         checkBookStoreInfo(resourceEls.get(0));
     }
     
     @Test
     public void testPetStoreWadl() throws Exception {
-        List<Element> resourceEls = getWadlResourcesInfo("http://localhost:9080/webapp/",
-                                                         "http://localhost:9080/webapp/petstore", 1);
+        List<Element> resourceEls = getWadlResourcesInfo("http://localhost:" + PORT + "/webapp/",
+                                                         "http://localhost:" + PORT + "/webapp/petstore", 1);
         checkPetStoreInfo(resourceEls.get(0));
     }
     
     @Test
     public void testPetStoreSource() throws Exception {
         try {
-            WebClient wc = WebClient.create("http://localhost:9080/webapp/petstore");
+            WebClient wc = WebClient.create("http://localhost:" + PORT + "/webapp/petstore");
             HTTPConduit conduit = WebClient.getConfig(wc).getHttpConduit();
             conduit.getClient().setReceiveTimeout(1000000);
             conduit.getClient().setConnectionTimeout(1000000);
@@ -184,7 +185,7 @@ public class JAXRSClientServerResourceCr
     public void testGetBook123() throws Exception {
         
         String endpointAddress =
-            "http://localhost:9080/webapp/bookstore/books/123"; 
+            "http://localhost:" + PORT + "/webapp/bookstore/books/123"; 
         URL url = new URL(endpointAddress);
         URLConnection connect = url.openConnection();
         connect.addRequestProperty("Accept", "application/json");
@@ -205,7 +206,7 @@ public class JAXRSClientServerResourceCr
     public void testGetBookNotFound() throws Exception {
         
         String endpointAddress =
-            "http://localhost:9080/webapp/bookstore/books/12345"; 
+            "http://localhost:" + PORT + "/webapp/bookstore/books/12345"; 
         URL url = new URL(endpointAddress);
         HttpURLConnection connect = (HttpURLConnection)url.openConnection();
         connect.addRequestProperty("Accept", "text/plain,application/xml");
@@ -225,7 +226,7 @@ public class JAXRSClientServerResourceCr
     public void testGetBookNotExistent() throws Exception {
         
         String endpointAddress =
-            "http://localhost:9080/webapp/bookstore/nonexistent"; 
+            "http://localhost:" + PORT + "/webapp/bookstore/nonexistent"; 
         URL url = new URL(endpointAddress);
         HttpURLConnection connect = (HttpURLConnection)url.openConnection();
         connect.addRequestProperty("Accept", "application/xml");
@@ -242,7 +243,7 @@ public class JAXRSClientServerResourceCr
     public void testPostPetStatus() throws Exception {
         
         String endpointAddress =
-            "http://localhost:9080/webapp/petstore/pets";
+            "http://localhost:" + PORT + "/webapp/petstore/pets";
 
         URL url = new URL(endpointAddress);   
         HttpURLConnection httpUrlConnection = (HttpURLConnection)url.openConnection();  
@@ -283,7 +284,7 @@ public class JAXRSClientServerResourceCr
     public void testPostPetStatus2() throws Exception {
         
         
-        Socket s = new Socket("localhost", 9080);
+        Socket s = new Socket("localhost", Integer.parseInt(PORT));
         IOUtils.copyAndCloseInput(getClass().getResource("resources/formRequest.txt").openStream(), 
                                   s.getOutputStream());
 

Modified: cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceJacksonSpringProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceJacksonSpringProviderTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceJacksonSpringProviderTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceJacksonSpringProviderTest.java Tue Jul 27 20:46:55 2010
@@ -35,6 +35,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class JAXRSClientServerResourceJacksonSpringProviderTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = BookServerResourceJacksonSpringProviders.PORT;
 
     @BeforeClass
     public static void startServers() throws Exception {
@@ -46,7 +47,7 @@ public class JAXRSClientServerResourceJa
     public void testGetBook123() throws Exception {
         
         String endpointAddress =
-            "http://localhost:9080/webapp/bookstore/books/123"; 
+            "http://localhost:" + PORT + "/webapp/bookstore/books/123"; 
         URL url = new URL(endpointAddress);
         URLConnection connect = url.openConnection();
         connect.addRequestProperty("Accept", "application/json");
@@ -62,7 +63,7 @@ public class JAXRSClientServerResourceJa
     public void testPostPetStatus() throws Exception {
         
         String endpointAddress =
-            "http://localhost:9080/webapp/petstore/pets";
+            "http://localhost:" + PORT + "/webapp/petstore/pets";
 
         URL url = new URL(endpointAddress);   
         HttpURLConnection httpUrlConnection = (HttpURLConnection)url.openConnection();  
@@ -103,7 +104,7 @@ public class JAXRSClientServerResourceJa
     public void testPostPetStatus2() throws Exception {
         
         
-        Socket s = new Socket("localhost", 9080);
+        Socket s = new Socket("localhost", Integer.parseInt(PORT));
         IOUtils.copyAndCloseInput(getClass().getResource("resources/formRequest.txt").openStream(), 
                                   s.getOutputStream());
 

Modified: cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java Tue Jul 27 20:46:55 2010
@@ -50,6 +50,7 @@ import org.junit.Ignore;
 import org.junit.Test;
 
 public class JAXRSClientServerSpringBookTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = BookServerSpring.PORT;
 
     @BeforeClass
     public static void startServers() throws Exception {
@@ -60,7 +61,7 @@ public class JAXRSClientServerSpringBook
     @Test
     public void testGetBookByUriInfo() throws Exception {
         String endpointAddress =
-            "http://localhost:9080/the/thebooks/bookstore/bookinfo?"
+            "http://localhost:" + PORT + "/the/thebooks/bookstore/bookinfo?"
                                + "param1=12&param2=3"; 
         getBook(endpointAddress, "resources/expected_get_book123json.txt");
     }
@@ -69,7 +70,7 @@ public class JAXRSClientServerSpringBook
     public void testGetBookXSLTHtml() throws Exception {
 
         String endpointAddress =
-            "http://localhost:9080/the/thebooks5/bookstore/books/xslt";
+            "http://localhost:" + PORT + "/the/thebooks5/bookstore/books/xslt";
         WebClient wc = WebClient.create(endpointAddress);
         wc.accept("application/xhtml+xml").path(666).matrix("name2", 2).query("name", "Action - ");
         XMLSource source = wc.get(XMLSource.class);
@@ -83,7 +84,7 @@ public class JAXRSClientServerSpringBook
     @Test
     public void testGetBookByUriInfo2() throws Exception {
         String endpointAddress =
-            "http://localhost:9080/the/thebooks3/bookstore/bookinfo?"
+            "http://localhost:" + PORT + "/the/thebooks3/bookstore/bookinfo?"
                                + "param1=12&param2=3"; 
         getBook(endpointAddress, "resources/expected_get_book123json.txt");
     }
@@ -91,7 +92,7 @@ public class JAXRSClientServerSpringBook
     @Test
     public void testGetBook123() throws Exception {
         String endpointAddress =
-            "http://localhost:9080/the/bookstore/books/123"; 
+            "http://localhost:" + PORT + "/the/bookstore/books/123"; 
         getBook(endpointAddress, "resources/expected_get_book123json.txt");
         getBook(endpointAddress, "resources/expected_get_book123json.txt",
                 "application/jettison");
@@ -99,7 +100,7 @@ public class JAXRSClientServerSpringBook
     
     @Test
     public void testGetBookAsArray() throws Exception {
-        URL url = new URL("http://localhost:9080/the/bookstore/books/list/123");
+        URL url = new URL("http://localhost:" + PORT + "/the/bookstore/books/list/123");
         URLConnection connect = url.openConnection();
         connect.addRequestProperty("Accept", "application/json");
         InputStream in = connect.getInputStream();           
@@ -112,28 +113,28 @@ public class JAXRSClientServerSpringBook
     @Test
     public void testGetBookWithEncodedQueryValue() throws Exception {
         String endpointAddress =
-            "http://localhost:9080/the/bookstore/booksquery?id=12%2B3"; 
+            "http://localhost:" + PORT + "/the/bookstore/booksquery?id=12%2B3"; 
         getBook(endpointAddress, "resources/expected_get_book123json.txt"); 
     }
     
     @Test
     public void testGetBookWithEncodedPathValue() throws Exception {
         String endpointAddress =
-            "http://localhost:9080/the/bookstore/id=12%2B3"; 
+            "http://localhost:" + PORT + "/the/bookstore/id=12%2B3"; 
         getBook(endpointAddress, "resources/expected_get_book123json.txt"); 
     }
     
     @Test
     public void testGetBookWithEncodedPathValue2() throws Exception {
         String endpointAddress =
-            "http://localhost:9080/the/bookstore/id=12+3"; 
+            "http://localhost:" + PORT + "/the/bookstore/id=12+3"; 
         getBook(endpointAddress, "resources/expected_get_book123json.txt"); 
     }
     
     @Test
     public void testGetDefaultBook() throws Exception {
         String endpointAddress =
-            "http://localhost:9080/the/bookstore"; 
+            "http://localhost:" + PORT + "/the/bookstore"; 
         getBook(endpointAddress, "resources/expected_get_book123json.txt"); 
     }
 
@@ -151,6 +152,7 @@ public class JAXRSClientServerSpringBook
         URLConnection connect = url.openConnection();
         connect.addRequestProperty("Content-Type", "*/*");
         connect.addRequestProperty("Accept", type);
+        connect.addRequestProperty("Accept-Encoding", "gzip;q=1.0, identity; q=0.5, *;q=0");
         if (mHeader != null) {
             connect.addRequestProperty("X-HTTP-Method-Override", mHeader);
         }
@@ -179,13 +181,13 @@ public class JAXRSClientServerSpringBook
     @Test
     public void testAddInvalidXmlBook() throws Exception {
         
-        doPost("http://localhost:9080/the/bookstore/books/convert",
+        doPost("http://localhost:" + PORT + "/the/bookstore/books/convert",
                500,
                "application/xml",
                "resources/add_book.txt",
                null);
         
-        doPost("http://localhost:9080/the/thebooks/bookstore/books/convert",
+        doPost("http://localhost:" + PORT + "/the/thebooks/bookstore/books/convert",
                500,
                "application/xml",
                "resources/add_book.txt",
@@ -196,13 +198,13 @@ public class JAXRSClientServerSpringBook
     @Test
     public void testAddInvalidJsonBook() throws Exception {
         
-        doPost("http://localhost:9080/the/bookstore/books/convert",
+        doPost("http://localhost:" + PORT + "/the/bookstore/books/convert",
                500,
                "application/json",
                "resources/add_book2json_invalid.txt",
                null);
         
-        doPost("http://localhost:9080/the/thebooks/bookstore/books/convert",
+        doPost("http://localhost:" + PORT + "/the/thebooks/bookstore/books/convert",
                500,
                "application/json",
                "resources/add_book2json_invalid.txt",
@@ -213,13 +215,13 @@ public class JAXRSClientServerSpringBook
     @Test
     public void testAddValidXmlBook() throws Exception {
         
-        doPost("http://localhost:9080/the/bookstore/books/convert",
+        doPost("http://localhost:" + PORT + "/the/bookstore/books/convert",
                200,
                "application/xml",
                "resources/add_book2.txt",
                "resources/expected_get_book123.txt");
         
-        doPost("http://localhost:9080/the/thebooks/bookstore/books/convert",
+        doPost("http://localhost:" + PORT + "/the/thebooks/bookstore/books/convert",
                200,
                "application/xml",
                "resources/add_book2.txt",
@@ -231,7 +233,7 @@ public class JAXRSClientServerSpringBook
     public void testGetBookAegis() throws Exception {
         
         String endpointAddress =
-            "http://localhost:9080/the/thebooks4/bookstore/books/aegis"; 
+            "http://localhost:" + PORT + "/the/thebooks4/bookstore/books/aegis"; 
         getBookAegis(endpointAddress, "application/xml"); 
     }
     
@@ -239,7 +241,7 @@ public class JAXRSClientServerSpringBook
     public void testRetrieveBookAegis1() throws Exception {
         
         String endpointAddress =
-            "http://localhost:9080/the/thebooks4/bookstore/books/aegis/retrieve?_method=RETRIEVE"; 
+            "http://localhost:" + PORT + "/the/thebooks4/bookstore/books/aegis/retrieve?_method=RETRIEVE"; 
         getBookAegis(endpointAddress, "application/xml"); 
     }
     
@@ -247,14 +249,14 @@ public class JAXRSClientServerSpringBook
     public void testRetrieveBookAegis2() throws Exception {
         
         String endpointAddress =
-            "http://localhost:9080/the/thebooks4/bookstore/books/aegis/retrieve"; 
+            "http://localhost:" + PORT + "/the/thebooks4/bookstore/books/aegis/retrieve"; 
         getBookAegis(endpointAddress, "application/xml", "RETRIEVE"); 
     }
     
     @Test
     public void testRetrieveBookAegis3() throws Exception {
         
-        Socket s = new Socket("localhost", 9080);
+        Socket s = new Socket("localhost", Integer.parseInt(PORT));
         
         InputStream is = this.getClass().getResourceAsStream("resources/retrieveRequest.txt");
         byte[] bytes = IOUtils.readBytesFromStream(is);
@@ -279,7 +281,7 @@ public class JAXRSClientServerSpringBook
     public void testGetBookUserResource() throws Exception {
         
         String endpointAddress =
-            "http://localhost:9080/the/thebooks6/bookstore/books/123"; 
+            "http://localhost:" + PORT + "/the/thebooks6/bookstore/books/123"; 
         getBook(endpointAddress, "resources/expected_get_book123.txt", "application/xml"); 
     }
     
@@ -287,7 +289,7 @@ public class JAXRSClientServerSpringBook
     public void testGetBookUserResource2() throws Exception {
         
         String endpointAddress =
-            "http://localhost:9080/the/thebooks7/bookstore/books/123"; 
+            "http://localhost:" + PORT + "/the/thebooks7/bookstore/books/123"; 
         getBook(endpointAddress, "resources/expected_get_book123.txt", "application/xml"); 
     }
     
@@ -295,7 +297,7 @@ public class JAXRSClientServerSpringBook
     public void testGetBookUserResourceFromProxy() throws Exception {
         
         String endpointAddress =
-            "http://localhost:9080/the/thebooks6"; 
+            "http://localhost:" + PORT + "/the/thebooks6"; 
         BookStoreNoAnnotations bStore = JAXRSClientFactory.createFromModel(
                                          endpointAddress, 
                                          BookStoreNoAnnotations.class,
@@ -315,7 +317,7 @@ public class JAXRSClientServerSpringBook
     @Test
     public void testGetBookXSLTXml() throws Exception {
         String endpointAddress =
-            "http://localhost:9080/the/thebooks5/bookstore/books/xslt";
+            "http://localhost:" + PORT + "/the/thebooks5/bookstore/books/xslt";
         WebClient wc = WebClient.create(endpointAddress);
         wc.accept("application/xml").path(666).matrix("name2", 2).query("name", "Action - ");
         Book b = wc.get(Book.class);
@@ -326,7 +328,7 @@ public class JAXRSClientServerSpringBook
     @Test
     public void testReaderWriterFromJaxrsFilters() throws Exception {
         String endpointAddress =
-            "http://localhost:9080/the/thebooks5/bookstore/books/convert2/123";
+            "http://localhost:" + PORT + "/the/thebooks5/bookstore/books/convert2/123";
         WebClient wc = WebClient.create(endpointAddress);
         wc.type("application/xml").accept("application/xml");
         Book2 b = new Book2();
@@ -341,7 +343,7 @@ public class JAXRSClientServerSpringBook
     @Test
     public void testReaderWriterFromInterceptors() throws Exception {
         String endpointAddress =
-            "http://localhost:9080/the/thebooks5/bookstore/books/convert";
+            "http://localhost:" + PORT + "/the/thebooks5/bookstore/books/convert";
         WebClient wc = WebClient.create(endpointAddress);
         wc.type("application/xml").accept("application/xml");
         Book2 b = new Book2();
@@ -355,19 +357,19 @@ public class JAXRSClientServerSpringBook
     
     @Test
     public void testAddValidBookJson() throws Exception {
-        doPost("http://localhost:9080/the/bookstore/books/convert",
+        doPost("http://localhost:" + PORT + "/the/bookstore/books/convert",
                200,
                "application/json",
                "resources/add_book2json.txt",
                "resources/expected_get_book123.txt");
         
-        doPost("http://localhost:9080/the/thebooks/bookstore/books/convert",
+        doPost("http://localhost:" + PORT + "/the/thebooks/bookstore/books/convert",
                200,
                "application/json",
                "resources/add_book2json.txt",
                "resources/expected_get_book123.txt");
         
-        doPost("http://localhost:9080/the/thebooks/bookstore/books/convert",
+        doPost("http://localhost:" + PORT + "/the/thebooks/bookstore/books/convert",
                200,
                "application/jettison",
                "resources/add_book2json.txt",

Modified: cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java Tue Jul 27 20:46:55 2010
@@ -46,6 +46,7 @@ import org.junit.Ignore;
 import org.junit.Test;
 
 public class JAXRSClientServerStreamingTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = allocatePort(Server.class);
 
     @Ignore
     public static class Server extends AbstractBusTestServerBase {        
@@ -66,7 +67,7 @@ public class JAXRSClientServerStreamingT
             providers.add(p1);
             providers.add(p2);
             sf.setProviders(providers);
-            sf.setAddress("http://localhost:9080/");
+            sf.setAddress("http://localhost:" + PORT + "/");
             Map<String, Object> properties = new HashMap<String, Object>();
             properties.put("org.apache.cxf.serviceloader-context", "true");
             sf.setProperties(properties);
@@ -95,13 +96,13 @@ public class JAXRSClientServerStreamingT
     
     @Test
     public void testGetBook123() throws Exception {
-        getAndCompare("http://localhost:9080/bookstore/books/123",
+        getAndCompare("http://localhost:" + PORT + "/bookstore/books/123",
                       "application/xml", 200);
     }
     
     @Test
     public void testGetBookUsingStaxWriter() throws Exception {
-        getAndCompare("http://localhost:9080/bookstore/books/123",
+        getAndCompare("http://localhost:" + PORT + "/bookstore/books/123",
                       "text/xml", 200);
     }
     

Modified: cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceTest.java Tue Jul 27 20:46:55 2010
@@ -42,13 +42,14 @@ import org.junit.Ignore;
 import org.junit.Test;
 
 public class JAXRSClientServerUserResourceTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = allocatePort(Server.class);
 
     @Ignore
     public static class Server extends AbstractBusTestServerBase {        
 
         protected void run() {
             JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
-            sf.setAddress("http://localhost:9080/");
+            sf.setAddress("http://localhost:" + PORT + "/");
             
             UserResource ur = new UserResource();
             ur.setName(BookStoreNoAnnotations.class.getName());
@@ -108,20 +109,20 @@ public class JAXRSClientServerUserResour
     
     @Test
     public void testGetBook123() throws Exception {
-        getAndCompare("http://localhost:9080/bookstoreNoAnnotations/books/123",
+        getAndCompare("http://localhost:" + PORT + "/bookstoreNoAnnotations/books/123",
                       "application/xml", 200);
     }
     
     @Test
     public void testGetBookInterface123() throws Exception {
-        getAndCompare("http://localhost:9080/bookstore2/books/123",
+        getAndCompare("http://localhost:" + PORT + "/bookstore2/books/123",
                       "application/xml", 200);
     }
     
     @Test
     public void testGetChapter() throws Exception {
         
-        getAndCompareChapter("http://localhost:9080/bookstoreNoAnnotations/books/123/chapter",
+        getAndCompareChapter("http://localhost:" + PORT + "/bookstoreNoAnnotations/books/123/chapter",
                       "application/xml", 200);
     }
     

Modified: cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSContinuationsTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSContinuationsTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSContinuationsTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSContinuationsTest.java Tue Jul 27 20:46:55 2010
@@ -35,7 +35,8 @@ import org.junit.Test;
 
 
 public class JAXRSContinuationsTest extends AbstractBusClientServerTestBase {
-    
+    public static final String PORT = BookContinuationServer.PORT;
+
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly",
@@ -49,19 +50,19 @@ public class JAXRSContinuationsTest exte
         CountDownLatch startSignal = new CountDownLatch(1);
         CountDownLatch doneSignal = new CountDownLatch(5);
         
-        executor.execute(new BookWorker("http://localhost:9080/bookstore/books/1", 
+        executor.execute(new BookWorker("http://localhost:" + PORT + "/bookstore/books/1", 
                                         "1", 
                                         "CXF in Action1", startSignal, doneSignal));
-        executor.execute(new BookWorker("http://localhost:9080/bookstore/books/2", 
+        executor.execute(new BookWorker("http://localhost:" + PORT + "/bookstore/books/2", 
                                         "2", 
                                         "CXF in Action2", startSignal, doneSignal));
-        executor.execute(new BookWorker("http://localhost:9080/bookstore/books/3", 
+        executor.execute(new BookWorker("http://localhost:" + PORT + "/bookstore/books/3", 
                                         "3", 
                                         "CXF in Action3", startSignal, doneSignal));
-        executor.execute(new BookWorker("http://localhost:9080/bookstore/books/4", 
+        executor.execute(new BookWorker("http://localhost:" + PORT + "/bookstore/books/4", 
                                         "4", 
                                         "CXF in Action4", startSignal, doneSignal));
-        executor.execute(new BookWorker("http://localhost:9080/bookstore/books/5", 
+        executor.execute(new BookWorker("http://localhost:" + PORT + "/bookstore/books/5", 
                                         "5", 
                                         "CXF in Action5", startSignal, doneSignal));
         

Modified: cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java Tue Jul 27 20:46:55 2010
@@ -40,6 +40,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class JAXRSDataBindingTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = BookDataBindingServer.PORT;
 
     @BeforeClass
     public static void startServers() throws Exception {
@@ -50,7 +51,8 @@ public class JAXRSDataBindingTest extend
     
     @Test
     public void testGetBookJAXB() throws Exception {
-        WebClient client = WebClient.create("http://localhost:9080/databinding/jaxb/bookstore/books/123");
+        WebClient client = WebClient.create("http://localhost:" 
+                                            + PORT + "/databinding/jaxb/bookstore/books/123");
         Book book = client.accept("application/xml").get(Book.class);
         assertEquals(123L, book.getId());
         assertEquals("CXF in Action", book.getName());
@@ -59,7 +61,8 @@ public class JAXRSDataBindingTest extend
     //@org.junit.Ignore
     @Test
     public void testGetBookAegis() throws Exception {
-        WebClient client = WebClient.create("http://localhost:9080/databinding/aegis/bookstore/books/123",
+        WebClient client = WebClient.create("http://localhost:"
+                                            + PORT + "/databinding/aegis/bookstore/books/123",
                                             Collections.singletonList(new AegisElementProvider<Book>()));
         Book book = client.accept("application/xml").get(Book.class);
         assertEquals(123L, book.getId());
@@ -70,7 +73,7 @@ public class JAXRSDataBindingTest extend
     public void testSDOStructure() throws Exception {
         JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
         bean.setDataBinding(new SDODataBinding());
-        bean.setAddress("http://localhost:9080/databinding/sdo");
+        bean.setAddress("http://localhost:" + PORT + "/databinding/sdo");
         bean.setResourceClass(SDOResource.class);
         SDOResource client = bean.create(SDOResource.class);
         Structure struct = client.getStructure();
@@ -88,7 +91,7 @@ public class JAXRSDataBindingTest extend
         provider.setNamespaceMap(Collections.singletonMap("http://apache.org/structure/types", "p0"));
         provider.setDataBinding(db);
         bean.setProvider(provider);
-        bean.setAddress("http://localhost:9080/databinding/sdo");
+        bean.setAddress("http://localhost:" + PORT + "/databinding/sdo");
         bean.setResourceClass(SDOResource.class);
         List<Interceptor<? extends Message>> list = new ArrayList<Interceptor<? extends Message>>();
         list.add(new LoggingInInterceptor());

Modified: cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSJmsTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSJmsTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSJmsTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSJmsTest.java Tue Jul 27 20:46:55 2010
@@ -47,8 +47,8 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class JAXRSJmsTest extends AbstractBusClientServerTestBase {
-
     protected static boolean serversStarted;
+    static final String JMS_PORT = EmbeddedJMSBrokerLauncher.PORT;
     
     @BeforeClass
     public static void startServers() throws Exception {
@@ -167,7 +167,7 @@ public class JAXRSJmsTest extends Abstra
         Properties props = new Properties();
         props.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                           "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
-        props.setProperty(Context.PROVIDER_URL, "tcp://localhost:61500");
+        props.setProperty(Context.PROVIDER_URL, "tcp://localhost:" + JMS_PORT);
         return new InitialContext(props);
         
     }



Mime
View raw message