From 381e5636ce7ef965814dc1f6efa5dd5f4463c098 Mon Sep 17 00:00:00 2001 From: Tim Fox Date: Fri, 18 Oct 2019 08:15:51 +0100 Subject: [PATCH] fix: Created new test for running topology generation manually from the IDE, and removed main() from TopologyFileGenerator (#3609) --- .../test/ManualTopologyFileGeneratorTest.java | 33 +++++++++++++++++++ .../ksql/test/TopologyFileGenerator.java | 8 ++--- 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 ksql-functional-tests/src/test/java/io/confluent/ksql/test/ManualTopologyFileGeneratorTest.java diff --git a/ksql-functional-tests/src/test/java/io/confluent/ksql/test/ManualTopologyFileGeneratorTest.java b/ksql-functional-tests/src/test/java/io/confluent/ksql/test/ManualTopologyFileGeneratorTest.java new file mode 100644 index 000000000000..9563754957e8 --- /dev/null +++ b/ksql-functional-tests/src/test/java/io/confluent/ksql/test/ManualTopologyFileGeneratorTest.java @@ -0,0 +1,33 @@ +/* + * Copyright 2019 Confluent Inc. + * + * Licensed under the Confluent Community License (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.confluent.io/confluent-community-license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package io.confluent.ksql.test; + +import org.junit.Ignore; +import org.junit.Test; + +/** + * This test exists only to be able to generate topologies as part of the release process + * It can be run manually from the IDE + * It is deliberately excluded from the test suite + */ +@Ignore +public final class ManualTopologyFileGeneratorTest { + + @Test + public void manuallyGenerateTopologies() throws Exception { + TopologyFileGenerator.generateTopologies(); + } +} diff --git a/ksql-functional-tests/src/test/java/io/confluent/ksql/test/TopologyFileGenerator.java b/ksql-functional-tests/src/test/java/io/confluent/ksql/test/TopologyFileGenerator.java index 7643b8b381ab..a88ffb14c658 100644 --- a/ksql-functional-tests/src/test/java/io/confluent/ksql/test/TopologyFileGenerator.java +++ b/ksql-functional-tests/src/test/java/io/confluent/ksql/test/TopologyFileGenerator.java @@ -81,10 +81,6 @@ public final class TopologyFileGenerator { private TopologyFileGenerator() { } - public static void main(final String[] args) throws Exception { - generateTopologies(findBaseDir()); - } - static Path findBaseDir() { Path path = Paths.get("./ksql-functional-tests"); if (Files.exists(path)) { @@ -99,6 +95,10 @@ static Path findBaseDir() { + "root of the ksql-functional-tests module"); } + static void generateTopologies() throws Exception { + generateTopologies(findBaseDir()); + } + static void generateTopologies(final Path base) throws Exception { final String formattedVersion = getFormattedVersionFromPomFile(); final Path generatedTopologyPath = base.resolve(formattedVersion);