Return-Path: X-Original-To: apmail-tinkerpop-commits-archive@minotaur.apache.org Delivered-To: apmail-tinkerpop-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9ED381828E for ; Fri, 4 Dec 2015 14:09:54 +0000 (UTC) Received: (qmail 14007 invoked by uid 500); 4 Dec 2015 14:09:54 -0000 Delivered-To: apmail-tinkerpop-commits-archive@tinkerpop.apache.org Received: (qmail 13983 invoked by uid 500); 4 Dec 2015 14:09:54 -0000 Mailing-List: contact commits-help@tinkerpop.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tinkerpop.incubator.apache.org Delivered-To: mailing list commits@tinkerpop.incubator.apache.org Received: (qmail 13974 invoked by uid 99); 4 Dec 2015 14:09:54 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Dec 2015 14:09:54 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id E342ECCD42 for ; Fri, 4 Dec 2015 14:09:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.791 X-Spam-Level: X-Spam-Status: No, score=0.791 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id itRuQ88xlxkG for ; Fri, 4 Dec 2015 14:09:39 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id AA5A621624 for ; Fri, 4 Dec 2015 14:09:38 +0000 (UTC) Received: (qmail 13812 invoked by uid 99); 4 Dec 2015 14:09:38 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Dec 2015 14:09:38 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 423EBE05D9; Fri, 4 Dec 2015 14:09:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: spmallette@apache.org To: commits@tinkerpop.incubator.apache.org Date: Fri, 04 Dec 2015 14:09:39 -0000 Message-Id: <5b8a42c1ce3440b48f633143b1c8b930@git.apache.org> In-Reply-To: <55a10f2415744deaadc97b6eaa1d8b76@git.apache.org> References: <55a10f2415744deaadc97b6eaa1d8b76@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/3] 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/master Commit: 2b2bf960f09e704244f91801116c081368fbdb11 Parents: 19beece Author: Stephen Mallette Authored: Fri Dec 4 09:08:00 2015 -0500 Committer: Stephen Mallette 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 `` entries, paying special attention to the pathing of t uploaded to the server and should preserve the directory structure in git as referenced in ``. Please see the <> 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. org.apache.maven.plugins + maven-surefire-plugin + + + org.apache.maven.plugins maven-failsafe-plugin @@ -240,20 +244,6 @@ limitations under the License. - - org.apache.maven.plugins - maven-surefire-plugin - - - - - **/*IntegrateTest.java - **/*PerformanceTest.java - - **/HadoopGremlinPluginTest.java - - - \ 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. + + + ${basedir}/src/test/resources + + + org.apache.maven.plugins 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. ${basedir}/target ${project.artifactId}-${project.version} + + + ${basedir}/src/test/resources + + + org.apache.maven.plugins 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 TINKERPOP3-981 - */ -@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 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> 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> 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 TINKERPOP3-981 + */ +@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 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> 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> 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. + + + ${basedir}/src/test/resources + + + org.apache.maven.plugins 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. org.apache.maven.plugins + maven-surefire-plugin + + + org.apache.maven.plugins maven-failsafe-plugin @@ -222,20 +226,6 @@ limitations under the License. true - - org.apache.maven.plugins - maven-surefire-plugin - - - - - **/*IntegrateTest.java - **/*PerformanceTest.java - - **/HadoopGremlinPluginTest.java - - - \ 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 ls = (List) 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) 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 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 traversal = (Traversal) 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>> 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>> 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 ls = (List) 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) 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 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 traversal = (Traversal) 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>> 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>> 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. + + + ${basedir}/src/test/resources + + + org.apache.maven.plugins 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. 2.4.1 4.12 - - ${project.basedir}/../gremlin-server/conf/ - log4j.properties 3.0.2 UTF-8 UTF-8 @@ -144,6 +137,15 @@ limitations under the License. 1.10 1.2 2.10.1 + + + file:target/test-classes/log4j-test.properties + file:target/test-classes/log4j-silent.properties + false @@ -316,12 +318,8 @@ limitations under the License. maven-surefire-plugin 2.17 - -Dlog4j.configuration=${log4j.properties} -Dbuild.dir=${project.build.directory} + -Dlog4j.configuration=${log4j-test.properties} -Dbuild.dir=${project.build.directory} - - - ${log4j.properties.dir} - **/*IntegrateTest.java **/*PerformanceTest.java @@ -343,15 +341,11 @@ limitations under the License. **/*IntegrateTest.java ${skipIntegrationTests} - -Dlog4j.configuration=${log4j.properties} -Dhost=localhost -Dport=8182 + -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} - - - ${log4j.properties.dir} - target/failsafe-reports/failsafe-integration.xml @@ -365,15 +359,11 @@ limitations under the License. **/*PerformanceTest.java ${skipPerformanceTests} - -Dlog4j.configuration=${log4j.properties} -Dhost=localhost -Dport=8182 + -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} - - - ${log4j.properties.dir} - target/failsafe-reports/failsafe-performance.xml @@ -418,6 +408,7 @@ limitations under the License. 1.0 + org.apache.maven.plugins maven-javadoc-plugin ${javadoc-plugin.version} @@ -914,7 +905,7 @@ limitations under the License. - + ci false @@ -927,12 +918,22 @@ limitations under the License. org.apache.maven.plugins + maven-javadoc-plugin + ${javadoc-plugin.version} + + true + + + + org.apache.maven.plugins maven-surefire-plugin 2.17 true + -Dlog4j.configuration=${log4j-silent.properties} -Dbuild.dir=${project.build.directory} + **/*IntegrateTest.java **/*PerformanceTest.java