This is an automated email from the ASF dual-hosted git repository.
nizhikov pushed a commit to branch ignite-ducktape
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/ignite-ducktape by this push:
new 7d4f0d8 naming -> ducktest (#7857)
7d4f0d8 is described below
commit 7d4f0d86e5cd57e8c405496f00977128fa1f4078
Author: Anton Vinogradov <[email protected]>
AuthorDate: Wed May 27 15:07:57 2020 +0300
naming -> ducktest (#7857)
docker clean-up script
codestyle fixes
modules fix
---
modules/{integration-tests => ducktests}/pom.xml | 2 +-
.../ignite/internal/test/IgniteApplication.java | 17 ++++++++++++---
.../ignite/internal/test/SparkApplication.java | 24 +++++++++++++++++++---
pom.xml | 9 +++++++-
tests/docker/clean_up.sh | 19 +++++++++++++++++
5 files changed, 63 insertions(+), 8 deletions(-)
diff --git a/modules/integration-tests/pom.xml b/modules/ducktests/pom.xml
similarity index 98%
rename from modules/integration-tests/pom.xml
rename to modules/ducktests/pom.xml
index 47fd080..8e5d5b3 100644
--- a/modules/integration-tests/pom.xml
+++ b/modules/ducktests/pom.xml
@@ -30,7 +30,7 @@
<relativePath>../../parent</relativePath>
</parent>
- <artifactId>ignite-integration-tests</artifactId>
+ <artifactId>ignite-ducktests</artifactId>
<version>2.9.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
diff --git
a/modules/integration-tests/src/main/java/org/apache/ignite/internal/test/IgniteApplication.java
b/modules/ducktests/src/main/java/org/apache/ignite/internal/test/IgniteApplication.java
similarity index 90%
rename from
modules/integration-tests/src/main/java/org/apache/ignite/internal/test/IgniteApplication.java
rename to
modules/ducktests/src/main/java/org/apache/ignite/internal/test/IgniteApplication.java
index 1a480bb..d6d710f 100644
---
a/modules/integration-tests/src/main/java/org/apache/ignite/internal/test/IgniteApplication.java
+++
b/modules/ducktests/src/main/java/org/apache/ignite/internal/test/IgniteApplication.java
@@ -27,9 +27,16 @@ import org.apache.ignite.internal.IgnitionEx;
import
org.apache.ignite.internal.processors.resource.GridSpringResourceContext;
import org.apache.ignite.lang.IgniteBiTuple;
+/**
+ *
+ */
public class IgniteApplication {
+ /** Config path. */
public static final String CONFIG_PATH =
"/mnt/client_app/ignite-client-config.xml";
+ /**
+ * @param args Args.
+ */
public static void main(String[] args) throws IgniteCheckedException {
IgniteBiTuple<IgniteConfiguration, GridSpringResourceContext> cfgs =
IgnitionEx.loadConfiguration(CONFIG_PATH);
IgniteConfiguration cfg = cfgs.get1();
@@ -43,9 +50,8 @@ public class IgniteApplication {
IgniteCache<Integer, Integer> cache =
ign.createCache("test-cache");
- for (int i = 0; i < 1000; i++) {
+ for (int i = 0; i < 1000; i++)
cache.put(i, i);
- }
executeSql(cache, "CREATE TABLE person(id INT, fio VARCHAR,
PRIMARY KEY(id))");
executeSql(cache, "INSERT INTO person(id, fio) VALUES(?, ?)", 1,
"Ivanov Ivan");
@@ -56,7 +62,12 @@ public class IgniteApplication {
}
}
- private static void executeSql(IgniteCache<Integer, Integer> cache, String
query, Object...args) {
+ /**
+ * @param cache Cache.
+ * @param query Query.
+ * @param args Args.
+ */
+ private static void executeSql(IgniteCache<Integer, Integer> cache, String
query, Object... args) {
cache.query(new SqlFieldsQuery(query).setArgs(args)).getAll();
}
}
diff --git
a/modules/integration-tests/src/main/java/org/apache/ignite/internal/test/SparkApplication.java
b/modules/ducktests/src/main/java/org/apache/ignite/internal/test/SparkApplication.java
similarity index 93%
rename from
modules/integration-tests/src/main/java/org/apache/ignite/internal/test/SparkApplication.java
rename to
modules/ducktests/src/main/java/org/apache/ignite/internal/test/SparkApplication.java
index 8a88079..fc41f7f 100644
---
a/modules/integration-tests/src/main/java/org/apache/ignite/internal/test/SparkApplication.java
+++
b/modules/ducktests/src/main/java/org/apache/ignite/internal/test/SparkApplication.java
@@ -25,13 +25,22 @@ import org.apache.spark.sql.ignite.IgniteSparkSession;
import static org.apache.ignite.internal.test.IgniteApplication.CONFIG_PATH;
+/**
+ *
+ */
public class SparkApplication {
+ /** Home. */
public static final String HOME = "/opt/ignite-dev";
+ /** Version. */
public static final String VER = "2.9.0-SNAPSHOT";
+ /** Spring version. */
public static final String SPRING_VER = "4.3.26.RELEASE";
+ /**
+ * @param args Args.
+ */
public static void main(String[] args) {
System.out.println("SparkApplication.main - args");
for (String arg : args)
@@ -44,12 +53,15 @@ public class SparkApplication {
System.out.println("Ignite Client Finish.");
}
+ /**
+ * @param masterUrl Master url.
+ */
private static void sparkSession(String masterUrl) {
//Creating spark session.
try (SparkSession spark = SparkSession.builder()
- .appName("SparkApplication")
- .master(masterUrl)
- .getOrCreate()) {
+ .appName("SparkApplication")
+ .master(masterUrl)
+ .getOrCreate()) {
spark.sparkContext().addJar(HOME +
"/modules/core/target/ignite-core-" + VER + ".jar");
spark.sparkContext().addJar(HOME +
"/modules/spring/target/ignite-spring-" + VER + ".jar");
spark.sparkContext().addJar(HOME +
"/modules/log4j/target/ignite-log4j-" + VER + ".jar");
@@ -66,6 +78,9 @@ public class SparkApplication {
}
}
+ /**
+ * @param masterUrl Master url.
+ */
private static void igniteSession(String masterUrl) {
//Creating spark session.
try (IgniteSparkSession spark = IgniteSparkSession.builder()
@@ -91,6 +106,9 @@ public class SparkApplication {
}
}
+ /**
+ * @param spark Spark.
+ */
private static void sparkDSLExample(SparkSession spark) {
System.out.println("Querying using Spark DSL.");
diff --git a/pom.xml b/pom.xml
index e56fd2f..fe71482 100644
--- a/pom.xml
+++ b/pom.xml
@@ -104,6 +104,7 @@
<module>examples</module>
<module>modules/benchmarks</module>
<module>modules/compatibility</module>
+ <module>modules/ducktests</module>
<module>modules/geospatial</module>
<module>modules/hibernate-4.2</module>
<module>modules/hibernate-5.1</module>
@@ -135,6 +136,13 @@
</profile>
<profile>
+ <id>ducktests</id>
+ <modules>
+ <module>modules/ducktests</module>
+ </modules>
+ </profile>
+
+ <profile>
<id>test</id>
<build>
<plugins>
@@ -617,7 +625,6 @@
<id>benchmarks</id>
<modules>
<module>modules/benchmarks</module>
- <module>modules/integration-tests</module>
</modules>
</profile>
diff --git a/tests/docker/clean_up.sh b/tests/docker/clean_up.sh
new file mode 100644
index 0000000..34ce05d
--- /dev/null
+++ b/tests/docker/clean_up.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+
+# 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.
+
+docker stop $(docker ps -a -q)
+docker rm $(docker ps -a -q)
\ No newline at end of file