diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eb5a316 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +target diff --git a/.project b/.project new file mode 100644 index 0000000..b9b4caf --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + parent + + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/db-to-db-camel-main/.classpath b/db-to-db-camel-main/.classpath new file mode 100644 index 0000000..6e0021f --- /dev/null +++ b/db-to-db-camel-main/.classpath @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/db-to-db-camel-main/.factorypath b/db-to-db-camel-main/.factorypath new file mode 100644 index 0000000..c70296e --- /dev/null +++ b/db-to-db-camel-main/.factorypath @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/db-to-db-camel-main/.project b/db-to-db-camel-main/.project new file mode 100644 index 0000000..7152358 --- /dev/null +++ b/db-to-db-camel-main/.project @@ -0,0 +1,23 @@ + + + db-to-db-camel-main + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/db-to-db-camel-main/.settings/org.eclipse.core.resources.prefs b/db-to-db-camel-main/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..29abf99 --- /dev/null +++ b/db-to-db-camel-main/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 +encoding/=UTF-8 diff --git a/db-to-db-camel-main/.settings/org.eclipse.jdt.apt.core.prefs b/db-to-db-camel-main/.settings/org.eclipse.jdt.apt.core.prefs new file mode 100644 index 0000000..dfa4f3a --- /dev/null +++ b/db-to-db-camel-main/.settings/org.eclipse.jdt.apt.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.apt.aptEnabled=true +org.eclipse.jdt.apt.genSrcDir=target/generated-sources/annotations +org.eclipse.jdt.apt.genTestSrcDir=target/generated-test-sources/test-annotations diff --git a/db-to-db-camel-main/.settings/org.eclipse.jdt.core.prefs b/db-to-db-camel-main/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..07d21c4 --- /dev/null +++ b/db-to-db-camel-main/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,10 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.methodParameters=generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.processAnnotations=enabled +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/db-to-db-camel-main/.settings/org.eclipse.m2e.core.prefs b/db-to-db-camel-main/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/db-to-db-camel-main/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/db-to-db-camel-main/pom.xml b/db-to-db-camel-main/pom.xml new file mode 100644 index 0000000..e931d57 --- /dev/null +++ b/db-to-db-camel-main/pom.xml @@ -0,0 +1,130 @@ + + + + 4.0.0 + + io.github.zregvart.dbzcamel + parent + 0.0.1-SNAPSHOT + ../pom.xml + + db-to-db-camel-main + DB to DB - Camel main + Database to database replication with Debezium and Camel + + + org.apache.camel + camel-main + + + org.apache.camel + camel-core-model + + + org.apache.camel + camel-bean + runtime + + + org.apache.camel + camel-endpointdsl + + + org.apache.camel + camel-kafka + runtime + + + org.apache.camel + camel-jdbc + runtime + + + org.apache.camel + camel-freemarker + runtime + + + org.apache.camel + camel-jackson + runtime + + + com.fasterxml.jackson.core + jackson-databind + runtime + + + org.junit.jupiter + junit-jupiter-api + test + + + io.github.zregvart.dbzcamel + test-harness + tests + test + + + org.testcontainers + testcontainers + + + org.testcontainers + junit-jupiter + test + + + org.testcontainers + kafka + test + + + io.debezium + debezium-testing-testcontainers + + + io.cucumber + cucumber-java8 + ${io.cucumber.version} + test + + + ch.qos.logback + logback-classic + 1.2.3 + runtime + + + + + + de.sormuras.junit + junit-platform-maven-plugin + 1.1.2 + true + + + features + + + features,io.github.zregvart.dbzcamel.dbtodb + + + + + + diff --git a/db-to-db-camel-main/src/main/java/io/github/zregvart/dbzcamel/dbtodb/App.java b/db-to-db-camel-main/src/main/java/io/github/zregvart/dbzcamel/dbtodb/App.java new file mode 100644 index 0000000..6249338 --- /dev/null +++ b/db-to-db-camel-main/src/main/java/io/github/zregvart/dbzcamel/dbtodb/App.java @@ -0,0 +1,30 @@ +/* + * Licensed 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 io.github.zregvart.dbzcamel.dbtodb; + +import org.apache.camel.main.Main; +import org.apache.camel.main.MainConfigurationProperties; + +public final class App { + static final Main main = new Main(); + + public static void main(final String... args) { + try (MainConfigurationProperties configure = main.configure()) { + configure.addRoutesBuilder(Route.class); + main.run(args); + } catch (final Exception e) { + throw new RuntimeException(e); + } + } +} diff --git a/db-to-db-camel-main/src/main/java/io/github/zregvart/dbzcamel/dbtodb/Route.java b/db-to-db-camel-main/src/main/java/io/github/zregvart/dbzcamel/dbtodb/Route.java new file mode 100644 index 0000000..dac7932 --- /dev/null +++ b/db-to-db-camel-main/src/main/java/io/github/zregvart/dbzcamel/dbtodb/Route.java @@ -0,0 +1,29 @@ +/* + * Licensed 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 io.github.zregvart.dbzcamel.dbtodb; + +import org.apache.camel.builder.endpoint.EndpointRouteBuilder; + +public final class Route extends EndpointRouteBuilder { + + @Override + public void configure() throws Exception { + from(kafka("source.public.customers").brokers("{{kafka.bootstrapServers}}")) + .unmarshal().json() + .setHeader("CamelJdbcParameters").simple("${body[after]}") + .to(freemarker("insert.ftl")) + .to(jdbc("app.dataSource").allowNamedParameters(true).useHeadersAsParameters(true)); + } + +} diff --git a/db-to-db-camel-main/src/main/resources/insert.ftl b/db-to-db-camel-main/src/main/resources/insert.ftl new file mode 100644 index 0000000..9ab29c5 --- /dev/null +++ b/db-to-db-camel-main/src/main/resources/insert.ftl @@ -0,0 +1,26 @@ +<#-- + + Licensed 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. + +--> +INSERT INTO ${body['source']['table']} ( +<#list body['after']?keys as key> + ${key}<#sep>, + + +) VALUES ( +<#list body['after']?keys as key> + :?${key}<#sep>, + + +) \ No newline at end of file diff --git a/db-to-db-camel-main/src/test/java/io/github/zregvart/dbzcamel/dbtodb/EndToEndRouteTest.java b/db-to-db-camel-main/src/test/java/io/github/zregvart/dbzcamel/dbtodb/EndToEndRouteTest.java new file mode 100644 index 0000000..ce14a99 --- /dev/null +++ b/db-to-db-camel-main/src/test/java/io/github/zregvart/dbzcamel/dbtodb/EndToEndRouteTest.java @@ -0,0 +1,94 @@ +/* + * Licensed 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 io.github.zregvart.dbzcamel.dbtodb; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ForkJoinPool; +import java.util.concurrent.Phaser; + +import javax.sql.DataSource; + +import io.cucumber.java8.En; +import io.debezium.testing.testcontainers.ConnectorConfiguration; +import io.debezium.testing.testcontainers.DebeziumContainer; + +import org.apache.camel.main.BaseMainSupport; +import org.apache.camel.main.MainListenerSupport; +import org.junit.jupiter.api.AfterAll; +import org.testcontainers.containers.KafkaContainer; +import org.testcontainers.utility.DockerImageName; + +import configuration.EndToEndTests; +import database.SourceDatabase; + +public class EndToEndRouteTest implements En { + + private final ExecutorService exec = Executors.newSingleThreadExecutor(); + + public EndToEndRouteTest() { + @SuppressWarnings("resource") + final KafkaContainer kafka = new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka:6.2.0")) + .withNetwork(EndToEndTests.testNetwork); + kafka.start(); + + @SuppressWarnings("resource") + final DebeziumContainer debezium = new DebeziumContainer("debezium/connect:1.6.0.Final") + .withKafka(kafka) + .dependsOn(kafka) + .withNetwork(EndToEndTests.testNetwork); + debezium.start(); + + Given("a running example", () -> { + ForkJoinPool.commonPool().submit(() -> { + final Phaser startup = new Phaser(2); + + final DataSource dataSource = EndToEndTests.destinationDatabase().dataSource(); + App.main.bind("app.dataSource", dataSource); + + App.main.addInitialProperty("kafka.bootstrapServers", kafka.getBootstrapServers()); + + App.main.addMainListener(new MainListenerSupport() { + @Override + public void afterStart(final BaseMainSupport main) { + startup.arrive(); + } + }); + + exec.execute(() -> App.main()); + + startup.arriveAndAwaitAdvance(); + + final SourceDatabase database = EndToEndTests.sourceDatabase(); + final ConnectorConfiguration connector = ConnectorConfiguration.create() + .with("connector.class", "io.debezium.connector.postgresql.PostgresConnector") + .with("database.hostname", database.hostname()) + .with("database.port", database.port()) + .with("database.dbname", database.name()) + .with("database.user", database.username()) + .with("database.password", database.password()) + .with("database.server.name", "source") + .with("plugin.name", "pgoutput"); + + debezium.registerConnector("source", connector); + }).get(); + }); + } + + @AfterAll + public void shutdown() { + App.main.shutdown(); + exec.shutdown(); + } +} diff --git a/policy/checkstyle.xml b/policy/checkstyle.xml new file mode 100644 index 0000000..69a153b --- /dev/null +++ b/policy/checkstyle.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/policy/dbeaver-sql-format.properties b/policy/dbeaver-sql-format.properties new file mode 100644 index 0000000..735953c --- /dev/null +++ b/policy/dbeaver-sql-format.properties @@ -0,0 +1,16 @@ +# +# Licensed 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. +# + +sql.formatter.indent.type=tab +sql.formatter.indent.size=1 \ No newline at end of file diff --git a/policy/eclipse-formatter.xml b/policy/eclipse-formatter.xml new file mode 100644 index 0000000..b930cfd --- /dev/null +++ b/policy/eclipse-formatter.xml @@ -0,0 +1,521 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/policy/org.eclipse.wst.xml.core.prefs b/policy/org.eclipse.wst.xml.core.prefs new file mode 100644 index 0000000..536c4ab --- /dev/null +++ b/policy/org.eclipse.wst.xml.core.prefs @@ -0,0 +1,18 @@ +# +# Licensed 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. +# + +eclipse.preferences.version=1 +formatCommentJoinLines=false +indentationSize=1 +lineWidth=120 diff --git a/policy/xml-prefix.xml b/policy/xml-prefix.xml new file mode 100644 index 0000000..bc5cf4f --- /dev/null +++ b/policy/xml-prefix.xml @@ -0,0 +1,26 @@ + + + + + <!-- + + --> + ^<\?xml.*>$ + (\s|\t)*<!--.*$ + .*-->(\s|\t)*$ + true + true + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..e773908 --- /dev/null +++ b/pom.xml @@ -0,0 +1,313 @@ + + + 4.0.0 + + org.basepom + basepom-oss + 39 + + io.github.zregvart.dbzcamel + parent + 0.0.1-SNAPSHOT + pom + Debezium and Camel examples + Examples of using Debezium and Camel + + + Apache License 2.0 + http://www.spdx.org/licenses/Apache-2.0 + + + + + 11 + 1.6.0.Final + 1.15.3 + 6.10.4 + 2.12.2 + + + + db-to-db-camel-main + test-harness + + + + + + org.apache.camel + camel-bom + 3.11.0 + pom + import + + + org.junit + junit-bom + 5.7.2 + pom + import + + + com.fasterxml.jackson + jackson-bom + 2.12.4 + pom + import + + + org.testcontainers + testcontainers-bom + ${org.testcontainers.version} + pom + import + + + io.github.zregvart.dbzcamel + test-harness + ${project.version} + tests + test + + + io.debezium + debezium-testing-testcontainers + ${io.debezium.version} + test + + + io.quarkus + quarkus-test-common + + + + + org.testcontainers + testcontainers + ${org.testcontainers.version} + test + + + org.hamcrest + hamcrest-core + + + + + + + + + central + https://repo1.maven.org/maven2/ + Maven Central + + false + + + true + + + + + atlassian-public + https://packages.atlassian.com/maven-external + Atlassian Public Repo + + false + + + true + + + + + jboss.thirdparty + JBoss Thirdparty Repository + https://repository.jboss.org/nexus/service/local/repositories/thirdparty-releases/content/ + + false + + + true + + + + + + + + maven-jar-plugin + + + create-policy-jar + validate + + jar + + false + + ${project.basedir}/policy + policy + + + + + + maven-install-plugin + + + install-policy-jar + validate + + install-file + + false + + io.github.zregvart.dbzcamel + parent + ${project.version} + policy + true + ${project.build.directory}/parent-${project.version}-policy.jar + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${com.diffplug.spotless.version} + false + + + format-code + + apply + + process-sources + + + + + + + *.md + .gitignore + **/*.xml + + + + + true + 4 + + + XML + + ${project.basedir}/policy/org.eclipse.wst.xml.core.prefs + + + + + + + ${project.basedir}/policy/eclipse-formatter.xml + + + + + **/*.sql + + + Newline after license + ^-- + --%n%n + + + ${project.basedir}/policy/dbeaver-sql-format.properties + + + + + + com.mycila + license-maven-plugin + + + basepom.default + + + + format-license + process-sources + + format + + false + + + **/src/** + **/pom.xml + policy/* + + + + + + + xml-prefix.xml + + + SCRIPT_STYLE + SCRIPT_STYLE + + true + + + + io.github.zregvart.dbzcamel + parent + ${project.version} + policy + + + + + maven-checkstyle-plugin + + checkstyle.xml + + + + basepom.default + + false + + + + + io.github.zregvart.dbzcamel + parent + ${project.version} + policy + + + + + + + diff --git a/test-harness/.classpath b/test-harness/.classpath new file mode 100644 index 0000000..15f02af --- /dev/null +++ b/test-harness/.classpath @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-harness/.externalToolBuilders/cucumber.eclipse.builder.stepdefinition.launch b/test-harness/.externalToolBuilders/cucumber.eclipse.builder.stepdefinition.launch new file mode 100644 index 0000000..8e8569b --- /dev/null +++ b/test-harness/.externalToolBuilders/cucumber.eclipse.builder.stepdefinition.launch @@ -0,0 +1,7 @@ + + + + + + + diff --git a/test-harness/.factorypath b/test-harness/.factorypath new file mode 100644 index 0000000..cee4985 --- /dev/null +++ b/test-harness/.factorypath @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-harness/.project b/test-harness/.project new file mode 100644 index 0000000..12a8641 --- /dev/null +++ b/test-harness/.project @@ -0,0 +1,39 @@ + + + test-harness + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, + + + LaunchConfigHandle + <project>/.externalToolBuilders/cucumber.eclipse.builder.stepdefinition.launch + + + + + cucumber.eclipse.builder.gherkin + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + cucumber.eclipse.nature + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/test-harness/.settings/cucumber.backend.java.prefs b/test-harness/.settings/cucumber.backend.java.prefs new file mode 100644 index 0000000..3ece7f7 --- /dev/null +++ b/test-harness/.settings/cucumber.backend.java.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +enabled=false +glue= diff --git a/test-harness/.settings/org.eclipse.core.resources.prefs b/test-harness/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..f022440 --- /dev/null +++ b/test-harness/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 +encoding/=UTF-8 diff --git a/test-harness/.settings/org.eclipse.jdt.apt.core.prefs b/test-harness/.settings/org.eclipse.jdt.apt.core.prefs new file mode 100644 index 0000000..dfa4f3a --- /dev/null +++ b/test-harness/.settings/org.eclipse.jdt.apt.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.apt.aptEnabled=true +org.eclipse.jdt.apt.genSrcDir=target/generated-sources/annotations +org.eclipse.jdt.apt.genTestSrcDir=target/generated-test-sources/test-annotations diff --git a/test-harness/.settings/org.eclipse.jdt.core.prefs b/test-harness/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..07d21c4 --- /dev/null +++ b/test-harness/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,10 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.methodParameters=generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.processAnnotations=enabled +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/test-harness/.settings/org.eclipse.m2e.core.prefs b/test-harness/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/test-harness/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/test-harness/pom.xml b/test-harness/pom.xml new file mode 100644 index 0000000..4ebf14a --- /dev/null +++ b/test-harness/pom.xml @@ -0,0 +1,119 @@ + + + + 4.0.0 + + io.github.zregvart.dbzcamel + parent + 0.0.1-SNAPSHOT + ../pom.xml + + test-harness + Test harness + Test harness to verify solutions + + 7.11.1 + false + + + + io.cucumber + cucumber-junit-platform-engine + ${io.cucumber.version} + runtime + + + io.cucumber + cucumber-java8 + ${io.cucumber.version} + runtime + + + org.testcontainers + testcontainers + + + org.testcontainers + jdbc + runtime + + + org.testcontainers + postgresql + runtime + + + org.testcontainers + mysql + runtime + + + com.zaxxer + HikariCP + 4.0.3 + runtime + + + org.slf4j + slf4j-api + + + + + org.postgresql + postgresql + 42.2.23 + runtime + + + mysql + mysql-connector-java + 8.0.25 + runtime + + + org.flywaydb + flyway-core + ${org.flywaydb.version} + runtime + + + org.assertj + assertj-core + 3.20.2 + runtime + + + org.awaitility + awaitility + 4.1.0 + runtime + + + + + + de.sormuras.junit + junit-platform-maven-plugin + 1.1.2 + true + + true + + + + + diff --git a/test-harness/src/test/java/configuration/EndToEndTests.java b/test-harness/src/test/java/configuration/EndToEndTests.java new file mode 100644 index 0000000..6e1ab13 --- /dev/null +++ b/test-harness/src/test/java/configuration/EndToEndTests.java @@ -0,0 +1,41 @@ +/* + * Licensed 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 configuration; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import org.testcontainers.containers.Network; + +import database.Database; +import database.DestinationDatabase; +import database.MySQLDatabase; +import database.PostgreSqlDatabase; +import database.SourceDatabase; + +public final class EndToEndTests { + + public static final Network testNetwork = Network.newNetwork(); + + private static final Map memo = new ConcurrentHashMap<>(); + + public static DestinationDatabase destinationDatabase() { + return (DestinationDatabase) memo.computeIfAbsent("destination", x -> new MySQLDatabase(x)); + } + + public static SourceDatabase sourceDatabase() { + return (SourceDatabase) memo.computeIfAbsent("source", x -> new PostgreSqlDatabase(x)); + } + +} diff --git a/test-harness/src/test/java/data/Customer.java b/test-harness/src/test/java/data/Customer.java new file mode 100644 index 0000000..ecdb9a4 --- /dev/null +++ b/test-harness/src/test/java/data/Customer.java @@ -0,0 +1,70 @@ +/* + * Licensed 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 data; + +import java.util.Map; +import java.util.Objects; + +public final class Customer { + public final String email; + + public final String firstName; + + public final int id; + + public final String lastName; + + public Customer(final int id, final String firstName, final String lastName, final String email) { + this.id = id; + this.firstName = firstName; + this.lastName = lastName; + this.email = email; + } + + public Customer(final Map entry) { + this(Integer.parseInt(entry.get("id")), entry.get("first_name"), entry.get("last_name"), entry.get("email")); + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + + if (!(obj instanceof Customer)) { + return false; + } + + final Customer another = (Customer) obj; + + return Objects.equals(id, another.id) + && Objects.equals(firstName, another.firstName) + && Objects.equals(lastName, another.lastName) + && Objects.equals(email, another.email); + } + + @Override + public int hashCode() { + return Objects.hash(id, firstName, lastName, email); + } + + @Override + public String toString() { + return new StringBuilder("Customer: id: ").append(id) + .append(", firstName: ").append(firstName) + .append(", lastName: ").append(lastName) + .append(", email: ").append(email) + .toString(); + } +} \ No newline at end of file diff --git a/test-harness/src/test/java/database/BaseDatabase.java b/test-harness/src/test/java/database/BaseDatabase.java new file mode 100644 index 0000000..67f12a6 --- /dev/null +++ b/test-harness/src/test/java/database/BaseDatabase.java @@ -0,0 +1,143 @@ +/* + * Licensed 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 database; + +import java.sql.DriverManager; +import java.sql.SQLException; + +import javax.sql.DataSource; + +import org.flywaydb.core.Flyway; +import org.postgresql.Driver; +import org.testcontainers.containers.JdbcDatabaseContainer; + +import com.zaxxer.hikari.HikariDataSource; + +import configuration.EndToEndTests; + +abstract class BaseDatabase { + + private final DataSource dataSource; + + private final String hostname; + + private final String name; + + private final String password; + + private final int port; + + private final String username; + + @SuppressWarnings("resource") + public BaseDatabase(final String classifier, final JdbcDatabaseContainer database, final int databasePort) { + database.withDatabaseName(classifier) + .withNetwork(EndToEndTests.testNetwork) + .withNetworkAliases(classifier) + .start(); + + hostname = classifier; + + port = databasePort; + + name = database.getDatabaseName(); + + username = database.getUsername(); + + password = database.getPassword(); + + dataSource = createDataSource(database); + + migrate(classifier, dataSource); + } + + public final DataSource dataSource() { + return dataSource; + } + + public final String hostname() { + return hostname; + } + + public final String name() { + return name; + } + + public final String password() { + return password; + } + + public final int port() { + return port; + } + + public final String username() { + return username; + } + + private static DataSource createDataSource(final JdbcDatabaseContainer database) { + registerDrivers(); + + final HikariDataSource dataSource = new HikariDataSource(); + final String jdbcUrl = database.getJdbcUrl(); + dataSource.setJdbcUrl(jdbcUrl); + dataSource.setUsername(database.getUsername()); + dataSource.setPassword(database.getPassword()); + + return dataSource; + } + + private static void migrate(final String classifier, final DataSource dataSource) { + final Flyway flyway = Flyway.configure(Flyway.class.getClassLoader()) + .dataSource(dataSource) + .locations("db/migration/" + classifier) + .load(); + + flyway.migrate(); + } + + /** + * Otherwise: + * + *
+	 * Failures (1):
+	 *   Cucumber:Data replication DB to DB:New row in source database is replicated to the destination
+	 *     ClasspathResourceSource [classpathResourceName = features/db-to-db.feature, filePosition = FilePosition [line = 23, column = 3]]
+	 *     => java.lang.RuntimeException: Failed to get driver instance for jdbcUrl=jdbc:postgresql://localhost:49538/source?loggerLevel=OFF
+	 *        all//com.zaxxer.hikari.util.DriverDataSource.(DriverDataSource.java:114)
+	 *        all//com.zaxxer.hikari.pool.PoolBase.initializeDataSource(PoolBase.java:331)
+	 *        all//com.zaxxer.hikari.pool.PoolBase.(PoolBase.java:114)
+	 *        all//com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:108)
+	 *        all//com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
+	 *        [...]
+	 *      Caused by: java.sql.SQLException: No suitable driver
+	 *        java.sql/java.sql.DriverManager.getDriver(DriverManager.java:298)
+	 *        all//com.zaxxer.hikari.util.DriverDataSource.(DriverDataSource.java:106)
+	 *        all//com.zaxxer.hikari.pool.PoolBase.initializeDataSource(PoolBase.java:331)
+	 *        all//com.zaxxer.hikari.pool.PoolBase.(PoolBase.java:114)
+	 *        all//com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:108)
+	 *        [...]
+	 * 
+ * + * Not sure why. + */ + private static void registerDrivers() { + try { + DriverManager.registerDriver(new Driver()); + } catch (final SQLException e) { + throw new IllegalStateException("Unable to register JDBC driver with DriverManager", e); + } + } + +} diff --git a/test-harness/src/test/java/database/Database.java b/test-harness/src/test/java/database/Database.java new file mode 100644 index 0000000..79c67fd --- /dev/null +++ b/test-harness/src/test/java/database/Database.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2021 Red Hat, Inc. + * + * Licensed 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 database; + +import javax.sql.DataSource; + +public interface Database { + + DataSource dataSource(); + + String hostname(); + + String name(); + + String password(); + + int port(); + + String username(); + +} diff --git a/test-harness/src/test/java/database/DestinationDatabase.java b/test-harness/src/test/java/database/DestinationDatabase.java new file mode 100644 index 0000000..e9224ac --- /dev/null +++ b/test-harness/src/test/java/database/DestinationDatabase.java @@ -0,0 +1,24 @@ +/* + * Licensed 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 database; + +import java.util.Optional; + +import data.Customer; + +public interface DestinationDatabase extends Database { + + Optional load(int id); + +} diff --git a/test-harness/src/test/java/database/MySQLDatabase.java b/test-harness/src/test/java/database/MySQLDatabase.java new file mode 100644 index 0000000..5c2e7aa --- /dev/null +++ b/test-harness/src/test/java/database/MySQLDatabase.java @@ -0,0 +1,56 @@ +/* + * Licensed 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 database; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Optional; + +import org.testcontainers.containers.MySQLContainer; + +import data.Customer; + +public final class MySQLDatabase extends BaseDatabase implements DestinationDatabase { + + @SuppressWarnings("resource") + public MySQLDatabase(final String classifier) { + super(classifier, new MySQLContainer<>("mysql:8"), MySQLContainer.MYSQL_PORT); + } + + @Override + public Optional load(final int id) { + try (Connection connection = dataSource().getConnection(); + PreparedStatement select = connection.prepareStatement("SELECT id, first_name, last_name, email FROM customers WHERE id = ?")) { + + select.setInt(1, id); + + try (ResultSet row = select.executeQuery()) { + if (!row.next()) { + return Optional.empty(); + } + + return Optional.of( + new Customer(id, + row.getString("first_name"), + row.getString("last_name"), + row.getString("email"))); + } + } catch (final SQLException e) { + throw new AssertionError(e); + } + } + +} diff --git a/test-harness/src/test/java/database/PostgreSqlDatabase.java b/test-harness/src/test/java/database/PostgreSqlDatabase.java new file mode 100644 index 0000000..dbbc8dd --- /dev/null +++ b/test-harness/src/test/java/database/PostgreSqlDatabase.java @@ -0,0 +1,59 @@ +/* + * Licensed 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 database; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; + +import org.testcontainers.containers.PostgreSQLContainer; + +import data.Customer; + +public final class PostgreSqlDatabase extends BaseDatabase implements SourceDatabase { + + @SuppressWarnings("resource") + public PostgreSqlDatabase(final String classifier) { + super(classifier, postgres(), PostgreSQLContainer.POSTGRESQL_PORT); + } + + @Override + public void store(final Customer customer) { + try (Connection connection = dataSource().getConnection(); + PreparedStatement insert = connection.prepareStatement("INSERT INTO customers (id, first_name, last_name, email) VALUES (?, ?, ?, ?)")) { + + insert.setInt(1, customer.id); + insert.setString(2, customer.firstName); + insert.setString(3, customer.lastName); + insert.setString(4, customer.email); + + insert.executeUpdate(); + } catch (final SQLException e) { + throw new AssertionError(e); + } + } + + private static PostgreSQLContainer postgres() { + final PostgreSQLContainer postgres = new PostgreSQLContainer<>("postgres:13-alpine"); + final String[] commandParts = postgres.getCommandParts(); + final String[] newCommandParts = new String[commandParts.length + 2]; + System.arraycopy(commandParts, 0, newCommandParts, 0, commandParts.length); + newCommandParts[newCommandParts.length - 2] = "-c"; + newCommandParts[newCommandParts.length - 1] = "wal_level=logical"; + postgres.setCommandParts(newCommandParts); + + return postgres; + } + +} diff --git a/test-harness/src/test/java/database/SourceDatabase.java b/test-harness/src/test/java/database/SourceDatabase.java new file mode 100644 index 0000000..5df3a82 --- /dev/null +++ b/test-harness/src/test/java/database/SourceDatabase.java @@ -0,0 +1,22 @@ +/* + * Licensed 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 database; + +import data.Customer; + +public interface SourceDatabase extends Database { + + void store(Customer customer); + +} diff --git a/test-harness/src/test/java/features/DatabaseSteps.java b/test-harness/src/test/java/features/DatabaseSteps.java new file mode 100644 index 0000000..ec883c1 --- /dev/null +++ b/test-harness/src/test/java/features/DatabaseSteps.java @@ -0,0 +1,52 @@ +/* + * Licensed 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 features; + +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.TimeUnit; + +import io.cucumber.java8.En; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.awaitility.Awaitility.await; + +import configuration.EndToEndTests; +import data.Customer; +import database.DestinationDatabase; +import database.SourceDatabase; + +public class DatabaseSteps implements En { + + public DatabaseSteps() { + + DataTableType((final Map entry) -> new Customer(entry)); + + When("A row is inserted in the source database", (final Customer customer) -> { + final SourceDatabase sourceDatabase = EndToEndTests.sourceDatabase(); + + sourceDatabase.store(customer); + }); + + Then("a row is present in the destination database", (final Customer customer) -> { + final DestinationDatabase destinationDatabase = EndToEndTests.destinationDatabase(); + + await().atMost(5, TimeUnit.SECONDS).untilAsserted(() -> { + final Optional loaded = destinationDatabase.load(customer.id); + assertThat(loaded).contains(customer); + }); + }); + + } +} diff --git a/test-harness/src/test/resources/db/migration/destination/U1__customers_table.sql b/test-harness/src/test/resources/db/migration/destination/U1__customers_table.sql new file mode 100644 index 0000000..b086d83 --- /dev/null +++ b/test-harness/src/test/resources/db/migration/destination/U1__customers_table.sql @@ -0,0 +1,17 @@ +-- +-- Licensed 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. +-- + +DROP + TABLE + IF EXISTS customers; \ No newline at end of file diff --git a/test-harness/src/test/resources/db/migration/destination/V1__customers_table.sql b/test-harness/src/test/resources/db/migration/destination/V1__customers_table.sql new file mode 100644 index 0000000..cf5431b --- /dev/null +++ b/test-harness/src/test/resources/db/migration/destination/V1__customers_table.sql @@ -0,0 +1,23 @@ +-- +-- Licensed 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. +-- + +CREATE + TABLE + customers( + id INTEGER NOT NULL, + first_name VARCHAR(100) NOT NULL, + last_name VARCHAR(100) NOT NULL, + email VARCHAR(100) NOT NULL, + CONSTRAINT customers_pk PRIMARY KEY(id) + ); \ No newline at end of file diff --git a/test-harness/src/test/resources/db/migration/source/U1__customers_table.sql b/test-harness/src/test/resources/db/migration/source/U1__customers_table.sql new file mode 100644 index 0000000..b086d83 --- /dev/null +++ b/test-harness/src/test/resources/db/migration/source/U1__customers_table.sql @@ -0,0 +1,17 @@ +-- +-- Licensed 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. +-- + +DROP + TABLE + IF EXISTS customers; \ No newline at end of file diff --git a/test-harness/src/test/resources/db/migration/source/V1__customers_table.sql b/test-harness/src/test/resources/db/migration/source/V1__customers_table.sql new file mode 100644 index 0000000..d1fe435 --- /dev/null +++ b/test-harness/src/test/resources/db/migration/source/V1__customers_table.sql @@ -0,0 +1,23 @@ +-- +-- Licensed 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. +-- + +CREATE + TABLE + customers( + id SERIAL NOT NULL, + first_name VARCHAR(100) NOT NULL, + last_name VARCHAR(100) NOT NULL, + email VARCHAR(100) NOT NULL, + CONSTRAINT customers_pk PRIMARY KEY(id) + ); \ No newline at end of file diff --git a/test-harness/src/test/resources/features/db-to-db.feature b/test-harness/src/test/resources/features/db-to-db.feature new file mode 100644 index 0000000..6fa4b48 --- /dev/null +++ b/test-harness/src/test/resources/features/db-to-db.feature @@ -0,0 +1,30 @@ +# +# Licensed 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. +# + +Feature: Data replication DB to DB + Move data from a RDBMS (Postgres) to another database (MySQL) during + application modernization (monolith to microservices migration, + database migration etc) + +Background: Example solution is deployed + Given a running example + + Scenario: New row in source database is replicated to the destination + databasee + When A row is inserted in the source database + | id | first_name | last_name | email | + | 1 | John | Doe | john.doe@example.com | + Then a row is present in the destination database + | id | first_name | last_name | email | + | 1 | John | Doe | john.doe@example.com | diff --git a/test-harness/src/test/resources/junit-platform.properties b/test-harness/src/test/resources/junit-platform.properties new file mode 100644 index 0000000..cce15ab --- /dev/null +++ b/test-harness/src/test/resources/junit-platform.properties @@ -0,0 +1,16 @@ +# +# Licensed 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. +# + +cucumber.publish.enabled=false +cucumber.publish.quiet=true diff --git a/test-harness/src/test/resources/logback-test.xml b/test-harness/src/test/resources/logback-test.xml new file mode 100644 index 0000000..9b1014c --- /dev/null +++ b/test-harness/src/test/resources/logback-test.xml @@ -0,0 +1,27 @@ + + + + + + + %d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n + + + + + + + +