You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2014/02/25 23:46:16 UTC
git commit: [CXF-5339] Removing BookStoreWebSocket
Repository: cxf
Updated Branches:
refs/heads/master 2d4c98545 -> b177b2331
[CXF-5339] Removing BookStoreWebSocket
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/b177b233
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b177b233
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b177b233
Branch: refs/heads/master
Commit: b177b2331f47ead04faa81661277cdc34772bd51
Parents: 2d4c985
Author: Sergey Beryozkin <sb...@talend.com>
Authored: Tue Feb 25 22:45:36 2014 +0000
Committer: Sergey Beryozkin <sb...@talend.com>
Committed: Tue Feb 25 22:45:36 2014 +0000
----------------------------------------------------------------------
.../org/apache/cxf/systest/jaxrs/BookStore.java | 24 ++++++++
.../jaxrs/websocket/BookServerWebSocket.java | 7 ++-
.../jaxrs/websocket/BookStoreWebSocket.java | 62 --------------------
.../JAXRSClientServerWebSocketTest.java | 1 -
4 files changed, 28 insertions(+), 66 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/b177b233/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
index 7274e03..1168ad8 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
@@ -1319,6 +1319,30 @@ public class BookStore {
return new Long(theBookId);
}
+ @GET
+ @Path("/bookbought")
+ @Produces("text/*")
+ public StreamingOutput getBookBought() {
+ return new StreamingOutput() {
+ public void write(final OutputStream out) throws IOException, WebApplicationException {
+ out.write(("Today: " + new java.util.Date()).getBytes());
+ // just for testing, using a thread
+ new Thread(new Runnable() {
+ public void run() {
+ try {
+ for (int r = 2, i = 1; i <= 5; r *= 2, i++) {
+ Thread.sleep(500);
+ out.write(Integer.toString(r).getBytes());
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }).start();
+ }
+ };
+ }
+
@POST
@Path("/booksecho")
@Consumes("text/plain")
http://git-wip-us.apache.org/repos/asf/cxf/blob/b177b233/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/BookServerWebSocket.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/BookServerWebSocket.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/BookServerWebSocket.java
index 7084406..b704f68 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/BookServerWebSocket.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/BookServerWebSocket.java
@@ -26,6 +26,7 @@ import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
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.transport.http_jetty.JettyHTTPDestination;
@@ -51,9 +52,9 @@ public class BookServerWebSocket extends AbstractBusTestServerBase {
setBus(bus);
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setBus(bus);
- sf.setResourceClasses(BookStoreWebSocket.class);
- sf.setResourceProvider(BookStoreWebSocket.class,
- new SingletonResourceProvider(new BookStoreWebSocket(), true));
+ sf.setResourceClasses(BookStore.class);
+ sf.setResourceProvider(BookStore.class,
+ new SingletonResourceProvider(new BookStore(), true));
sf.setAddress("http://localhost:" + PORT + "/");
server = sf.create();
((JettyHTTPDestination)server.getDestination())
http://git-wip-us.apache.org/repos/asf/cxf/blob/b177b233/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/BookStoreWebSocket.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/BookStoreWebSocket.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/BookStoreWebSocket.java
deleted file mode 100644
index 6dd5149..0000000
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/BookStoreWebSocket.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.cxf.systest.jaxrs.websocket;
-
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.StreamingOutput;
-
-@Path("/bookstore")
-public class BookStoreWebSocket {
-
-
- @GET
- @Path("/bookbought")
- @Produces("text/*")
- public StreamingOutput getBookBought() {
- return new StreamingOutput() {
- public void write(final OutputStream out) throws IOException, WebApplicationException {
- out.write(("Today: " + new java.util.Date()).getBytes());
- // just for testing, using a thread
- new Thread(new Runnable() {
- public void run() {
- try {
- for (int r = 2, i = 1; i <= 5; r *= 2, i++) {
- Thread.sleep(500);
- out.write(Integer.toString(r).getBytes());
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }).start();
- }
- };
- }
-
-}
-
-
http://git-wip-us.apache.org/repos/asf/cxf/blob/b177b233/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketTest.java
index 1933079..beadb69 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketTest.java
@@ -44,7 +44,6 @@ public class JAXRSClientServerWebSocketTest extends AbstractBusClientServerTestB
@Test
// seems to cause PermGen issue to another systests/jaxrs later in some system. the code under analysis
- @org.junit.Ignore
public void testBookWithWebSocket() throws Exception {
String address = "ws://localhost:" + PORT + "/bookstore";