You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@edgent.apache.org by cd...@apache.org on 2017/11/23 08:34:34 UTC

[1/6] incubator-edgent git commit: [Edgent-438] improve WebSocketClientTest's skip-if-cant-connect

Repository: incubator-edgent
Updated Branches:
  refs/heads/feature/pre-release-finetuning 34b21c96a -> ef78d4db3


[Edgent-438] improve WebSocketClientTest's skip-if-cant-connect

Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/718ff63b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/718ff63b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/718ff63b

Branch: refs/heads/feature/pre-release-finetuning
Commit: 718ff63b5ec1194d138233e7f8481bb205818132
Parents: f46dd81
Author: Dale LaBossiere <dl...@us.ibm.com>
Authored: Mon Nov 20 17:21:50 2017 -0500
Committer: Dale LaBossiere <dl...@us.ibm.com>
Committed: Mon Nov 20 17:21:50 2017 -0500

----------------------------------------------------------------------
 .../WebSocketClientConnectTestHelper.java       | 46 ++++++++++++++++++++
 .../javax/websocket/WebSocketClientTest.java    | 26 ++++-------
 2 files changed, 55 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/718ff63b/connectors/websocket/src/test/java/org/apache/edgent/test/connectors/wsclient/javax/websocket/WebSocketClientConnectTestHelper.java
----------------------------------------------------------------------
diff --git a/connectors/websocket/src/test/java/org/apache/edgent/test/connectors/wsclient/javax/websocket/WebSocketClientConnectTestHelper.java b/connectors/websocket/src/test/java/org/apache/edgent/test/connectors/wsclient/javax/websocket/WebSocketClientConnectTestHelper.java
new file mode 100644
index 0000000..f6ffc12
--- /dev/null
+++ b/connectors/websocket/src/test/java/org/apache/edgent/test/connectors/wsclient/javax/websocket/WebSocketClientConnectTestHelper.java
@@ -0,0 +1,46 @@
+package org.apache.edgent.test.connectors.wsclient.javax.websocket;
+
+import java.net.URI;
+import java.util.Properties;
+
+import javax.websocket.ClientEndpoint;
+import javax.websocket.ContainerProvider;
+import javax.websocket.OnError;
+import javax.websocket.Session;
+import javax.websocket.WebSocketContainer;
+
+import org.eclipse.jetty.util.component.LifeCycle;
+
+@ClientEndpoint 
+public class WebSocketClientConnectTestHelper {
+  
+  @OnError
+  public void onError(Session client, Throwable t) {
+    System.err.println("Unable to connect to WebSocket server: "+t.getMessage());
+  }
+
+  public static void connectToServer(Properties config) throws Exception {
+    // Verify we can create a real websocket connection to the server.
+    //
+    // We do the following instead of a simple socket connect
+    // because in at least one location, the websocket connect/upgrade
+    // fails with: expecting 101 got 403 (Forbidden).
+    // There's something about that location that's not
+    // allowing a websocket to be created to the (public) server.
+    // Everything works fine from other locations.
+    //
+    String wsUri = config.getProperty("ws.uri");
+    URI uri = new URI(wsUri);
+    WebSocketContainer container = ContainerProvider.getWebSocketContainer();
+    try {
+      Session session = container.connectToServer(WebSocketClientConnectTestHelper.class,  uri);
+      session.close();
+    }
+    finally {
+      if (container instanceof LifeCycle) {
+        ((LifeCycle)container).stop();
+      }
+    }
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/718ff63b/connectors/websocket/src/test/java/org/apache/edgent/test/connectors/wsclient/javax/websocket/WebSocketClientTest.java
----------------------------------------------------------------------
diff --git a/connectors/websocket/src/test/java/org/apache/edgent/test/connectors/wsclient/javax/websocket/WebSocketClientTest.java b/connectors/websocket/src/test/java/org/apache/edgent/test/connectors/wsclient/javax/websocket/WebSocketClientTest.java
index 4ef65c9..b256bfe 100644
--- a/connectors/websocket/src/test/java/org/apache/edgent/test/connectors/wsclient/javax/websocket/WebSocketClientTest.java
+++ b/connectors/websocket/src/test/java/org/apache/edgent/test/connectors/wsclient/javax/websocket/WebSocketClientTest.java
@@ -23,8 +23,6 @@ import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assume.assumeTrue;
 
-import java.net.InetSocketAddress;
-import java.net.Socket;
 import java.net.URI;
 import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
@@ -772,21 +770,15 @@ public class WebSocketClientTest extends ConnectorTestBase {
     }
     
     private void skipTestIfCantConnect(Properties config) throws Exception {
-        String wsUri = config.getProperty("ws.uri");
-        // Skip tests if the WebSocket server can't be contacted.
-        try {
-            URI uri = new URI(wsUri);
-            int port = uri.getPort();
-            if (port == -1)
-                port = uri.getScheme().equals("ws") ? 80 : 443;
-            Socket s = new Socket();
-            s.connect(new InetSocketAddress(uri.getHost(), port), 5*1000/*cn-timeout-msec*/);
-            s.close();
-        } catch (Exception e) {
-            System.err.println("Unable to connect to WebSocket server "+wsUri+" : "+e.getMessage());
-            e.printStackTrace();
-            assumeTrue(false);
-        }
+      String wsUri = config.getProperty("ws.uri");
+      try {
+          WebSocketClientConnectTestHelper.connectToServer(config);
+      } catch (Exception e) {
+          System.err.println("Unable to connect to WebSocket server "+wsUri+" : "+e.getMessage());
+          e.printStackTrace();
+          System.err.println("skipTestIfCantConnect(): SKIPPING TEST");
+          assumeTrue(false);
+      }
     }
     
     @Test


[4/6] incubator-edgent git commit: update doc for samples repo

Posted by cd...@apache.org.
update doc for samples repo


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

Branch: refs/heads/feature/pre-release-finetuning
Commit: 421700896b8b4c4a95e74f1047c617ffc006d59e
Parents: 62384dd
Author: Dale LaBossiere <dl...@us.ibm.com>
Authored: Tue Nov 21 18:18:35 2017 -0500
Committer: Dale LaBossiere <dl...@us.ibm.com>
Committed: Tue Nov 21 18:18:35 2017 -0500

----------------------------------------------------------------------
 DEVELOPMENT.md | 7 ++++---
 README         | 3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/42170089/DEVELOPMENT.md
----------------------------------------------------------------------
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md
index 5f1c8c8..671c81c 100644
--- a/DEVELOPMENT.md
+++ b/DEVELOPMENT.md
@@ -142,7 +142,7 @@ For a not quite two hour introduction into Maven please feel free to watch this
 ## Building Edgent For Using Edgent
 
 __Note:__ Apache Edgent releases include convenience binaries. Use of them
-is covered in [samples/APPLICATION_DEVELOPMENT.md](samples/APPLICATION_DEVELOPMENT.md).
+is covered in [samples/APPLICATION_DEVELOPMENT.md](https://github.com/apache/incubator-edgent-samples/APPLICATION_DEVELOPMENT.md).
 
 If instead you want to build Edgent for your use there are two different use-cases:
 
@@ -171,7 +171,7 @@ $ ./mvnw clean install -Djava8.home=$JAVA_HOME -Ptoolchain,platform-java7,platfo
 ### Building Edgent for NOT using it with Maven
 
 Build Edgent as described above to populate the local maven repository.
-Then see [samples/APPLICATION_DEVELOPMENT.md](samples/APPLICATION_DEVELOPMENT.md)
+Then see [samples/APPLICATION_DEVELOPMENT.md](https://github.com/apache/incubator-edgent-samples/APPLICATION_DEVELOPMENT.md)
 for information about the `get-edgent-jars.sh` script.
 
 An alternative to using the `get-edgent-jars.sh` script is to
@@ -484,10 +484,11 @@ such as an MQTT broker, Apache Kafka, a cloud based IoT service, etc.
 * `analytics` - Analytics for use by Edgent applications.
 * `utils` - Optional utilities for Edgent applications.
 * `console` - Development console that allows visualization of the streams within an Edgent application during development.
-* `samples` - Sample applications, from Hello World to some sensor simulation applications.
 * `android` - Code specific to Android.
 * `test` - SVT
 
+Samples are located at https://github.com/apache/incubator-edgent-samples
+
 ## Coding Conventions
 
 Placeholder: see [EDGENT-23](https://issues.apache.org/jira/browse/EDGENT-23)

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/42170089/README
----------------------------------------------------------------------
diff --git a/README b/README
index ce57c19..40d08ad 100644
--- a/README
+++ b/README
@@ -12,7 +12,8 @@ Build the Edgent SDK Java8 jars and install them in your local maven repository
 $ ./mvnw clean install  # add -DskipTests to omit running the tests
 
 You can now construct applications that use Edgent.  The Edgent samples
-are a good place to start and are available as a separate download.
+are a good place to start and are available as a separate download
+at https://github.com/apache/incubator-edgent-samples
 
 Additional Information
 ----------------------


[6/6] incubator-edgent git commit: Merge branches 'develop' and 'feature/pre-release-finetuning' of https://git-wip-us.apache.org/repos/asf/incubator-edgent into feature/pre-release-finetuning

Posted by cd...@apache.org.
Merge branches 'develop' and 'feature/pre-release-finetuning' of https://git-wip-us.apache.org/repos/asf/incubator-edgent into feature/pre-release-finetuning


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

Branch: refs/heads/feature/pre-release-finetuning
Commit: ef78d4db349fb14965a695bed06ddc72b96e078d
Parents: 34b21c9 c761283
Author: Christofer Dutz <ch...@c-ware.de>
Authored: Thu Nov 23 09:34:18 2017 +0100
Committer: Christofer Dutz <ch...@c-ware.de>
Committed: Thu Nov 23 09:34:18 2017 +0100

----------------------------------------------------------------------
 DEVELOPMENT.md                                  |  7 ++-
 README                                          |  3 +-
 RELEASE_NOTES                                   |  1 +
 .../WebSocketClientConnectTestHelper.java       | 64 ++++++++++++++++++++
 .../javax/websocket/WebSocketClientTest.java    | 26 +++-----
 5 files changed, 80 insertions(+), 21 deletions(-)
----------------------------------------------------------------------



[2/6] incubator-edgent git commit: add header to new module, update RELEASE_NOTES

Posted by cd...@apache.org.
add header to new module, update RELEASE_NOTES

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

Branch: refs/heads/feature/pre-release-finetuning
Commit: cc1864b57b54c88a80b1eb2889c7cbbb94f6dd26
Parents: 718ff63
Author: Dale LaBossiere <dl...@us.ibm.com>
Authored: Mon Nov 20 17:38:19 2017 -0500
Committer: Dale LaBossiere <dl...@us.ibm.com>
Committed: Mon Nov 20 17:38:19 2017 -0500

----------------------------------------------------------------------
 RELEASE_NOTES                                     |  1 +
 .../WebSocketClientConnectTestHelper.java         | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/cc1864b5/RELEASE_NOTES
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index 7da5c39..fc2bbd8 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -71,6 +71,7 @@ EDGENT-423  Range.toStringUnsigned() not supported on Java7/Android
 
 Miscellaneous changes
 ---------------------
+EDGENT-438  Improve WebSocketClientTest skip-if-cant-connect
 EDGENT-436  Change tests that use complete() TMO for successful runs
 EDGENT-435  CME in TrackingScheduledExecutor seen with testMultiTopologyPollWithError()
 EDGENT-434  Desensitize PlumbingTest.testParallelBalanced

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/cc1864b5/connectors/websocket/src/test/java/org/apache/edgent/test/connectors/wsclient/javax/websocket/WebSocketClientConnectTestHelper.java
----------------------------------------------------------------------
diff --git a/connectors/websocket/src/test/java/org/apache/edgent/test/connectors/wsclient/javax/websocket/WebSocketClientConnectTestHelper.java b/connectors/websocket/src/test/java/org/apache/edgent/test/connectors/wsclient/javax/websocket/WebSocketClientConnectTestHelper.java
index f6ffc12..aaf3b57 100644
--- a/connectors/websocket/src/test/java/org/apache/edgent/test/connectors/wsclient/javax/websocket/WebSocketClientConnectTestHelper.java
+++ b/connectors/websocket/src/test/java/org/apache/edgent/test/connectors/wsclient/javax/websocket/WebSocketClientConnectTestHelper.java
@@ -1,3 +1,21 @@
+/*
+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.edgent.test.connectors.wsclient.javax.websocket;
 
 import java.net.URI;


[3/6] incubator-edgent git commit: add nl

Posted by cd...@apache.org.
add nl

Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/62384ddc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/62384ddc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/62384ddc

Branch: refs/heads/feature/pre-release-finetuning
Commit: 62384ddcef54391167bd4b853bc0d7ea7e25ace7
Parents: cc1864b
Author: Dale LaBossiere <dl...@us.ibm.com>
Authored: Mon Nov 20 17:40:02 2017 -0500
Committer: Dale LaBossiere <dl...@us.ibm.com>
Committed: Mon Nov 20 17:40:02 2017 -0500

----------------------------------------------------------------------
 .../wsclient/javax/websocket/WebSocketClientConnectTestHelper.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/62384ddc/connectors/websocket/src/test/java/org/apache/edgent/test/connectors/wsclient/javax/websocket/WebSocketClientConnectTestHelper.java
----------------------------------------------------------------------
diff --git a/connectors/websocket/src/test/java/org/apache/edgent/test/connectors/wsclient/javax/websocket/WebSocketClientConnectTestHelper.java b/connectors/websocket/src/test/java/org/apache/edgent/test/connectors/wsclient/javax/websocket/WebSocketClientConnectTestHelper.java
index aaf3b57..41878f7 100644
--- a/connectors/websocket/src/test/java/org/apache/edgent/test/connectors/wsclient/javax/websocket/WebSocketClientConnectTestHelper.java
+++ b/connectors/websocket/src/test/java/org/apache/edgent/test/connectors/wsclient/javax/websocket/WebSocketClientConnectTestHelper.java
@@ -61,4 +61,4 @@ public class WebSocketClientConnectTestHelper {
     }
   }
 
-}
\ No newline at end of file
+}


[5/6] incubator-edgent git commit: fix url to APPLICATION_DEVELOPMENT.md in samples repo

Posted by cd...@apache.org.
fix url to APPLICATION_DEVELOPMENT.md in samples repo


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

Branch: refs/heads/feature/pre-release-finetuning
Commit: c761283a68a55e42d76a5f8ac49a013e4db95727
Parents: 4217008
Author: Dale LaBossiere <dl...@us.ibm.com>
Authored: Tue Nov 21 18:23:43 2017 -0500
Committer: Dale LaBossiere <dl...@us.ibm.com>
Committed: Tue Nov 21 18:23:43 2017 -0500

----------------------------------------------------------------------
 DEVELOPMENT.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/c761283a/DEVELOPMENT.md
----------------------------------------------------------------------
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md
index 671c81c..d57cdc1 100644
--- a/DEVELOPMENT.md
+++ b/DEVELOPMENT.md
@@ -142,7 +142,7 @@ For a not quite two hour introduction into Maven please feel free to watch this
 ## Building Edgent For Using Edgent
 
 __Note:__ Apache Edgent releases include convenience binaries. Use of them
-is covered in [samples/APPLICATION_DEVELOPMENT.md](https://github.com/apache/incubator-edgent-samples/APPLICATION_DEVELOPMENT.md).
+is covered in [samples/APPLICATION_DEVELOPMENT.md](https://github.com/apache/incubator-edgent-samples/blob/develop/APPLICATION_DEVELOPMENT.md).
 
 If instead you want to build Edgent for your use there are two different use-cases:
 
@@ -171,7 +171,7 @@ $ ./mvnw clean install -Djava8.home=$JAVA_HOME -Ptoolchain,platform-java7,platfo
 ### Building Edgent for NOT using it with Maven
 
 Build Edgent as described above to populate the local maven repository.
-Then see [samples/APPLICATION_DEVELOPMENT.md](https://github.com/apache/incubator-edgent-samples/APPLICATION_DEVELOPMENT.md)
+Then see [samples/APPLICATION_DEVELOPMENT.md](https://github.com/apache/incubator-edgent-samples/blob/develop/APPLICATION_DEVELOPMENT.md)
 for information about the `get-edgent-jars.sh` script.
 
 An alternative to using the `get-edgent-jars.sh` script is to