This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git
commit 5bd24f61573913d8124f124e483bd4e4680b280d Author: Nick Reich <nre...@pivotal.io> AuthorDate: Thu Mar 29 11:08:02 2018 -0700 GEODE-4947: Improve pathing to docker compose resource files --- .../jdbc/MySqlJdbcAsyncWriterIntegrationTest.java | 10 ++++---- .../connectors/jdbc/MySqlJdbcDistributedTest.java | 9 ++++--- .../jdbc/MySqlJdbcLoaderIntegrationTest.java | 9 ++++--- .../jdbc/MySqlJdbcWriterIntegrationTest.java | 9 ++++--- .../PostgresJdbcAsyncWriterIntegrationTest.java | 9 ++++--- .../jdbc/PostgresJdbcDistributedTest.java | 9 ++++--- .../jdbc/PostgresJdbcLoaderIntegrationTest.java | 9 ++++--- .../jdbc/PostgresJdbcWriterIntegrationTest.java | 9 ++++--- .../src/test/resources/docker/mysql.yml | 12 ---------- .../src/test/resources/docker/postgres.yml | 11 --------- .../apache/geode/connectors/jdbc/docker/mysql.yml | 28 ++++++++++++++++++++++ .../geode/connectors/jdbc/docker/postgres.yml | 27 +++++++++++++++++++++ 12 files changed, 103 insertions(+), 48 deletions(-) diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcAsyncWriterIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcAsyncWriterIntegrationTest.java index 2ca6ff4..8e758d9 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcAsyncWriterIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcAsyncWriterIntegrationTest.java @@ -14,6 +14,7 @@ */ package org.apache.geode.connectors.jdbc; +import java.net.URL; import java.sql.Connection; import java.sql.SQLException; @@ -23,15 +24,16 @@ import org.junit.experimental.categories.Category; import org.apache.geode.test.junit.categories.IntegrationTest; import org.apache.geode.test.junit.rules.DatabaseConnectionRule; import org.apache.geode.test.junit.rules.MySqlConnectionRule; -import org.apache.geode.test.junit.rules.PostgresConnectionRule; @Category(IntegrationTest.class) public class MySqlJdbcAsyncWriterIntegrationTest extends JdbcAsyncWriterIntegrationTest { + private static final URL COMPOSE_RESOURCE_PATH = + MySqlJdbcAsyncWriterIntegrationTest.class.getResource("docker/mysql.yml"); + @ClassRule - public static DatabaseConnectionRule dbRule = - new MySqlConnectionRule.Builder().file("src/test/resources/docker/mysql.yml") - .serviceName("db").port(3306).database(DB_NAME).build(); + public static DatabaseConnectionRule dbRule = new MySqlConnectionRule.Builder() + .file(COMPOSE_RESOURCE_PATH.getPath()).serviceName("db").port(3306).database(DB_NAME).build(); @Override public Connection getConnection() throws SQLException { diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java index fc1f655..32fb9f3 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java @@ -14,6 +14,7 @@ */ package org.apache.geode.connectors.jdbc; +import java.net.URL; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; @@ -33,13 +34,15 @@ import org.apache.geode.test.junit.rules.SqlDatabaseConnectionRule; @Category(DistributedTest.class) public class MySqlJdbcDistributedTest extends JdbcDistributedTest { + private static final URL COMPOSE_RESOURCE_PATH = + MySqlJdbcAsyncWriterIntegrationTest.class.getResource("docker/mysql.yml"); + @ClassRule - public static transient SqlDatabaseConnectionRule dbRule = createConnectionRule();// = new - // MySqlConnectionRule.Builder().file("src/test/resources/docker/mysql.yml").serviceName("db").port(3306).database(DB_NAME).build(); + public static transient SqlDatabaseConnectionRule dbRule = createConnectionRule(); private static SqlDatabaseConnectionRule createConnectionRule() { try { - return new MySqlConnectionRule.Builder().file("src/test/resources/docker/mysql.yml") + return new MySqlConnectionRule.Builder().file(COMPOSE_RESOURCE_PATH.getPath()) .serviceName("db").port(3306).database(DB_NAME).build(); } catch (IllegalStateException e) { return null; diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcLoaderIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcLoaderIntegrationTest.java index c59cc41..9ab31a0 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcLoaderIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcLoaderIntegrationTest.java @@ -14,6 +14,7 @@ */ package org.apache.geode.connectors.jdbc; +import java.net.URL; import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; @@ -28,10 +29,12 @@ import org.apache.geode.test.junit.rules.MySqlConnectionRule; @Category(IntegrationTest.class) public class MySqlJdbcLoaderIntegrationTest extends JdbcLoaderIntegrationTest { + private static final URL COMPOSE_RESOURCE_PATH = + MySqlJdbcAsyncWriterIntegrationTest.class.getResource("docker/mysql.yml"); + @ClassRule - public static DatabaseConnectionRule dbRule = - new MySqlConnectionRule.Builder().file("src/test/resources/docker/mysql.yml") - .serviceName("db").port(3306).database(DB_NAME).build(); + public static DatabaseConnectionRule dbRule = new MySqlConnectionRule.Builder() + .file(COMPOSE_RESOURCE_PATH.getPath()).serviceName("db").port(3306).database(DB_NAME).build(); @Override public Connection getConnection() throws SQLException { diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcWriterIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcWriterIntegrationTest.java index 8ca1ca3..50df180 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcWriterIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcWriterIntegrationTest.java @@ -14,6 +14,7 @@ */ package org.apache.geode.connectors.jdbc; +import java.net.URL; import java.sql.Connection; import java.sql.SQLException; @@ -27,10 +28,12 @@ import org.apache.geode.test.junit.rules.MySqlConnectionRule; @Category(IntegrationTest.class) public class MySqlJdbcWriterIntegrationTest extends JdbcWriterIntegrationTest { + private static final URL COMPOSE_RESOURCE_PATH = + MySqlJdbcAsyncWriterIntegrationTest.class.getResource("docker/mysql.yml"); + @ClassRule - public static DatabaseConnectionRule dbRule = - new MySqlConnectionRule.Builder().file("src/test/resources/docker/mysql.yml") - .serviceName("db").port(3306).database(DB_NAME).build(); + public static DatabaseConnectionRule dbRule = new MySqlConnectionRule.Builder() + .file(COMPOSE_RESOURCE_PATH.getPath()).serviceName("db").port(3306).database(DB_NAME).build(); @Override public Connection getConnection() throws SQLException { diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcAsyncWriterIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcAsyncWriterIntegrationTest.java index 31baf95..3b363c2 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcAsyncWriterIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcAsyncWriterIntegrationTest.java @@ -14,6 +14,7 @@ */ package org.apache.geode.connectors.jdbc; +import java.net.URL; import java.sql.Connection; import java.sql.SQLException; @@ -27,10 +28,12 @@ import org.apache.geode.test.junit.rules.PostgresConnectionRule; @Category(IntegrationTest.class) public class PostgresJdbcAsyncWriterIntegrationTest extends JdbcAsyncWriterIntegrationTest { + private static final URL COMPOSE_RESOURCE_PATH = + MySqlJdbcAsyncWriterIntegrationTest.class.getResource("docker/postgres.yml"); + @ClassRule - public static DatabaseConnectionRule dbRule = - new PostgresConnectionRule.Builder().file("src/test/resources/docker/postgres.yml") - .serviceName("db").port(5432).database(DB_NAME).build(); + public static DatabaseConnectionRule dbRule = new PostgresConnectionRule.Builder() + .file(COMPOSE_RESOURCE_PATH.getPath()).serviceName("db").port(5432).database(DB_NAME).build(); @Override public Connection getConnection() throws SQLException { diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcDistributedTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcDistributedTest.java index 04c1a4f..82e0ec6 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcDistributedTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcDistributedTest.java @@ -14,6 +14,7 @@ */ package org.apache.geode.connectors.jdbc; +import java.net.URL; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; @@ -33,13 +34,15 @@ import org.apache.geode.test.junit.rules.SqlDatabaseConnectionRule; @Category(DistributedTest.class) public class PostgresJdbcDistributedTest extends JdbcDistributedTest { + private static final URL COMPOSE_RESOURCE_PATH = + MySqlJdbcAsyncWriterIntegrationTest.class.getResource("docker/postgres.yml"); + @ClassRule - public static transient SqlDatabaseConnectionRule dbRule = createConnectionRule();// = new - // MySqlConnectionRule.Builder().file("src/test/resources/docker/mysql.yml").serviceName("db").port(3306).database(DB_NAME).build(); + public static transient SqlDatabaseConnectionRule dbRule = createConnectionRule(); private static SqlDatabaseConnectionRule createConnectionRule() { try { - return new PostgresConnectionRule.Builder().file("src/test/resources/docker/postgres.yml") + return new PostgresConnectionRule.Builder().file(COMPOSE_RESOURCE_PATH.getPath()) .serviceName("db").port(5432).database(DB_NAME).build(); } catch (IllegalStateException e) { return null; diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcLoaderIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcLoaderIntegrationTest.java index e9e4115..904a5b8 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcLoaderIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcLoaderIntegrationTest.java @@ -14,6 +14,7 @@ */ package org.apache.geode.connectors.jdbc; +import java.net.URL; import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; @@ -28,10 +29,12 @@ import org.apache.geode.test.junit.rules.PostgresConnectionRule; @Category(IntegrationTest.class) public class PostgresJdbcLoaderIntegrationTest extends JdbcLoaderIntegrationTest { + private static final URL COMPOSE_RESOURCE_PATH = + MySqlJdbcAsyncWriterIntegrationTest.class.getResource("docker/postgres.yml"); + @ClassRule - public static DatabaseConnectionRule dbRule = - new PostgresConnectionRule.Builder().file("src/test/resources/docker/postgres.yml") - .serviceName("db").port(5432).database(DB_NAME).build(); + public static DatabaseConnectionRule dbRule = new PostgresConnectionRule.Builder() + .file(COMPOSE_RESOURCE_PATH.getPath()).serviceName("db").port(5432).database(DB_NAME).build(); @Override public Connection getConnection() throws SQLException { diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcWriterIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcWriterIntegrationTest.java index ab2fe8d..1009119 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcWriterIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcWriterIntegrationTest.java @@ -14,6 +14,7 @@ */ package org.apache.geode.connectors.jdbc; +import java.net.URL; import java.sql.Connection; import java.sql.SQLException; @@ -27,10 +28,12 @@ import org.apache.geode.test.junit.rules.PostgresConnectionRule; @Category(IntegrationTest.class) public class PostgresJdbcWriterIntegrationTest extends JdbcWriterIntegrationTest { + private static final URL COMPOSE_RESOURCE_PATH = + MySqlJdbcAsyncWriterIntegrationTest.class.getResource("docker/postgres.yml"); + @ClassRule - public static DatabaseConnectionRule dbRule = - new PostgresConnectionRule.Builder().file("src/test/resources/docker/postgres.yml") - .serviceName("db").port(5432).database(DB_NAME).build(); + public static DatabaseConnectionRule dbRule = new PostgresConnectionRule.Builder() + .file(COMPOSE_RESOURCE_PATH.getPath()).serviceName("db").port(5432).database(DB_NAME).build(); @Override public Connection getConnection() throws SQLException { diff --git a/geode-connectors/src/test/resources/docker/mysql.yml b/geode-connectors/src/test/resources/docker/mysql.yml deleted file mode 100644 index 1bebd2b..0000000 --- a/geode-connectors/src/test/resources/docker/mysql.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: '3.1' - -services: - - db: - image: mysql:5.7 - restart: always - ports: - - 3306 - environment: - MYSQL_ALLOW_EMPTY_PASSWORD: "true" - #MYSQL_ROOT_PASSWORD: "secret" \ No newline at end of file diff --git a/geode-connectors/src/test/resources/docker/postgres.yml b/geode-connectors/src/test/resources/docker/postgres.yml deleted file mode 100644 index 1b2ce80..0000000 --- a/geode-connectors/src/test/resources/docker/postgres.yml +++ /dev/null @@ -1,11 +0,0 @@ -version: '3.1' - -services: - - db: - image: postgres - restart: always - ports: - - 5432 - environment: - POSTGRES_DB: test diff --git a/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/docker/mysql.yml b/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/docker/mysql.yml new file mode 100644 index 0000000..97e1c32 --- /dev/null +++ b/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/docker/mysql.yml @@ -0,0 +1,28 @@ +# +# 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. +# +version: '3.1' + +services: + + db: + image: mysql:5.7 + restart: always + ports: + - 3306 + environment: + MYSQL_ALLOW_EMPTY_PASSWORD: "true" + #MYSQL_ROOT_PASSWORD: "secret" \ No newline at end of file diff --git a/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/docker/postgres.yml b/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/docker/postgres.yml new file mode 100644 index 0000000..2380b9e --- /dev/null +++ b/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/docker/postgres.yml @@ -0,0 +1,27 @@ +# +# 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. +# +version: '3.1' + +services: + + db: + image: postgres + restart: always + ports: + - 5432 + environment: + POSTGRES_DB: test -- To stop receiving notification emails like this one, please contact aging...@apache.org.