You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/06/10 08:15:37 UTC

[1/2] camel git commit: Add test of HereNowRefresh. Upgrade to PubNub 4.6.4

Repository: camel
Updated Branches:
  refs/heads/master 50d134f72 -> ff6e52ebb


Add test of HereNowRefresh. Upgrade to PubNub 4.6.4

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

Branch: refs/heads/master
Commit: ff6e52ebb922c86b7278b8184b8a46d5d57ef5e4
Parents: eef3590
Author: Preben Asmussen <pr...@gmail.com>
Authored: Sat Jun 10 09:57:45 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Jun 10 10:13:46 2017 +0200

----------------------------------------------------------------------
 .../camel/component/pubnub/PubNubPresenceTest.java | 17 +++++++++++++++++
 parent/pom.xml                                     |  2 +-
 2 files changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ff6e52eb/components/camel-pubnub/src/test/java/org/apache/camel/component/pubnub/PubNubPresenceTest.java
----------------------------------------------------------------------
diff --git a/components/camel-pubnub/src/test/java/org/apache/camel/component/pubnub/PubNubPresenceTest.java b/components/camel-pubnub/src/test/java/org/apache/camel/component/pubnub/PubNubPresenceTest.java
index e49fdf8..dc83b81 100644
--- a/components/camel-pubnub/src/test/java/org/apache/camel/component/pubnub/PubNubPresenceTest.java
+++ b/components/camel-pubnub/src/test/java/org/apache/camel/component/pubnub/PubNubPresenceTest.java
@@ -56,6 +56,23 @@ public class PubNubPresenceTest extends PubNubTestBase {
         assertThat(presence.getOccupancy(), equalTo(3));
     }
 
+    @Test
+    public void testPresenceWithHereNowRefresh() throws Exception {
+        stubFor(get(urlPathEqualTo("/v2/presence/sub-key/mySubscribeKey/channel/mychannel/heartbeat"))
+            .willReturn(aResponse().withBody("{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\"}")));
+
+        stubFor(get(urlPathEqualTo("/v2/subscribe/mySubscribeKey/mychannel,mychannel-pnpres/0"))
+            .willReturn(aResponse()
+                .withBody("{\"t\":{\"t\":\"14901247588021627\",\"r\":2},\"m\":[{\"a\":\"4\",\"f\":0,\"p\":{\"t\":\"14901247587675704\",\"r\":1},\"k\":\"demo-36\",\"c\":\"mychannel-pnpres\","
+                          + "\"d\":{\"action\": \"interval\", \"timestamp\": 1490124758, \"occupancy\": 2, \"here_now_refresh\": true, "
+                          + "\"join\": [\"2220E216-5A30-49AD-A89C-1E0B5AE26AD7\", \"4262AE3F-3202-4487-BEE0-1A0D91307DEB\"]},\"b\":\"mychannel-pnpres\"}]}")));
+        context.startRoute("presence-route");
+        mockResult.expectedMessageCount(1);
+        assertMockEndpointsSatisfied();
+        PNPresenceEventResult presence = mockResult.getReceivedExchanges().get(0).getIn().getBody(PNPresenceEventResult.class);
+        assertThat(presence.getHereNowRefresh(), equalTo(true));
+    }
+
 
     @Override
     protected RouteBuilder createRouteBuilder() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/ff6e52eb/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index ab56773..09eb014 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -537,7 +537,7 @@
     <protobuf-version>3.1.0</protobuf-version>
     <protobuf-guava-version>18.0</protobuf-guava-version>
     <protobuf-maven-plugin-version>0.5.0</protobuf-maven-plugin-version>
-    <pubnub-version>4.6.3</pubnub-version>
+    <pubnub-version>4.6.4</pubnub-version>
     <qpid-bundle-version>0.28_1</qpid-bundle-version>
     <qpid-proton-j-version>0.16.0</qpid-proton-j-version>
     <qpid-proton-j-bundle-version>0.14.0</qpid-proton-j-bundle-version>


[2/2] camel git commit: Renamed test class

Posted by da...@apache.org.
Renamed test class

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

Branch: refs/heads/master
Commit: eef3590206226f2bf0d02cf3d6460aa7bd4a3a95
Parents: 50d134f
Author: Preben Asmussen <pr...@gmail.com>
Authored: Fri Jun 9 15:21:35 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Jun 10 10:13:46 2017 +0200

----------------------------------------------------------------------
 .../component/pubnub/PubNubPresenceTest.java    | 71 ++++++++++++++++++++
 .../component/pubnub/PubNubPresensTest.java     | 70 -------------------
 2 files changed, 71 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/eef35902/components/camel-pubnub/src/test/java/org/apache/camel/component/pubnub/PubNubPresenceTest.java
----------------------------------------------------------------------
diff --git a/components/camel-pubnub/src/test/java/org/apache/camel/component/pubnub/PubNubPresenceTest.java b/components/camel-pubnub/src/test/java/org/apache/camel/component/pubnub/PubNubPresenceTest.java
new file mode 100644
index 0000000..e49fdf8
--- /dev/null
+++ b/components/camel-pubnub/src/test/java/org/apache/camel/component/pubnub/PubNubPresenceTest.java
@@ -0,0 +1,71 @@
+/**
+ * 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.camel.component.pubnub;
+
+import com.pubnub.api.models.consumer.pubsub.PNPresenceEventResult;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.Test;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+
+
+public class PubNubPresenceTest extends PubNubTestBase {
+
+    @EndpointInject(uri = "mock:result")
+    private MockEndpoint mockResult;
+
+    @Test
+    public void testPresence() throws Exception {
+        stubFor(get(urlPathEqualTo("/v2/presence/sub-key/mySubscribeKey/channel/mychannel/heartbeat"))
+            .willReturn(aResponse().withBody("{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\"}")));
+
+        stubFor(get(urlPathEqualTo("/v2/subscribe/mySubscribeKey/mychannel,mychannel-pnpres/0"))
+            .willReturn(aResponse()
+                .withBody("{\"t\":{\"t\":\"14637536741734954\",\"r\":1},\"m\":[{\"a\":\"4\",\"f\":512,\"p\":{\"t\":\"14637536740940378\",\"r\":1},\"k\":\"demo-36\",\"c\":\"mychannel-pnpres\","
+                          + "\"d\":{\"action\": \"join\", \"timestamp\": 1463753674, \"uuid\": \"24c9bb19-1fcd-4c40-a6f1-522a8a1329ef\", \"occupancy\": 3},\"b\":\"mychannel-pnpres\"},"
+                          + "{\"a\":\"4\",\"f\":512,\"p\":{\"t\":\"14637536741726901\",\"r\":1},\"k\":\"demo-36\",\"c\":\"mychannel-pnpres\",\"d\":{\"action\": \"state-change\", "
+                          + "\"timestamp\": 1463753674, \"data\": {\"state\": \"cool\"}, \"uuid\": \"24c9bb19-1fcd-4c40-a6f1-522a8a1329ef\", \"occupancy\": 3},\"b\":\"mychannel-pnpres\"}]}")));
+        context.startRoute("presence-route");
+        mockResult.expectedMessageCount(1);
+        mockResult.expectedHeaderReceived(PubNubConstants.CHANNEL, "mychannel");
+        assertMockEndpointsSatisfied();
+        PNPresenceEventResult presence = mockResult.getReceivedExchanges().get(0).getIn().getBody(PNPresenceEventResult.class);
+        assertThat(presence.getEvent(), equalTo("join"));
+        assertThat(presence.getOccupancy(), equalTo(3));
+    }
+
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() {
+                from("pubnub:mychannel?pubnub=#pubnub&withPresence=true").id("presence-route")
+                    .autoStartup(false)
+                    .to("mock:result");
+            }
+        };
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/eef35902/components/camel-pubnub/src/test/java/org/apache/camel/component/pubnub/PubNubPresensTest.java
----------------------------------------------------------------------
diff --git a/components/camel-pubnub/src/test/java/org/apache/camel/component/pubnub/PubNubPresensTest.java b/components/camel-pubnub/src/test/java/org/apache/camel/component/pubnub/PubNubPresensTest.java
deleted file mode 100644
index 252a894..0000000
--- a/components/camel-pubnub/src/test/java/org/apache/camel/component/pubnub/PubNubPresensTest.java
+++ /dev/null
@@ -1,70 +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.camel.component.pubnub;
-
-import com.pubnub.api.models.consumer.pubsub.PNPresenceEventResult;
-
-import org.apache.camel.EndpointInject;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Test;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.get;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
-
-import static org.hamcrest.CoreMatchers.equalTo;
-
-
-public class PubNubPresensTest extends PubNubTestBase {
-
-    @EndpointInject(uri = "mock:result")
-    private MockEndpoint mockResult;
-
-    @Test
-    public void testPresens() throws Exception {
-        stubFor(get(urlPathEqualTo("/v2/presence/sub-key/mySubscribeKey/channel/mychannel/heartbeat"))
-            .willReturn(aResponse().withBody("{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\"}")));
-
-        stubFor(get(urlPathEqualTo("/v2/subscribe/mySubscribeKey/mychannel,mychannel-pnpres/0"))
-            .willReturn(aResponse()
-                .withBody("{\"t\":{\"t\":\"14637536741734954\",\"r\":1},\"m\":[{\"a\":\"4\",\"f\":512,\"p\":{\"t\":\"14637536740940378\",\"r\":1},\"k\":\"demo-36\",\"c\":\"mychannel-pnpres\","
-                          + "\"d\":{\"action\": \"join\", \"timestamp\": 1463753674, \"uuid\": \"24c9bb19-1fcd-4c40-a6f1-522a8a1329ef\", \"occupancy\": 3},\"b\":\"mychannel-pnpres\"},"
-                          + "{\"a\":\"4\",\"f\":512,\"p\":{\"t\":\"14637536741726901\",\"r\":1},\"k\":\"demo-36\",\"c\":\"mychannel-pnpres\",\"d\":{\"action\": \"state-change\", "
-                          + "\"timestamp\": 1463753674, \"data\": {\"state\": \"cool\"}, \"uuid\": \"24c9bb19-1fcd-4c40-a6f1-522a8a1329ef\", \"occupancy\": 3},\"b\":\"mychannel-pnpres\"}]}")));
-        context.startRoute("presence-route");
-        mockResult.expectedMessageCount(1);
-        mockResult.expectedHeaderReceived(PubNubConstants.CHANNEL, "mychannel");
-        assertMockEndpointsSatisfied();
-        PNPresenceEventResult presence = mockResult.getReceivedExchanges().get(0).getIn().getBody(PNPresenceEventResult.class);
-        assertThat(presence.getEvent(), equalTo("join"));
-    }
-
-
-    @Override
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            public void configure() {
-                from("pubnub:mychannel?pubnub=#pubnub&withPresence=true").id("presence-route")
-                    .autoStartup(false)
-                    .to("mock:result");
-            }
-        };
-    }
-
-}