You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2016/11/15 14:35:23 UTC
[1/7] tinkerpop git commit: TINKERPOP-1538 Fixed broken test that
needed to use TestClientFactory
Repository: tinkerpop
Updated Branches:
refs/heads/master 4166e7c90 -> ae11314c8
TINKERPOP-1538 Fixed broken test that needed to use TestClientFactory
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/18781cd3
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/18781cd3
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/18781cd3
Branch: refs/heads/master
Commit: 18781cd3e370f1abbfb0f6d2ae481e272d0c03d4
Parents: 70570bd
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Nov 14 18:40:44 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Nov 14 18:49:28 2016 -0500
----------------------------------------------------------------------
.../tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/18781cd3/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
index daf4df6..d51ff8d 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
@@ -734,7 +734,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldWorkWithGraphSONExtendedV2Serialization() throws Exception {
- final Cluster cluster = Cluster.build("localhost").serializer(Serializers.GRAPHSON_V2D0).create();
+ final Cluster cluster = TestClientFactory.build().serializer(Serializers.GRAPHSON_V2D0).create();
final Client client = cluster.connect();
final Instant now = Instant.now();
[6/7] tinkerpop git commit: Merge branch 'TINKERPOP-1538-tp32' into
TINKERPOP-1538-master
Posted by sp...@apache.org.
Merge branch 'TINKERPOP-1538-tp32' into TINKERPOP-1538-master
Conflicts:
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerPerformanceTest.java
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinAdditionPerformanceTest.java
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinTraversalPerformanceTest.java
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/76b8fbf2
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/76b8fbf2
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/76b8fbf2
Branch: refs/heads/master
Commit: 76b8fbf28eabb0d7d4ed0cc258ea370fa3040941
Parents: 9fe678c b803dce
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Nov 14 19:13:17 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Nov 14 19:13:17 2016 -0500
----------------------------------------------------------------------
CHANGELOG.asciidoc | 2 +
.../src/main/java/Service.java | 2 +-
.../src/test/java/ServiceTest.java | 2 +-
.../src/test/resources/gremlin-server.yaml | 2 +-
.../plugin/gremlin-server-integration.yaml | 2 +-
.../gremlin/console/groovy/plugin/remote.yaml | 2 +-
.../driver/remote/DriverRemoteConnection.java | 6 +-
gremlin-python/pom.xml | 7 +-
.../driver/test_driver_remote_connection.py | 12 +--
.../driver/gremlin-server-modern-secure-py.yaml | 4 +-
.../driver/remote/RemoteGraphProvider.java | 5 +-
.../server/GremlinDriverIntegrateTest.java | 98 ++++++++++----------
.../server/GremlinResultSetIntegrateTest.java | 4 +-
.../server/GremlinServerAuthIntegrateTest.java | 24 +++--
.../GremlinServerAuthOldIntegrateTest.java | 25 ++---
.../server/GremlinServerHttpIntegrateTest.java | 94 +++++++++----------
.../server/GremlinServerIntegrateTest.java | 74 ++++++++-------
.../GremlinServerSessionIntegrateTest.java | 22 ++---
.../gremlin/server/TestClientFactory.java | 60 ++++++++++++
.../remote/gremlin-server-integration.yaml | 2 +-
.../server/gremlin-server-integration.yaml | 2 +-
.../server/gremlin-server-performance.yaml | 2 +-
22 files changed, 263 insertions(+), 190 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/76b8fbf2/CHANGELOG.asciidoc
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/76b8fbf2/gremlin-python/pom.xml
----------------------------------------------------------------------
[3/7] tinkerpop git commit: TINKERPOP-1538 Use non-default port for
gremlin server tests
Posted by sp...@apache.org.
TINKERPOP-1538 Use non-default port for gremlin server tests
Used something other than 8182 to run the gremlin server tests to avoid port conflicts if gremlin server happens to be running in the background.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/83ac6832
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/83ac6832
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/83ac6832
Branch: refs/heads/master
Commit: 83ac683266418343684f35300eb088af23143fcc
Parents: ad01fa1
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Sun Nov 13 09:03:13 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Nov 14 18:49:28 2016 -0500
----------------------------------------------------------------------
CHANGELOG.asciidoc | 1 +
.../src/main/java/Service.java | 2 +-
.../src/test/java/ServiceTest.java | 2 +-
.../src/test/resources/gremlin-server.yaml | 2 +-
.../plugin/gremlin-server-integration.yaml | 2 +-
.../gremlin/console/groovy/plugin/remote.yaml | 2 +-
.../AbstractGremlinServerPerformanceTest.java | 2 +-
.../server/GremlinAdditionPerformanceTest.java | 2 +-
.../server/GremlinDriverIntegrateTest.java | 94 ++++++++++----------
.../server/GremlinResultSetIntegrateTest.java | 2 +-
.../server/GremlinServerAuthIntegrateTest.java | 24 ++---
.../GremlinServerAuthOldIntegrateTest.java | 25 +++---
.../server/GremlinServerHttpIntegrateTest.java | 92 +++++++++----------
.../server/GremlinServerIntegrateTest.java | 68 +++++++-------
.../GremlinServerSessionIntegrateTest.java | 17 ++--
.../server/GremlinTraversalPerformanceTest.java | 2 +-
.../gremlin/server/TestClientFactory.java | 60 +++++++++++++
.../server/gremlin-server-integration.yaml | 2 +-
.../server/gremlin-server-performance.yaml | 2 +-
19 files changed, 236 insertions(+), 167 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index ccbbc89..7041489 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -540,6 +540,7 @@ TinkerPop 3.1.6 (Release Date: NOT OFFICIALLY RELEASED YET)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Returned a confirmation on session close from Gremlin Server.
+* Use non-default port for running tests on Gremlin Server.
* Fully shutdown metrics services in Gremlin Server on shutdown.
* Deprecated `tryRandomCommit()` in `AbstractGremlinTest` - the annotation was never added in 3.1.1, and was only deprecated via javadoc.
* Minor fixes to various test feature requirements in `gremlin-test`.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/Service.java
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/Service.java b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/Service.java
index b2e9de6..2561d39 100644
--- a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/Service.java
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/Service.java
@@ -32,7 +32,7 @@ public class Service implements AutoCloseable {
/**
* There typically needs to be only one Cluster instance in an application.
*/
- private final Cluster cluster = Cluster.open();
+ private final Cluster cluster = Cluster.build().port(45940).create();
/**
* Use the Cluster instance to construct different Client instances (e.g. one for sessionless communication
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/java/ServiceTest.java
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/java/ServiceTest.java b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/java/ServiceTest.java
index 6f7d5c3..d888f46 100644
--- a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/java/ServiceTest.java
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/java/ServiceTest.java
@@ -78,7 +78,7 @@ public class ServiceTest {
@Test
public void shouldCreateGraph() throws Exception {
- List<String> result = service.findCreatorsOfSoftware("lop");
+ final List<String> result = service.findCreatorsOfSoftware("lop");
assertThat(result, is(Arrays.asList("marko", "josh", "peter")));
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
index 5744d29..d1f91ef 100644
--- a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
@@ -16,7 +16,7 @@
# under the License.
host: localhost
-port: 8182
+port: 45940
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/gremlin-server-integration.yaml
----------------------------------------------------------------------
diff --git a/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/gremlin-server-integration.yaml b/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/gremlin-server-integration.yaml
index 1c7c666..a7ef1a9 100644
--- a/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/gremlin-server-integration.yaml
+++ b/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/gremlin-server-integration.yaml
@@ -16,7 +16,7 @@
# under the License.
host: localhost
-port: 8182
+port: 45940
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/remote.yaml
----------------------------------------------------------------------
diff --git a/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/remote.yaml b/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/remote.yaml
index 7b23779..373934b 100644
--- a/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/remote.yaml
+++ b/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/remote.yaml
@@ -16,5 +16,5 @@
# under the License.
hosts: [localhost]
-port: 8182
+port: 45940
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerPerformanceTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerPerformanceTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerPerformanceTest.java
index 7808c7e..14750bd 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerPerformanceTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerPerformanceTest.java
@@ -82,7 +82,7 @@ public abstract class AbstractGremlinServerPerformanceTest {
logger.info("Gremlin Server is started and ready for performance test to execute");
host = System.getProperty("host", "localhost");
- port = System.getProperty("port", "8182");
+ port = System.getProperty("port", "45940");
}
@AfterClass
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinAdditionPerformanceTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinAdditionPerformanceTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinAdditionPerformanceTest.java
index d2d9d97..c562756 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinAdditionPerformanceTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinAdditionPerformanceTest.java
@@ -83,7 +83,7 @@ public class GremlinAdditionPerformanceTest extends AbstractGremlinServerPerform
final Serializers[] mimes = new Serializers[]{Serializers.GRAPHSON, Serializers.GRAPHSON_V1D0, Serializers.GRYO_V1D0};
final Serializers mimeType = mimes[rand.nextInt(3)];
logger.info(mimeType.toString());
- final Cluster cluster = Cluster.build("localhost")
+ final Cluster cluster = TestClientFactory.build()
.serializer(mimeType)
.create();
final Client client = cluster.connect();
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
index d8aff4a..daf4df6 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
@@ -206,7 +206,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldEventuallySucceedAfterChannelLevelError() throws Exception {
- final Cluster cluster = Cluster.build().addContactPoint("localhost")
+ final Cluster cluster = TestClientFactory.build()
.reconnectIntialDelay(500)
.reconnectInterval(500)
.maxContentLength(1024).create();
@@ -227,7 +227,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldEventuallySucceedAfterMuchFailure() throws Exception {
- final Cluster cluster = Cluster.build().addContactPoint("localhost").create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
// tested independently to 10000 iterations but for speed, bumped back to 1000
@@ -250,7 +250,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
public void shouldEventuallySucceedOnSameServer() throws Exception {
stopServer();
- final Cluster cluster = Cluster.build().addContactPoint("localhost").create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
try {
@@ -274,7 +274,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldEventuallySucceedWithRoundRobin() throws Exception {
final String noGremlinServer = "74.125.225.19";
- final Cluster cluster = Cluster.build(noGremlinServer).addContactPoint("localhost").create();
+ final Cluster cluster = TestClientFactory.build().addContactPoint(noGremlinServer).create();
final Client client = cluster.connect();
// the first host is dead on init. request should succeed on localhost
@@ -289,7 +289,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldHandleResultsOfAllSizes() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
final String script = "g.V().drop().iterate();\n" +
@@ -328,7 +328,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldFailWithBadClientSideSerialization() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
final ResultSet results = client.submit("java.awt.Color.RED");
@@ -351,7 +351,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldFailWithScriptExecutionException() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
final ResultSet results = client.submit("1/0");
@@ -374,7 +374,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldProcessRequestsOutOfOrder() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
final ResultSet rsFive = client.submit("Thread.sleep(5000);'five'");
@@ -397,7 +397,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldProcessSessionRequestsInOrder() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect(name.getMethodName());
final ResultSet rsFive = client.submit("Thread.sleep(5000);'five'");
@@ -423,7 +423,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldWaitForAllResultsToArrive() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
final AtomicInteger checked = new AtomicInteger(0);
@@ -441,7 +441,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldWorkOverNioTransport() throws Exception {
- final Cluster cluster = Cluster.build().channelizer(Channelizer.NioChannelizer.class.getName()).create();
+ final Cluster cluster = TestClientFactory.build().channelizer(Channelizer.NioChannelizer.class.getName()).create();
final Client client = cluster.connect();
final AtomicInteger checked = new AtomicInteger(0);
@@ -459,7 +459,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldStream() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
final ResultSet results = client.submit("[1,2,3,4,5,6,7,8,9]");
@@ -476,7 +476,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldIterate() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
final ResultSet results = client.submit("[1,2,3,4,5,6,7,8,9]");
@@ -498,7 +498,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldGetSomeThenSomeMore() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
final ResultSet results = client.submit("[1,2,3,4,5,6,7,8,9]");
@@ -526,7 +526,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldGetOneThenSomeThenSomeMore() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
final ResultSet results = client.submit("[1,2,3,4,5,6,7,8,9]");
@@ -574,7 +574,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
// that the client doesn't timeout waiting for an available connection. obviously this can also be fixed
// by increasing the maxConnectionPoolSize.
final int requests = workerPoolSizeForDriver * 4;
- final Cluster cluster = Cluster.build()
+ final Cluster cluster = TestClientFactory.build()
.workerPoolSize(workerPoolSizeForDriver)
.maxWaitForConnection(300000)
.create();
@@ -598,7 +598,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldCloseWithServerDown() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
cluster.connect().init();
stopServer();
@@ -608,7 +608,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldMarkHostDeadSinceServerIsDown() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
assertEquals(0, cluster.availableHosts().size());
cluster.connect().init();
assertEquals(1, cluster.availableHosts().size());
@@ -623,7 +623,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldFailWithBadServerSideSerialization() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
final ResultSet results = client.submit("TinkerGraph.open().variables()");
@@ -651,7 +651,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
final GryoMessageSerializerV1d0 serializer = new GryoMessageSerializerV1d0();
serializer.configure(m, null);
- final Cluster cluster = Cluster.build().serializer(serializer).create();
+ final Cluster cluster = TestClientFactory.build().serializer(serializer).create();
final Client client = cluster.connect();
final ResultSet resultSet = client.submit("TinkerFactory.createClassic()");
@@ -669,7 +669,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
final GryoMessageSerializerV1d0 serializer = new GryoMessageSerializerV1d0();
serializer.configure(m, null);
- final Cluster cluster = Cluster.build().serializer(serializer).create();
+ final Cluster cluster = TestClientFactory.build().serializer(serializer).create();
final Client client = cluster.connect();
final List<Result> json = client.submit("b = new JsonBuilder();b.people{person {fname 'stephen'\nlname 'mallette'}};b").all().join();
@@ -679,7 +679,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldWorkWithGraphSONV1Serialization() throws Exception {
- final Cluster cluster = Cluster.build("localhost").serializer(Serializers.GRAPHSON_V1D0).create();
+ final Cluster cluster = TestClientFactory.build().serializer(Serializers.GRAPHSON_V1D0).create();
final Client client = cluster.connect();
final List<Result> r = client.submit("TinkerFactory.createModern().traversal().V(1)").all().join();
@@ -715,7 +715,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldWorkWithGraphSONV2Serialization() throws Exception {
- final Cluster cluster = Cluster.build("localhost").serializer(Serializers.GRAPHSON_V2D0).create();
+ final Cluster cluster = TestClientFactory.build().serializer(Serializers.GRAPHSON_V2D0).create();
final Client client = cluster.connect();
final List<Result> r = client.submit("TinkerFactory.createModern().traversal().V(1)").all().join();
@@ -750,7 +750,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
@org.junit.Ignore("Can't seem to make this test pass consistently")
public void shouldHandleRequestSentThatNeverReturns() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
final ResultSet results = client.submit("Thread.sleep(10000); 'should-not-ever-get-back-coz-we-killed-the-server'");
@@ -775,7 +775,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldFailClientSideWithTooLargeAResponse() {
- final Cluster cluster = Cluster.build().maxContentLength(1).create();
+ final Cluster cluster = TestClientFactory.build().maxContentLength(1).create();
final Client client = cluster.connect();
try {
@@ -792,7 +792,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldReturnNiceMessageFromOpSelector() {
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.build().create();
final Client client = cluster.connect();
try {
@@ -810,7 +810,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldExecuteScriptInSession() throws Exception {
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.build().create();
final Client client = cluster.connect(name.getMethodName());
final ResultSet results1 = client.submit("x = [1,2,3,4,5,6,7,8,9]");
@@ -827,7 +827,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldNotThrowNoSuchElementException() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
try {
@@ -840,7 +840,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldCloseSession() throws Exception {
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.build().create();
final Client client = cluster.connect(name.getMethodName());
final ResultSet results1 = client.submit("x = [1,2,3,4,5,6,7,8,9]");
@@ -863,7 +863,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldExecuteScriptInSessionAssumingDefaultedImports() throws Exception {
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect(name.getMethodName());
final ResultSet results1 = client.submit("TinkerFactory.class.name");
@@ -876,7 +876,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
public void shouldExecuteScriptInSessionOnTransactionalGraph() throws Exception {
assumeNeo4jIsPresent();
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect(name.getMethodName());
final Vertex vertexBeforeTx = client.submit("v=graph.addVertex(\"name\",\"stephen\")").all().get().get(0).getVertex();
@@ -899,7 +899,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
public void shouldExecuteScriptInSessionOnTransactionalWithManualTransactionsGraph() throws Exception {
assumeNeo4jIsPresent();
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect(name.getMethodName());
final Client sessionlessClient = cluster.connect();
client.submit("graph.tx().onReadWrite(Transaction.READ_WRITE_BEHAVIOR.MANUAL);null").all().get();
@@ -936,7 +936,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
public void shouldExecuteInSessionAndSessionlessWithoutOpeningTransaction() throws Exception {
assumeNeo4jIsPresent();
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client sessionClient = cluster.connect(name.getMethodName());
final Client sessionlessClient = cluster.connect();
@@ -963,7 +963,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
public void shouldExecuteSessionlessScriptOnTransactionalGraph() throws Exception {
assumeNeo4jIsPresent();
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
// this line is important because it tests GraphTraversal which has a certain transactional path
@@ -984,7 +984,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldExecuteScriptInSessionWithBindingsSavedOnServerBetweenRequests() throws Exception {
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect(name.getMethodName());
final Map<String, Object> bindings1 = new HashMap<>();
@@ -1012,7 +1012,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldExecuteScriptsInMultipleSession() throws Exception {
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client1 = cluster.connect(name.getMethodName() + "1");
final Client client2 = cluster.connect(name.getMethodName() + "2");
final Client client3 = cluster.connect(name.getMethodName() + "3");
@@ -1036,7 +1036,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldNotHaveKnowledgeOfBindingsBetweenRequestsWhenSessionless() throws Exception {
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client1 = cluster.connect();
final Client client2 = cluster.connect();
final Client client3 = cluster.connect();
@@ -1080,7 +1080,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldBeThreadSafeToUseOneClient() throws Exception {
- final Cluster cluster = Cluster.build().workerPoolSize(2)
+ final Cluster cluster = TestClientFactory.build().workerPoolSize(2)
.maxInProcessPerConnection(64)
.minInProcessPerConnection(32)
.maxConnectionPoolSize(16)
@@ -1115,7 +1115,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldRequireAliasedGraphVariablesInStrictTransactionMode() throws Exception {
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
try {
@@ -1135,7 +1135,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
public void shouldAliasGraphVariablesInStrictTransactionMode() throws Exception {
assumeNeo4jIsPresent();
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
try {
@@ -1162,7 +1162,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldAliasGraphVariables() throws Exception {
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
try {
@@ -1189,7 +1189,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldAliasTraversalSourceVariables() throws Exception {
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
try {
@@ -1216,7 +1216,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldAliasGraphVariablesInSession() throws Exception {
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect(name.getMethodName());
try {
@@ -1245,7 +1245,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldAliasTraversalSourceVariablesInSession() throws Exception {
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect(name.getMethodName());
try {
@@ -1276,7 +1276,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
public void shouldManageTransactionsInSession() throws Exception {
assumeNeo4jIsPresent();
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
final Client sessionWithManagedTx = cluster.connect(name.getMethodName() + "-managed", true);
final Client sessionWithoutManagedTx = cluster.connect(name.getMethodName() + "-not-managed");
@@ -1314,7 +1314,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldProcessSessionRequestsInOrderAfterTimeout() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect(name.getMethodName());
for(int index = 0; index < 50; index++)
@@ -1357,7 +1357,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldCloseAllClientsOnCloseOfCluster() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client sessionlessOne = cluster.connect();
final Client session = cluster.connect("session");
final Client sessionlessTwo = cluster.connect();
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinResultSetIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinResultSetIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinResultSetIntegrateTest.java
index 3c1efef..9916f73 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinResultSetIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinResultSetIntegrateTest.java
@@ -83,7 +83,7 @@ public class GremlinResultSetIntegrateTest extends AbstractGremlinServerIntegrat
c.put("custom", Collections.singletonList("groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer"));
serializer.configure(c, null);
- cluster = Cluster.build().serializer(serializer).create();
+ cluster = TestClientFactory.build().serializer(serializer).create();
client = cluster.connect();
}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
index 887d408..1c5188d 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
@@ -72,7 +72,7 @@ public class GremlinServerAuthIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void shouldFailIfSslEnabledOnServerButNotClient() throws Exception {
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
try {
@@ -89,7 +89,7 @@ public class GremlinServerAuthIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void shouldAuthenticateWithPlainText() throws Exception {
- final Cluster cluster = Cluster.build().credentials("stephen", "password").create();
+ final Cluster cluster = TestClientFactory.build().credentials("stephen", "password").create();
final Client client = cluster.connect();
try {
@@ -103,7 +103,7 @@ public class GremlinServerAuthIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void shouldAuthenticateOverSslWithPlainText() throws Exception {
- final Cluster cluster = Cluster.build()
+ final Cluster cluster = TestClientFactory.build()
.enableSsl(true)
.credentials("stephen", "password").create();
final Client client = cluster.connect();
@@ -119,7 +119,7 @@ public class GremlinServerAuthIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void shouldFailAuthenticateWithPlainTextNoCredentials() throws Exception {
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
try {
@@ -135,7 +135,7 @@ public class GremlinServerAuthIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void shouldFailAuthenticateWithPlainTextBadPassword() throws Exception {
- final Cluster cluster = Cluster.build().credentials("stephen", "bad").create();
+ final Cluster cluster = TestClientFactory.build().credentials("stephen", "bad").create();
final Client client = cluster.connect();
try {
@@ -152,7 +152,7 @@ public class GremlinServerAuthIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void shouldFailAuthenticateWithPlainTextBadUsername() throws Exception {
- final Cluster cluster = Cluster.build().credentials("marko", "password").create();
+ final Cluster cluster = TestClientFactory.build().credentials("marko", "password").create();
final Client client = cluster.connect();
try {
@@ -168,7 +168,8 @@ public class GremlinServerAuthIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void shouldAuthenticateWithPlainTextOverJSONSerialization() throws Exception {
- final Cluster cluster = Cluster.build().serializer(Serializers.GRAPHSON).credentials("stephen", "password").create();
+ final Cluster cluster = TestClientFactory.build().serializer(Serializers.GRAPHSON)
+ .credentials("stephen", "password").create();
final Client client = cluster.connect();
try {
@@ -182,7 +183,8 @@ public class GremlinServerAuthIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void shouldAuthenticateWithPlainTextOverGraphSONSerialization() throws Exception {
- final Cluster cluster = Cluster.build().serializer(Serializers.GRAPHSON_V1D0).credentials("stephen", "password").create();
+ final Cluster cluster = TestClientFactory.build().serializer(Serializers.GRAPHSON_V1D0)
+ .credentials("stephen", "password").create();
final Client client = cluster.connect();
try {
@@ -196,7 +198,8 @@ public class GremlinServerAuthIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void shouldAuthenticateAndWorkWithVariablesOverJsonSerialization() throws Exception {
- final Cluster cluster = Cluster.build().serializer(Serializers.GRAPHSON).credentials("stephen", "password").create();
+ final Cluster cluster = TestClientFactory.build().serializer(Serializers.GRAPHSON)
+ .credentials("stephen", "password").create();
final Client client = cluster.connect(name.getMethodName());
try {
@@ -213,7 +216,8 @@ public class GremlinServerAuthIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void shouldAuthenticateAndWorkWithVariablesOverGraphSONSerialization() throws Exception {
- final Cluster cluster = Cluster.build().serializer(Serializers.GRAPHSON_V1D0).credentials("stephen", "password").create();
+ final Cluster cluster = TestClientFactory.build().serializer(Serializers.GRAPHSON_V1D0)
+ .credentials("stephen", "password").create();
final Client client = cluster.connect(name.getMethodName());
try {
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthOldIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthOldIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthOldIntegrateTest.java
index 2f332be..f0e2104 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthOldIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthOldIntegrateTest.java
@@ -24,7 +24,6 @@ import org.apache.tinkerpop.gremlin.driver.Cluster;
import org.apache.tinkerpop.gremlin.driver.exception.ResponseException;
import org.apache.tinkerpop.gremlin.driver.ser.Serializers;
import org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator;
-import org.ietf.jgss.GSSException;
import org.junit.Test;
import java.util.HashMap;
@@ -76,7 +75,7 @@ public class GremlinServerAuthOldIntegrateTest extends AbstractGremlinServerInte
@Test
public void shouldFailIfSslEnabledOnServerButNotClient() throws Exception {
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
try {
@@ -93,7 +92,7 @@ public class GremlinServerAuthOldIntegrateTest extends AbstractGremlinServerInte
@Test
public void shouldAuthenticateWithPlainText() throws Exception {
- final Cluster cluster = Cluster.build().credentials("stephen", "password").create();
+ final Cluster cluster = TestClientFactory.build().credentials("stephen", "password").create();
final Client client = cluster.connect();
try {
@@ -107,7 +106,7 @@ public class GremlinServerAuthOldIntegrateTest extends AbstractGremlinServerInte
@Test
public void shouldAuthenticateOverSslWithPlainText() throws Exception {
- final Cluster cluster = Cluster.build()
+ final Cluster cluster = TestClientFactory.build()
.enableSsl(true)
.credentials("stephen", "password").create();
final Client client = cluster.connect();
@@ -123,7 +122,7 @@ public class GremlinServerAuthOldIntegrateTest extends AbstractGremlinServerInte
@Test
public void shouldFailAuthenticateWithPlainTextNoCredentials() throws Exception {
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
try {
@@ -142,7 +141,7 @@ public class GremlinServerAuthOldIntegrateTest extends AbstractGremlinServerInte
@Test
public void shouldFailAuthenticateWithPlainTextBadPassword() throws Exception {
- final Cluster cluster = Cluster.build().credentials("stephen", "bad").create();
+ final Cluster cluster = TestClientFactory.build().credentials("stephen", "bad").create();
final Client client = cluster.connect();
try {
@@ -159,7 +158,7 @@ public class GremlinServerAuthOldIntegrateTest extends AbstractGremlinServerInte
@Test
public void shouldFailAuthenticateWithPlainTextBadUsername() throws Exception {
- final Cluster cluster = Cluster.build().credentials("marko", "password").create();
+ final Cluster cluster = TestClientFactory.build().credentials("marko", "password").create();
final Client client = cluster.connect();
try {
@@ -175,7 +174,8 @@ public class GremlinServerAuthOldIntegrateTest extends AbstractGremlinServerInte
@Test
public void shouldAuthenticateWithPlainTextOverJSONSerialization() throws Exception {
- final Cluster cluster = Cluster.build().serializer(Serializers.GRAPHSON).credentials("stephen", "password").create();
+ final Cluster cluster = TestClientFactory.build().serializer(Serializers.GRAPHSON)
+ .credentials("stephen", "password").create();
final Client client = cluster.connect();
try {
@@ -189,7 +189,8 @@ public class GremlinServerAuthOldIntegrateTest extends AbstractGremlinServerInte
@Test
public void shouldAuthenticateWithPlainTextOverGraphSONSerialization() throws Exception {
- final Cluster cluster = Cluster.build().serializer(Serializers.GRAPHSON_V1D0).credentials("stephen", "password").create();
+ final Cluster cluster = TestClientFactory.build().serializer(Serializers.GRAPHSON_V1D0)
+ .credentials("stephen", "password").create();
final Client client = cluster.connect();
try {
@@ -203,7 +204,8 @@ public class GremlinServerAuthOldIntegrateTest extends AbstractGremlinServerInte
@Test
public void shouldAuthenticateAndWorkWithVariablesOverJsonSerialization() throws Exception {
- final Cluster cluster = Cluster.build().serializer(Serializers.GRAPHSON).credentials("stephen", "password").create();
+ final Cluster cluster = TestClientFactory.build().serializer(Serializers.GRAPHSON)
+ .credentials("stephen", "password").create();
final Client client = cluster.connect(name.getMethodName());
try {
@@ -220,7 +222,8 @@ public class GremlinServerAuthOldIntegrateTest extends AbstractGremlinServerInte
@Test
public void shouldAuthenticateAndWorkWithVariablesOverGraphSONSerialization() throws Exception {
- final Cluster cluster = Cluster.build().serializer(Serializers.GRAPHSON_V1D0).credentials("stephen", "password").create();
+ final Cluster cluster = TestClientFactory.build().serializer(Serializers.GRAPHSON_V1D0)
+ .credentials("stephen", "password").create();
final Client client = cluster.connect(name.getMethodName());
try {
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
index 6d5fc7c..cefe0df 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
@@ -132,7 +132,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should401OnGETWithNoAuthorizationHeader() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpGet httpget = new HttpGet("http://localhost:8182?gremlin=1-1");
+ final HttpGet httpget = new HttpGet(TestClientFactory.createURLString("?gremlin=1-1"));
try (final CloseableHttpResponse response = httpclient.execute(httpget)) {
assertEquals(401, response.getStatusLine().getStatusCode());
@@ -142,7 +142,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should401OnPOSTWithNoAuthorizationHeader() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.setEntity(new StringEntity("{\"gremlin\":\"1-1\"}", Consts.UTF_8));
@@ -154,7 +154,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should401OnGETWithBadAuthorizationHeader() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpGet httpget = new HttpGet("http://localhost:8182?gremlin=1-1");
+ final HttpGet httpget = new HttpGet(TestClientFactory.createURLString("?gremlin=1-1"));
httpget.addHeader("Authorization", "not-base-64-encoded");
try (final CloseableHttpResponse response = httpclient.execute(httpget)) {
@@ -165,7 +165,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should401OnPOSTWithBadAuthorizationHeader() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.addHeader("Authorization", "not-base-64-encoded");
httppost.setEntity(new StringEntity("{\"gremlin\":\"1-1\"}", Consts.UTF_8));
@@ -178,7 +178,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should401OnGETWithBadEncodedAuthorizationHeader() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpGet httpget = new HttpGet("http://localhost:8182?gremlin=1-1");
+ final HttpGet httpget = new HttpGet(TestClientFactory.createURLString("?gremlin=1-1"));
httpget.addHeader("Authorization", "Basic: not-base-64-encoded");
try (final CloseableHttpResponse response = httpclient.execute(httpget)) {
@@ -189,7 +189,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should401OnPOSTWithBadEncodedAuthorizationHeader() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.addHeader("Authorization", "Basic: not-base-64-encoded");
httppost.setEntity(new StringEntity("{\"gremlin\":\"1-1\"}", Consts.UTF_8));
@@ -202,7 +202,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should401OnGETWithInvalidPasswordAuthorizationHeader() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpGet httpget = new HttpGet("http://localhost:8182?gremlin=1-1");
+ final HttpGet httpget = new HttpGet(TestClientFactory.createURLString("?gremlin=1-1"));
httpget.addHeader("Authorization", "Basic " + encoder.encodeToString("stephen:not-my-password".getBytes()));
try (final CloseableHttpResponse response = httpclient.execute(httpget)) {
@@ -213,7 +213,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should401OnPOSTWithInvalidPasswordAuthorizationHeader() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.addHeader("Authorization", "Basic " + encoder.encodeToString("stephen:not-my-password".getBytes()));
httppost.setEntity(new StringEntity("{\"gremlin\":\"1-1\"}", Consts.UTF_8));
@@ -227,7 +227,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Deprecated
public void should401OnPOSTWithInvalidPasswordAuthorizationHeaderOld() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.addHeader("Authorization", "Basic " + encoder.encodeToString("stephen:not-my-password".getBytes()));
httppost.setEntity(new StringEntity("{\"gremlin\":\"1-1\"}", Consts.UTF_8));
@@ -240,7 +240,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnGETWithAuthorizationHeader() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpGet httpget = new HttpGet("http://localhost:8182?gremlin=1-1");
+ final HttpGet httpget = new HttpGet(TestClientFactory.createURLString("?gremlin=1-1"));
httpget.addHeader("Authorization", "Basic " + encoder.encodeToString("stephen:password".getBytes()));
try (final CloseableHttpResponse response = httpclient.execute(httpget)) {
@@ -255,7 +255,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnPOSTWithAuthorizationHeader() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.addHeader("Authorization", "Basic " + encoder.encodeToString("stephen:password".getBytes()));
httppost.setEntity(new StringEntity("{\"gremlin\":\"1-1\"}", Consts.UTF_8));
@@ -273,7 +273,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Deprecated
public void should200OnPOSTWithAuthorizationHeaderOld() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.addHeader("Authorization", "Basic " + encoder.encodeToString("stephen:password".getBytes()));
httppost.setEntity(new StringEntity("{\"gremlin\":\"1-1\"}", Consts.UTF_8));
@@ -290,7 +290,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnGETWithGremlinQueryStringArgumentWithBindingsAndFunction() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpGet httpget = new HttpGet("http://localhost:8182?gremlin=addItUp(Integer.parseInt(x),Integer.parseInt(y))&bindings.x=10&bindings.y=10");
+ final HttpGet httpget = new HttpGet(TestClientFactory.createURLString("?gremlin=addItUp(Integer.parseInt(x),Integer.parseInt(y))&bindings.x=10&bindings.y=10"));
try (final CloseableHttpResponse response = httpclient.execute(httpget)) {
assertEquals(200, response.getStatusLine().getStatusCode());
@@ -304,7 +304,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnGETWithGremlinQueryStringArgumentWithIteratorResult() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpGet httpget = new HttpGet("http://localhost:8182?gremlin=g.V()");
+ final HttpGet httpget = new HttpGet(TestClientFactory.createURLString("?gremlin=g.V()"));
try (final CloseableHttpResponse response = httpclient.execute(httpget)) {
assertEquals(200, response.getStatusLine().getStatusCode());
@@ -319,7 +319,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
public void should200OnGETWithGremlinQueryStringArgumentWithIteratorResultAndAliases() throws Exception {
// we can remove this first test when rebindings are completely removed
final CloseableHttpClient httpclientLegacy = HttpClients.createDefault();
- final HttpGet httpgetLegacy = new HttpGet("http://localhost:8182?gremlin=g1.V()&rebindings.g1=g");
+ final HttpGet httpgetLegacy = new HttpGet(TestClientFactory.createURLString("?gremlin=g1.V()&rebindings.g1=g"));
try (final CloseableHttpResponse response = httpclientLegacy.execute(httpgetLegacy)) {
assertEquals(200, response.getStatusLine().getStatusCode());
@@ -330,7 +330,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
}
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpGet httpget = new HttpGet("http://localhost:8182?gremlin=g1.V()&aliases.g1=g");
+ final HttpGet httpget = new HttpGet(TestClientFactory.createURLString("?gremlin=g1.V()&aliases.g1=g"));
try (final CloseableHttpResponse response = httpclient.execute(httpget)) {
assertEquals(200, response.getStatusLine().getStatusCode());
@@ -344,7 +344,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnGETWithGremlinQueryStringArgument() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpGet httpget = new HttpGet("http://localhost:8182?gremlin=1-1");
+ final HttpGet httpget = new HttpGet(TestClientFactory.createURLString("?gremlin=1-1"));
try (final CloseableHttpResponse response = httpclient.execute(httpget)) {
assertEquals(200, response.getStatusLine().getStatusCode());
@@ -358,7 +358,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnGETWithGremlinQueryStringArgumentReturningVertex() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpGet httpget = new HttpGet("http://localhost:8182?gremlin=graph.addVertex('name','stephen')");
+ final HttpGet httpget = new HttpGet(TestClientFactory.createURLString("?gremlin=graph.addVertex('name','stephen')"));
try (final CloseableHttpResponse response = httpclient.execute(httpget)) {
assertEquals(200, response.getStatusLine().getStatusCode());
@@ -372,7 +372,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnGETWithGremlinQueryStringArgumentWithBindings() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpGet httpget = new HttpGet("http://localhost:8182?gremlin=Integer.parseInt(x)%2BInteger.parseInt(y)&bindings.x=10&bindings.y=10");
+ final HttpGet httpget = new HttpGet(TestClientFactory.createURLString("?gremlin=Integer.parseInt(x)%2BInteger.parseInt(y)&bindings.x=10&bindings.y=10"));
try (final CloseableHttpResponse response = httpclient.execute(httpget)) {
assertEquals(200, response.getStatusLine().getStatusCode());
@@ -386,7 +386,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should400OnGETWithNoGremlinQueryStringArgument() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpGet httpget = new HttpGet("http://localhost:8182");
+ final HttpGet httpget = new HttpGet(TestClientFactory.createURLString());
try (final CloseableHttpResponse response = httpclient.execute(httpget)) {
assertEquals(400, response.getStatusLine().getStatusCode());
@@ -396,7 +396,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnGETWithAnyAcceptHeaderDefaultResultToJson() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpGet httpget = new HttpGet("http://localhost:8182?gremlin=1-1");
+ final HttpGet httpget = new HttpGet(TestClientFactory.createURLString("?gremlin=1-1"));
httpget.addHeader("Accept", "*/*");
try (final CloseableHttpResponse response = httpclient.execute(httpget)) {
@@ -411,7 +411,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should400OnGETWithBadAcceptHeader() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpGet httpget = new HttpGet("http://localhost:8182?gremlin=1-1");
+ final HttpGet httpget = new HttpGet(TestClientFactory.createURLString("?gremlin=1-1"));
httpget.addHeader("Accept", "application/json+something-else-that-does-not-exist");
try (final CloseableHttpResponse response = httpclient.execute(httpget)) {
@@ -422,7 +422,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnPOSTWithGremlinJsonEndcodedBody() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.setEntity(new StringEntity("{\"gremlin\":\"1-1\"}", Consts.UTF_8));
@@ -440,7 +440,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
// basic test of java.time.* serialization over JSON from the server perspective. more complete tests
// exist in gremlin-core
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.setEntity(new StringEntity("{\"gremlin\":\"java.time.Instant.MAX\"}", Consts.UTF_8));
@@ -458,7 +458,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
assumeNeo4jIsPresent();
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.setEntity(new StringEntity("{\"gremlin\":\"graph.addVertex('name','stephen');g.V().count()\"}", Consts.UTF_8));
@@ -470,7 +470,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
assertEquals(1, node.get("result").get("data").get(0).intValue());
}
- final HttpGet httpget = new HttpGet("http://localhost:8182?gremlin=g.V().count()");
+ final HttpGet httpget = new HttpGet(TestClientFactory.createURLString("?gremlin=g.V().count()"));
httpget.addHeader("Accept", "application/json");
// execute this a bunch of times so that there's a good chance a different thread on the server processes
@@ -492,7 +492,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
// we can remove this first test when rebindings are completely removed
final CloseableHttpClient httpclientLegacy = HttpClients.createDefault();
- final HttpPost httppostLegacy = new HttpPost("http://localhost:8182");
+ final HttpPost httppostLegacy = new HttpPost(TestClientFactory.createURLString());
httppostLegacy.addHeader("Content-Type", "application/json");
httppostLegacy.setEntity(new StringEntity("{\"gremlin\":\"g1.addV()\",\"rebindings\":{\"g1\":\"g\"}}", Consts.UTF_8));
@@ -505,7 +505,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
}
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.setEntity(new StringEntity("{\"gremlin\":\"g1.addV()\",\"aliases\":{\"g1\":\"g\"}}", Consts.UTF_8));
@@ -521,7 +521,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnPOSTWithGremlinJsonEndcodedBodyWithIteratorResult() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.setEntity(new StringEntity("{\"gremlin\":\"g.V()\"}", Consts.UTF_8));
@@ -537,7 +537,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnPOSTWithGremlinJsonEndcodedBodyWithTinkerGraphResult() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.setEntity(new StringEntity("{\"gremlin\":\"org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory.createModern()\"}", Consts.UTF_8));
@@ -561,7 +561,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
public void should200OnPOSTWithGremlinJsonEndcodedBodyWithIteratorResultAndAliases() throws Exception {
// we can remove this first test when rebindings are completely removed
final CloseableHttpClient httpclientLegacy = HttpClients.createDefault();
- final HttpPost httppostLegacy = new HttpPost("http://localhost:8182");
+ final HttpPost httppostLegacy = new HttpPost(TestClientFactory.createURLString());
httppostLegacy.addHeader("Content-Type", "application/json");
httppostLegacy.setEntity(new StringEntity("{\"gremlin\":\"g1.V()\",\"rebindings\":{\"g1\":\"g\"}}", Consts.UTF_8));
@@ -574,7 +574,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
}
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.setEntity(new StringEntity("{\"gremlin\":\"g1.V()\",\"aliases\":{\"g1\":\"g\"}}", Consts.UTF_8));
@@ -590,7 +590,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnPOSTWithGremlinJsonEndcodedBodyAndBindings() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.setEntity(new StringEntity("{\"gremlin\":\"x+y\", \"bindings\":{\"x\":10, \"y\":10}}", Consts.UTF_8));
@@ -606,7 +606,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnPOSTWithGremlinJsonEndcodedBodyAndLongBindings() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.setEntity(new StringEntity("{\"gremlin\":\"x\", \"bindings\":{\"x\":10}}", Consts.UTF_8));
@@ -622,7 +622,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnPOSTWithGremlinJsonEndcodedBodyAndDoubleBindings() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.setEntity(new StringEntity("{\"gremlin\":\"x\", \"bindings\":{\"x\":10.5}}", Consts.UTF_8));
@@ -638,7 +638,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnPOSTWithGremlinJsonEndcodedBodyAndStringBindings() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.setEntity(new StringEntity("{\"gremlin\":\"x\", \"bindings\":{\"x\":\"10\"}}", Consts.UTF_8));
@@ -654,7 +654,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnPOSTWithGremlinJsonEndcodedBodyAndBooleanBindings() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.setEntity(new StringEntity("{\"gremlin\":\"x\", \"bindings\":{\"x\":true}}", Consts.UTF_8));
@@ -670,7 +670,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnPOSTWithGremlinJsonEndcodedBodyAndNullBindings() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.setEntity(new StringEntity("{\"gremlin\":\"x\", \"bindings\":{\"x\":null}}", Consts.UTF_8));
@@ -686,7 +686,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnPOSTWithGremlinJsonEndcodedBodyAndArrayBindings() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.setEntity(new StringEntity("{\"gremlin\":\"x\", \"bindings\":{\"x\":[1,2,3]}}", Consts.UTF_8));
@@ -705,7 +705,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnPOSTWithGremlinJsonEndcodedBodyAndMapBindings() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.setEntity(new StringEntity("{\"gremlin\":\"x\", \"bindings\":{\"x\":{\"y\":1}}}", Consts.UTF_8));
@@ -722,7 +722,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should400OnPOSTWithGremlinJsonEndcodedBodyAndBadBindings() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.setEntity(new StringEntity("{\"gremlin\":\"x+y\", \"bindings\":10}}", Consts.UTF_8));
@@ -734,7 +734,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should400OnPOSTWithGremlinJsonEndcodedBodyWithNoGremlinKey() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.setEntity(new StringEntity("{\"gremadfadflin\":\"1-1\"}", Consts.UTF_8));
@@ -746,7 +746,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should400OnPOSTWithBadAcceptHeader() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.addHeader("Accept", "application/json+something-else-that-does-not-exist");
httppost.setEntity(new StringEntity("{\"gremlin\":\"1-1\"}", Consts.UTF_8));
@@ -759,7 +759,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnPOSTWithAnyAcceptHeaderDefaultResultToJson() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.addHeader("Accept", "*/*");
httppost.setEntity(new StringEntity("{\"gremlin\":\"1-1\"}", Consts.UTF_8));
@@ -776,7 +776,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnPOSTWithComplexAcceptHeaderDefaultResultToJson() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "*.*;q=0.8,application/xhtml");
httppost.addHeader("Accept", "*/*");
httppost.setEntity(new StringEntity("{\"gremlin\":\"1-1\"}", Consts.UTF_8));
@@ -793,7 +793,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should500OnGETWithGremlinEvalFailure() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
httppost.setEntity(new StringEntity("{\"gremlin\":\"1/0\"}", Consts.UTF_8));
[2/7] tinkerpop git commit: TINKERPOP-1538 Use non-default port for
gremlin server tests
Posted by sp...@apache.org.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
index 15db36d..7240509 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
@@ -40,7 +40,6 @@ import org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteTraversalSideEffec
import org.apache.tinkerpop.gremlin.driver.ser.Serializers;
import org.apache.tinkerpop.gremlin.driver.simple.NioClient;
import org.apache.tinkerpop.gremlin.driver.simple.SimpleClient;
-import org.apache.tinkerpop.gremlin.driver.simple.WebSocketClient;
import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine;
import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.CompileStaticCustomizerProvider;
import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.ConfigurationCustomizerProvider;
@@ -163,7 +162,10 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
settings.ssl.overrideSslContext(createServerSslContext());
break;
case "shouldStartWithDefaultSettings":
- return new Settings();
+ // test with defaults exception for port because we want to keep testing off of 8182
+ final Settings defaultSettings = new Settings();
+ defaultSettings.port = TestClientFactory.PORT;
+ return settings;
case "shouldUseSimpleSandbox":
settings.scriptEngines.get("gremlin-groovy").config = getScriptEngineConfForSimpleSandbox();
break;
@@ -237,7 +239,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldUseBaseScript() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect(name.getMethodName());
assertEquals("hello, stephen", client.submit("hello('stephen')").all().get().get(0).getString());
@@ -247,7 +249,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldUseInterpreterMode() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect(name.getMethodName());
client.submit("def subtractAway(x,y){x-y};[]").all().get();
@@ -269,7 +271,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldNotUseInterpreterMode() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect(name.getMethodName());
client.submit("def subtractAway(x,y){x-y};[]").all().get();
@@ -291,7 +293,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldUseSimpleSandbox() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
assertEquals(2, client.submit("1+1").all().get().get(0).getInt());
@@ -311,7 +313,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
public void shouldStartWithDefaultSettings() {
// just quickly validate that results are returning given defaults. no graphs are config'd with defaults
// so just eval a groovy script.
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
final ResultSet results = client.submit("[1,2,3,4,5,6,7,8,9]");
@@ -323,7 +325,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldEnableSsl() {
- final Cluster cluster = Cluster.build().enableSsl(true).create();
+ final Cluster cluster = TestClientFactory.build().enableSsl(true).create();
final Client client = cluster.connect();
try {
@@ -341,7 +343,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
builder.trustManager(InsecureTrustManagerFactory.INSTANCE);
builder.sslProvider(SslProvider.JDK);
- final Cluster cluster = Cluster.build().enableSsl(true).sslContext(builder.build()).create();
+ final Cluster cluster = TestClientFactory.build().enableSsl(true).sslContext(builder.build()).create();
final Client client = cluster.connect();
try {
@@ -354,7 +356,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldEnableSslButFailIfClientConnectsWithoutIt() {
- final Cluster cluster = Cluster.build().enableSsl(false).create();
+ final Cluster cluster = TestClientFactory.build().enableSsl(false).create();
final Client client = cluster.connect();
try {
@@ -376,7 +378,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
assumeThat("Set the 'assertNonDeterministic' property to true to execute this test",
System.getProperty("assertNonDeterministic"), is("true"));
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
try {
@@ -422,7 +424,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldReturnInvalidRequestArgsWhenGremlinArgIsNotSupplied() throws Exception {
- try (SimpleClient client = new WebSocketClient()) {
+ try (SimpleClient client = TestClientFactory.createWebSocketClient()) {
final RequestMessage request = RequestMessage.build(Tokens.OPS_EVAL).create();
final ResponseMessage result = client.submit(request).get(0);
assertThat(result.getStatus().getCode(), is(not(ResponseStatusCode.PARTIAL_CONTENT)));
@@ -432,7 +434,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldReturnInvalidRequestArgsWhenInvalidReservedBindingKeyIsUsed() throws Exception {
- try (SimpleClient client = new WebSocketClient()) {
+ try (SimpleClient client = TestClientFactory.createWebSocketClient()) {
final Map<String, Object> bindings = new HashMap<>();
bindings.put(T.id.getAccessor(), "123");
final RequestMessage request = RequestMessage.build(Tokens.OPS_EVAL)
@@ -452,7 +454,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
assertThat(pass.get(), is(true));
}
- try (SimpleClient client = new WebSocketClient()) {
+ try (SimpleClient client = TestClientFactory.createWebSocketClient()) {
final Map<String, Object> bindings = new HashMap<>();
bindings.put("id", "123");
final RequestMessage request = RequestMessage.build(Tokens.OPS_EVAL)
@@ -475,7 +477,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldReturnInvalidRequestArgsWhenInvalidTypeBindingKeyIsUsed() throws Exception {
- try (SimpleClient client = new WebSocketClient()) {
+ try (SimpleClient client = TestClientFactory.createWebSocketClient()) {
final Map<Object, Object> bindings = new HashMap<>();
bindings.put(1, "123");
final RequestMessage request = RequestMessage.build(Tokens.OPS_EVAL)
@@ -498,7 +500,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldReturnInvalidRequestArgsWhenInvalidNullBindingKeyIsUsed() throws Exception {
- try (SimpleClient client = new WebSocketClient()) {
+ try (SimpleClient client = TestClientFactory.createWebSocketClient()) {
final Map<String, Object> bindings = new HashMap<>();
bindings.put(null, "123");
final RequestMessage request = RequestMessage.build(Tokens.OPS_EVAL)
@@ -522,7 +524,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
@SuppressWarnings("unchecked")
public void shouldBatchResultsByTwos() throws Exception {
- try (SimpleClient client = new WebSocketClient()) {
+ try (SimpleClient client = TestClientFactory.createWebSocketClient()) {
final RequestMessage request = RequestMessage.build(Tokens.OPS_EVAL)
.addArg(Tokens.ARGS_GREMLIN, "[0,1,2,3,4,5,6,7,8,9]").create();
@@ -544,7 +546,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
@SuppressWarnings("unchecked")
public void shouldBatchResultsByOnesByOverridingFromClientSide() throws Exception {
- try (SimpleClient client = new WebSocketClient()) {
+ try (SimpleClient client = TestClientFactory.createWebSocketClient()) {
final RequestMessage request = RequestMessage.build(Tokens.OPS_EVAL)
.addArg(Tokens.ARGS_GREMLIN, "[0,1,2,3,4,5,6,7,8,9]")
.addArg(Tokens.ARGS_BATCH_SIZE, 1).create();
@@ -558,7 +560,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
@SuppressWarnings("unchecked")
public void shouldWorkOverNioTransport() throws Exception {
- try (SimpleClient client = new NioClient()) {
+ try (SimpleClient client = TestClientFactory.createNioClient()) {
final RequestMessage request = RequestMessage.build(Tokens.OPS_EVAL)
.addArg(Tokens.ARGS_GREMLIN, "[0,1,2,3,4,5,6,7,8,9,]").create();
@@ -571,7 +573,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldNotThrowNoSuchElementException() throws Exception {
- try (SimpleClient client = new WebSocketClient()){
+ try (SimpleClient client = TestClientFactory.createWebSocketClient()){
// this should return "nothing" - there should be no exception
final List<ResponseMessage> responses = client.submit("g.V().has('name','kadfjaldjfla')");
assertNull(responses.get(0).getResult().getData());
@@ -581,7 +583,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
@SuppressWarnings("unchecked")
public void shouldReceiveFailureTimeOutOnScriptEval() throws Exception {
- try (SimpleClient client = new WebSocketClient()){
+ try (SimpleClient client = TestClientFactory.createWebSocketClient()){
final List<ResponseMessage> responses = client.submit("Thread.sleep(3000);'some-stuff-that-should not return'");
assertThat(responses.get(0).getStatus().getMessage(), startsWith("Script evaluation exceeded the configured 'scriptEvaluationTimeout' threshold of 200 ms"));
@@ -593,7 +595,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
@SuppressWarnings("unchecked")
public void shouldReceiveFailureTimeOutOnScriptEvalUsingOverride() throws Exception {
- try (SimpleClient client = new WebSocketClient()) {
+ try (SimpleClient client = TestClientFactory.createWebSocketClient()) {
final RequestMessage msg = RequestMessage.build("eval")
.addArg(Tokens.ARGS_SCRIPT_EVAL_TIMEOUT, 100)
.addArg(Tokens.ARGS_GREMLIN, "Thread.sleep(3000);'some-stuff-that-should not return'")
@@ -608,7 +610,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldReceiveFailureTimeOutOnScriptEvalOfOutOfControlLoop() throws Exception {
- try (SimpleClient client = new WebSocketClient()){
+ try (SimpleClient client = TestClientFactory.createWebSocketClient()){
// timeout configured for 1 second so the timed interrupt should trigger prior to the
// scriptEvaluationTimeout which is at 30 seconds by default
final List<ResponseMessage> responses = client.submit("while(true){}");
@@ -626,7 +628,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@SuppressWarnings("unchecked")
@Deprecated
public void shouldReceiveFailureTimeOutOnTotalSerialization() throws Exception {
- try (SimpleClient client = new WebSocketClient()){
+ try (SimpleClient client = TestClientFactory.createWebSocketClient()){
final List<ResponseMessage> responses = client.submit("(0..<100000)");
// the last message should contain the error
@@ -640,14 +642,14 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
@SuppressWarnings("unchecked")
public void shouldLoadInitScript() throws Exception {
- try (SimpleClient client = new WebSocketClient()){
+ try (SimpleClient client = TestClientFactory.createWebSocketClient()){
assertEquals(2, ((List<Integer>) client.submit("addItUp(1,1)").get(0).getResult().getData()).get(0).intValue());
}
}
@Test
public void shouldGarbageCollectPhantomButNotHard() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
assertEquals(2, client.submit("addItUp(1,1)").all().join().get(0).getInt());
@@ -670,7 +672,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldReceiveFailureOnBadGraphSONSerialization() throws Exception {
- final Cluster cluster = Cluster.build("localhost").serializer(Serializers.GRAPHSON_V1D0).create();
+ final Cluster cluster = TestClientFactory.build().serializer(Serializers.GRAPHSON_V1D0).create();
final Client client = cluster.connect();
try {
@@ -689,7 +691,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldReceiveFailureOnBadGryoSerialization() throws Exception {
- final Cluster cluster = Cluster.build("localhost").serializer(Serializers.GRYO_V1D0).create();
+ final Cluster cluster = TestClientFactory.build().serializer(Serializers.GRYO_V1D0).create();
final Client client = cluster.connect();
try {
@@ -709,7 +711,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
@Test
public void shouldBlockRequestWhenTooBig() throws Exception {
- final Cluster cluster = Cluster.open();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
try {
@@ -736,7 +738,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldFailOnDeadHost() throws Exception {
- final Cluster cluster = Cluster.build("localhost").create();
+ final Cluster cluster = TestClientFactory.build().create();
final Client client = cluster.connect();
// ensure that connection to server is good
@@ -772,7 +774,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldNotHavePartialContentWithOneResult() throws Exception {
- try (SimpleClient client = new WebSocketClient()) {
+ try (SimpleClient client = TestClientFactory.createWebSocketClient()) {
final RequestMessage request = RequestMessage.build(Tokens.OPS_EVAL)
.addArg(Tokens.ARGS_GREMLIN, "10").create();
final List<ResponseMessage> responses = client.submit(request);
@@ -783,7 +785,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldFailWithBadScriptEval() throws Exception {
- try (SimpleClient client = new WebSocketClient()) {
+ try (SimpleClient client = TestClientFactory.createWebSocketClient()) {
final RequestMessage request = RequestMessage.build(Tokens.OPS_EVAL)
.addArg(Tokens.ARGS_GREMLIN, "new String().doNothingAtAllBecauseThis is a syntax error").create();
final List<ResponseMessage> responses = client.submit(request);
@@ -796,7 +798,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
@SuppressWarnings("unchecked")
public void shouldStillSupportDeprecatedRebindingsParameterOnServer() throws Exception {
// this test can be removed when the rebindings arg is removed
- try (SimpleClient client = new WebSocketClient()) {
+ try (SimpleClient client = TestClientFactory.createWebSocketClient()) {
final Map<String,String> rebindings = new HashMap<>();
rebindings.put("xyz", "graph");
final RequestMessage request = RequestMessage.build(Tokens.OPS_EVAL)
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
index cc0cb68..4042b28 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
@@ -31,7 +31,6 @@ import org.apache.tinkerpop.gremlin.driver.message.RequestMessage;
import org.apache.tinkerpop.gremlin.driver.message.ResponseMessage;
import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode;
import org.apache.tinkerpop.gremlin.driver.simple.SimpleClient;
-import org.apache.tinkerpop.gremlin.driver.simple.WebSocketClient;
import org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor;
import org.apache.tinkerpop.gremlin.util.Log4jRecordingAppender;
import org.junit.After;
@@ -125,10 +124,10 @@ public class GremlinServerSessionIntegrateTest extends AbstractGremlinServerInt
// basically, we need one to submit the long run job and one to do the close operation that will cancel the
// long run job. it is probably possible to do this with some low-level message manipulation but that's
// probably not necessary
- final Cluster cluster1 = Cluster.build().create();
+ final Cluster cluster1 = TestClientFactory.open();
final Client client1 = cluster1.connect(name.getMethodName());
client1.submit("graph.addVertex()").all().join();
- final Cluster cluster2 = Cluster.build().create();
+ final Cluster cluster2 = TestClientFactory.open()
final Client client2 = cluster2.connect(name.getMethodName());
client2.submit("1+1").all().join();
@@ -194,7 +193,7 @@ public class GremlinServerSessionIntegrateTest extends AbstractGremlinServerInt
public void shouldRollbackOnEvalExceptionForManagedTransaction() throws Exception {
assumeNeo4jIsPresent();
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect(name.getMethodName(), true);
try {
@@ -215,7 +214,7 @@ public class GremlinServerSessionIntegrateTest extends AbstractGremlinServerInt
@Test
public void shouldCloseSessionOnceOnRequest() throws Exception {
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect(name.getMethodName());
final ResultSet results1 = client.submit("x = [1,2,3,4,5,6,7,8,9]");
@@ -249,7 +248,7 @@ public class GremlinServerSessionIntegrateTest extends AbstractGremlinServerInt
@Test
public void shouldHaveTheSessionTimeout() throws Exception {
- final Cluster cluster = Cluster.build().create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect(name.getMethodName());
final ResultSet results1 = client.submit("x = [1,2,3,4,5,6,7,8,9]");
@@ -285,7 +284,7 @@ public class GremlinServerSessionIntegrateTest extends AbstractGremlinServerInt
@Test
public void shouldEnsureSessionBindingsAreThreadSafe() throws Exception {
- final Cluster cluster = Cluster.build().minInProcessPerConnection(16).maxInProcessPerConnection(64).create();
+ final Cluster cluster = TestClientFactory.build().minInProcessPerConnection(16).maxInProcessPerConnection(64).create();
final Client client = cluster.connect(name.getMethodName());
client.submitAsync("a=100;b=1000;c=10000;null");
@@ -318,7 +317,7 @@ public class GremlinServerSessionIntegrateTest extends AbstractGremlinServerInt
public void shouldExecuteInSessionAndSessionlessWithoutOpeningTransactionWithSingleClient() throws Exception {
assumeNeo4jIsPresent();
- try (final SimpleClient client = new WebSocketClient()) {
+ try (final SimpleClient client = TestClientFactory.createWebSocketClient()) {
//open a transaction, create a vertex, commit
final RequestMessage openRequest = RequestMessage.build(Tokens.OPS_EVAL)
@@ -385,7 +384,7 @@ public class GremlinServerSessionIntegrateTest extends AbstractGremlinServerInt
public void shouldExecuteInSessionWithTransactionManagement() throws Exception {
assumeNeo4jIsPresent();
- try (final SimpleClient client = new WebSocketClient()) {
+ try (final SimpleClient client = TestClientFactory.createWebSocketClient()) {
final RequestMessage addRequest = RequestMessage.build(Tokens.OPS_EVAL)
.processor("session")
.addArg(Tokens.ARGS_SESSION, name.getMethodName())
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinTraversalPerformanceTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinTraversalPerformanceTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinTraversalPerformanceTest.java
index 9a80edd..26421f6 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinTraversalPerformanceTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinTraversalPerformanceTest.java
@@ -58,7 +58,7 @@ public class GremlinTraversalPerformanceTest extends AbstractGremlinServerPerfor
public final static int DEFAULT_CONCURRENT_BENCHMARK_ROUNDS = 500;
public final static int DEFAULT_CONCURRENT_WARMUP_ROUNDS = 10;
- private final static Cluster cluster = Cluster.build("localhost").maxConnectionPoolSize(32).maxWaitForConnection(30000).create();
+ private final static Cluster cluster = TestClientFactory.build().maxConnectionPoolSize(32).maxWaitForConnection(30000).create();
private final static AtomicReference<Client> client = new AtomicReference<>();
@Rule
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/TestClientFactory.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/TestClientFactory.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/TestClientFactory.java
new file mode 100644
index 0000000..bfbb40b
--- /dev/null
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/TestClientFactory.java
@@ -0,0 +1,60 @@
+/*
+ * 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.tinkerpop.gremlin.server;
+
+import org.apache.tinkerpop.gremlin.driver.Cluster;
+import org.apache.tinkerpop.gremlin.driver.simple.NioClient;
+import org.apache.tinkerpop.gremlin.driver.simple.WebSocketClient;
+
+import java.net.URI;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public final class TestClientFactory {
+
+ public static final int PORT = 45940;
+ public static final URI WEBSOCKET_URI = URI.create("ws://localhost:" + PORT);
+ public static final URI NIO_URI = URI.create("gs://localhost:" + PORT);
+ public static final String HTTP = "http://localhost:" + PORT;
+
+ public static Cluster.Builder build() {
+ return Cluster.build("localhost").port(45940);
+ }
+
+ public static Cluster open() {
+ return build().create();
+ }
+
+ public static WebSocketClient createWebSocketClient() {
+ return new WebSocketClient(WEBSOCKET_URI);
+ }
+
+ public static NioClient createNioClient() {
+ return new NioClient(NIO_URI);
+ }
+
+ public static String createURLString() {
+ return createURLString("");
+ }
+
+ public static String createURLString(final String suffix) {
+ return HTTP + suffix;
+ }
+}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
index 3d5c154..d0f7b32 100644
--- a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
+++ b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
@@ -16,7 +16,7 @@
# under the License.
host: localhost
-port: 8182
+port: 45940
scriptEvaluationTimeout: 30000
graphs: {
graph: conf/tinkergraph-empty.properties}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-performance.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-performance.yaml b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-performance.yaml
index db36aed..cda4f19 100644
--- a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-performance.yaml
+++ b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-performance.yaml
@@ -16,7 +16,7 @@
# under the License.
host: localhost
-port: 8182
+port: 45940
scriptEvaluationTimeout: 30000
graphs: {
graph: conf/tinkergraph-empty.properties}
[5/7] tinkerpop git commit: TINKERPOP-1538 Fixed up test logic after
merge.
Posted by sp...@apache.org.
TINKERPOP-1538 Fixed up test logic after merge.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b803dce9
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b803dce9
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b803dce9
Branch: refs/heads/master
Commit: b803dce99bc31339410d3b60857d3364cb788d7a
Parents: 18781cd
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Nov 14 18:50:59 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Nov 14 18:50:59 2016 -0500
----------------------------------------------------------------------
.../tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java | 2 +-
.../gremlin/server/GremlinServerSessionIntegrateTest.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b803dce9/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
index d51ff8d..a8164b5 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
@@ -178,7 +178,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
public void shouldKeepAliveForWebSockets() throws Exception {
// keep the connection pool size at 1 to remove the possibility of lots of connections trying to ping which will
// complicate the assertion logic
- final Cluster cluster = Cluster.build().
+ final Cluster cluster = TestClientFactory.build().
minConnectionPoolSize(1).
maxConnectionPoolSize(1).
keepAliveInterval(1000).create();
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b803dce9/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
index 434bda8..6b89f53 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
@@ -127,7 +127,7 @@ public class GremlinServerSessionIntegrateTest extends AbstractGremlinServerInt
final Cluster cluster1 = TestClientFactory.open();
final Client client1 = cluster1.connect(name.getMethodName());
client1.submit("graph.addVertex()").all().join();
- final Cluster cluster2 = TestClientFactory.open()
+ final Cluster cluster2 = TestClientFactory.open();
final Client client2 = cluster2.connect(name.getMethodName());
client2.submit("1+1").all().join();
[4/7] tinkerpop git commit: TINKERPOP-1538 Fixed handling of
pass-thru configs for DriverRemoteConnection
Posted by sp...@apache.org.
TINKERPOP-1538 Fixed handling of pass-thru configs for DriverRemoteConnection
Used non-standard port for tests.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/70570bdd
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/70570bdd
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/70570bdd
Branch: refs/heads/master
Commit: 70570bdd746c2b2498adf1686a9358ffc401c9b0
Parents: 83ac683
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Sun Nov 13 19:40:19 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Nov 14 18:49:28 2016 -0500
----------------------------------------------------------------------
CHANGELOG.asciidoc | 1 +
.../gremlin/driver/remote/DriverRemoteConnection.java | 6 ++++--
gremlin-python/pom.xml | 7 ++++---
.../tests/driver/test_driver_remote_connection.py | 12 ++++++------
.../python/driver/gremlin-server-modern-secure-py.yaml | 4 +---
.../gremlin/driver/remote/RemoteGraphProvider.java | 5 ++++-
.../gremlin/server/GremlinResultSetIntegrateTest.java | 2 +-
.../gremlin/server/GremlinServerHttpIntegrateTest.java | 2 +-
.../gremlin/server/GremlinServerIntegrateTest.java | 6 +++---
.../server/GremlinServerSessionIntegrateTest.java | 5 ++---
.../tinkerpop/gremlin/server/TestClientFactory.java | 2 +-
.../driver/remote/gremlin-server-integration.yaml | 2 +-
12 files changed, 29 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/70570bdd/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 7041489..3d963c9 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -41,6 +41,7 @@ TinkerPop 3.2.4 (Release Date: NOT OFFICIALLY RELEASED YET)
* Added `choose(predicate,traversal)` and `choose(traversal,traversal)` to effect if/then-semantics (no else). Equivalent to `choose(x,y,identity())`.
* Removed `ImmutablePath.TailPath` as it is no longer required with new recursion model.
* Removed call stack recursion in `ImmutablePath`.
+* Fixed the handling of the `DriverRemoteConnection` pass-through configurations to the driver.
* `IncidentToAdjacentStrategy` now uses a hidden label marker model to avoid repeated recursion for invalidating steps.
* `PathProcessorStrategy` can inline certain `where(traversal)`-steps in order to increase the likelihood of star-local children.
* `SparkGraphComputer` no longer starts a worker iteration if the worker's partition is empty.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/70570bdd/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteConnection.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteConnection.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteConnection.java
index c1eba34..bb2d33d 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteConnection.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteConnection.java
@@ -33,6 +33,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
import java.util.Iterator;
import java.util.Optional;
@@ -59,14 +60,15 @@ public class DriverRemoteConnection implements RemoteConnection {
private static final boolean attachElements = Boolean.valueOf(System.getProperty("is.testing", "false"));
public DriverRemoteConnection(final Configuration conf) {
- if (conf.containsKey(GREMLIN_REMOTE_DRIVER_CLUSTERFILE) && conf.containsKey("clusterConfiguration"))
+ final boolean hasClusterConf = IteratorUtils.anyMatch(conf.getKeys(), k -> k.startsWith("clusterConfiguration"));
+ if (conf.containsKey(GREMLIN_REMOTE_DRIVER_CLUSTERFILE) && hasClusterConf)
throw new IllegalStateException(String.format("A configuration should not contain both '%s' and 'clusterConfiguration'", GREMLIN_REMOTE_DRIVER_CLUSTERFILE));
remoteTraversalSourceName = conf.getString(GREMLIN_REMOTE_DRIVER_SOURCENAME, DEFAULT_TRAVERSAL_SOURCE);
try {
final Cluster cluster;
- if (!conf.containsKey(GREMLIN_REMOTE_DRIVER_CLUSTERFILE) && !conf.containsKey("clusterConfiguration"))
+ if (!conf.containsKey(GREMLIN_REMOTE_DRIVER_CLUSTERFILE) && !hasClusterConf)
cluster = Cluster.open();
else
cluster = conf.containsKey(GREMLIN_REMOTE_DRIVER_CLUSTERFILE) ?
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/70570bdd/gremlin-python/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml
index 923380d..aa7d088 100644
--- a/gremlin-python/pom.xml
+++ b/gremlin-python/pom.xml
@@ -488,17 +488,18 @@ log.info("Starting Gremlin Server instances for native testing of gremlin-python
def settings = Settings.read("${gremlin.server.dir}/conf/gremlin-server-modern-py.yaml")
settings.graphs.graph = "${gremlin.server.dir}/conf/tinkergraph-empty.properties"
settings.scriptEngines["gremlin-groovy"].scripts = ["${gremlin.server.dir}/scripts/generate-modern.groovy"]
+settings.port = 45940
def server = new GremlinServer(settings)
server.start().join()
project.setContextValue("gremlin.py.server", server)
-log.info("Gremlin Server with no authentication started on port 8182")
+log.info("Gremlin Server with no authentication started on port 45940")
def settingsSecure = Settings.read("${gremlin.server.dir}/conf/gremlin-server-modern-py.yaml")
settingsSecure.graphs.graph = "${gremlin.server.dir}/conf/tinkergraph-empty.properties"
settingsSecure.scriptEngines["gremlin-groovy"].scripts = ["${gremlin.server.dir}/scripts/generate-modern.groovy"]
-settingsSecure.port = 8183
+settingsSecure.port = 45941
settingsSecure.authentication.className = "org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator"
settingsSecure.authentication.config = [credentialsDb: "${gremlin.server.dir}/conf/tinkergraph-credentials.properties"]
@@ -506,7 +507,7 @@ def serverSecure = new GremlinServer(settingsSecure)
serverSecure.start().join()
project.setContextValue("gremlin.py.server.secure", serverSecure)
-log.info("Gremlin Server with authentication started on port 8183")
+log.info("Gremlin Server with authentication started on port 45941")
]]>
</script>
</scripts>
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/70570bdd/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
index 6921837..9f3e466 100644
--- a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
+++ b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
@@ -38,8 +38,8 @@ from gremlin_python.process.strategies import SubgraphStrategy
class TestDriverRemoteConnection(TestCase):
def test_traversals(self):
statics.load_statics(globals())
- connection = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g')
- assert "remoteconnection[ws://localhost:8182/gremlin,g]" == str(connection)
+ connection = DriverRemoteConnection('ws://localhost:45940/gremlin', 'g')
+ assert "remoteconnection[ws://localhost:45940/gremlin,g]" == str(connection)
g = Graph().traversal().withRemote(connection)
assert long(6) == g.V().count().toList()[0]
@@ -66,7 +66,7 @@ class TestDriverRemoteConnection(TestCase):
def test_strategies(self):
statics.load_statics(globals())
- connection = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g')
+ connection = DriverRemoteConnection('ws://localhost:45940/gremlin', 'g')
#
g = Graph().traversal().withRemote(connection). \
withStrategies(TraversalStrategy("SubgraphStrategy",
@@ -98,7 +98,7 @@ class TestDriverRemoteConnection(TestCase):
def test_side_effects(self):
statics.load_statics(globals())
- connection = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g')
+ connection = DriverRemoteConnection('ws://localhost:45940/gremlin', 'g')
#
g = Graph().traversal().withRemote(connection)
###
@@ -155,7 +155,7 @@ class TestDriverRemoteConnection(TestCase):
connection.close()
def test_side_effect_close(self):
- connection = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g')
+ connection = DriverRemoteConnection('ws://localhost:45940/gremlin', 'g')
g = Graph().traversal().withRemote(connection)
t = g.V().aggregate('a').aggregate('b')
t.toList()
@@ -192,7 +192,7 @@ class TestDriverRemoteConnection(TestCase):
if __name__ == '__main__':
test = False
try:
- connection = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g')
+ connection = DriverRemoteConnection('ws://localhost:45940/gremlin', 'g')
test = True
connection.close()
except:
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/70570bdd/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml
----------------------------------------------------------------------
diff --git a/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml b/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml
index a1b28a9..a5b3480 100644
--- a/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml
+++ b/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml
@@ -26,9 +26,7 @@
# is the addition of "gremlin-jython" to the "scriptEngines" field.
host: localhost
-port: 8182
-threadPoolWorker: 1
-gremlinPool: 8
+port: 45940
scriptEvaluationTimeout: 30000
graphs: {
graph: src/test/resources/org/apache/tinkerpop/gremlin/python/driver/tinkergraph-empty.properties}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/70570bdd/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteGraphProvider.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteGraphProvider.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteGraphProvider.java
index f071671..a19ecc8 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteGraphProvider.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteGraphProvider.java
@@ -29,6 +29,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo
import org.apache.tinkerpop.gremlin.server.GremlinServer;
import org.apache.tinkerpop.gremlin.server.ServerTestHelper;
import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.server.TestClientFactory;
import org.apache.tinkerpop.gremlin.structure.Graph;
import java.io.InputStream;
@@ -49,7 +50,7 @@ public class RemoteGraphProvider extends AbstractGraphProvider implements AutoCl
private static GremlinServer server;
private final Map<String, RemoteGraph> remoteCache = new HashMap<>();
- private final Cluster cluster = Cluster.open();
+ private final Cluster cluster = TestClientFactory.open();
//private final Cluster cluster = Cluster.build().maxContentLength(1024000).serializer(Serializers.GRAPHSON_V2D0).create();
private final Client client = cluster.connect();
@@ -87,6 +88,8 @@ public class RemoteGraphProvider extends AbstractGraphProvider implements AutoCl
put(Graph.GRAPH, RemoteGraph.class.getName());
put(RemoteGraph.GREMLIN_REMOTE_GRAPH_REMOTE_CONNECTION_CLASS, DriverRemoteConnection.class.getName());
put(DriverRemoteConnection.GREMLIN_REMOTE_DRIVER_SOURCENAME, "g" + serverGraphName);
+ put("clusterConfiguration.port", TestClientFactory.PORT);
+ put("clusterConfiguration.hosts", "localhost");
put("hidden.for.testing.only", graphGetter);
}};
}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/70570bdd/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinResultSetIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinResultSetIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinResultSetIntegrateTest.java
index 9916f73..ec39dec 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinResultSetIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinResultSetIntegrateTest.java
@@ -141,7 +141,7 @@ public class GremlinResultSetIntegrateTest extends AbstractGremlinServerIntegrat
@Test
public void shouldHandleVertexResultWithLiteSerialization() throws Exception {
- final Cluster cluster = Cluster.build().serializer(Serializers.GRYO_LITE_V1D0).create();
+ final Cluster cluster = TestClientFactory.build().serializer(Serializers.GRYO_LITE_V1D0).create();
final Client clientLite = cluster.connect();
final ResultSet results = clientLite.submit("g.V(1).next()");
final Vertex v = results.all().get().get(0).getVertex();
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/70570bdd/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
index cefe0df..78109e6 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
@@ -805,7 +805,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
@Test
public void should200OnPOSTWithGraphSON2d0AcceptHeaderDefaultResultToJson() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpPost httppost = new HttpPost("http://localhost:8182");
+ final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.setEntity(new StringEntity("{\"gremlin\":\"1-1\"}", Consts.UTF_8));
try (final CloseableHttpResponse response = httpclient.execute(httppost)) {
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/70570bdd/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
index 7240509..b3dbe29 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
@@ -38,7 +38,6 @@ import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode;
import org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteConnection;
import org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteTraversalSideEffects;
import org.apache.tinkerpop.gremlin.driver.ser.Serializers;
-import org.apache.tinkerpop.gremlin.driver.simple.NioClient;
import org.apache.tinkerpop.gremlin.driver.simple.SimpleClient;
import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine;
import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.CompileStaticCustomizerProvider;
@@ -59,7 +58,6 @@ import org.apache.tinkerpop.gremlin.util.Log4jRecordingAppender;
import org.apache.tinkerpop.gremlin.util.function.Lambda;
import org.hamcrest.CoreMatchers;
import org.junit.After;
-import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -110,6 +108,8 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
setProperty(GREMLIN_REMOTE_CONNECTION_CLASS, DriverRemoteConnection.class.getName());
setProperty(DriverRemoteConnection.GREMLIN_REMOTE_DRIVER_SOURCENAME, "g");
setProperty("hidden.for.testing.only", graphGetter);
+ setProperty("clusterConfiguration.port", TestClientFactory.PORT);
+ setProperty("clusterConfiguration.hosts", "localhost");
}};
@Before
@@ -883,7 +883,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
assertThat(localSideEffects.isEmpty(), is(false));
// Try to get side effect from server
- final Cluster cluster = Cluster.build("localhost").create();
+ final Cluster cluster = TestClientFactory.open();
final Client client = cluster.connect();
final Field field = DriverRemoteTraversalSideEffects.class.getDeclaredField("serverSideEffect");
field.setAccessible(true);
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/70570bdd/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
index 4042b28..434bda8 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
@@ -157,10 +157,10 @@ public class GremlinServerSessionIntegrateTest extends AbstractGremlinServerInt
// basically, we need one to submit the long run job and one to do the close operation that will cancel the
// long run job. it is probably possible to do this with some low-level message manipulation but that's
// probably not necessary
- final Cluster cluster1 = Cluster.build().create();
+ final Cluster cluster1 = TestClientFactory.open();
final Client client1 = cluster1.connect(name.getMethodName());
client1.submit("graph.addVertex()").all().join();
- final Cluster cluster2 = Cluster.build().create();
+ final Cluster cluster2 = TestClientFactory.open();
final Client.SessionSettings sessionSettings = Client.SessionSettings.build()
.sessionId(name.getMethodName())
.forceClosed(true).create();
@@ -188,7 +188,6 @@ public class GremlinServerSessionIntegrateTest extends AbstractGremlinServerInt
cluster2.close();
}
-
@Test
public void shouldRollbackOnEvalExceptionForManagedTransaction() throws Exception {
assumeNeo4jIsPresent();
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/70570bdd/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/TestClientFactory.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/TestClientFactory.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/TestClientFactory.java
index bfbb40b..a2ee492 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/TestClientFactory.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/TestClientFactory.java
@@ -30,7 +30,7 @@ import java.net.URI;
public final class TestClientFactory {
public static final int PORT = 45940;
- public static final URI WEBSOCKET_URI = URI.create("ws://localhost:" + PORT);
+ public static final URI WEBSOCKET_URI = URI.create("ws://localhost:" + PORT + "/gremlin");
public static final URI NIO_URI = URI.create("gs://localhost:" + PORT);
public static final String HTTP = "http://localhost:" + PORT;
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/70570bdd/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml
index 552b2ea..a25c6b1 100644
--- a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml
+++ b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml
@@ -16,7 +16,7 @@
# under the License.
host: localhost
-port: 8182
+port: 45940
scriptEvaluationTimeout: 30000
graphs: {
graph: conf/tinkergraph-empty.properties,
[7/7] tinkerpop git commit: Merge branch 'TINKERPOP-1538-master'
Posted by sp...@apache.org.
Merge branch 'TINKERPOP-1538-master'
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/ae11314c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ae11314c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ae11314c
Branch: refs/heads/master
Commit: ae11314c87dca8850756913e8122c52bcf941779
Parents: 4166e7c 76b8fbf
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Nov 15 09:35:07 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Nov 15 09:35:07 2016 -0500
----------------------------------------------------------------------
CHANGELOG.asciidoc | 2 +
.../src/main/java/Service.java | 2 +-
.../src/test/java/ServiceTest.java | 2 +-
.../src/test/resources/gremlin-server.yaml | 2 +-
.../plugin/gremlin-server-integration.yaml | 2 +-
.../gremlin/console/groovy/plugin/remote.yaml | 2 +-
.../driver/remote/DriverRemoteConnection.java | 6 +-
gremlin-python/pom.xml | 7 +-
.../driver/test_driver_remote_connection.py | 12 +--
.../driver/gremlin-server-modern-secure-py.yaml | 4 +-
.../driver/remote/RemoteGraphProvider.java | 5 +-
.../server/GremlinDriverIntegrateTest.java | 98 ++++++++++----------
.../server/GremlinResultSetIntegrateTest.java | 4 +-
.../server/GremlinServerAuthIntegrateTest.java | 24 +++--
.../GremlinServerAuthOldIntegrateTest.java | 25 ++---
.../server/GremlinServerHttpIntegrateTest.java | 94 +++++++++----------
.../server/GremlinServerIntegrateTest.java | 74 ++++++++-------
.../GremlinServerSessionIntegrateTest.java | 22 ++---
.../gremlin/server/TestClientFactory.java | 60 ++++++++++++
.../remote/gremlin-server-integration.yaml | 2 +-
.../server/gremlin-server-integration.yaml | 2 +-
.../server/gremlin-server-performance.yaml | 2 +-
22 files changed, 263 insertions(+), 190 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ae11314c/CHANGELOG.asciidoc
----------------------------------------------------------------------