You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@edgent.apache.org by dl...@apache.org on 2016/03/30 18:02:29 UTC
[3/3] incubator-quarks git commit: rebase and resolve issues
rebase and resolve issues
Project: http://git-wip-us.apache.org/repos/asf/incubator-quarks/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quarks/commit/a3c2770e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quarks/tree/a3c2770e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quarks/diff/a3c2770e
Branch: refs/heads/master
Commit: a3c2770e7091ad8d49b63573daaed570d4acff6b
Parents: ecbd427
Author: Dale LaBossiere <dl...@us.ibm.com>
Authored: Wed Mar 30 11:33:46 2016 -0400
Committer: Dale LaBossiere <dl...@us.ibm.com>
Committed: Wed Mar 30 11:33:46 2016 -0400
----------------------------------------------------------------------
.../test/connectors/common/KeystorePath.java | 69 --------------------
.../test/connectors/common/TestRepoPath.java | 61 +++++++++++++++++
.../connectors/mqtt/MqttStreamsTestManual.java | 4 +-
.../javax/websocket/WebSocketClientTest.java | 4 +-
.../javax/websocket/WebSocketServerEcho.java | 4 +-
5 files changed, 67 insertions(+), 75 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-quarks/blob/a3c2770e/connectors/common/src/test/java/quarks/test/connectors/common/KeystorePath.java
----------------------------------------------------------------------
diff --git a/connectors/common/src/test/java/quarks/test/connectors/common/KeystorePath.java b/connectors/common/src/test/java/quarks/test/connectors/common/KeystorePath.java
deleted file mode 100644
index 32e374d..0000000
--- a/connectors/common/src/test/java/quarks/test/connectors/common/KeystorePath.java
+++ /dev/null
@@ -1,69 +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 quarks.test.connectors.common;
-
-import java.io.File;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-public class KeystorePath {
-
- /**
- *
- * @param connectorsRelPathComponent
- * @param more additional path components
- * @return absolute path to the keystore
- */
- public static String getStorePath(String connectorsRelPathComponent, String... more) {
- String pathStr = System.getProperty("user.dir");
- // Under eclipse/junit: path to project in repo: <repo>/connectors
- // Under ant/junit: <repo>/connectors/<project>/unittests/testrunxxxxxxx
- // Get the path to the <repo>/connectors
- Path path = new File(pathStr).toPath();
- do {
- if (path.endsWith("connectors"))
- break;
- path = path.getParent();
- } while (path != null);
- path = path.resolve(Paths.get(connectorsRelPathComponent, more));
- if (!path.toFile().exists())
- throw new IllegalArgumentException("File does not exist: "+path);
- return path.toString();
- }
-
- public static String getPath(String repoRelPathComponent, String... more) {
- String pathStr = System.getProperty("user.dir");
- // Under eclipse/junit: path to project in repo: <repo>/connectors
- // Under ant/junit: <repo>/connectors/<project>/unittests/testrunxxxxxxx
- // Get the path to the <repo>/connectors
- Path path = new File(pathStr).toPath();
- do {
- if (path.endsWith(repoRelPathComponent)) {
- path = path.getParent();
- break;
- }
- path = path.getParent();
- } while (path != null);
- path = path.resolve(Paths.get(repoRelPathComponent, more));
- if (!path.toFile().exists())
- throw new IllegalArgumentException("File does not exist: "+path);
- return path.toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-quarks/blob/a3c2770e/connectors/common/src/test/java/quarks/test/connectors/common/TestRepoPath.java
----------------------------------------------------------------------
diff --git a/connectors/common/src/test/java/quarks/test/connectors/common/TestRepoPath.java b/connectors/common/src/test/java/quarks/test/connectors/common/TestRepoPath.java
new file mode 100644
index 0000000..6132d13
--- /dev/null
+++ b/connectors/common/src/test/java/quarks/test/connectors/common/TestRepoPath.java
@@ -0,0 +1,61 @@
+/*
+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 quarks.test.connectors.common;
+
+import java.io.File;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+/**
+ * Utility for tests to get the path to something in the local git repository.
+ */
+public class TestRepoPath {
+
+ /**
+ * Get an absolute path to something in the local git repository.
+ * <p>
+ * Deals with implications of the different execution contexts:
+ * eclipse/junit and ant/junit.
+ *
+ * @param testProject the project (e.g., "connectors") that the
+ * test belongs to.
+ * @param more more components
+ * @return absolute path in the repository
+ */
+ public static String getPath(String testProject, String... more) {
+ String pathStr = System.getProperty("user.dir");
+ // Under eclipse/junit: path to project in repo: <repo>/<testProject>
+ // Under ant/junit: <repo>/<testProject>/<project>/unittests/testrunxxxxxxx
+ // Get the path to the <repo>
+ Path path = new File(pathStr).toPath();
+ do {
+ if (path.endsWith(testProject)) {
+ path = path.getParent();
+ break;
+ }
+ path = path.getParent();
+ } while (path != null);
+ // add the components to the repo-path
+ path = path.resolve(Paths.get(testProject, more));
+ if (!path.toFile().exists())
+ throw new IllegalArgumentException("File does not exist: "+path);
+ return path.toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-quarks/blob/a3c2770e/connectors/mqtt/src/test/java/quarks/test/connectors/mqtt/MqttStreamsTestManual.java
----------------------------------------------------------------------
diff --git a/connectors/mqtt/src/test/java/quarks/test/connectors/mqtt/MqttStreamsTestManual.java b/connectors/mqtt/src/test/java/quarks/test/connectors/mqtt/MqttStreamsTestManual.java
index 82b71a6..b747c37 100644
--- a/connectors/mqtt/src/test/java/quarks/test/connectors/mqtt/MqttStreamsTestManual.java
+++ b/connectors/mqtt/src/test/java/quarks/test/connectors/mqtt/MqttStreamsTestManual.java
@@ -53,7 +53,7 @@ import quarks.function.BiFunction;
import quarks.function.Function;
import quarks.function.Supplier;
import quarks.test.connectors.common.ConnectorTestBase;
-import quarks.test.connectors.common.KeystorePath;
+import quarks.test.connectors.common.TestRepoPath;
import quarks.topology.TSink;
import quarks.topology.TStream;
import quarks.topology.Topology;
@@ -102,7 +102,7 @@ public class MqttStreamsTestManual extends ConnectorTestBase {
}
protected String getKeystorePath(String storeLeaf) {
- return KeystorePath.getPath("connectors", "mqtt", "src", "test", "keystores", storeLeaf);
+ return TestRepoPath.getPath("connectors", "mqtt", "src", "test", "keystores", storeLeaf);
}
private MqttConfig newConfig(String serverURL, String clientId) {
http://git-wip-us.apache.org/repos/asf/incubator-quarks/blob/a3c2770e/connectors/wsclient-javax.websocket/src/test/java/quarks/tests/connectors/wsclient/javax/websocket/WebSocketClientTest.java
----------------------------------------------------------------------
diff --git a/connectors/wsclient-javax.websocket/src/test/java/quarks/tests/connectors/wsclient/javax/websocket/WebSocketClientTest.java b/connectors/wsclient-javax.websocket/src/test/java/quarks/tests/connectors/wsclient/javax/websocket/WebSocketClientTest.java
index 04ca101..a1e72e2 100644
--- a/connectors/wsclient-javax.websocket/src/test/java/quarks/tests/connectors/wsclient/javax/websocket/WebSocketClientTest.java
+++ b/connectors/wsclient-javax.websocket/src/test/java/quarks/tests/connectors/wsclient/javax/websocket/WebSocketClientTest.java
@@ -40,7 +40,7 @@ import com.google.gson.JsonObject;
import quarks.connectors.wsclient.WebSocketClient;
import quarks.connectors.wsclient.javax.websocket.Jsr356WebSocketClient;
import quarks.test.connectors.common.ConnectorTestBase;
-import quarks.test.connectors.common.KeystorePath;
+import quarks.test.connectors.common.TestRepoPath;
import quarks.topology.TSink;
import quarks.topology.TStream;
import quarks.topology.Topology;
@@ -122,7 +122,7 @@ public class WebSocketClientTest extends ConnectorTestBase {
}
private String getStorePath(String storeLeaf) {
- return KeystorePath.getPath("connectors", "wsclient-javax.websocket", "src", "test", "keystores", storeLeaf);
+ return TestRepoPath.getPath("connectors", "wsclient-javax.websocket", "src", "test", "keystores", storeLeaf);
}
@Test
http://git-wip-us.apache.org/repos/asf/incubator-quarks/blob/a3c2770e/connectors/wsclient-javax.websocket/src/test/java/quarks/tests/connectors/wsclient/javax/websocket/WebSocketServerEcho.java
----------------------------------------------------------------------
diff --git a/connectors/wsclient-javax.websocket/src/test/java/quarks/tests/connectors/wsclient/javax/websocket/WebSocketServerEcho.java b/connectors/wsclient-javax.websocket/src/test/java/quarks/tests/connectors/wsclient/javax/websocket/WebSocketServerEcho.java
index ea8eb47..a63a471 100644
--- a/connectors/wsclient-javax.websocket/src/test/java/quarks/tests/connectors/wsclient/javax/websocket/WebSocketServerEcho.java
+++ b/connectors/wsclient-javax.websocket/src/test/java/quarks/tests/connectors/wsclient/javax/websocket/WebSocketServerEcho.java
@@ -46,7 +46,7 @@ import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer;
-import quarks.test.connectors.common.KeystorePath;
+import quarks.test.connectors.common.TestRepoPath;
/**
* Simple WebSocket server program to echo received messages.
@@ -145,7 +145,7 @@ public class WebSocketServerEcho {
}
private String getStorePath(String storeLeaf) {
- return KeystorePath.getPath("connectors", "wsclient-javax.websocket", "src", "test", "keystores", storeLeaf);
+ return TestRepoPath.getPath("connectors", "wsclient-javax.websocket", "src", "test", "keystores", storeLeaf);
}
public int getPort() {