You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2015/12/07 17:00:48 UTC
[10/18] incubator-tinkerpop git commit: Improved the ability to
control logging for maven builds.
Improved the ability to control logging for maven builds.
Added a "silent" configuration for the "ci" profile so that travis will be happy.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/2b2bf960
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/2b2bf960
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/2b2bf960
Branch: refs/heads/TINKERPOP3-1014
Commit: 2b2bf960f09e704244f91801116c081368fbdb11
Parents: 19beece
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Dec 4 09:08:00 2015 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Dec 4 09:08:00 2015 -0500
----------------------------------------------------------------------
CHANGELOG.asciidoc | 1 +
docs/src/dev/developer/contributing.asciidoc | 13 +-
giraph-gremlin/pom.xml | 18 +-
.../src/test/resources/log4j-silent.properties | 18 ++
.../src/test/resources/log4j-test.properties | 23 ++
gremlin-console/pom.xml | 6 +
.../src/test/resources/log4j-silent.properties | 18 ++
.../src/test/resources/log4j-test.properties | 21 ++
gremlin-core/pom.xml | 6 +
.../src/test/resources/log4j-silent.properties | 18 ++
.../src/test/resources/log4j-test.properties | 21 ++
.../src/test/resources/log4j-silent.properties | 18 ++
.../src/test/resources/log4j-test.properties | 21 ++
.../src/test/resources/log4j-silent.properties | 18 ++
.../src/test/resources/log4j-test.properties | 21 ++
.../GremlinServerAuthIntegrateOldTest.java | 235 -------------------
.../GremlinServerAuthOldIntegrateTest.java | 235 +++++++++++++++++++
.../src/test/resources/log4j-silent.properties | 18 ++
.../src/test/resources/log4j-test.properties | 21 ++
gremlin-test/pom.xml | 6 +
.../tinkerpop/gremlin/AbstractGremlinTest.java | 6 +
.../src/test/resources/log4j-silent.properties | 21 ++
.../src/test/resources/log4j-test.properties | 24 ++
hadoop-gremlin/pom.xml | 18 +-
.../groovy/plugin/HadoopGremlinPluginCheck.java | 176 ++++++++++++++
.../groovy/plugin/HadoopGremlinPluginTest.java | 173 --------------
.../hadoop/groovy/plugin/HadoopPluginSuite.java | 2 +-
.../src/test/resources/log4j-silent.properties | 18 ++
.../src/test/resources/log4j-test.properties | 21 ++
neo4j-gremlin/pom.xml | 6 +
.../src/test/resources/log4j-silent.properties | 18 ++
.../src/test/resources/log4j-test.properties | 21 ++
pom.xml | 47 ++--
spark-gremlin/pom.xml | 18 +-
.../src/test/resources/log4j-silent.properties | 18 ++
.../src/test/resources/log4j-test.properties | 25 ++
.../src/test/resources/log4j-silent.properties | 18 ++
.../src/test/resources/log4j-test.properties | 21 ++
38 files changed, 932 insertions(+), 475 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 717aa71..1fa03d5 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/incubator-tinkerpop/master/docs/
TinkerPop 3.1.1 (NOT OFFICIALLY RELEASED YET)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* Improved logging control during builds with Maven.
* `Column` now implements `Function` and now `by(valueDecr)` can be replaced with `by(values,decr)` and thus, projection and order are now separated.
* Added `InputRDDFormat` which wraps an `InputRDD` to make it accessible to Hadoop and not just Spark.
* Added `AbstractSparkTest` which handles closing `SparkContext` instances between tests now that we support persisted contexts.
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/docs/src/dev/developer/contributing.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/developer/contributing.asciidoc b/docs/src/dev/developer/contributing.asciidoc
index 70c78e2..959f4ef 100644
--- a/docs/src/dev/developer/contributing.asciidoc
+++ b/docs/src/dev/developer/contributing.asciidoc
@@ -401,4 +401,15 @@ the existing `<execution>` entries, paying special attention to the pathing of t
uploaded to the server and should preserve the directory structure in git as referenced in `<sourceDirectory>`.
Please see the <<building-testing,Building and Testing>> section for more information on how to generate the
-documentation.
\ No newline at end of file
+documentation.
+
+[[logging]]
+Logging
+~~~~~~~
+
+TinkerPop uses SLF4j for logging and typically leans back on Log4j as the implementation. Configuring log outputs
+for debugging purposes within tests can be altered by editing the `log4j-test.properties` file in each module's test
+resources. That file gets copied to the `target/test-classes` on build and surefire and failsafe plugins in maven
+are then configured to point at that area of the file system for those configuration files. The properties files
+can be edited to fine tune control of the log output, but generally speaking the current configuration is likely
+best for everyone's general purposes, so if changes are made please revert them prior to commit.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/giraph-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/giraph-gremlin/pom.xml b/giraph-gremlin/pom.xml
index 7a65788..ba037cf 100644
--- a/giraph-gremlin/pom.xml
+++ b/giraph-gremlin/pom.xml
@@ -203,6 +203,10 @@ limitations under the License.
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
<plugin>
@@ -240,20 +244,6 @@ limitations under the License.
</archive>
</configuration>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <!-- log4j.configuration>log4j-core.properties</log4j.configuration> -->
- <!--<argLine>-Xmx2048M</argLine>-->
- <excludes>
- <exclude>**/*IntegrateTest.java</exclude>
- <exclude>**/*PerformanceTest.java</exclude>
- <!-- this is technically a member of the integration test suite -->
- <exclude>**/HadoopGremlinPluginTest.java</exclude>
- </excludes>
- </configuration>
- </plugin>
</plugins>
</build>
</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/giraph-gremlin/src/test/resources/log4j-silent.properties
----------------------------------------------------------------------
diff --git a/giraph-gremlin/src/test/resources/log4j-silent.properties b/giraph-gremlin/src/test/resources/log4j-silent.properties
new file mode 100644
index 0000000..9c6148d
--- /dev/null
+++ b/giraph-gremlin/src/test/resources/log4j-silent.properties
@@ -0,0 +1,18 @@
+# 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.
+
+log4j.rootLogger=OFF
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/giraph-gremlin/src/test/resources/log4j-test.properties
----------------------------------------------------------------------
diff --git a/giraph-gremlin/src/test/resources/log4j-test.properties b/giraph-gremlin/src/test/resources/log4j-test.properties
new file mode 100644
index 0000000..a3e679c
--- /dev/null
+++ b/giraph-gremlin/src/test/resources/log4j-test.properties
@@ -0,0 +1,23 @@
+# 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.
+
+log4j.rootLogger=WARN, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%p] %C - %m%n
+
+log4j.logger.org.apache.hadoop=ERROR
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/gremlin-console/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-console/pom.xml b/gremlin-console/pom.xml
index dfa9415..419fd7e 100644
--- a/gremlin-console/pom.xml
+++ b/gremlin-console/pom.xml
@@ -144,6 +144,12 @@ limitations under the License.
</directory>
</resource>
</resources>
+ <testResources>
+ <testResource>
+ <directory>${basedir}/src/test/resources
+ </directory>
+ </testResource>
+ </testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/gremlin-console/src/test/resources/log4j-silent.properties
----------------------------------------------------------------------
diff --git a/gremlin-console/src/test/resources/log4j-silent.properties b/gremlin-console/src/test/resources/log4j-silent.properties
new file mode 100644
index 0000000..9c6148d
--- /dev/null
+++ b/gremlin-console/src/test/resources/log4j-silent.properties
@@ -0,0 +1,18 @@
+# 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.
+
+log4j.rootLogger=OFF
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/gremlin-console/src/test/resources/log4j-test.properties
----------------------------------------------------------------------
diff --git a/gremlin-console/src/test/resources/log4j-test.properties b/gremlin-console/src/test/resources/log4j-test.properties
new file mode 100644
index 0000000..ef436fe
--- /dev/null
+++ b/gremlin-console/src/test/resources/log4j-test.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+log4j.rootLogger=WARN, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%p] %C - %m%n
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/gremlin-core/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-core/pom.xml b/gremlin-core/pom.xml
index 77d826e..668830a 100644
--- a/gremlin-core/pom.xml
+++ b/gremlin-core/pom.xml
@@ -102,6 +102,12 @@ limitations under the License.
<build>
<directory>${basedir}/target</directory>
<finalName>${project.artifactId}-${project.version}</finalName>
+ <testResources>
+ <testResource>
+ <directory>${basedir}/src/test/resources
+ </directory>
+ </testResource>
+ </testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/gremlin-core/src/test/resources/log4j-silent.properties
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/resources/log4j-silent.properties b/gremlin-core/src/test/resources/log4j-silent.properties
new file mode 100644
index 0000000..9c6148d
--- /dev/null
+++ b/gremlin-core/src/test/resources/log4j-silent.properties
@@ -0,0 +1,18 @@
+# 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.
+
+log4j.rootLogger=OFF
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/gremlin-core/src/test/resources/log4j-test.properties
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/resources/log4j-test.properties b/gremlin-core/src/test/resources/log4j-test.properties
new file mode 100644
index 0000000..ef436fe
--- /dev/null
+++ b/gremlin-core/src/test/resources/log4j-test.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+log4j.rootLogger=WARN, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%p] %C - %m%n
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/gremlin-driver/src/test/resources/log4j-silent.properties
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/resources/log4j-silent.properties b/gremlin-driver/src/test/resources/log4j-silent.properties
new file mode 100644
index 0000000..9c6148d
--- /dev/null
+++ b/gremlin-driver/src/test/resources/log4j-silent.properties
@@ -0,0 +1,18 @@
+# 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.
+
+log4j.rootLogger=OFF
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/gremlin-driver/src/test/resources/log4j-test.properties
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/resources/log4j-test.properties b/gremlin-driver/src/test/resources/log4j-test.properties
new file mode 100644
index 0000000..ef436fe
--- /dev/null
+++ b/gremlin-driver/src/test/resources/log4j-test.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+log4j.rootLogger=WARN, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%p] %C - %m%n
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/gremlin-groovy/src/test/resources/log4j-silent.properties
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/test/resources/log4j-silent.properties b/gremlin-groovy/src/test/resources/log4j-silent.properties
new file mode 100644
index 0000000..9c6148d
--- /dev/null
+++ b/gremlin-groovy/src/test/resources/log4j-silent.properties
@@ -0,0 +1,18 @@
+# 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.
+
+log4j.rootLogger=OFF
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/gremlin-groovy/src/test/resources/log4j-test.properties
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/test/resources/log4j-test.properties b/gremlin-groovy/src/test/resources/log4j-test.properties
new file mode 100644
index 0000000..ef436fe
--- /dev/null
+++ b/gremlin-groovy/src/test/resources/log4j-test.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+log4j.rootLogger=WARN, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%p] %C - %m%n
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateOldTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateOldTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateOldTest.java
deleted file mode 100644
index 5b09425..0000000
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateOldTest.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.server;
-
-import org.apache.commons.lang.exception.ExceptionUtils;
-import org.apache.tinkerpop.gremlin.driver.Client;
-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;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.TimeoutException;
-
-import static org.hamcrest.CoreMatchers.startsWith;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- * @deprecated As of release 3.1.1-incubating, replaced by {@link GremlinServerAuthIntegrateTest}
- * @see <a href="https://issues.apache.org/jira/browse/TINKERPOP3-981">TINKERPOP3-981</a>
- */
-@Deprecated
-public class GremlinServerAuthIntegrateOldTest extends AbstractGremlinServerIntegrationTest {
-
- /**
- * Configure specific Gremlin Server settings for specific tests.
- */
- @Override
- public Settings overrideSettings(final Settings settings) {
- final Settings.AuthenticationSettings authSettings = new Settings.AuthenticationSettings();
- authSettings.className = SimpleAuthenticator.class.getName();
-
- // use a credentials graph with one user in it: stephen/password
- final Map<String,Object> authConfig = new HashMap<>();
- authConfig.put(SimpleAuthenticator.CONFIG_CREDENTIALS_DB, "conf/tinkergraph-empty.properties");
- authConfig.put(SimpleAuthenticator.CONFIG_CREDENTIALS_LOCATION, "data/credentials.kryo");
-
- authSettings.config = authConfig;
- settings.authentication = authSettings;
-
- final String nameOfTest = name.getMethodName();
- switch (nameOfTest) {
- case "shouldAuthenticateOverSslWithPlainText":
- case "shouldFailIfSslEnabledOnServerButNotClient":
- final Settings.SslSettings sslConfig = new Settings.SslSettings();
- sslConfig.enabled = true;
- settings.ssl = sslConfig;
- break;
- }
-
- return settings;
- }
-
- @Test
- public void shouldFailIfSslEnabledOnServerButNotClient() throws Exception {
- final Cluster cluster = Cluster.build().create();
- final Client client = cluster.connect();
-
- try {
- client.submit("1+1").all().get();
- fail("This should not succeed as the client did not enable SSL");
- } catch(Exception ex) {
- final Throwable root = ExceptionUtils.getRootCause(ex);
- assertEquals(TimeoutException.class, root.getClass());
- assertEquals("Timed out waiting for an available host.", root.getMessage());
- } finally {
- cluster.close();
- }
- }
-
- @Test
- public void shouldAuthenticateWithPlainText() throws Exception {
- final Cluster cluster = Cluster.build().credentials("stephen", "password").create();
- final Client client = cluster.connect();
-
- try {
- assertEquals(2, client.submit("1+1").all().get().get(0).getInt());
- assertEquals(3, client.submit("1+2").all().get().get(0).getInt());
- assertEquals(4, client.submit("1+3").all().get().get(0).getInt());
- } finally {
- cluster.close();
- }
- }
-
- @Test
- public void shouldAuthenticateOverSslWithPlainText() throws Exception {
- final Cluster cluster = Cluster.build()
- .enableSsl(true)
- .credentials("stephen", "password").create();
- final Client client = cluster.connect();
-
- try {
- assertEquals(2, client.submit("1+1").all().get().get(0).getInt());
- assertEquals(3, client.submit("1+2").all().get().get(0).getInt());
- assertEquals(4, client.submit("1+3").all().get().get(0).getInt());
- } finally {
- cluster.close();
- }
- }
-
- @Test
- public void shouldFailAuthenticateWithPlainTextNoCredentials() throws Exception {
- final Cluster cluster = Cluster.build().create();
- final Client client = cluster.connect();
-
- try {
- client.submit("1+1").all().get();
- fail("This should not succeed as the client did not provide credentials");
- } catch(Exception ex) {
- final Throwable root = ExceptionUtils.getRootCause(ex);
- assertEquals(GSSException.class, root.getClass());
- assertThat(root.getMessage(), startsWith("Invalid name provided"));
- } finally {
- cluster.close();
- }
- }
-
- @Test
- public void shouldFailAuthenticateWithPlainTextBadPassword() throws Exception {
- final Cluster cluster = Cluster.build().credentials("stephen", "bad").create();
- final Client client = cluster.connect();
-
- try {
- client.submit("1+1").all().get();
- fail("This should not succeed as the client did not provide valid credentials");
- } catch(Exception ex) {
- final Throwable root = ExceptionUtils.getRootCause(ex);
- assertEquals(ResponseException.class, root.getClass());
- assertEquals("Username and/or password are incorrect", root.getMessage());
- } finally {
- cluster.close();
- }
- }
-
- @Test
- public void shouldFailAuthenticateWithPlainTextBadUsername() throws Exception {
- final Cluster cluster = Cluster.build().credentials("marko", "password").create();
- final Client client = cluster.connect();
-
- try {
- client.submit("1+1").all();
- } catch(Exception ex) {
- final Throwable root = ExceptionUtils.getRootCause(ex);
- assertEquals(ResponseException.class, root.getClass());
- assertEquals("Username and/or password are incorrect", root.getMessage());
- } finally {
- cluster.close();
- }
- }
-
- @Test
- public void shouldAuthenticateWithPlainTextOverJSONSerialization() throws Exception {
- final Cluster cluster = Cluster.build().serializer(Serializers.GRAPHSON).credentials("stephen", "password").create();
- final Client client = cluster.connect();
-
- try {
- assertEquals(2, client.submit("1+1").all().get().get(0).getInt());
- assertEquals(3, client.submit("1+2").all().get().get(0).getInt());
- assertEquals(4, client.submit("1+3").all().get().get(0).getInt());
- } finally {
- cluster.close();
- }
- }
-
- @Test
- public void shouldAuthenticateWithPlainTextOverGraphSONSerialization() throws Exception {
- final Cluster cluster = Cluster.build().serializer(Serializers.GRAPHSON_V1D0).credentials("stephen", "password").create();
- final Client client = cluster.connect();
-
- try {
- assertEquals(2, client.submit("1+1").all().get().get(0).getInt());
- assertEquals(3, client.submit("1+2").all().get().get(0).getInt());
- assertEquals(4, client.submit("1+3").all().get().get(0).getInt());
- } finally {
- cluster.close();
- }
- }
-
- @Test
- public void shouldAuthenticateAndWorkWithVariablesOverJsonSerialization() throws Exception {
- final Cluster cluster = Cluster.build().serializer(Serializers.GRAPHSON).credentials("stephen", "password").create();
- final Client client = cluster.connect(name.getMethodName());
-
- try {
- Map vertex = (Map) client.submit("v=graph.addVertex(\"name\", \"stephen\")").all().get().get(0).getObject();
- Map<String, List<Map>> properties = (Map) vertex.get("properties");
- assertEquals("stephen", properties.get("name").get(0).get("value"));
-
- final Map vpName = (Map)client.submit("v.property('name')").all().get().get(0).getObject();
- assertEquals("stephen", vpName.get("value"));
- } finally {
- cluster.close();
- }
- }
-
- @Test
- public void shouldAuthenticateAndWorkWithVariablesOverGraphSONSerialization() throws Exception {
- final Cluster cluster = Cluster.build().serializer(Serializers.GRAPHSON_V1D0).credentials("stephen", "password").create();
- final Client client = cluster.connect(name.getMethodName());
-
- try {
- Map vertex = (Map) client.submit("v=graph.addVertex('name', 'stephen')").all().get().get(0).getObject();
- Map<String, List<Map>> properties = (Map) vertex.get("properties");
- assertEquals("stephen", properties.get("name").get(0).get("value"));
-
- final Map vpName = (Map)client.submit("v.property('name')").all().get().get(0).getObject();
- assertEquals("stephen", vpName.get("value"));
- } finally {
- cluster.close();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/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
new file mode 100644
index 0000000..cd3a431
--- /dev/null
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthOldIntegrateTest.java
@@ -0,0 +1,235 @@
+/*
+ * 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.commons.lang.exception.ExceptionUtils;
+import org.apache.tinkerpop.gremlin.driver.Client;
+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;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeoutException;
+
+import static org.hamcrest.CoreMatchers.startsWith;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ * @deprecated As of release 3.1.1-incubating, replaced by {@link GremlinServerAuthIntegrateTest}
+ * @see <a href="https://issues.apache.org/jira/browse/TINKERPOP3-981">TINKERPOP3-981</a>
+ */
+@Deprecated
+public class GremlinServerAuthOldIntegrateTest extends AbstractGremlinServerIntegrationTest {
+
+ /**
+ * Configure specific Gremlin Server settings for specific tests.
+ */
+ @Override
+ public Settings overrideSettings(final Settings settings) {
+ final Settings.AuthenticationSettings authSettings = new Settings.AuthenticationSettings();
+ authSettings.className = SimpleAuthenticator.class.getName();
+
+ // use a credentials graph with one user in it: stephen/password
+ final Map<String,Object> authConfig = new HashMap<>();
+ authConfig.put(SimpleAuthenticator.CONFIG_CREDENTIALS_DB, "conf/tinkergraph-empty.properties");
+ authConfig.put(SimpleAuthenticator.CONFIG_CREDENTIALS_LOCATION, "data/credentials.kryo");
+
+ authSettings.config = authConfig;
+ settings.authentication = authSettings;
+
+ final String nameOfTest = name.getMethodName();
+ switch (nameOfTest) {
+ case "shouldAuthenticateOverSslWithPlainText":
+ case "shouldFailIfSslEnabledOnServerButNotClient":
+ final Settings.SslSettings sslConfig = new Settings.SslSettings();
+ sslConfig.enabled = true;
+ settings.ssl = sslConfig;
+ break;
+ }
+
+ return settings;
+ }
+
+ @Test
+ public void shouldFailIfSslEnabledOnServerButNotClient() throws Exception {
+ final Cluster cluster = Cluster.build().create();
+ final Client client = cluster.connect();
+
+ try {
+ client.submit("1+1").all().get();
+ fail("This should not succeed as the client did not enable SSL");
+ } catch(Exception ex) {
+ final Throwable root = ExceptionUtils.getRootCause(ex);
+ assertEquals(TimeoutException.class, root.getClass());
+ assertEquals("Timed out waiting for an available host.", root.getMessage());
+ } finally {
+ cluster.close();
+ }
+ }
+
+ @Test
+ public void shouldAuthenticateWithPlainText() throws Exception {
+ final Cluster cluster = Cluster.build().credentials("stephen", "password").create();
+ final Client client = cluster.connect();
+
+ try {
+ assertEquals(2, client.submit("1+1").all().get().get(0).getInt());
+ assertEquals(3, client.submit("1+2").all().get().get(0).getInt());
+ assertEquals(4, client.submit("1+3").all().get().get(0).getInt());
+ } finally {
+ cluster.close();
+ }
+ }
+
+ @Test
+ public void shouldAuthenticateOverSslWithPlainText() throws Exception {
+ final Cluster cluster = Cluster.build()
+ .enableSsl(true)
+ .credentials("stephen", "password").create();
+ final Client client = cluster.connect();
+
+ try {
+ assertEquals(2, client.submit("1+1").all().get().get(0).getInt());
+ assertEquals(3, client.submit("1+2").all().get().get(0).getInt());
+ assertEquals(4, client.submit("1+3").all().get().get(0).getInt());
+ } finally {
+ cluster.close();
+ }
+ }
+
+ @Test
+ public void shouldFailAuthenticateWithPlainTextNoCredentials() throws Exception {
+ final Cluster cluster = Cluster.build().create();
+ final Client client = cluster.connect();
+
+ try {
+ client.submit("1+1").all().get();
+ fail("This should not succeed as the client did not provide credentials");
+ } catch(Exception ex) {
+ final Throwable root = ExceptionUtils.getRootCause(ex);
+ assertEquals(GSSException.class, root.getClass());
+ assertThat(root.getMessage(), startsWith("Invalid name provided"));
+ } finally {
+ cluster.close();
+ }
+ }
+
+ @Test
+ public void shouldFailAuthenticateWithPlainTextBadPassword() throws Exception {
+ final Cluster cluster = Cluster.build().credentials("stephen", "bad").create();
+ final Client client = cluster.connect();
+
+ try {
+ client.submit("1+1").all().get();
+ fail("This should not succeed as the client did not provide valid credentials");
+ } catch(Exception ex) {
+ final Throwable root = ExceptionUtils.getRootCause(ex);
+ assertEquals(ResponseException.class, root.getClass());
+ assertEquals("Username and/or password are incorrect", root.getMessage());
+ } finally {
+ cluster.close();
+ }
+ }
+
+ @Test
+ public void shouldFailAuthenticateWithPlainTextBadUsername() throws Exception {
+ final Cluster cluster = Cluster.build().credentials("marko", "password").create();
+ final Client client = cluster.connect();
+
+ try {
+ client.submit("1+1").all();
+ } catch(Exception ex) {
+ final Throwable root = ExceptionUtils.getRootCause(ex);
+ assertEquals(ResponseException.class, root.getClass());
+ assertEquals("Username and/or password are incorrect", root.getMessage());
+ } finally {
+ cluster.close();
+ }
+ }
+
+ @Test
+ public void shouldAuthenticateWithPlainTextOverJSONSerialization() throws Exception {
+ final Cluster cluster = Cluster.build().serializer(Serializers.GRAPHSON).credentials("stephen", "password").create();
+ final Client client = cluster.connect();
+
+ try {
+ assertEquals(2, client.submit("1+1").all().get().get(0).getInt());
+ assertEquals(3, client.submit("1+2").all().get().get(0).getInt());
+ assertEquals(4, client.submit("1+3").all().get().get(0).getInt());
+ } finally {
+ cluster.close();
+ }
+ }
+
+ @Test
+ public void shouldAuthenticateWithPlainTextOverGraphSONSerialization() throws Exception {
+ final Cluster cluster = Cluster.build().serializer(Serializers.GRAPHSON_V1D0).credentials("stephen", "password").create();
+ final Client client = cluster.connect();
+
+ try {
+ assertEquals(2, client.submit("1+1").all().get().get(0).getInt());
+ assertEquals(3, client.submit("1+2").all().get().get(0).getInt());
+ assertEquals(4, client.submit("1+3").all().get().get(0).getInt());
+ } finally {
+ cluster.close();
+ }
+ }
+
+ @Test
+ public void shouldAuthenticateAndWorkWithVariablesOverJsonSerialization() throws Exception {
+ final Cluster cluster = Cluster.build().serializer(Serializers.GRAPHSON).credentials("stephen", "password").create();
+ final Client client = cluster.connect(name.getMethodName());
+
+ try {
+ Map vertex = (Map) client.submit("v=graph.addVertex(\"name\", \"stephen\")").all().get().get(0).getObject();
+ Map<String, List<Map>> properties = (Map) vertex.get("properties");
+ assertEquals("stephen", properties.get("name").get(0).get("value"));
+
+ final Map vpName = (Map)client.submit("v.property('name')").all().get().get(0).getObject();
+ assertEquals("stephen", vpName.get("value"));
+ } finally {
+ cluster.close();
+ }
+ }
+
+ @Test
+ public void shouldAuthenticateAndWorkWithVariablesOverGraphSONSerialization() throws Exception {
+ final Cluster cluster = Cluster.build().serializer(Serializers.GRAPHSON_V1D0).credentials("stephen", "password").create();
+ final Client client = cluster.connect(name.getMethodName());
+
+ try {
+ Map vertex = (Map) client.submit("v=graph.addVertex('name', 'stephen')").all().get().get(0).getObject();
+ Map<String, List<Map>> properties = (Map) vertex.get("properties");
+ assertEquals("stephen", properties.get("name").get(0).get("value"));
+
+ final Map vpName = (Map)client.submit("v.property('name')").all().get().get(0).getObject();
+ assertEquals("stephen", vpName.get("value"));
+ } finally {
+ cluster.close();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/gremlin-server/src/test/resources/log4j-silent.properties
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/log4j-silent.properties b/gremlin-server/src/test/resources/log4j-silent.properties
new file mode 100644
index 0000000..9c6148d
--- /dev/null
+++ b/gremlin-server/src/test/resources/log4j-silent.properties
@@ -0,0 +1,18 @@
+# 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.
+
+log4j.rootLogger=OFF
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/gremlin-server/src/test/resources/log4j-test.properties
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/log4j-test.properties b/gremlin-server/src/test/resources/log4j-test.properties
new file mode 100644
index 0000000..ef436fe
--- /dev/null
+++ b/gremlin-server/src/test/resources/log4j-test.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+log4j.rootLogger=WARN, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%p] %C - %m%n
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/gremlin-test/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-test/pom.xml b/gremlin-test/pom.xml
index 8ae4e40..e9aacad 100644
--- a/gremlin-test/pom.xml
+++ b/gremlin-test/pom.xml
@@ -72,6 +72,12 @@ limitations under the License.
</directory>
</resource>
</resources>
+ <testResources>
+ <testResource>
+ <directory>${basedir}/src/test/resources
+ </directory>
+ </testResource>
+ </testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
index 97dfea2..ab39572 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
@@ -191,6 +191,12 @@ public abstract class AbstractGremlinTest {
graph.tx().commit();
}
+ /**
+ * This method does not appear to be used in TinkerPop core. It was used at one time by Neo4j tests, but wasn't
+ * really a great pattern and was eventually removed.
+ *
+ * @deprecated as of 3.1.1-incubating, and is not replaced
+ */
public void tryRandomCommit(final Graph graph) {
if (graph.features().graph().supportsTransactions() && new Random().nextBoolean())
graph.tx().commit();
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/gremlin-test/src/test/resources/log4j-silent.properties
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/resources/log4j-silent.properties b/gremlin-test/src/test/resources/log4j-silent.properties
new file mode 100644
index 0000000..9d4f1d4
--- /dev/null
+++ b/gremlin-test/src/test/resources/log4j-silent.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+log4j.rootLogger=OFF
+
+# need to turn this on as this test actually tests "logging" - needs INFO at minimum for tests to pass
+log4j.logger.org.apache.tinkerpop.gremlin.util.Log4jRecordingAppenderTest=INFO
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/gremlin-test/src/test/resources/log4j-test.properties
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/resources/log4j-test.properties b/gremlin-test/src/test/resources/log4j-test.properties
new file mode 100644
index 0000000..3d02711
--- /dev/null
+++ b/gremlin-test/src/test/resources/log4j-test.properties
@@ -0,0 +1,24 @@
+# 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.
+
+log4j.rootLogger=WARN, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%p] %C - %m%n
+
+# need to turn this on as this test actually tests "logging" - needs INFO at minimum for tests to pass
+log4j.logger.org.apache.tinkerpop.gremlin.util.Log4jRecordingAppenderTest=INFO
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/hadoop-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/pom.xml b/hadoop-gremlin/pom.xml
index b2f7d69..3542275 100644
--- a/hadoop-gremlin/pom.xml
+++ b/hadoop-gremlin/pom.xml
@@ -198,6 +198,10 @@ limitations under the License.
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
<plugin>
@@ -222,20 +226,6 @@ limitations under the License.
<invokeDynamic>true</invokeDynamic>
</configuration>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <!-- log4j.configuration>log4j-core.properties</log4j.configuration> -->
- <!--<argLine>-Xmx2048M</argLine>-->
- <excludes>
- <exclude>**/*IntegrateTest.java</exclude>
- <exclude>**/*PerformanceTest.java</exclude>
- <!-- this is technically a member of the integration test suite -->
- <exclude>**/HadoopGremlinPluginTest.java</exclude>
- </excludes>
- </configuration>
- </plugin>
</plugins>
</build>
</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopGremlinPluginCheck.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopGremlinPluginCheck.java b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopGremlinPluginCheck.java
new file mode 100644
index 0000000..4108e35
--- /dev/null
+++ b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopGremlinPluginCheck.java
@@ -0,0 +1,176 @@
+/*
+ * 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.hadoop.groovy.plugin;
+
+import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
+import org.apache.tinkerpop.gremlin.LoadGraphWith;
+import org.apache.tinkerpop.gremlin.groovy.plugin.RemoteAcceptor;
+import org.apache.tinkerpop.gremlin.groovy.util.TestableConsolePluginAcceptor;
+import org.apache.tinkerpop.gremlin.hadoop.Constants;
+import org.apache.tinkerpop.gremlin.hadoop.HadoopGraphProvider;
+import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
+import org.apache.tinkerpop.gremlin.process.computer.KeyValue;
+import org.apache.tinkerpop.gremlin.process.computer.MapReduce;
+import org.apache.tinkerpop.gremlin.process.computer.traversal.step.sideEffect.mapreduce.TraverserMapReduce;
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.UUID;
+
+import static org.junit.Assert.*;
+
+/**
+ * This is an test that is mean to be used in the context of the {@link HadoopPluginSuite} and shouldn't be
+ * executed on its own.
+ *
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public class HadoopGremlinPluginCheck extends AbstractGremlinTest {
+
+ @Before
+ public void setupTest() {
+ try {
+ this.console = new TestableConsolePluginAcceptor();
+ final HadoopGremlinPlugin plugin = new HadoopGremlinPlugin();
+ plugin.pluginTo(this.console);
+ this.remote = (HadoopRemoteAcceptor) plugin.remoteAcceptor().get();
+ } catch (final Exception e) {
+ throw new IllegalStateException(e.getMessage(), e);
+ }
+ }
+
+ ///////////////////
+
+ private HadoopRemoteAcceptor remote;
+ private TestableConsolePluginAcceptor console;
+
+ @Test
+ @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
+ public void shouldSupportRemoteTraversal() throws Exception {
+ this.console.addBinding("graph", this.graph);
+ this.console.addBinding("g", this.g);
+ this.remote.connect(Arrays.asList("graph", "g"));
+ //
+ Traversal<?, ?> traversal = (Traversal<?, ?>) this.remote.submit(Arrays.asList("g.V().count()"));
+ assertEquals(6L, traversal.next());
+ assertFalse(traversal.hasNext());
+ assertNotNull(this.console.getBindings().get(RemoteAcceptor.RESULT));
+ }
+
+ @Test
+ @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
+ public void shouldSupportRemoteSugarTraversal() throws Exception {
+ this.console.addBinding("graph", this.graph);
+ this.console.addBinding("g", this.g);
+ this.remote.connect(Arrays.asList("graph"));
+ //
+ this.remote.configure(Arrays.asList("useSugar", "true"));
+ this.remote.connect(Arrays.asList("graph", "g"));
+ Traversal<?, ?> traversal = (Traversal<?, ?>) this.remote.submit(Arrays.asList("g.V.name.map{it.length()}.sum"));
+ assertEquals(28l, traversal.next());
+ assertFalse(traversal.hasNext());
+ assertNotNull(this.console.getBindings().get(RemoteAcceptor.RESULT));
+ }
+
+ @Test
+ @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
+ public void shouldSupportHDFSMethods() throws Exception {
+ ////////////////
+ List<String> ls = (List<String>) this.console.eval("hdfs.ls()");
+ for (final String line : ls) {
+ assertTrue(line.startsWith("-") || line.startsWith("r") || line.startsWith("w") || line.startsWith("x"));
+ assertEquals(" ", line.substring(9, 10));
+ }
+ ls = (List<String>) this.console.eval("local.ls()");
+ for (final String line : ls) {
+ assertTrue(line.startsWith("-") || line.startsWith("r") || line.startsWith("w") || line.startsWith("x"));
+ assertEquals(" ", line.substring(9, 10));
+ }
+ ////////////////
+ this.console.eval("hdfs.copyFromLocal('" + HadoopGraphProvider.PATHS.get("tinkerpop-classic.txt") + "', 'target/tinkerpop-classic.txt')");
+ assertTrue((Boolean) this.console.eval("hdfs.exists('target/tinkerpop-classic.txt')"));
+ ////////////////
+ List<String> head = IteratorUtils.asList(this.console.eval("hdfs.head('target/tinkerpop-classic.txt')"));
+ assertEquals(6, head.size());
+ for (final String line : head) {
+ assertEquals(":", line.substring(1, 2));
+ assertTrue(Integer.valueOf(line.substring(0, 1)) <= 6);
+ }
+ head = IteratorUtils.asList(this.console.eval("hdfs.head('target/tinkerpop-classic.txt',3)"));
+ assertEquals(3, head.size());
+ for (final String line : head) {
+ assertEquals(":", line.substring(1, 2));
+ assertTrue(Integer.valueOf(line.substring(0, 1)) <= 3);
+ }
+ ////////////////
+ this.console.eval("hdfs.rm('target/tinkerpop-classic.txt')");
+ assertFalse((Boolean) this.console.eval("hdfs.exists('target/tinkerpop-classic.txt')"));
+ ////////////////
+ this.console.addBinding("graph", this.graph);
+ this.console.addBinding("g", this.g);
+ this.remote.connect(Arrays.asList("graph", "g"));
+ Traversal<Vertex, String> traversal = (Traversal<Vertex, String>) this.remote.submit(Arrays.asList("g.V().hasLabel('person').group('m').by('age').by('name').out('knows').out('created').values('name')"));
+ AbstractGremlinProcessTest.checkResults(Arrays.asList("ripple", "lop"), traversal);
+ assertTrue((Boolean) this.console.eval("hdfs.exists('target/test-output/m')"));
+ assertTrue((Boolean) this.console.eval("hdfs.exists('target/test-output/" + TraverserMapReduce.TRAVERSERS + "')"));
+ final List<KeyValue<Integer, Collection<String>>> mList = IteratorUtils.asList(this.console.eval("hdfs.head('target/test-output/m',ObjectWritable)"));
+ assertEquals(4, mList.size());
+ mList.forEach(keyValue -> {
+ if (keyValue.getKey().equals(29))
+ assertTrue(keyValue.getValue().contains("marko"));
+ else if (keyValue.getKey().equals(35))
+ assertTrue(keyValue.getValue().contains("peter"));
+ else if (keyValue.getKey().equals(32))
+ assertTrue(keyValue.getValue().contains("josh"));
+ else if (keyValue.getKey().equals(27))
+ assertTrue(keyValue.getValue().contains("vadas"));
+ else
+ throw new IllegalStateException("The provided key/value is unknown: " + keyValue);
+ });
+ final List<KeyValue<MapReduce.NullObject, Traverser<String>>> traversersList = IteratorUtils.asList(this.console.eval("hdfs.head('target/test-output/" + TraverserMapReduce.TRAVERSERS + "',ObjectWritable)"));
+ assertEquals(2, traversersList.size());
+ traversersList.forEach(keyValue -> {
+ assertEquals(MapReduce.NullObject.instance(), keyValue.getKey());
+ final String name = keyValue.getValue().get();
+ assertTrue(name.equals("ripple") || name.equals("lop"));
+ });
+ ////////////////
+ }
+
+ @Test
+ @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
+ public void shouldGracefullyHandleBadGremlinHadoopLibs() throws Exception {
+ System.setProperty(Constants.HADOOP_GREMLIN_LIBS, "test/" + UUID.randomUUID());
+ this.graph.configuration().setProperty(Constants.GREMLIN_HADOOP_JARS_IN_DISTRIBUTED_CACHE, true);
+ this.console.addBinding("graph", this.graph);
+ this.console.addBinding("g", this.g);
+ this.remote.connect(Arrays.asList("graph", "g"));
+ Traversal<?, ?> traversal = (Traversal<?, ?>) this.remote.submit(Arrays.asList("g.V()"));
+ assertEquals(6, IteratorUtils.count(traversal));
+ assertNotNull(this.console.getBindings().get(RemoteAcceptor.RESULT));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopGremlinPluginTest.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopGremlinPluginTest.java b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopGremlinPluginTest.java
deleted file mode 100644
index 0d7da18..0000000
--- a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopGremlinPluginTest.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tinkerpop.gremlin.hadoop.groovy.plugin;
-
-import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
-import org.apache.tinkerpop.gremlin.LoadGraphWith;
-import org.apache.tinkerpop.gremlin.groovy.plugin.RemoteAcceptor;
-import org.apache.tinkerpop.gremlin.groovy.util.TestableConsolePluginAcceptor;
-import org.apache.tinkerpop.gremlin.hadoop.Constants;
-import org.apache.tinkerpop.gremlin.hadoop.HadoopGraphProvider;
-import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
-import org.apache.tinkerpop.gremlin.process.computer.KeyValue;
-import org.apache.tinkerpop.gremlin.process.computer.MapReduce;
-import org.apache.tinkerpop.gremlin.process.computer.traversal.step.sideEffect.mapreduce.TraverserMapReduce;
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import java.util.UUID;
-
-import static org.junit.Assert.*;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public class HadoopGremlinPluginTest extends AbstractGremlinTest {
-
- @Before
- public void setupTest() {
- try {
- this.console = new TestableConsolePluginAcceptor();
- final HadoopGremlinPlugin plugin = new HadoopGremlinPlugin();
- plugin.pluginTo(this.console);
- this.remote = (HadoopRemoteAcceptor) plugin.remoteAcceptor().get();
- } catch (final Exception e) {
- throw new IllegalStateException(e.getMessage(), e);
- }
- }
-
- ///////////////////
-
- private HadoopRemoteAcceptor remote;
- private TestableConsolePluginAcceptor console;
-
- @Test
- @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
- public void shouldSupportRemoteTraversal() throws Exception {
- this.console.addBinding("graph", this.graph);
- this.console.addBinding("g", this.g);
- this.remote.connect(Arrays.asList("graph", "g"));
- //
- Traversal<?, ?> traversal = (Traversal<?, ?>) this.remote.submit(Arrays.asList("g.V().count()"));
- assertEquals(6L, traversal.next());
- assertFalse(traversal.hasNext());
- assertNotNull(this.console.getBindings().get(RemoteAcceptor.RESULT));
- }
-
- @Test
- @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
- public void shouldSupportRemoteSugarTraversal() throws Exception {
- this.console.addBinding("graph", this.graph);
- this.console.addBinding("g", this.g);
- this.remote.connect(Arrays.asList("graph"));
- //
- this.remote.configure(Arrays.asList("useSugar", "true"));
- this.remote.connect(Arrays.asList("graph", "g"));
- Traversal<?, ?> traversal = (Traversal<?, ?>) this.remote.submit(Arrays.asList("g.V.name.map{it.length()}.sum"));
- assertEquals(28l, traversal.next());
- assertFalse(traversal.hasNext());
- assertNotNull(this.console.getBindings().get(RemoteAcceptor.RESULT));
- }
-
- @Test
- @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
- public void shouldSupportHDFSMethods() throws Exception {
- ////////////////
- List<String> ls = (List<String>) this.console.eval("hdfs.ls()");
- for (final String line : ls) {
- assertTrue(line.startsWith("-") || line.startsWith("r") || line.startsWith("w") || line.startsWith("x"));
- assertEquals(" ", line.substring(9, 10));
- }
- ls = (List<String>) this.console.eval("local.ls()");
- for (final String line : ls) {
- assertTrue(line.startsWith("-") || line.startsWith("r") || line.startsWith("w") || line.startsWith("x"));
- assertEquals(" ", line.substring(9, 10));
- }
- ////////////////
- this.console.eval("hdfs.copyFromLocal('" + HadoopGraphProvider.PATHS.get("tinkerpop-classic.txt") + "', 'target/tinkerpop-classic.txt')");
- assertTrue((Boolean) this.console.eval("hdfs.exists('target/tinkerpop-classic.txt')"));
- ////////////////
- List<String> head = IteratorUtils.asList(this.console.eval("hdfs.head('target/tinkerpop-classic.txt')"));
- assertEquals(6, head.size());
- for (final String line : head) {
- assertEquals(":", line.substring(1, 2));
- assertTrue(Integer.valueOf(line.substring(0, 1)) <= 6);
- }
- head = IteratorUtils.asList(this.console.eval("hdfs.head('target/tinkerpop-classic.txt',3)"));
- assertEquals(3, head.size());
- for (final String line : head) {
- assertEquals(":", line.substring(1, 2));
- assertTrue(Integer.valueOf(line.substring(0, 1)) <= 3);
- }
- ////////////////
- this.console.eval("hdfs.rm('target/tinkerpop-classic.txt')");
- assertFalse((Boolean) this.console.eval("hdfs.exists('target/tinkerpop-classic.txt')"));
- ////////////////
- this.console.addBinding("graph", this.graph);
- this.console.addBinding("g", this.g);
- this.remote.connect(Arrays.asList("graph", "g"));
- Traversal<Vertex, String> traversal = (Traversal<Vertex, String>) this.remote.submit(Arrays.asList("g.V().hasLabel('person').group('m').by('age').by('name').out('knows').out('created').values('name')"));
- AbstractGremlinProcessTest.checkResults(Arrays.asList("ripple", "lop"), traversal);
- assertTrue((Boolean) this.console.eval("hdfs.exists('target/test-output/m')"));
- assertTrue((Boolean) this.console.eval("hdfs.exists('target/test-output/" + TraverserMapReduce.TRAVERSERS + "')"));
- final List<KeyValue<Integer, Collection<String>>> mList = IteratorUtils.asList(this.console.eval("hdfs.head('target/test-output/m',ObjectWritable)"));
- assertEquals(4, mList.size());
- mList.forEach(keyValue -> {
- if (keyValue.getKey().equals(29))
- assertTrue(keyValue.getValue().contains("marko"));
- else if (keyValue.getKey().equals(35))
- assertTrue(keyValue.getValue().contains("peter"));
- else if (keyValue.getKey().equals(32))
- assertTrue(keyValue.getValue().contains("josh"));
- else if (keyValue.getKey().equals(27))
- assertTrue(keyValue.getValue().contains("vadas"));
- else
- throw new IllegalStateException("The provided key/value is unknown: " + keyValue);
- });
- final List<KeyValue<MapReduce.NullObject, Traverser<String>>> traversersList = IteratorUtils.asList(this.console.eval("hdfs.head('target/test-output/" + TraverserMapReduce.TRAVERSERS + "',ObjectWritable)"));
- assertEquals(2, traversersList.size());
- traversersList.forEach(keyValue -> {
- assertEquals(MapReduce.NullObject.instance(), keyValue.getKey());
- final String name = keyValue.getValue().get();
- assertTrue(name.equals("ripple") || name.equals("lop"));
- });
- ////////////////
- }
-
- @Test
- @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
- public void shouldGracefullyHandleBadGremlinHadoopLibs() throws Exception {
- System.setProperty(Constants.HADOOP_GREMLIN_LIBS, "test/" + UUID.randomUUID());
- this.graph.configuration().setProperty(Constants.GREMLIN_HADOOP_JARS_IN_DISTRIBUTED_CACHE, true);
- this.console.addBinding("graph", this.graph);
- this.console.addBinding("g", this.g);
- this.remote.connect(Arrays.asList("graph", "g"));
- Traversal<?, ?> traversal = (Traversal<?, ?>) this.remote.submit(Arrays.asList("g.V()"));
- assertEquals(6, IteratorUtils.count(traversal));
- assertNotNull(this.console.getBindings().get(RemoteAcceptor.RESULT));
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopPluginSuite.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopPluginSuite.java b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopPluginSuite.java
index 59ba23c..6c4cc20 100644
--- a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopPluginSuite.java
+++ b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopPluginSuite.java
@@ -29,6 +29,6 @@ import org.junit.runners.model.RunnerBuilder;
*/
public class HadoopPluginSuite extends AbstractGremlinSuite {
public HadoopPluginSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
- super(klass, builder, new Class<?>[]{HadoopGremlinPluginTest.class}, new Class<?>[]{HadoopGremlinPluginTest.class}, true, TraversalEngine.Type.COMPUTER);
+ super(klass, builder, new Class<?>[]{HadoopGremlinPluginCheck.class}, new Class<?>[]{HadoopGremlinPluginCheck.class}, true, TraversalEngine.Type.COMPUTER);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/hadoop-gremlin/src/test/resources/log4j-silent.properties
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/test/resources/log4j-silent.properties b/hadoop-gremlin/src/test/resources/log4j-silent.properties
new file mode 100644
index 0000000..9c6148d
--- /dev/null
+++ b/hadoop-gremlin/src/test/resources/log4j-silent.properties
@@ -0,0 +1,18 @@
+# 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.
+
+log4j.rootLogger=OFF
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/hadoop-gremlin/src/test/resources/log4j-test.properties
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/test/resources/log4j-test.properties b/hadoop-gremlin/src/test/resources/log4j-test.properties
new file mode 100644
index 0000000..4b5af31
--- /dev/null
+++ b/hadoop-gremlin/src/test/resources/log4j-test.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+log4j.rootLogger=WARN, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%p] %C - %m%n
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/neo4j-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/pom.xml b/neo4j-gremlin/pom.xml
index b8d6289..b13c556 100644
--- a/neo4j-gremlin/pom.xml
+++ b/neo4j-gremlin/pom.xml
@@ -64,6 +64,12 @@ limitations under the License.
</directory>
</resource>
</resources>
+ <testResources>
+ <testResource>
+ <directory>${basedir}/src/test/resources
+ </directory>
+ </testResource>
+ </testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/neo4j-gremlin/src/test/resources/log4j-silent.properties
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/resources/log4j-silent.properties b/neo4j-gremlin/src/test/resources/log4j-silent.properties
new file mode 100644
index 0000000..9c6148d
--- /dev/null
+++ b/neo4j-gremlin/src/test/resources/log4j-silent.properties
@@ -0,0 +1,18 @@
+# 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.
+
+log4j.rootLogger=OFF
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/neo4j-gremlin/src/test/resources/log4j-test.properties
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/resources/log4j-test.properties b/neo4j-gremlin/src/test/resources/log4j-test.properties
new file mode 100644
index 0000000..ef436fe
--- /dev/null
+++ b/neo4j-gremlin/src/test/resources/log4j-test.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+log4j.rootLogger=WARN, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%p] %C - %m%n
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b2bf960/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 0332cdc..371a108 100644
--- a/pom.xml
+++ b/pom.xml
@@ -127,13 +127,6 @@ limitations under the License.
<properties>
<groovy.version>2.4.1</groovy.version>
<junit.version>4.12</junit.version>
- <!-- Directory containing the file ${log4j.properties} defined
- above. Maven interpolates ${project.basedir} in the
- context of child modules, so path this relative to one of
- the modules under the root directory, not the root
- directory itself. -->
- <log4j.properties.dir>${project.basedir}/../gremlin-server/conf/</log4j.properties.dir>
- <log4j.properties>log4j.properties</log4j.properties>
<metrics.version>3.0.2</metrics.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
@@ -144,6 +137,15 @@ limitations under the License.
<commons.configuration.version>1.10</commons.configuration.version>
<java.tuples.version>1.2</java.tuples.version>
<javadoc-plugin.version>2.10.1</javadoc-plugin.version>
+
+ <!--
+ This file will come from the root of each modules test/resources/ directories. log4j-silent.properties will
+ turn off all logging possible while still allowing tests to pass. log4j-test.properties will be more verbose
+ in its output.
+ -->
+ <log4j-test.properties>file:target/test-classes/log4j-test.properties</log4j-test.properties>
+ <log4j-silent.properties>file:target/test-classes/log4j-silent.properties</log4j-silent.properties>
+
<muteTestLogs>false</muteTestLogs>
</properties>
<build>
@@ -316,12 +318,8 @@ limitations under the License.
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
- <argLine>-Dlog4j.configuration=${log4j.properties} -Dbuild.dir=${project.build.directory}
+ <argLine>-Dlog4j.configuration=${log4j-test.properties} -Dbuild.dir=${project.build.directory}
</argLine>
- <additionalClasspathElements>
- <!-- So that Log4j can find the Log4j properties file -->
- <additionalClasspathElement>${log4j.properties.dir}</additionalClasspathElement>
- </additionalClasspathElements>
<excludes>
<exclude>**/*IntegrateTest.java</exclude>
<exclude>**/*PerformanceTest.java</exclude>
@@ -343,15 +341,11 @@ limitations under the License.
<include>**/*IntegrateTest.java</include>
</includes>
<skipTests>${skipIntegrationTests}</skipTests>
- <argLine>-Dlog4j.configuration=${log4j.properties} -Dhost=localhost -Dport=8182
+ <argLine>-Dlog4j.configuration=${log4j-test.properties} -Dhost=localhost -Dport=8182
-Djub.consumers=CONSOLE,H2 -Djub.db.file=target/performance/h2/benchmarks
-Djub.charts.dir=target/performance/charts -Djub.customkey=${project.parent.version}
-Dbuild.dir=${project.build.directory}
</argLine>
- <additionalClasspathElements>
- <!-- So that Log4j can find the Log4j properties file -->
- <additionalClasspathElement>${log4j.properties.dir}</additionalClasspathElement>
- </additionalClasspathElements>
<summaryFile>target/failsafe-reports/failsafe-integration.xml</summaryFile>
</configuration>
</execution>
@@ -365,15 +359,11 @@ limitations under the License.
<include>**/*PerformanceTest.java</include>
</includes>
<skipTests>${skipPerformanceTests}</skipTests>
- <argLine>-Dlog4j.configuration=${log4j.properties} -Dhost=localhost -Dport=8182
+ <argLine>-Dlog4j.configuration=${log4j-test.properties} -Dhost=localhost -Dport=8182
-Djub.consumers=CONSOLE,H2 -Djub.db.file=target/performance/h2/benchmarks
-Djub.charts.dir=target/performance/charts -Djub.customkey=${project.parent.version}
-Dbuild.dir=${project.build.directory}
</argLine>
- <additionalClasspathElements>
- <!-- So that Log4j can find the Log4j properties file -->
- <additionalClasspathElement>${log4j.properties.dir}</additionalClasspathElement>
- </additionalClasspathElements>
<summaryFile>target/failsafe-reports/failsafe-performance.xml</summaryFile>
</configuration>
</execution>
@@ -418,6 +408,7 @@ limitations under the License.
<version>1.0</version>
</plugin>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc-plugin.version}</version>
</plugin>
@@ -914,7 +905,7 @@ limitations under the License.
</profile>
<profile>
- <!-- Continuous Integration - mutes test logs -->
+ <!-- Continuous Integration - mutes test logs and skip javadoc generation to lighten output -->
<id>ci</id>
<activation>
<activeByDefault>false</activeByDefault>
@@ -927,12 +918,22 @@ limitations under the License.
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>${javadoc-plugin.version}</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<systemPropertyVariables>
<muteTestLogs>true</muteTestLogs>
</systemPropertyVariables>
+ <argLine>-Dlog4j.configuration=${log4j-silent.properties} -Dbuild.dir=${project.build.directory}
+ </argLine>
<excludes>
<exclude>**/*IntegrateTest.java</exclude>
<exclude>**/*PerformanceTest.java</exclude>