cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cxf git commit: CXF-7085: Introduce support for Server Sent Events (Client). Removing unstable test cases (more to be added soon).
Date Sat, 24 Jun 2017 00:12:13 GMT
Repository: cxf
Updated Branches:
  refs/heads/master feba80454 -> e1a5b307c


CXF-7085: Introduce support for Server Sent Events (Client). Removing unstable test cases
(more to be added soon).


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e1a5b307
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e1a5b307
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e1a5b307

Branch: refs/heads/master
Commit: e1a5b307ca62fd05b23eb421b7a10c6d2b4b9a60
Parents: feba804
Author: reta <drreta@gmail.com>
Authored: Fri Jun 23 20:12:02 2017 -0400
Committer: reta <drreta@gmail.com>
Committed: Fri Jun 23 20:12:02 2017 -0400

----------------------------------------------------------------------
 .../cxf/systest/jaxrs/sse/AbstractSseTest.java  | 37 +++++---------------
 1 file changed, 8 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e1a5b307/systests/rs-sse/src/test/java/org/apache/cxf/systest/jaxrs/sse/AbstractSseTest.java
----------------------------------------------------------------------
diff --git a/systests/rs-sse/src/test/java/org/apache/cxf/systest/jaxrs/sse/AbstractSseTest.java
b/systests/rs-sse/src/test/java/org/apache/cxf/systest/jaxrs/sse/AbstractSseTest.java
index 98c530b..8f41bd7 100644
--- a/systests/rs-sse/src/test/java/org/apache/cxf/systest/jaxrs/sse/AbstractSseTest.java
+++ b/systests/rs-sse/src/test/java/org/apache/cxf/systest/jaxrs/sse/AbstractSseTest.java
@@ -23,10 +23,7 @@ import java.util.Collection;
 import java.util.function.Consumer;
 
 import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
 import javax.ws.rs.sse.InboundSseEvent;
 import javax.ws.rs.sse.SseEventSource;
 
@@ -34,34 +31,10 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 
 import org.junit.Test;
 
-import static org.hamcrest.CoreMatchers.containsString;
 import static org.hamcrest.CoreMatchers.hasItems;
 
 public abstract class AbstractSseTest extends AbstractSseBaseTest {
     @Test
-    public void testBooksStreamIsReturnedFromLastEventId() throws JsonProcessingException
{
-        Response r = createWebClient("/rest/api/bookstore/sse/100")
-            .header(HttpHeaders.LAST_EVENT_ID_HEADER, 150)
-            .get();
-        assertEquals(Status.OK.getStatusCode(), r.getStatus());
-
-        final String response = r.readEntity(String.class);
-        assertThat(response, containsString("id: 151"));
-        assertThat(response, containsString("data: " + toJson("New Book #151", 151)));
-
-        assertThat(response, containsString("id: 152"));
-        assertThat(response, containsString("data: " + toJson("New Book #152", 152)));
-
-        assertThat(response, containsString("id: 152"));
-        assertThat(response, containsString("data: " + toJson("New Book #153", 153)));
-
-        assertThat(response, containsString("id: 152"));
-        assertThat(response, containsString("data: " + toJson("New Book #154", 154)));
-
-        r.close();
-    }
-    
-    @Test
     public void testBooksStreamIsReturnedFromInboundSseEvents() throws JsonProcessingException,
InterruptedException {
         final WebTarget target = createWebTarget("/rest/api/bookstore/sse/0");
         final Collection<Book> books = new ArrayList<>();
@@ -73,8 +46,14 @@ public abstract class AbstractSseTest extends AbstractSseBaseTest {
             awaitEvents(3000, books, 4);
         }
 
-        assertThat(books, hasItems(new Book("New Book #1", 1), new Book("New Book #2", 2),

-            new Book("New Book #3", 3), new Book("New Book #4", 4)));
+        assertThat(books, 
+            hasItems(
+                new Book("New Book #1", 1), 
+                new Book("New Book #2", 2), 
+                new Book("New Book #3", 3), 
+                new Book("New Book #4", 4)
+            )
+        );
     }
 
     private static Consumer<InboundSseEvent> collect(final Collection< Book >
books) {


Mime
View raw message