You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2010/06/11 20:46:14 UTC
svn commit: r953824 [2/3] - in /cxf/branches/2.2.x-fixes: ./
systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/
systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/
systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/
Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java?rev=953824&r1=953823&r2=953824&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java Fri Jun 11 18:46:12 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¶m2=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¶m2=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");
}
@@ -179,13 +180,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 +197,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 +214,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 +232,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 +240,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 +248,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 +280,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 +288,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 +296,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 +316,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 +327,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 +342,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 +356,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/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java?rev=953824&r1=953823&r2=953824&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java Fri Jun 11 18:46:12 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/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceTest.java?rev=953824&r1=953823&r2=953824&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceTest.java Fri Jun 11 18:46:12 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/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSContinuationsTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSContinuationsTest.java?rev=953824&r1=953823&r2=953824&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSContinuationsTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSContinuationsTest.java Fri Jun 11 18:46:12 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/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java?rev=953824&r1=953823&r2=953824&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java Fri Jun 11 18:46:12 2010
@@ -29,6 +29,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 {
@@ -39,7 +40,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());
@@ -47,7 +49,8 @@ public class JAXRSDataBindingTest extend
@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 = client.accept("application/xml").get(Book.class);
assertEquals(123L, book.getId());
Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java?rev=953824&r1=953823&r2=953824&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java Fri Jun 11 18:46:12 2010
@@ -59,6 +59,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
public class JAXRSMultipartTest extends AbstractBusClientServerTestBase {
+ public static final String PORT = MultipartServer.PORT;
@BeforeClass
public static void startServers() throws Exception {
@@ -68,169 +69,169 @@ public class JAXRSMultipartTest extends
@Test
public void testBookAsRootAttachmentStreamSource() throws Exception {
- String address = "http://localhost:9085/bookstore/books/stream";
+ String address = "http://localhost:" + PORT + "/bookstore/books/stream";
doAddBook(address, "attachmentData", 200);
}
@Test
public void testBookAsRootAttachmentStreamSourceNoContentId() throws Exception {
- String address = "http://localhost:9085/bookstore/books/stream";
+ String address = "http://localhost:" + PORT + "/bookstore/books/stream";
doAddBook(address, "attachmentData3", 200);
}
@Test
public void testBookAsRootAttachmentInputStream() throws Exception {
- String address = "http://localhost:9085/bookstore/books/istream";
+ String address = "http://localhost:" + PORT + "/bookstore/books/istream";
doAddBook(address, "attachmentData", 200);
}
@Test
public void testBookAsMessageContextDataHandler() throws Exception {
- String address = "http://localhost:9085/bookstore/books/mchandlers";
+ String address = "http://localhost:" + PORT + "/bookstore/books/mchandlers";
doAddBook(address, "attachmentData", 200);
}
@Test
public void testBookAsMessageContextAttachments() throws Exception {
- String address = "http://localhost:9085/bookstore/books/attachments";
+ String address = "http://localhost:" + PORT + "/bookstore/books/attachments";
doAddBook(address, "attachmentData", 200);
}
@Test
public void testBookJSONForm() throws Exception {
- String address = "http://localhost:9085/bookstore/books/jsonform";
+ String address = "http://localhost:" + PORT + "/bookstore/books/jsonform";
doAddFormBook(address, "attachmentFormJson", 200);
}
@Test
public void testBookJaxbForm() throws Exception {
- String address = "http://localhost:9085/bookstore/books/jaxbform";
+ String address = "http://localhost:" + PORT + "/bookstore/books/jaxbform";
doAddFormBook(address, "attachmentFormJaxb", 200);
}
@Test
public void testBookJSONJAXBForm() throws Exception {
- String address = "http://localhost:9085/bookstore/books/jsonjaxbform";
+ String address = "http://localhost:" + PORT + "/bookstore/books/jsonjaxbform";
doAddFormBook(address, "attachmentFormJsonJaxb", 200);
}
@Test
public void testBookJSONJAXBFormEncoded() throws Exception {
- String address = "http://localhost:9085/bookstore/books/jsonjaxbform";
+ String address = "http://localhost:" + PORT + "/bookstore/books/jsonjaxbform";
doAddFormBook(address, "attachmentFormJsonJaxbEncoded", 200);
}
@Test
public void testBookJSONFormFiles() throws Exception {
- String address = "http://localhost:9085/bookstore/books/filesform";
+ String address = "http://localhost:" + PORT + "/bookstore/books/filesform";
doAddFormBook(address, "attachmentFormJsonFiles", 200);
}
@Test
public void testBookAsMessageContextAttachment() throws Exception {
- String address = "http://localhost:9085/bookstore/books/attachment";
+ String address = "http://localhost:" + PORT + "/bookstore/books/attachment";
doAddBook(address, "attachmentData", 200);
}
@Test
public void testAddBookAsRootAttachmentJAXB() throws Exception {
- String address = "http://localhost:9085/bookstore/books/jaxb";
+ String address = "http://localhost:" + PORT + "/bookstore/books/jaxb";
doAddBook(address, "attachmentData", 200);
}
@Test
public void testAddBookAsDataSource() throws Exception {
- String address = "http://localhost:9085/bookstore/books/dsource";
+ String address = "http://localhost:" + PORT + "/bookstore/books/dsource";
doAddBook(address, "attachmentData", 200);
}
@Test
public void testAddBookAsDataSource2() throws Exception {
- String address = "http://localhost:9085/bookstore/books/dsource2";
+ String address = "http://localhost:" + PORT + "/bookstore/books/dsource2";
doAddBook(address, "attachmentData", 200);
}
@Test
public void testAddBookAsBody() throws Exception {
- String address = "http://localhost:9085/bookstore/books/body";
+ String address = "http://localhost:" + PORT + "/bookstore/books/body";
doAddBook(address, "attachmentData", 200);
}
@Test
public void testAddBookFormData() throws Exception {
- String address = "http://localhost:9085/bookstore/books/form";
+ String address = "http://localhost:" + PORT + "/bookstore/books/form";
doAddBook("multipart/form-data", address, "attachmentForm", 200);
}
@Test
public void testAddBookFormParam() throws Exception {
- String address = "http://localhost:9085/bookstore/books/formparam";
+ String address = "http://localhost:" + PORT + "/bookstore/books/formparam";
doAddBook("multipart/form-data", address, "attachmentForm", 200);
}
@Test
public void testAddBookFormBody() throws Exception {
- String address = "http://localhost:9085/bookstore/books/formbody";
+ String address = "http://localhost:" + PORT + "/bookstore/books/formbody";
doAddBook("multipart/form-data", address, "attachmentForm", 200);
}
@Test
public void testAddBookFormBody2() throws Exception {
- String address = "http://localhost:9085/bookstore/books/formbody2";
+ String address = "http://localhost:" + PORT + "/bookstore/books/formbody2";
doAddBook("multipart/form-data", address, "attachmentForm", 200);
}
@Test
public void testAddBookFormParamBean() throws Exception {
- String address = "http://localhost:9085/bookstore/books/formparambean";
+ String address = "http://localhost:" + PORT + "/bookstore/books/formparambean";
doAddBook("multipart/form-data", address, "attachmentForm", 200);
}
@Test
public void testAddBookAsJAXB2() throws Exception {
- String address = "http://localhost:9085/bookstore/books/jaxb2";
+ String address = "http://localhost:" + PORT + "/bookstore/books/jaxb2";
doAddBook(address, "attachmentData", 200);
}
@Test
public void testAddBookAsListOfAttachments() throws Exception {
- String address = "http://localhost:9085/bookstore/books/listattachments";
+ String address = "http://localhost:" + PORT + "/bookstore/books/listattachments";
doAddBook(address, "attachmentData", 200);
}
@Test
public void testAddBookAsListOfStreams() throws Exception {
- String address = "http://localhost:9085/bookstore/books/lististreams";
+ String address = "http://localhost:" + PORT + "/bookstore/books/lististreams";
doAddBook(address, "attachmentData", 200);
}
@Test
public void testAddBookAsJAXBJSON() throws Exception {
- String address = "http://localhost:9085/bookstore/books/jaxbjson";
+ String address = "http://localhost:" + PORT + "/bookstore/books/jaxbjson";
doAddBook(address, "attachmentData2", 200);
}
@Test
public void testAddBookAsJAXBJSONMixed() throws Exception {
- String address = "http://localhost:9085/bookstore/books/jaxbjson";
+ String address = "http://localhost:" + PORT + "/bookstore/books/jaxbjson";
doAddBook("multipart/mixed", address, "attachmentData2", 200);
}
@Test
public void testConsumesMismatch() throws Exception {
- String address = "http://localhost:9085/bookstore/books/mismatch1";
+ String address = "http://localhost:" + PORT + "/bookstore/books/mismatch1";
doAddBook(address, "attachmentData2", 415);
}
@Test
public void testConsumesMismatch2() throws Exception {
- String address = "http://localhost:9085/bookstore/books/mismatch2";
+ String address = "http://localhost:" + PORT + "/bookstore/books/mismatch2";
doAddBook(address, "attachmentData2", 415);
}
@Test
public void testAddBookAsDataHandler() throws Exception {
- String address = "http://localhost:9085/bookstore/books/dhandler";
+ String address = "http://localhost:" + PORT + "/bookstore/books/dhandler";
doAddBook(address, "attachmentData", 200);
}
@@ -238,7 +239,7 @@ public class JAXRSMultipartTest extends
public void testAddBookWebClient() {
InputStream is1 =
getClass().getResourceAsStream("/org/apache/cxf/systest/jaxrs/resources/add_book.txt");
- String address = "http://localhost:9085/bookstore/books/jaxb";
+ String address = "http://localhost:" + PORT + "/bookstore/books/jaxb";
WebClient client = WebClient.create(address);
client.type("multipart/related;type=text/xml").accept("text/xml");
Book book = client.post(is1, Book.class);
@@ -247,7 +248,7 @@ public class JAXRSMultipartTest extends
@Test
public void testXopWebClient() throws Exception {
- String address = "http://localhost:9085/bookstore/xop";
+ String address = "http://localhost:" + PORT + "/bookstore/xop";
JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
bean.setAddress(address);
bean.setProperties(Collections.singletonMap(org.apache.cxf.message.Message.MTOM_ENABLED,
@@ -287,7 +288,7 @@ public class JAXRSMultipartTest extends
@Test
public void testAddBookJaxbJsonImageWebClient() throws Exception {
- String address = "http://localhost:9085/bookstore/books/jaxbjsonimage";
+ String address = "http://localhost:" + PORT + "/bookstore/books/jaxbjsonimage";
WebClient client = WebClient.create(address);
client.type("multipart/mixed").accept("multipart/mixed");
@@ -316,7 +317,7 @@ public class JAXRSMultipartTest extends
@Test
public void testAddBookJaxbJsonImageAttachments() throws Exception {
- String address = "http://localhost:9085/bookstore/books/jaxbimagejson";
+ String address = "http://localhost:" + PORT + "/bookstore/books/jaxbimagejson";
WebClient client = WebClient.create(address);
client.type("multipart/mixed").accept("multipart/mixed");
@@ -345,7 +346,7 @@ public class JAXRSMultipartTest extends
@Test
public void testAddGetJaxbBooksWebClient() throws Exception {
- String address = "http://localhost:9085/bookstore/books/jaxbonly";
+ String address = "http://localhost:" + PORT + "/bookstore/books/jaxbonly";
WebClient client = WebClient.create(address);
client.type("multipart/mixed;type=application/xml").accept("multipart/mixed");
@@ -369,7 +370,7 @@ public class JAXRSMultipartTest extends
public void testAddGetImageWebClient() throws Exception {
InputStream is1 =
getClass().getResourceAsStream("/org/apache/cxf/systest/jaxrs/resources/java.jpg");
- String address = "http://localhost:9085/bookstore/books/image";
+ String address = "http://localhost:" + PORT + "/bookstore/books/image";
WebClient client = WebClient.create(address);
HTTPConduit conduit = WebClient.getConfig(client).getHttpConduit();
conduit.getClient().setReceiveTimeout(1000000);
@@ -387,7 +388,7 @@ public class JAXRSMultipartTest extends
public void testUploadImageFromForm() throws Exception {
InputStream is1 =
getClass().getResourceAsStream("/org/apache/cxf/systest/jaxrs/resources/java.jpg");
- String address = "http://localhost:9085/bookstore/books/formimage";
+ String address = "http://localhost:" + PORT + "/bookstore/books/formimage";
WebClient client = WebClient.create(address);
HTTPConduit conduit = WebClient.getConfig(client).getHttpConduit();
conduit.getClient().setReceiveTimeout(1000000);
@@ -419,7 +420,7 @@ public class JAXRSMultipartTest extends
public void testUploadImageFromForm2() throws Exception {
File file =
new File(getClass().getResource("/org/apache/cxf/systest/jaxrs/resources/java.jpg").getFile());
- String address = "http://localhost:9085/bookstore/books/formimage2";
+ String address = "http://localhost:" + PORT + "/bookstore/books/formimage2";
WebClient client = WebClient.create(address);
HTTPConduit conduit = WebClient.getConfig(client).getHttpConduit();
conduit.getClient().setReceiveTimeout(1000000);
@@ -439,7 +440,7 @@ public class JAXRSMultipartTest extends
@Test
public void testMultipartRequestNoBody() throws Exception {
- PostMethod post = new PostMethod("http://localhost:9085/bookstore/books/image");
+ PostMethod post = new PostMethod("http://localhost:" + PORT + "/bookstore/books/image");
String ct = "multipart/mixed";
post.setRequestHeader("Content-Type", ct);
HttpClient httpclient = new HttpClient();
Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultithreadedClientTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultithreadedClientTest.java?rev=953824&r1=953823&r2=953824&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultithreadedClientTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultithreadedClientTest.java Fri Jun 11 18:46:12 2010
@@ -41,6 +41,7 @@ import org.junit.Ignore;
import org.junit.Test;
public class JAXRSMultithreadedClientTest extends AbstractBusClientServerTestBase {
+ public static final String PORT = BookServer.PORT;
@BeforeClass
public static void startServers() throws Exception {
@@ -50,49 +51,49 @@ public class JAXRSMultithreadedClientTes
@Test
public void testStatefulWebClientWithCopy() throws Exception {
- runWebClients(WebClient.create("http://localhost:9080/bookstore"), 10, false, true);
+ runWebClients(WebClient.create("http://localhost:" + PORT + "/bookstore"), 10, false, true);
}
@Test
public void testStatefulWebClientThreadLocal() throws Exception {
- runWebClients(WebClient.create("http://localhost:9080/bookstore", true), 10, true, true);
+ runWebClients(WebClient.create("http://localhost:" + PORT + "/bookstore", true), 10, true, true);
}
@Test
public void testStatefulWebClientThreadLocalWithCopy() throws Exception {
- runWebClients(WebClient.create("http://localhost:9080/bookstore", true), 10, false, true);
+ runWebClients(WebClient.create("http://localhost:" + PORT + "/bookstore", true), 10, false, true);
}
@Test
public void testSimpleWebClient() throws Exception {
- WebClient client = WebClient.create("http://localhost:9080/bookstore/booksecho");
+ WebClient client = WebClient.create("http://localhost:" + PORT + "/bookstore/booksecho");
client.type("text/plain").accept("text/plain").header("CustomHeader", "CustomValue");
runWebClients(client, 10, true, false);
}
@Test
public void testSimpleProxy() throws Exception {
- BookStore proxy = JAXRSClientFactory.create("http://localhost:9080", BookStore.class);
+ BookStore proxy = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
runProxies(proxy, 10, true, false);
}
@Test
public void testThreadSafeProxy() throws Exception {
- BookStore proxy = JAXRSClientFactory.create("http://localhost:9080", BookStore.class,
+ BookStore proxy = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class,
Collections.emptyList(), true);
runProxies(proxy, 10, true, true);
}
@Test
public void testThreadSafeProxyWithCopy() throws Exception {
- BookStore proxy = JAXRSClientFactory.create("http://localhost:9080", BookStore.class,
+ BookStore proxy = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class,
Collections.emptyList(), true);
runProxies(proxy, 10, false, true);
}
@Test
public void testThreadSafeSubProxy() throws Exception {
- BookStore proxy = JAXRSClientFactory.create("http://localhost:9080", BookStore.class,
+ BookStore proxy = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class,
Collections.emptyList(), true);
runProxies(proxy.echoThroughBookStoreSub(), 10, true, true);
Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSRequestDispatcherTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSRequestDispatcherTest.java?rev=953824&r1=953823&r2=953824&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSRequestDispatcherTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSRequestDispatcherTest.java Fri Jun 11 18:46:12 2010
@@ -31,6 +31,7 @@ import org.junit.Ignore;
import org.junit.Test;
public class JAXRSRequestDispatcherTest extends AbstractBusClientServerTestBase {
+ public static final String PORT = BookServerRequestDispatch.PORT;
@BeforeClass
public static void startServers() throws Exception {
@@ -41,7 +42,7 @@ public class JAXRSRequestDispatcherTest
@Test
public void testGetBookHTML() throws Exception {
String endpointAddress =
- "http://localhost:9080/the/bookstore1/books/html/123";
+ "http://localhost:" + PORT + "/the/bookstore1/books/html/123";
WebClient client = WebClient.create(endpointAddress);
client.accept("text/html");
WebClient.getConfig(client).getHttpConduit().getClient().setReceiveTimeout(100000000);
@@ -59,7 +60,7 @@ public class JAXRSRequestDispatcherTest
@Ignore("JSP pages need to be precompiled by Maven build")
public void testGetBookJSPRequestScope() throws Exception {
String endpointAddress =
- "http://localhost:9080/the/bookstore2/books/html/123";
+ "http://localhost:" + PORT + "/the/bookstore2/books/html/123";
WebClient client = WebClient.create(endpointAddress);
client.accept("text/html");
WebClient.getConfig(client).getHttpConduit().getClient().setReceiveTimeout(100000000);
@@ -73,7 +74,7 @@ public class JAXRSRequestDispatcherTest
@Ignore("JSP pages need to be precompiled by Maven build")
public void testGetBookJSPSessionScope() throws Exception {
String endpointAddress =
- "http://localhost:9080/the/bookstore3/books/html/456";
+ "http://localhost:" + PORT + "/the/bookstore3/books/html/456";
WebClient client = WebClient.create(endpointAddress);
client.accept("text/html");
WebClient.getConfig(client).getHttpConduit().getClient().setReceiveTimeout(100000000);
@@ -85,7 +86,7 @@ public class JAXRSRequestDispatcherTest
@Test
public void testGetBookHTMLFromDefaultServlet() throws Exception {
String endpointAddress =
- "http://localhost:9080/the/bookstore4/books/html/123";
+ "http://localhost:" + PORT + "/the/bookstore4/books/html/123";
WebClient client = WebClient.create(endpointAddress);
client.accept("text/html");
WebClient.getConfig(client).getHttpConduit().getClient().setReceiveTimeout(100000000);
Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java?rev=953824&r1=953823&r2=953824&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java Fri Jun 11 18:46:12 2010
@@ -69,6 +69,7 @@ import org.junit.Ignore;
import org.junit.Test;
public class JAXRSSoapBookTest extends AbstractBusClientServerTestBase {
+ public static final String PORT = BookServerRestSoap.PORT;
@BeforeClass
public static void startServers() throws Exception {
@@ -79,7 +80,8 @@ public class JAXRSSoapBookTest extends A
@Test
public void testGetAll() throws Exception {
- InputStream in = getHttpInputStream("http://localhost:9092/test/services/rest2/myRestService");
+ InputStream in = getHttpInputStream("http://localhost:" + PORT
+ + "/test/services/rest2/myRestService");
assertEquals("0", getStringFromInputStream(in));
}
@@ -88,7 +90,7 @@ public class JAXRSSoapBookTest extends A
public void testGetBookFastinfoset() throws Exception {
JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
- bean.setAddress("http://localhost:9092/test/services/rest3/bookstore/fastinfoset2");
+ bean.setAddress("http://localhost:" + PORT + "/test/services/rest3/bookstore/fastinfoset2");
bean.getInInterceptors().add(new FIStaxInInterceptor());
JAXBElementProvider p = new JAXBElementProvider();
p.setConsumeMediaTypes(Collections.singletonList("application/fastinfoset"));
@@ -108,7 +110,7 @@ public class JAXRSSoapBookTest extends A
public void testPostGetBookFastinfoset() throws Exception {
JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
- bean.setAddress("http://localhost:9092/test/services/rest3/bookstore/fastinfoset");
+ bean.setAddress("http://localhost:" + PORT + "/test/services/rest3/bookstore/fastinfoset");
bean.getOutInterceptors().add(new FIStaxOutInterceptor());
bean.getInInterceptors().add(new FIStaxInInterceptor());
JAXBElementProvider p = new JAXBElementProvider();
@@ -131,7 +133,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testGetBook123ServletResponse() throws Exception {
- InputStream in = getHttpInputStream("http://localhost:9092/test/services/rest/bookstore/0");
+ InputStream in = getHttpInputStream("http://localhost:" + PORT + "/test/services/rest/bookstore/0");
InputStream expected = getClass().getResourceAsStream("resources/expected_get_book123.txt");
assertEquals(getStringFromInputStream(expected), getStringFromInputStream(in));
@@ -140,7 +142,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testGetBook123() throws Exception {
- InputStream in = getHttpInputStream("http://localhost:9092/test/services/rest/bookstore/123");
+ InputStream in = getHttpInputStream("http://localhost:" + PORT + "/test/services/rest/bookstore/123");
InputStream expected = getClass().getResourceAsStream("resources/expected_get_book123.txt");
assertEquals(getStringFromInputStream(expected), getStringFromInputStream(in));
@@ -150,7 +152,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testGetBook123Client() throws Exception {
- String baseAddress = "http://localhost:9092/test/services/rest";
+ String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
BookStoreJaxrsJaxws proxy = JAXRSClientFactory.create(baseAddress,
BookStoreJaxrsJaxws.class);
HTTPConduit conduit = (HTTPConduit)WebClient.getConfig(proxy).getConduit();
@@ -170,7 +172,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testGetBook123WebClient() throws Exception {
- String baseAddress = "http://localhost:9092/test/services/rest";
+ String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
WebClient client = WebClient.create(baseAddress);
client.path("/bookstore/123").accept(MediaType.APPLICATION_XML_TYPE);
Book b = client.get(Book.class);
@@ -180,7 +182,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testGetBook123XMLSource() throws Exception {
- String baseAddress = "http://localhost:9092/test/services/rest";
+ String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
WebClient client = WebClient.create(baseAddress);
client.path("/bookstore/123").accept(MediaType.APPLICATION_XML_TYPE);
XMLSource source = client.get(XMLSource.class);
@@ -195,7 +197,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testNoBookWebClient() throws Exception {
- String baseAddress = "http://localhost:9092/test/services/rest";
+ String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
WebClient client = WebClient.create(baseAddress);
client.path("/bookstore/books/0/subresource").accept(MediaType.APPLICATION_XML_TYPE);
Book b = client.get(Book.class);
@@ -205,7 +207,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testGetBook123WebClientResponse() throws Exception {
- String baseAddress = "http://localhost:9092/test/services/rest";
+ String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
WebClient client = WebClient.create(baseAddress);
client.path("/bookstore/123").accept(MediaType.APPLICATION_XML_TYPE);
Book b = readBook((InputStream)client.get().getEntity());
@@ -216,7 +218,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testGetBook356ClientException() throws Exception {
- String baseAddress = "http://localhost:9092/test/services/rest";
+ String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
BookStoreJaxrsJaxws proxy = JAXRSClientFactory.create(baseAddress,
BookStoreJaxrsJaxws.class,
Collections.singletonList(new TestResponseExceptionMapper()));
@@ -236,7 +238,7 @@ public class JAXRSSoapBookTest extends A
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("org.apache.cxf.http.throw_io_exceptions", Boolean.TRUE);
bean.setProperties(properties);
- bean.setAddress("http://localhost:9092/test/services/rest/bookstore/356");
+ bean.setAddress("http://localhost:" + PORT + "/test/services/rest/bookstore/356");
WebClient wc = bean.createWebClient();
Response response = wc.get();
assertEquals(404, response.getStatus());
@@ -248,7 +250,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testOtherInterceptorDrainingStream() throws Exception {
- String baseAddress = "http://localhost:9092/test/services/rest";
+ String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
bean.setAddress(baseAddress);
bean.getInInterceptors().add(new TestStreamDrainInterptor());
@@ -262,7 +264,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testGetBookSubresourceClient() throws Exception {
- String baseAddress = "http://localhost:9092/test/services/rest";
+ String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
BookStoreJaxrsJaxws proxy = JAXRSClientFactory.create(baseAddress,
BookStoreJaxrsJaxws.class);
BookSubresource bs = proxy.getBookSubresource("125");
@@ -274,7 +276,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testGetBookSubresourceClientNoProduces() throws Exception {
- String baseAddress = "http://localhost:9092/test/services/rest";
+ String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
BookStoreJaxrsJaxws proxy = JAXRSClientFactory.create(baseAddress,
BookStoreJaxrsJaxws.class);
BookSubresource bs = proxy.getBookSubresource("125");
@@ -286,7 +288,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testGetBookSubresourceParamExtensions() throws Exception {
- String baseAddress = "http://localhost:9092/test/services/rest";
+ String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
BookStoreJaxrsJaxws proxy = JAXRSClientFactory.create(baseAddress,
BookStoreJaxrsJaxws.class);
BookSubresource bs = proxy.getBookSubresource("139");
@@ -299,7 +301,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testAddOrderFormBean() throws Exception {
- String baseAddress = "http://localhost:9092/test/services/rest";
+ String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
BookStoreJaxrsJaxws proxy = JAXRSClientFactory.create(baseAddress,
BookStoreJaxrsJaxws.class);
BookSubresource bs = proxy.getBookSubresource("139");
@@ -313,7 +315,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testGetBookSubresourceWebClientParamExtensions() throws Exception {
- WebClient client = WebClient.create("http://localhost:9092/test/services/rest");
+ WebClient client = WebClient.create("http://localhost:" + PORT + "/test/services/rest");
client.type(MediaType.TEXT_PLAIN_TYPE).accept(MediaType.APPLICATION_XML_TYPE);
client.path("/bookstore/books/139/subresource4/139/CXF Rocks");
Book bean = new Book("CXF Rocks", 139L);
@@ -327,7 +329,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testGetBookSubresourceClient2() throws Exception {
- String baseAddress = "http://localhost:9092/test/services/rest";
+ String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
BookStoreJaxrsJaxws proxy = JAXRSClientFactory.create(baseAddress,
BookStoreJaxrsJaxws.class);
doTestSubresource(proxy);
@@ -340,7 +342,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testGetBookSubresourceWebClientProxyBean() throws Exception {
- WebClient client = WebClient.create("http://localhost:9092/test/services/rest");
+ WebClient client = WebClient.create("http://localhost:" + PORT + "/test/services/rest");
client.type(MediaType.TEXT_PLAIN_TYPE)
.accept(MediaType.APPLICATION_XML_TYPE, MediaType.TEXT_XML_TYPE);
BookStoreJaxrsJaxws proxy =
@@ -358,7 +360,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testGetBookSubresourceWebClientProxy2() throws Exception {
- WebClient client = WebClient.create("http://localhost:9092/test/services/rest/bookstore")
+ WebClient client = WebClient.create("http://localhost:" + PORT + "/test/services/rest/bookstore")
.path("/books/378");
client.type(MediaType.TEXT_PLAIN_TYPE).accept(MediaType.APPLICATION_XML_TYPE);
BookSubresource proxy = JAXRSClientFactory.fromClient(client, BookSubresource.class);
@@ -388,7 +390,8 @@ public class JAXRSSoapBookTest extends A
@Test
public void testGetBookWebClientForm() throws Exception {
- String baseAddress = "http://localhost:9092/test/services/rest/bookstore/books/679/subresource3";
+ String baseAddress = "http://localhost:" + PORT
+ + "/test/services/rest/bookstore/books/679/subresource3";
WebClient wc = WebClient.create(baseAddress);
MultivaluedMap<String, Object> map = new MetadataMap<String, Object>();
map.putSingle("id", "679");
@@ -403,7 +406,8 @@ public class JAXRSSoapBookTest extends A
@Test
public void testGetBookWebClientForm2() throws Exception {
- String baseAddress = "http://localhost:9092/test/services/rest/bookstore/books/679/subresource3";
+ String baseAddress = "http://localhost:" + PORT
+ + "/test/services/rest/bookstore/books/679/subresource3";
WebClient wc = WebClient.create(baseAddress);
Form f = new Form();
f.set("id", "679").set("name", "CXF in Action - ")
@@ -417,7 +421,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testGetBookSubresourceClientFormParam() throws Exception {
- String baseAddress = "http://localhost:9092/test/services/rest";
+ String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
BookStoreJaxrsJaxws proxy = JAXRSClientFactory.create(baseAddress,
BookStoreJaxrsJaxws.class);
BookSubresource bs = proxy.getBookSubresource("679");
@@ -428,7 +432,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testAddGetBook123WebClient() throws Exception {
- String baseAddress = "http://localhost:9092/test/services/rest";
+ String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
WebClient client = WebClient.create(baseAddress);
client.path("/bookstore/books").accept(MediaType.APPLICATION_XML_TYPE)
.type(MediaType.APPLICATION_XML_TYPE);
@@ -443,7 +447,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testAddGetBook123Client() throws Exception {
- String baseAddress = "http://localhost:9092/test/services/rest";
+ String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
BookStoreJaxrsJaxws proxy = JAXRSClientFactory.create(baseAddress,
BookStoreJaxrsJaxws.class);
Book b = new Book();
@@ -459,7 +463,7 @@ public class JAXRSSoapBookTest extends A
public void testAddGetBookRest() throws Exception {
String endpointAddress =
- "http://localhost:9092/test/services/rest/bookstore/books";
+ "http://localhost:" + PORT + "/test/services/rest/bookstore/books";
File input = new File(getClass().getResource("resources/add_book.txt").toURI());
PostMethod post = new PostMethod(endpointAddress);
@@ -485,7 +489,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testGetBookSoap() throws Exception {
String wsdlAddress =
- "http://localhost:9092/test/services/soap/bookservice?wsdl";
+ "http://localhost:" + PORT + "/test/services/soap/bookservice?wsdl";
URL wsdlUrl = new URL(wsdlAddress);
BookSoapService service =
new BookSoapService(wsdlUrl,
@@ -498,20 +502,20 @@ public class JAXRSSoapBookTest extends A
@Test
public void testServiceListingsAndWadl() throws Exception {
String listings =
- getStringFromInputStream(getHttpInputStream("http://localhost:9092/test/services"));
+ getStringFromInputStream(getHttpInputStream("http://localhost:" + PORT + "/test/services"));
assertNotNull(listings);
- assertTrue(listings.contains("http://localhost:9092/test/services/soap/bookservice?wsdl"));
- assertFalse(listings.contains("http://localhost:9092/test/services/soap/bookservice2?wsdl"));
+ assertTrue(listings.contains("http://localhost:" + PORT + "/test/services/soap/bookservice?wsdl"));
+ assertFalse(listings.contains("http://localhost:" + PORT + "/test/services/soap/bookservice2?wsdl"));
- assertTrue(listings.contains("http://localhost:9092/test/services/rest?_wadl&type=xml"));
+ assertTrue(listings.contains("http://localhost:" + PORT + "/test/services/rest?_wadl&type=xml"));
assertEquals(200, WebClient.create(
- "http://localhost:9092/test/services/rest?_wadl&type=xml").get().getStatus());
- assertTrue(listings.contains("http://localhost:9092/test/services/rest2?_wadl&type=xml"));
+ "http://localhost:" + PORT + "/test/services/rest?_wadl&type=xml").get().getStatus());
+ assertTrue(listings.contains("http://localhost:" + PORT + "/test/services/rest2?_wadl&type=xml"));
assertEquals(200, WebClient.create(
- "http://localhost:9092/test/services/rest2?_wadl&type=xml").get().getStatus());
- assertFalse(listings.contains("http://localhost:9092/test/services/rest3?_wadl&type=xml"));
+ "http://localhost:" + PORT + "/test/services/rest2?_wadl&type=xml").get().getStatus());
+ assertFalse(listings.contains("http://localhost:" + PORT + "/test/services/rest3?_wadl&type=xml"));
assertEquals(401, WebClient.create(
- "http://localhost:9092/test/services/rest3?_wadl&type=xml").get().getStatus());
+ "http://localhost:" + PORT + "/test/services/rest3?_wadl&type=xml").get().getStatus());
@@ -520,7 +524,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testAddFeatureToClient() throws Exception {
- String baseAddress = "http://localhost:9092/test/services/rest";
+ String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
bean.setAddress(baseAddress);
bean.setResourceClass(BookStoreJaxrsJaxws.class);
@@ -549,7 +553,7 @@ public class JAXRSSoapBookTest extends A
@Test
public void testClientFaultOutInterceptor() throws Exception {
//testing faults created by client out interceptor chain handled correctly
- String baseAddress = "http://localhost:9092/test/services/rest";
+ String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
bean.setAddress(baseAddress);
bean.setResourceClass(BookStoreJaxrsJaxws.class);
@@ -573,7 +577,7 @@ public class JAXRSSoapBookTest extends A
}
private void serverFaultInInterceptorTest(String param) {
- String baseAddress = "http://localhost:9092/test/services/rest";
+ String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
bean.setAddress(baseAddress);
bean.setResourceClass(BookStoreJaxrsJaxws.class);
Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSUriInfoTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSUriInfoTest.java?rev=953824&r1=953823&r2=953824&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSUriInfoTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSUriInfoTest.java Fri Jun 11 18:46:12 2010
@@ -33,7 +33,7 @@ import org.junit.Ignore;
import org.junit.Test;
public class JAXRSUriInfoTest extends AbstractClientServerTestBase {
-
+ public static final String PORT = SpringServer.PORT;
@BeforeClass
public static void beforeClass() throws Exception {
// must be 'in-process' to communicate with inner class in single JVM
@@ -44,7 +44,7 @@ public class JAXRSUriInfoTest extends Ab
@Ignore
public static class SpringServer extends AbstractSpringServer {
public SpringServer() {
- super("/jaxrs_uriinfo", "/app", 9080);
+ super("/jaxrs_uriinfo", "/app");
}
}
@@ -60,24 +60,24 @@ public class JAXRSUriInfoTest extends Ab
*/
@Test
public void testBasePathAndPathAndPathParam() throws Exception {
- checkUriInfo("http://localhost:9080/app/v1", "\"\"", "/");
- checkUriInfo("http://localhost:9080/app/v1/", "\"\"", "/");
- checkUriInfo("http://localhost:9080/app/v1/test", "\"test\"", "test");
- checkUriInfo("http://localhost:9080/app/v1/", "\"\"", "/");
- checkUriInfo("http://localhost:9080/app/v1", "\"\"", "/");
+ checkUriInfo("http://localhost:" + PORT + "/app/v1", "\"\"", "/");
+ checkUriInfo("http://localhost:" + PORT + "/app/v1/", "\"\"", "/");
+ checkUriInfo("http://localhost:" + PORT + "/app/v1/test", "\"test\"", "test");
+ checkUriInfo("http://localhost:" + PORT + "/app/v1/", "\"\"", "/");
+ checkUriInfo("http://localhost:" + PORT + "/app/v1", "\"\"", "/");
- checkUriInfo("http://localhost:9080/app/v1/bar", "\"bar\"", "bar");
- checkUriInfo("http://localhost:9080/app/v1/bar", "\"bar\"", "bar");
- checkUriInfo("http://localhost:9080/app/v1/bar/test", "\"bar/test\"", "bar/test");
- checkUriInfo("http://localhost:9080/app/v1/bar", "\"bar\"", "bar");
- checkUriInfo("http://localhost:9080/app/v1/bar", "\"bar\"", "bar");
+ checkUriInfo("http://localhost:" + PORT + "/app/v1/bar", "\"bar\"", "bar");
+ checkUriInfo("http://localhost:" + PORT + "/app/v1/bar", "\"bar\"", "bar");
+ checkUriInfo("http://localhost:" + PORT + "/app/v1/bar/test", "\"bar/test\"", "bar/test");
+ checkUriInfo("http://localhost:" + PORT + "/app/v1/bar", "\"bar\"", "bar");
+ checkUriInfo("http://localhost:" + PORT + "/app/v1/bar", "\"bar\"", "bar");
}
private void checkUriInfo(String address, String path, String pathParam) {
WebClient wc = WebClient.create(address);
wc.accept("text/plain");
String data = wc.get(String.class);
- assertEquals("http://localhost:9080/app/v1/," + path + "," + pathParam, data);
+ assertEquals("http://localhost:" + PORT + "/app/v1/," + path + "," + pathParam, data);
}
@Ignore
Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartServer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartServer.java?rev=953824&r1=953823&r2=953824&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartServer.java (original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartServer.java Fri Jun 11 18:46:12 2010
@@ -24,14 +24,14 @@ import org.apache.cxf.jaxrs.lifecycle.Si
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
public class MultipartServer extends AbstractBusTestServerBase {
-
+ public static final String PORT = allocatePort(MultipartServer.class);
protected void run() {
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(MultipartStore.class);
//default lifecycle is per-request, change it to singleton
sf.setResourceProvider(MultipartStore.class,
new SingletonResourceProvider(new MultipartStore()));
- sf.setAddress("http://localhost:9085/");
+ sf.setAddress("http://localhost:" + PORT + "/");
sf.create();
}
Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/BookHttpsServer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/BookHttpsServer.java?rev=953824&r1=953823&r2=953824&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/BookHttpsServer.java (original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/BookHttpsServer.java Fri Jun 11 18:46:12 2010
@@ -26,9 +26,11 @@ import org.apache.cxf.jaxrs.JAXRSServerF
import org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider;
import org.apache.cxf.systest.jaxrs.BookStore;
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+import org.apache.cxf.testutil.common.TestUtil;
public class BookHttpsServer extends AbstractBusTestServerBase {
-
+ public static final String PORT = TestUtil.getPortNumber("jaxrs-https");
+
private static final String SERVER_CONFIG_FILE =
"org/apache/cxf/systest/jaxrs/security/jaxrs-https.xml";
@@ -43,7 +45,7 @@ public class BookHttpsServer extends Abs
//default lifecycle is per-request, change it to singleton
sf.setResourceProvider(BookStore.class,
new SingletonResourceProvider(new BookStore()));
- sf.setAddress("https://localhost:9095/");
+ sf.setAddress("https://localhost:" + PORT + "/");
sf.create();
}
Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java?rev=953824&r1=953823&r2=953824&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java Fri Jun 11 18:46:12 2010
@@ -31,6 +31,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
public class JAXRSHttpsBookTest extends AbstractBusClientServerTestBase {
+ public static final String PORT = BookHttpsServer.PORT;
private static final String CLIENT_CONFIG_FILE =
"org/apache/cxf/systest/jaxrs/security/jaxrs-https.xml";
@@ -46,10 +47,10 @@ public class JAXRSHttpsBookTest extends
@Test
public void testGetBook123Proxy() throws Exception {
- BookStore bs = JAXRSClientFactory.create("https://localhost:9095", BookStore.class,
+ BookStore bs = JAXRSClientFactory.create("https://localhost:" + PORT, BookStore.class,
CLIENT_CONFIG_FILE);
// just to verify the interface call goes through CGLIB proxy too
- assertEquals("https://localhost:9095", WebClient.client(bs).getBaseURI().toString());
+ assertEquals("https://localhost:" + PORT, WebClient.client(bs).getBaseURI().toString());
Book b = bs.getSecureBook("123");
assertEquals(b.getId(), 123);
b = bs.getSecureBook("123");
@@ -59,10 +60,10 @@ public class JAXRSHttpsBookTest extends
@Test
public void testGetBook123ProxyWithURLConduitId() throws Exception {
- BookStore bs = JAXRSClientFactory.create("https://localhost:9095", BookStore.class,
+ BookStore bs = JAXRSClientFactory.create("https://localhost:" + PORT, BookStore.class,
CLIENT_CONFIG_FILE2);
// just to verify the interface call goes through CGLIB proxy too
- assertEquals("https://localhost:9095", WebClient.client(bs).getBaseURI().toString());
+ assertEquals("https://localhost:" + PORT, WebClient.client(bs).getBaseURI().toString());
Book b = bs.getSecureBook("123");
assertEquals(b.getId(), 123);
b = bs.getSecureBook("123");
@@ -73,7 +74,7 @@ public class JAXRSHttpsBookTest extends
@Test
public void testGetBook123ProxyToWebClient() throws Exception {
- BookStore bs = JAXRSClientFactory.create("https://localhost:9095", BookStore.class,
+ BookStore bs = JAXRSClientFactory.create("https://localhost:" + PORT, BookStore.class,
CLIENT_CONFIG_FILE);
Book b = bs.getSecureBook("123");
assertEquals(b.getId(), 123);
@@ -87,7 +88,7 @@ public class JAXRSHttpsBookTest extends
@Test
public void testGetBook123WebClientToProxy() throws Exception {
- WebClient wc = WebClient.create("https://localhost:9095", CLIENT_CONFIG_FILE);
+ WebClient wc = WebClient.create("https://localhost:" + PORT, CLIENT_CONFIG_FILE);
wc.path("/bookstore/securebooks/123").accept(MediaType.APPLICATION_XML_TYPE);
Book b = wc.get(Book.class);
assertEquals(123, b.getId());
@@ -104,8 +105,8 @@ public class JAXRSHttpsBookTest extends
@Test
public void testGetBook123WebClient() throws Exception {
- WebClient client = WebClient.create("https://localhost:9095", CLIENT_CONFIG_FILE);
- assertEquals("https://localhost:9095", client.getBaseURI().toString());
+ WebClient client = WebClient.create("https://localhost:" + PORT, CLIENT_CONFIG_FILE);
+ assertEquals("https://localhost:" + PORT, client.getBaseURI().toString());
client.path("/bookstore/securebooks/123").accept(MediaType.APPLICATION_XML_TYPE);
Book b = client.get(Book.class);
@@ -116,8 +117,8 @@ public class JAXRSHttpsBookTest extends
@Test
public void testGetBook123WebClientWithURLConduitId() throws Exception {
- WebClient client = WebClient.create("https://localhost:9095", CLIENT_CONFIG_FILE2);
- assertEquals("https://localhost:9095", client.getBaseURI().toString());
+ WebClient client = WebClient.create("https://localhost:" + PORT, CLIENT_CONFIG_FILE2);
+ assertEquals("https://localhost:" + PORT, client.getBaseURI().toString());
client.path("/bookstore/securebooks/123").accept(MediaType.APPLICATION_XML_TYPE);
Book b = client.get(Book.class);
Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSSpringSecurityClassTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSSpringSecurityClassTest.java?rev=953824&r1=953823&r2=953824&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSSpringSecurityClassTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSSpringSecurityClassTest.java Fri Jun 11 18:46:12 2010
@@ -33,7 +33,8 @@ import org.junit.BeforeClass;
import org.junit.Test;
public class JAXRSSpringSecurityClassTest extends AbstractSpringSecurityTest {
-
+ public static final String PORT = BookServerSecuritySpringClass.PORT;
+
@BeforeClass
public static void startServers() throws Exception {
assertTrue("server did not launch correctly",
@@ -43,14 +44,14 @@ public class JAXRSSpringSecurityClassTes
@Test
public void testFailedAuthentication() throws Exception {
String endpointAddress =
- "http://localhost:9080/bookstorestorage/thosebooks/123";
+ "http://localhost:" + PORT + "/bookstorestorage/thosebooks/123";
getBook(endpointAddress, "foo", "ba", 401);
}
@Test
public void testBookFromForm() throws Exception {
- WebClient wc = WebClient.create("http://localhost:9080/bookstorestorage/bookforms",
+ WebClient wc = WebClient.create("http://localhost:" + PORT + "/bookstorestorage/bookforms",
"foo", "bar", null);
Response r = wc.form(new Form().set("name", "CXF Rocks").set("id", "123"));
@@ -63,7 +64,7 @@ public class JAXRSSpringSecurityClassTes
@Test
public void testGetBookUserAdmin() throws Exception {
String endpointAddress =
- "http://localhost:9080/bookstorestorage/thosebooks/123";
+ "http://localhost:" + PORT + "/bookstorestorage/thosebooks/123";
getBook(endpointAddress, "foo", "bar", 200);
getBook(endpointAddress, "bob", "bobspassword", 200);
}
@@ -72,7 +73,7 @@ public class JAXRSSpringSecurityClassTes
@Test
public void testGetBookUser() throws Exception {
String endpointAddress =
- "http://localhost:9080/bookstorestorage/thosebooks/123/123";
+ "http://localhost:" + PORT + "/bookstorestorage/thosebooks/123/123";
getBook(endpointAddress, "foo", "bar", 200);
getBook(endpointAddress, "bob", "bobspassword", 200);
}
@@ -80,7 +81,7 @@ public class JAXRSSpringSecurityClassTes
@Test
public void testGetBookAdmin() throws Exception {
String endpointAddress =
- "http://localhost:9080/bookstorestorage/thosebooks";
+ "http://localhost:" + PORT + "/bookstorestorage/thosebooks";
getBook(endpointAddress, "foo", "bar", 200);
getBook(endpointAddress, "bob", "bobspassword", 403);
}
@@ -94,7 +95,7 @@ public class JAXRSSpringSecurityClassTes
@Test
public void testGetBookSubresourceAdmin() throws Exception {
String endpointAddress =
- "http://localhost:9080/bookstorestorage/securebook/self";
+ "http://localhost:" + PORT + "/bookstorestorage/securebook/self";
getBook(endpointAddress, "foo", "bar", 200);
getBook(endpointAddress, "bob", "bobspassword", 403);
}
Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSSpringSecurityInterfaceTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSSpringSecurityInterfaceTest.java?rev=953824&r1=953823&r2=953824&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSSpringSecurityInterfaceTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSSpringSecurityInterfaceTest.java Fri Jun 11 18:46:12 2010
@@ -30,6 +30,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
public class JAXRSSpringSecurityInterfaceTest extends AbstractSpringSecurityTest {
+ public static final String PORT = BookServerSecuritySpringInterface.PORT;
@BeforeClass
public static void startServers() throws Exception {
@@ -40,14 +41,14 @@ public class JAXRSSpringSecurityInterfac
@Test
public void testFailedAuthentication() throws Exception {
String endpointAddress =
- "http://localhost:9080/bookstorestorage/thosebooks/123";
+ "http://localhost:" + PORT + "/bookstorestorage/thosebooks/123";
getBook(endpointAddress, "foo", "ba", 401);
}
@Test
public void testGetBookUserAdmin() throws Exception {
String endpointAddress =
- "http://localhost:9080/bookstorestorage/thosebooks/123";
+ "http://localhost:" + PORT + "/bookstorestorage/thosebooks/123";
getBook(endpointAddress, "foo", "bar", 200);
getBook(endpointAddress, "bob", "bobspassword", 200);
}
@@ -55,7 +56,7 @@ public class JAXRSSpringSecurityInterfac
@Test
public void testGetBookUser() throws Exception {
String endpointAddress =
- "http://localhost:9080/bookstorestorage/thosebooks/123/123";
+ "http://localhost:" + PORT + "/bookstorestorage/thosebooks/123/123";
getBook(endpointAddress, "foo", "bar", 200);
getBook(endpointAddress, "bob", "bobspassword", 200);
getBook(endpointAddress, "baddy", "baddyspassword", 403);
@@ -64,7 +65,7 @@ public class JAXRSSpringSecurityInterfac
@Test
public void testGetBookAdmin() throws Exception {
String endpointAddress =
- "http://localhost:9080/bookstorestorage/thosebooks";
+ "http://localhost:" + PORT + "/bookstorestorage/thosebooks";
getBook(endpointAddress, "foo", "bar", 200);
getBook(endpointAddress, "bob", "bobspassword", 403);
}
@@ -72,32 +73,32 @@ public class JAXRSSpringSecurityInterfac
@Test
public void testGetBookSubresource() throws Exception {
String endpointAddress =
- "http://localhost:9080/bookstorestorage/subresource";
+ "http://localhost:" + PORT + "/bookstorestorage/subresource";
getBook(endpointAddress, "foo", "bar", 200);
getBook(endpointAddress, "bob", "bobspassword", 403);
}
@Test
public void testWebClientAdmin() throws Exception {
- String address = "http://localhost:9080/bookstorestorage/thosebooks";
+ String address = "http://localhost:" + PORT + "/bookstorestorage/thosebooks";
doGetBookWebClient(address, "foo", "bar", 200);
}
@Test
public void testProxyClientAdmin() throws Exception {
- String address = "http://localhost:9080/bookstorestorage";
+ String address = "http://localhost:" + PORT + "/bookstorestorage";
doGetBookProxyClient(address, "foo", "bar", 200);
}
@Test
public void testWebClientUserUnauthorized() throws Exception {
- String address = "http://localhost:9080/bookstorestorage/thosebooks";
+ String address = "http://localhost:" + PORT + "/bookstorestorage/thosebooks";
doGetBookWebClient(address, "bob", "bobspassword", 403);
}
@Test
public void testWebClientUserAuthorized() throws Exception {
- String address = "http://localhost:9080/bookstorestorage/thosebooks/123/123";
+ String address = "http://localhost:" + PORT + "/bookstorestorage/thosebooks/123/123";
doGetBookWebClient(address, "bob", "bobspassword", 200);
}
@@ -124,7 +125,7 @@ public class JAXRSSpringSecurityInterfac
@Test
public void testGetBookSubresourceAdmin() throws Exception {
String endpointAddress =
- "http://localhost:9080/bookstorestorage/securebook/self";
+ "http://localhost:" + PORT + "/bookstorestorage/securebook/self";
getBook(endpointAddress, "foo", "bar", 200);
getBook(endpointAddress, "bob", "bobspassword", 403);
}
Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSSpringSecurityNoAnnotationsTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSSpringSecurityNoAnnotationsTest.java?rev=953824&r1=953823&r2=953824&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSSpringSecurityNoAnnotationsTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSSpringSecurityNoAnnotationsTest.java Fri Jun 11 18:46:12 2010
@@ -23,6 +23,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
public class JAXRSSpringSecurityNoAnnotationsTest extends AbstractSpringSecurityTest {
+ public static final String PORT = BookServerSecuritySpringInterface.PORT;
@BeforeClass
public static void startServers() throws Exception {
@@ -33,14 +34,14 @@ public class JAXRSSpringSecurityNoAnnota
@Test
public void testFailedAuthentication() throws Exception {
String endpointAddress =
- "http://localhost:9080/bookstorestorage/thosebooks/123";
+ "http://localhost:" + PORT + "/bookstorestorage/thosebooks/123";
getBook(endpointAddress, "foo", "ba", 401);
}
@Test
public void testGetBookUserAdmin() throws Exception {
String endpointAddress =
- "http://localhost:9080/bookstorestorage/thosebooks/123";
+ "http://localhost:" + PORT + "/bookstorestorage/thosebooks/123";
getBook(endpointAddress, "foo", "bar", 200);
getBook(endpointAddress, "bob", "bobspassword", 200);
}
@@ -49,7 +50,7 @@ public class JAXRSSpringSecurityNoAnnota
@Test
public void testGetBookUser() throws Exception {
String endpointAddress =
- "http://localhost:9080/bookstorestorage/thosebooks/123/123";
+ "http://localhost:" + PORT + "/bookstorestorage/thosebooks/123/123";
getBook(endpointAddress, "foo", "bar", 200);
getBook(endpointAddress, "bob", "bobspassword", 200);
}
@@ -57,7 +58,7 @@ public class JAXRSSpringSecurityNoAnnota
@Test
public void testGetBookAdmin() throws Exception {
String endpointAddress =
- "http://localhost:9080/bookstorestorage/thosebooks";
+ "http://localhost:" + PORT + "/bookstorestorage/thosebooks";
getBook(endpointAddress, "foo", "bar", 200);
getBook(endpointAddress, "bob", "bobspassword", 403);
}
Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-url.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-url.xml?rev=953824&r1=953823&r2=953824&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-url.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-url.xml Fri Jun 11 18:46:12 2010
@@ -28,9 +28,10 @@ under the License.
http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/schemas/configuration/http-jetty.xsd
http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd
">
+ <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<httpj:engine-factory id="port-9095-tls-config">
- <httpj:engine port="9095">
+ <httpj:engine port="${testutil.ports.jaxrs-https}">
<httpj:tlsServerParameters>
<sec:keyManagers keyPassword="password">
<sec:keyStore type="JKS" password="password"
@@ -47,7 +48,7 @@ under the License.
<!-- -->
<!-- HTTP/S configuration for proxy & web clients -->
<!-- -->
- <http:conduit name="https://localhost:9095/bookstore/securebooks.*">
+ <http:conduit name="https://localhost:.*/bookstore/securebooks.*">
<http:client ConnectionTimeout="3000000" ReceiveTimeout="3000000"/>
<http:tlsClientParameters disableCNCheck="true">
<sec:keyManagers keyPassword="password">
Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https.xml?rev=953824&r1=953823&r2=953824&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https.xml Fri Jun 11 18:46:12 2010
@@ -29,8 +29,11 @@ under the License.
http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd
">
+ <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+
+
<httpj:engine-factory id="port-9095-tls-config">
- <httpj:engine port="9095">
+ <httpj:engine port="${testutil.ports.jaxrs-https}">
<httpj:tlsServerParameters>
<sec:keyManagers keyPassword="password">
<sec:keyStore type="JKS" password="password"
@@ -64,7 +67,7 @@ under the License.
<!-- -->
<!-- HTTP/S configuration for web clients -->
<!-- -->
- <http:conduit name="{https://localhost:9095}WebClient.http-conduit">
+ <http:conduit name="\{https://localhost\:.*\}WebClient\.http-conduit">
<http:client ConnectionTimeout="3000000" ReceiveTimeout="3000000"/>
<http:tlsClientParameters disableCNCheck="true">
<sec:keyManagers keyPassword="password">