This is an automated email from the ASF dual-hosted git repository. sgoeschl pushed a commit to branch FREEMARKER-153 in repository https://gitbox.apache.org/repos/asf/freemarker-generator.git
commit 8a0c6eca29d8a4defcdd15afb4b8fe5efb4e722d Author: Siegfried Goeschl <[email protected]> AuthorDate: Mon Aug 3 21:47:13 2020 +0200 FREEMARKER-153 Move "freemarker-cli/examples" to "freemarker-cli/src/examples" --- freemarker-generator-cli/pom.xml | 2 +- .../examples/data/accesslog/combined-access.log | 0 .../{ => src}/examples/data/csv/contract.csv | 0 .../{ => src}/examples/data/csv/dataframe.csv | 0 .../examples/data/csv/excel-export-utf8.csv | 0 .../examples/data/csv/locker-test-users.csv | 0 .../{ => src}/examples/data/csv/sales-records.csv | 0 .../{ => src}/examples/data/csv/transactions.csv | 0 .../{ => src}/examples/data/csv/user.csv | 0 .../examples/data/excel/test-multiple-sheets.xlsx | Bin .../{ => src}/examples/data/excel/test.xls | Bin .../{ => src}/examples/data/excel/test.xlsx | Bin .../examples/data/ftl/nginx/nginx.conf.ftl | 0 .../{ => src}/examples/data/ftl/nginx/nginx.env | 0 .../{ => src}/examples/data/html/dependencies.html | 0 .../{ => src}/examples/data/json/github-users.json | 0 .../{ => src}/examples/data/json/swagger-spec.json | 0 .../data/properties/user_0001/user.properties | 0 .../data/properties/user_0002/user.properties | 0 .../data/properties/user_0003/user.properties | 0 .../data/properties/user_0004/user.properties | 0 .../examples/data/template/application.properties | 0 .../examples/data/template/nginx/nginx.conf.ftl | 0 .../{ => src}/examples/data/xml/recipients.xml | 0 .../{ => src}/examples/data/yaml/customer.yaml | 0 .../{ => src}/examples/data/yaml/swagger-spec.yaml | 0 .../templates/accesslog/combined-access.ftl | 0 .../templates/csv/csv/gatling-user-credentials.ftl | 0 .../examples/templates/csv/fo/transactions.ftl | 0 .../examples/templates/csv/fo/transform.ftl | 0 .../examples/templates/csv/html/transactions.ftl | 0 .../{ => src}/examples/templates/csv/md/filter.ftl | 0 .../examples/templates/csv/shell/curl.ftl | 0 .../examples/templates/dataframe/example.ftl | 0 .../examples/templates/dataframe/html/print.ftl | 0 .../{ => src}/examples/templates/demo.ftl | 0 .../examples/templates/excel/csv/custom.ftl | 0 .../templates/excel/dataframe/transform.ftl | 0 .../examples/templates/html/csv/dependencies.ftl | 0 .../examples/templates/html/txt/licence.ftl | 0 .../templates/json/csv/swagger-endpoints.ftl | 0 .../templates/json/dataframe/github-users.ftl | 0 .../examples/templates/json/md/github-users.ftl | 0 .../templates/properties/csv/locker-test-users.ftl | 0 .../examples/templates/tsv/fo/transactions.ftl | 0 .../examples/templates/xml/txt/recipients.ftl | 0 .../examples/templates/yaml/txt/transform.ftl | 0 .../freemarker/generator/cli/ExamplesTest.java | 81 ++++++++++----------- 48 files changed, 41 insertions(+), 42 deletions(-) diff --git a/freemarker-generator-cli/pom.xml b/freemarker-generator-cli/pom.xml index ff7c4b0..66310bc 100644 --- a/freemarker-generator-cli/pom.xml +++ b/freemarker-generator-cli/pom.xml @@ -81,7 +81,7 @@ <fileset dir="templates" /> </copy> <copy todir="./target/appassembler/examples"> - <fileset dir="examples" /> + <fileset dir="src/examples" /> </copy> <chmod file="./target/appassembler/run-examples.sh" perm="a+x" /> </target> diff --git a/freemarker-generator-cli/examples/data/accesslog/combined-access.log b/freemarker-generator-cli/src/examples/data/accesslog/combined-access.log similarity index 100% rename from freemarker-generator-cli/examples/data/accesslog/combined-access.log rename to freemarker-generator-cli/src/examples/data/accesslog/combined-access.log diff --git a/freemarker-generator-cli/examples/data/csv/contract.csv b/freemarker-generator-cli/src/examples/data/csv/contract.csv similarity index 100% rename from freemarker-generator-cli/examples/data/csv/contract.csv rename to freemarker-generator-cli/src/examples/data/csv/contract.csv diff --git a/freemarker-generator-cli/examples/data/csv/dataframe.csv b/freemarker-generator-cli/src/examples/data/csv/dataframe.csv similarity index 100% rename from freemarker-generator-cli/examples/data/csv/dataframe.csv rename to freemarker-generator-cli/src/examples/data/csv/dataframe.csv diff --git a/freemarker-generator-cli/examples/data/csv/excel-export-utf8.csv b/freemarker-generator-cli/src/examples/data/csv/excel-export-utf8.csv similarity index 100% rename from freemarker-generator-cli/examples/data/csv/excel-export-utf8.csv rename to freemarker-generator-cli/src/examples/data/csv/excel-export-utf8.csv diff --git a/freemarker-generator-cli/examples/data/csv/locker-test-users.csv b/freemarker-generator-cli/src/examples/data/csv/locker-test-users.csv similarity index 100% rename from freemarker-generator-cli/examples/data/csv/locker-test-users.csv rename to freemarker-generator-cli/src/examples/data/csv/locker-test-users.csv diff --git a/freemarker-generator-cli/examples/data/csv/sales-records.csv b/freemarker-generator-cli/src/examples/data/csv/sales-records.csv similarity index 100% rename from freemarker-generator-cli/examples/data/csv/sales-records.csv rename to freemarker-generator-cli/src/examples/data/csv/sales-records.csv diff --git a/freemarker-generator-cli/examples/data/csv/transactions.csv b/freemarker-generator-cli/src/examples/data/csv/transactions.csv similarity index 100% rename from freemarker-generator-cli/examples/data/csv/transactions.csv rename to freemarker-generator-cli/src/examples/data/csv/transactions.csv diff --git a/freemarker-generator-cli/examples/data/csv/user.csv b/freemarker-generator-cli/src/examples/data/csv/user.csv similarity index 100% rename from freemarker-generator-cli/examples/data/csv/user.csv rename to freemarker-generator-cli/src/examples/data/csv/user.csv diff --git a/freemarker-generator-cli/examples/data/excel/test-multiple-sheets.xlsx b/freemarker-generator-cli/src/examples/data/excel/test-multiple-sheets.xlsx similarity index 100% rename from freemarker-generator-cli/examples/data/excel/test-multiple-sheets.xlsx rename to freemarker-generator-cli/src/examples/data/excel/test-multiple-sheets.xlsx diff --git a/freemarker-generator-cli/examples/data/excel/test.xls b/freemarker-generator-cli/src/examples/data/excel/test.xls similarity index 100% rename from freemarker-generator-cli/examples/data/excel/test.xls rename to freemarker-generator-cli/src/examples/data/excel/test.xls diff --git a/freemarker-generator-cli/examples/data/excel/test.xlsx b/freemarker-generator-cli/src/examples/data/excel/test.xlsx similarity index 100% rename from freemarker-generator-cli/examples/data/excel/test.xlsx rename to freemarker-generator-cli/src/examples/data/excel/test.xlsx diff --git a/freemarker-generator-cli/examples/data/ftl/nginx/nginx.conf.ftl b/freemarker-generator-cli/src/examples/data/ftl/nginx/nginx.conf.ftl similarity index 100% rename from freemarker-generator-cli/examples/data/ftl/nginx/nginx.conf.ftl rename to freemarker-generator-cli/src/examples/data/ftl/nginx/nginx.conf.ftl diff --git a/freemarker-generator-cli/examples/data/ftl/nginx/nginx.env b/freemarker-generator-cli/src/examples/data/ftl/nginx/nginx.env similarity index 100% rename from freemarker-generator-cli/examples/data/ftl/nginx/nginx.env rename to freemarker-generator-cli/src/examples/data/ftl/nginx/nginx.env diff --git a/freemarker-generator-cli/examples/data/html/dependencies.html b/freemarker-generator-cli/src/examples/data/html/dependencies.html similarity index 100% rename from freemarker-generator-cli/examples/data/html/dependencies.html rename to freemarker-generator-cli/src/examples/data/html/dependencies.html diff --git a/freemarker-generator-cli/examples/data/json/github-users.json b/freemarker-generator-cli/src/examples/data/json/github-users.json similarity index 100% rename from freemarker-generator-cli/examples/data/json/github-users.json rename to freemarker-generator-cli/src/examples/data/json/github-users.json diff --git a/freemarker-generator-cli/examples/data/json/swagger-spec.json b/freemarker-generator-cli/src/examples/data/json/swagger-spec.json similarity index 100% rename from freemarker-generator-cli/examples/data/json/swagger-spec.json rename to freemarker-generator-cli/src/examples/data/json/swagger-spec.json diff --git a/freemarker-generator-cli/examples/data/properties/user_0001/user.properties b/freemarker-generator-cli/src/examples/data/properties/user_0001/user.properties similarity index 100% rename from freemarker-generator-cli/examples/data/properties/user_0001/user.properties rename to freemarker-generator-cli/src/examples/data/properties/user_0001/user.properties diff --git a/freemarker-generator-cli/examples/data/properties/user_0002/user.properties b/freemarker-generator-cli/src/examples/data/properties/user_0002/user.properties similarity index 100% rename from freemarker-generator-cli/examples/data/properties/user_0002/user.properties rename to freemarker-generator-cli/src/examples/data/properties/user_0002/user.properties diff --git a/freemarker-generator-cli/examples/data/properties/user_0003/user.properties b/freemarker-generator-cli/src/examples/data/properties/user_0003/user.properties similarity index 100% rename from freemarker-generator-cli/examples/data/properties/user_0003/user.properties rename to freemarker-generator-cli/src/examples/data/properties/user_0003/user.properties diff --git a/freemarker-generator-cli/examples/data/properties/user_0004/user.properties b/freemarker-generator-cli/src/examples/data/properties/user_0004/user.properties similarity index 100% rename from freemarker-generator-cli/examples/data/properties/user_0004/user.properties rename to freemarker-generator-cli/src/examples/data/properties/user_0004/user.properties diff --git a/freemarker-generator-cli/examples/data/template/application.properties b/freemarker-generator-cli/src/examples/data/template/application.properties similarity index 100% rename from freemarker-generator-cli/examples/data/template/application.properties rename to freemarker-generator-cli/src/examples/data/template/application.properties diff --git a/freemarker-generator-cli/examples/data/template/nginx/nginx.conf.ftl b/freemarker-generator-cli/src/examples/data/template/nginx/nginx.conf.ftl similarity index 100% rename from freemarker-generator-cli/examples/data/template/nginx/nginx.conf.ftl rename to freemarker-generator-cli/src/examples/data/template/nginx/nginx.conf.ftl diff --git a/freemarker-generator-cli/examples/data/xml/recipients.xml b/freemarker-generator-cli/src/examples/data/xml/recipients.xml similarity index 100% rename from freemarker-generator-cli/examples/data/xml/recipients.xml rename to freemarker-generator-cli/src/examples/data/xml/recipients.xml diff --git a/freemarker-generator-cli/examples/data/yaml/customer.yaml b/freemarker-generator-cli/src/examples/data/yaml/customer.yaml similarity index 100% rename from freemarker-generator-cli/examples/data/yaml/customer.yaml rename to freemarker-generator-cli/src/examples/data/yaml/customer.yaml diff --git a/freemarker-generator-cli/examples/data/yaml/swagger-spec.yaml b/freemarker-generator-cli/src/examples/data/yaml/swagger-spec.yaml similarity index 100% rename from freemarker-generator-cli/examples/data/yaml/swagger-spec.yaml rename to freemarker-generator-cli/src/examples/data/yaml/swagger-spec.yaml diff --git a/freemarker-generator-cli/examples/templates/accesslog/combined-access.ftl b/freemarker-generator-cli/src/examples/templates/accesslog/combined-access.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/accesslog/combined-access.ftl rename to freemarker-generator-cli/src/examples/templates/accesslog/combined-access.ftl diff --git a/freemarker-generator-cli/examples/templates/csv/csv/gatling-user-credentials.ftl b/freemarker-generator-cli/src/examples/templates/csv/csv/gatling-user-credentials.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/csv/csv/gatling-user-credentials.ftl rename to freemarker-generator-cli/src/examples/templates/csv/csv/gatling-user-credentials.ftl diff --git a/freemarker-generator-cli/examples/templates/csv/fo/transactions.ftl b/freemarker-generator-cli/src/examples/templates/csv/fo/transactions.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/csv/fo/transactions.ftl rename to freemarker-generator-cli/src/examples/templates/csv/fo/transactions.ftl diff --git a/freemarker-generator-cli/examples/templates/csv/fo/transform.ftl b/freemarker-generator-cli/src/examples/templates/csv/fo/transform.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/csv/fo/transform.ftl rename to freemarker-generator-cli/src/examples/templates/csv/fo/transform.ftl diff --git a/freemarker-generator-cli/examples/templates/csv/html/transactions.ftl b/freemarker-generator-cli/src/examples/templates/csv/html/transactions.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/csv/html/transactions.ftl rename to freemarker-generator-cli/src/examples/templates/csv/html/transactions.ftl diff --git a/freemarker-generator-cli/examples/templates/csv/md/filter.ftl b/freemarker-generator-cli/src/examples/templates/csv/md/filter.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/csv/md/filter.ftl rename to freemarker-generator-cli/src/examples/templates/csv/md/filter.ftl diff --git a/freemarker-generator-cli/examples/templates/csv/shell/curl.ftl b/freemarker-generator-cli/src/examples/templates/csv/shell/curl.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/csv/shell/curl.ftl rename to freemarker-generator-cli/src/examples/templates/csv/shell/curl.ftl diff --git a/freemarker-generator-cli/examples/templates/dataframe/example.ftl b/freemarker-generator-cli/src/examples/templates/dataframe/example.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/dataframe/example.ftl rename to freemarker-generator-cli/src/examples/templates/dataframe/example.ftl diff --git a/freemarker-generator-cli/examples/templates/dataframe/html/print.ftl b/freemarker-generator-cli/src/examples/templates/dataframe/html/print.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/dataframe/html/print.ftl rename to freemarker-generator-cli/src/examples/templates/dataframe/html/print.ftl diff --git a/freemarker-generator-cli/examples/templates/demo.ftl b/freemarker-generator-cli/src/examples/templates/demo.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/demo.ftl rename to freemarker-generator-cli/src/examples/templates/demo.ftl diff --git a/freemarker-generator-cli/examples/templates/excel/csv/custom.ftl b/freemarker-generator-cli/src/examples/templates/excel/csv/custom.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/excel/csv/custom.ftl rename to freemarker-generator-cli/src/examples/templates/excel/csv/custom.ftl diff --git a/freemarker-generator-cli/examples/templates/excel/dataframe/transform.ftl b/freemarker-generator-cli/src/examples/templates/excel/dataframe/transform.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/excel/dataframe/transform.ftl rename to freemarker-generator-cli/src/examples/templates/excel/dataframe/transform.ftl diff --git a/freemarker-generator-cli/examples/templates/html/csv/dependencies.ftl b/freemarker-generator-cli/src/examples/templates/html/csv/dependencies.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/html/csv/dependencies.ftl rename to freemarker-generator-cli/src/examples/templates/html/csv/dependencies.ftl diff --git a/freemarker-generator-cli/examples/templates/html/txt/licence.ftl b/freemarker-generator-cli/src/examples/templates/html/txt/licence.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/html/txt/licence.ftl rename to freemarker-generator-cli/src/examples/templates/html/txt/licence.ftl diff --git a/freemarker-generator-cli/examples/templates/json/csv/swagger-endpoints.ftl b/freemarker-generator-cli/src/examples/templates/json/csv/swagger-endpoints.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/json/csv/swagger-endpoints.ftl rename to freemarker-generator-cli/src/examples/templates/json/csv/swagger-endpoints.ftl diff --git a/freemarker-generator-cli/examples/templates/json/dataframe/github-users.ftl b/freemarker-generator-cli/src/examples/templates/json/dataframe/github-users.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/json/dataframe/github-users.ftl rename to freemarker-generator-cli/src/examples/templates/json/dataframe/github-users.ftl diff --git a/freemarker-generator-cli/examples/templates/json/md/github-users.ftl b/freemarker-generator-cli/src/examples/templates/json/md/github-users.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/json/md/github-users.ftl rename to freemarker-generator-cli/src/examples/templates/json/md/github-users.ftl diff --git a/freemarker-generator-cli/examples/templates/properties/csv/locker-test-users.ftl b/freemarker-generator-cli/src/examples/templates/properties/csv/locker-test-users.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/properties/csv/locker-test-users.ftl rename to freemarker-generator-cli/src/examples/templates/properties/csv/locker-test-users.ftl diff --git a/freemarker-generator-cli/examples/templates/tsv/fo/transactions.ftl b/freemarker-generator-cli/src/examples/templates/tsv/fo/transactions.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/tsv/fo/transactions.ftl rename to freemarker-generator-cli/src/examples/templates/tsv/fo/transactions.ftl diff --git a/freemarker-generator-cli/examples/templates/xml/txt/recipients.ftl b/freemarker-generator-cli/src/examples/templates/xml/txt/recipients.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/xml/txt/recipients.ftl rename to freemarker-generator-cli/src/examples/templates/xml/txt/recipients.ftl diff --git a/freemarker-generator-cli/examples/templates/yaml/txt/transform.ftl b/freemarker-generator-cli/src/examples/templates/yaml/txt/transform.ftl similarity index 100% rename from freemarker-generator-cli/examples/templates/yaml/txt/transform.ftl rename to freemarker-generator-cli/src/examples/templates/yaml/txt/transform.ftl diff --git a/freemarker-generator-cli/src/test/java/org/apache/freemarker/generator/cli/ExamplesTest.java b/freemarker-generator-cli/src/test/java/org/apache/freemarker/generator/cli/ExamplesTest.java index d4bf8b2..97f7e77 100644 --- a/freemarker-generator-cli/src/test/java/org/apache/freemarker/generator/cli/ExamplesTest.java +++ b/freemarker-generator-cli/src/test/java/org/apache/freemarker/generator/cli/ExamplesTest.java @@ -41,63 +41,62 @@ public class ExamplesTest extends AbstractMainTest { @Test public void shouldRunDemoExamples() throws IOException { - assertValid(execute("-t examples/templates/demo.ftl README.md")); + assertValid(execute("-t src/examples/templates/demo.ftl README.md")); } @Test public void shouldRunCsvExamples() throws IOException { - assertValid(execute("-t templates/csv/html/transform.ftl examples/data/csv/contract.csv")); - assertValid(execute("-t templates/csv/md/transform.ftl examples/data/csv/contract.csv")); - assertValid(execute("-t examples/templates/csv/shell/curl.ftl examples/data/csv/user.csv")); - assertValid(execute("-t examples/templates/csv/fo/transform.ftl examples/data/csv/locker-test-users.csv")); - assertValid(execute("-t examples/templates/csv/fo/transactions.ftl examples/data/csv/transactions.csv")); - assertValid(execute("-t examples/templates/csv/html/transactions.ftl examples/data/csv/transactions.csv")); - assertValid(execute("-t templates/csv/csv/transform.ftl examples/data/csv/contract.csv")); + assertValid(execute("-t templates/csv/html/transform.ftl src/examples/data/csv/contract.csv")); + assertValid(execute("-t templates/csv/md/transform.ftl src/examples/data/csv/contract.csv")); + assertValid(execute("-t src/examples/templates/csv/shell/curl.ftl src/examples/data/csv/user.csv")); + assertValid(execute("-t src/examples/templates/csv/fo/transform.ftl src/examples/data/csv/locker-test-users.csv")); + assertValid(execute("-t src/examples/templates/csv/fo/transactions.ftl src/examples/data/csv/transactions.csv")); + assertValid(execute("-t src/examples/templates/csv/html/transactions.ftl src/examples/data/csv/transactions.csv")); + assertValid(execute("-t templates/csv/csv/transform.ftl src/examples/data/csv/contract.csv")); } @Test public void shouldRunExcelExamples() throws IOException { - assertValid(execute("-t templates/excel/html/transform.ftl examples/data/excel/test.xls")); - assertValid(execute("-t templates/excel/html/transform.ftl examples/data/excel/test.xlsx")); - assertValid(execute("-t templates/excel/html/transform.ftl examples/data/excel/test-multiple-sheets.xlsx")); - assertValid(execute("-t templates/excel/md/transform.ftl examples/data/excel/test-multiple-sheets.xlsx")); - assertValid(execute("-t templates/excel/csv/transform.ftl examples/data/excel/test-multiple-sheets.xlsx")); - assertValid(execute("-t examples/templates/excel/csv/custom.ftl -Pcsv.format=MYSQL examples/data/excel/test.xls")); - assertValid(execute("-t examples/templates/excel/dataframe/transform.ftl examples/data/excel/test.xls")); + assertValid(execute("-t templates/excel/html/transform.ftl src/examples/data/excel/test.xls")); + assertValid(execute("-t templates/excel/html/transform.ftl src/examples/data/excel/test.xlsx")); + assertValid(execute("-t templates/excel/html/transform.ftl src/examples/data/excel/test-multiple-sheets.xlsx")); + assertValid(execute("-t templates/excel/md/transform.ftl src/examples/data/excel/test-multiple-sheets.xlsx")); + assertValid(execute("-t templates/excel/csv/transform.ftl src/examples/data/excel/test-multiple-sheets.xlsx")); + assertValid(execute("-t src/examples/templates/excel/csv/custom.ftl -Pcsv.format=MYSQL src/examples/data/excel/test.xls")); + assertValid(execute("-t src/examples/templates/excel/dataframe/transform.ftl src/examples/data/excel/test.xls")); } @Test public void shouldRunHtmlExamples() throws IOException { - assertValid(execute("-t examples/templates/html/csv/dependencies.ftl examples/data/html/dependencies.html")); - assertValid(execute("-t examples/templates/html/txt/licence.ftl examples/data/html/dependencies.html")); + assertValid(execute("-t src/examples/templates/html/csv/dependencies.ftl src/examples/data/html/dependencies.html")); } @Test public void shouldRunJsonExamples() throws IOException { - assertValid(execute("-t examples/templates/json/csv/swagger-endpoints.ftl examples/data/json/swagger-spec.json")); - assertValid(execute("-t examples/templates/json/md/github-users.ftl examples/data/json/github-users.json")); - assertValid(execute("-t templates/json/yaml/transform.ftl examples/data/json/swagger-spec.json")); + assertValid(execute("-t src/examples/templates/json/csv/swagger-endpoints.ftl src/examples/data/json/swagger-spec.json")); + assertValid(execute("-t src/examples/templates/json/md/github-users.ftl src/examples/data/json/github-users.json")); + assertValid(execute("-t templates/json/yaml/transform.ftl src/examples/data/json/swagger-spec.json")); } @Test public void shouldRunPropertiesExamples() throws IOException { - assertValid(execute("-t examples/templates/properties/csv/locker-test-users.ftl examples/data/properties")); + assertValid(execute("-t src/examples/templates/properties/csv/locker-test-users.ftl src/examples/data/properties")); } @Test public void shouldRunYamlExamples() throws IOException { - assertValid(execute("-t examples/templates/yaml/txt/transform.ftl examples/data/yaml/customer.yaml")); - assertValid(execute("-t templates/yaml/json/transform.ftl examples/data/yaml/swagger-spec.yaml")); + assertValid(execute("-t src/examples/templates/yaml/txt/transform.ftl src/examples/data/yaml/customer.yaml")); + assertValid(execute("-t templates/yaml/json/transform.ftl src/examples/data/yaml/swagger-spec.yaml")); } @Test public void shouldRunXmlExamples() throws IOException { - assertValid(execute("-t examples/templates/xml/txt/recipients.ftl examples/data/xml/recipients.xml")); + assertValid(execute("-t src/examples/templates/xml/txt/recipients.ftl src/examples/data/xml/recipients.xml")); } @Test public void shouldRunGrokExamples() throws IOException { - assertValid(execute("-t examples/templates/accesslog/combined-access.ftl examples/data/accesslog/combined-access.log")); + assertValid(execute("-t src/examples/templates/accesslog/combined-access.ftl src/examples/data/accesslog/combined-access.log")); } @Test @@ -107,42 +106,42 @@ public class ExamplesTest extends AbstractMainTest { @Test public void shouldRunDataFrameExamples() throws IOException { - assertValid(execute("-PCSV_SOURCE_DELIMITER=SEMICOLON -PCSV_SOURCE_WITH_HEADER=true -t examples/templates/dataframe/example.ftl examples/data/csv/dataframe.csv")); + assertValid(execute("-PCSV_SOURCE_DELIMITER=SEMICOLON -PCSV_SOURCE_WITH_HEADER=true -t src/examples/templates/dataframe/example.ftl src/examples/data/csv/dataframe.csv")); } @Test public void shouldRunInteractiveTemplateExamples() throws IOException { - assertValid(execute("-i ${tools.jsonpath.parse(dataSources?values[0]).read(\"$.info.title\")} examples/data/json/swagger-spec.json")); - assertValid(execute("-i ${tools.xml.parse(dataSources?values[0])[\"recipients/person[1]/name\"]} examples/data/xml/recipients.xml")); - assertValid(execute("-i ${tools.jsoup.parse(dataSources?values[0]).select(\"a\")[0]} examples/data/html/dependencies.html")); - assertValid(execute("-i ${tools.gson.toJson(tools.yaml.parse(dataSources?values[0]))} examples/data/yaml/swagger-spec.yaml")); - assertValid(execute("-i ${tools.gson.toJson(yaml)} -m yaml=examples/data/yaml/swagger-spec.yaml")); - assertValid(execute("-i ${tools.yaml.toYaml(tools.gson.parse(dataSources?values[0]))} examples/data/json/swagger-spec.json")); - assertValid(execute("-i ${tools.yaml.toYaml(json)} -m json=examples/data/json/swagger-spec.json")); - assertValid(execute("-i ${tools.dataframe.print(tools.dataframe.fromMaps(tools.gson.parse(dataSources?values[0])))} examples/data/json/github-users.json")); + assertValid(execute("-i ${tools.jsonpath.parse(dataSources?values[0]).read(\"$.info.title\")} src/examples/data/json/swagger-spec.json")); + assertValid(execute("-i ${tools.xml.parse(dataSources?values[0])[\"recipients/person[1]/name\"]} src/examples/data/xml/recipients.xml")); + assertValid(execute("-i ${tools.jsoup.parse(dataSources?values[0]).select(\"a\")[0]} src/examples/data/html/dependencies.html")); + assertValid(execute("-i ${tools.gson.toJson(tools.yaml.parse(dataSources?values[0]))} src/examples/data/yaml/swagger-spec.yaml")); + assertValid(execute("-i ${tools.gson.toJson(yaml)} -m yaml=src/examples/data/yaml/swagger-spec.yaml")); + assertValid(execute("-i ${tools.yaml.toYaml(tools.gson.parse(dataSources?values[0]))} src/examples/data/json/swagger-spec.json")); + assertValid(execute("-i ${tools.yaml.toYaml(json)} -m json=src/examples/data/json/swagger-spec.json")); + assertValid(execute("-i ${tools.dataframe.print(tools.dataframe.fromMaps(tools.gson.parse(dataSources?values[0])))} src/examples/data/json/github-users.json")); } @Test public void shouldTransformSingleTemplateDirectory() throws IOException { - assertTrue(execute("-t examples/data/template").contains("server.name=127.0.0.1")); - assertTrue(execute("-t examples/data/template -PNGINX_HOSTNAME=my.domain.com").contains("server.name=my.domain.com")); + assertTrue(execute("-t src/examples/data/template").contains("server.name=127.0.0.1")); + assertTrue(execute("-t src/examples/data/template -PNGINX_HOSTNAME=my.domain.com").contains("server.name=my.domain.com")); } @Test public void shouldTransformMultipleTemplateDirectories() throws IOException { - assertValid(execute("-t examples/data/template -t examples/data/template")); - assertValid(execute("-t examples/data/template -o target/out/template1 -t examples/data/template -o target/out/template2")); + assertValid(execute("-t src/examples/data/template -t src/examples/data/template")); + assertValid(execute("-t src/examples/data/template -o target/out/template1 -t src/examples/data/template -o target/out/template2")); } @Test public void shouldTransformMultipleTemplates() throws IOException { - assertValid(execute("-t templates/csv/md/transform.ftl -t templates/csv/html/transform.ftl examples/data/csv/contract.csv")); - assertValid(execute("-t templates/csv/md/transform.ftl -o target/contract.md -t templates/csv/html/transform.ftl -o target/contract.html examples/data/csv/contract.csv")); + assertValid(execute("-t templates/csv/md/transform.ftl -t templates/csv/html/transform.ftl src/examples/data/csv/contract.csv")); + assertValid(execute("-t templates/csv/md/transform.ftl -o target/contract.md -t templates/csv/html/transform.ftl -o target/contract.html src/examples/data/csv/contract.csv")); } @Test public void shouldSupportDataSourcesAccessInFTL() throws IOException { - final String args = "users=examples/data/json/github-users.json contract=examples/data/csv/contract.csv"; + final String args = "users=src/examples/data/json/github-users.json contract=src/examples/data/csv/contract.csv"; // check FreeMarker directives assertEquals("true", execute(args + " -i ${dataSources?has_content?c}"));
