This is an automated email from the ASF dual-hosted git repository. asf-gitbox-commits pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cayenne.git
commit 8ddcb09af69632bb06bcaafa9eb548082d234639 Author: Andrus Adamchik <[email protected]> AuthorDate: Thu Aug 27 16:04:15 2026 -0400 merging cayenne-maven-plugin-itest into cayenne-maven-plugin --- cayenne-maven-plugin-itest/pom.xml | 161 --------------------- .../tools/CayenneGeneratorMojoOutputTest.java | 107 ++++++++------ .../test/resources/cgen/output}/embeddable.map.xml | 0 .../cgen/output/pairs-embeddables3-pom.xml | 42 ++++++ .../src/test/resources/cgen/output/pairs1-pom.xml | 41 ++++++ .../src/test/resources/cgen/output/pairs2-pom.xml | 41 ++++++ .../src/test/resources/cgen/output/pairs3-pom.xml | 42 ++++++ .../output/single-classes-cust-template-pom.xml | 42 ++++++ .../resources/cgen/output/single-classes1-pom.xml | 41 ++++++ .../resources/cgen/output/single-classes2-pom.xml | 41 ++++++ .../test/resources/cgen/output}/testmap.map.xml | 0 .../test/resources/cgen/output}/velotemplate.vm | 0 pom.xml | 1 - 13 files changed, 349 insertions(+), 210 deletions(-) diff --git a/cayenne-maven-plugin-itest/pom.xml b/cayenne-maven-plugin-itest/pom.xml deleted file mode 100644 index 769d42329..000000000 --- a/cayenne-maven-plugin-itest/pom.xml +++ /dev/null @@ -1,161 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - <!-- - 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 - - https://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. - --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <artifactId>cayenne-parent</artifactId> - <groupId>org.apache.cayenne</groupId> - <version>5.0-SNAPSHOT</version> - </parent> - - <description>Integration Tests - Cayenne Maven Plugin</description> - <artifactId>cayenne-maven-plugin-itest</artifactId> - <name>cayenne-maven-plugin-itest: Maven Plugin integration tests</name> - <packaging>jar</packaging> - - <properties> - <testResourceDir>${project.build.testSourceDirectory}/../resources</testResourceDir> - <generatedClassesDir>${project.build.directory}/generated-tests</generatedClassesDir> - </properties> - - <dependencies> - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter</artifactId> - </dependency> - <dependency> - <groupId>org.apache.cayenne</groupId> - <artifactId>cayenne-di</artifactId> - <version>${project.version}</version> - </dependency> - - <dependency> - <groupId>org.apache.cayenne</groupId> - <artifactId>cayenne</artifactId> - <version>${project.version}</version> - </dependency> - - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-deploy-plugin</artifactId> - <configuration> - <skip>true</skip> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.cayenne.plugins</groupId> - <artifactId>cayenne-maven-plugin</artifactId> - <version>${project.version}</version> - <executions> - <execution> - <id>single-classes-cust-template</id> - <goals> - <goal>cgen</goal> - </goals> - <configuration> - <map>${testResourceDir}/testmap.map.xml</map> - <destDir>${generatedClassesDir}/single-classes-cust-template</destDir> - <makePairs>false</makePairs> - <usePkgPath>true</usePkgPath> - <template>${testResourceDir}/org/apache/cayenne/tools/velotemplate.vm</template> - </configuration> - </execution> - <execution> - <id>single-classes1</id> - <goals> - <goal>cgen</goal> - </goals> - <configuration> - <map>${testResourceDir}/testmap.map.xml</map> - <destDir>${generatedClassesDir}/single-classes1</destDir> - <makePairs>false</makePairs> - <usePkgPath>true</usePkgPath> - </configuration> - </execution> - <execution> - <id>single-classes2</id> - <goals> - <goal>cgen</goal> - </goals> - <configuration> - <map>${testResourceDir}/testmap.map.xml</map> - <destDir>${generatedClassesDir}/single-classes2</destDir> - <makePairs>false</makePairs> - <usePkgPath>false</usePkgPath> - </configuration> - </execution> - <execution> - <id>pairs1</id> - <goals> - <goal>cgen</goal> - </goals> - <configuration> - <map>${testResourceDir}/testmap.map.xml</map> - <destDir>${generatedClassesDir}/pairs1</destDir> - <makePairs>true</makePairs> - <usePkgPath>true</usePkgPath> - </configuration> - </execution> - <execution> - <id>pairs2</id> - <goals> - <goal>cgen</goal> - </goals> - <configuration> - <map>${testResourceDir}/testmap.map.xml</map> - <destDir>${generatedClassesDir}/pairs2</destDir> - <makePairs>true</makePairs> - <usePkgPath>false</usePkgPath> - </configuration> - </execution> - <execution> - <id>pairs3</id> - <goals> - <goal>cgen</goal> - </goals> - <configuration> - <map>${testResourceDir}/testmap.map.xml</map> - <destDir>${generatedClassesDir}/pairs3</destDir> - <makePairs>true</makePairs> - <usePkgPath>true</usePkgPath> - <superPkg>org.apache.cayenne.testdo.testmap.superart</superPkg> - </configuration> - </execution> - <execution> - <id>pairs-embeddables3</id> - <goals> - <goal>cgen</goal> - </goals> - <configuration> - <map>${testResourceDir}/embeddable.map.xml</map> - <destDir>${generatedClassesDir}/pairs-embeddables3</destDir> - <makePairs>true</makePairs> - <usePkgPath>true</usePkgPath> - <superPkg>org.apache.cayenne.testdo.embeddable.auto</superPkg> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/cayenne-maven-plugin-itest/src/test/java/org/apache/cayenne/tools/CayenneGeneratorIntegrationTest.java b/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/CayenneGeneratorMojoOutputTest.java similarity index 61% rename from cayenne-maven-plugin-itest/src/test/java/org/apache/cayenne/tools/CayenneGeneratorIntegrationTest.java rename to cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/CayenneGeneratorMojoOutputTest.java index 0959dc447..87de06385 100644 --- a/cayenne-maven-plugin-itest/src/test/java/org/apache/cayenne/tools/CayenneGeneratorIntegrationTest.java +++ b/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/CayenneGeneratorMojoOutputTest.java @@ -18,63 +18,79 @@ ****************************************************************/ package org.apache.cayenne.tools; +import org.apache.maven.api.plugin.testing.InjectMojo; +import org.apache.maven.api.plugin.testing.MojoTest; import org.junit.jupiter.api.Test; import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStreamReader; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.regex.Pattern; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; -public class CayenneGeneratorIntegrationTest { +/** + * Tests the layout and the content of the files produced by the "cgen" goal with the default templates. + */ +@MojoTest +public class CayenneGeneratorMojoOutputTest { - private File testDir; + private static final String POM_DIR = "src/test/resources/cgen/output/"; - private void startTest(String testName) { - testDir = new File("target/generated-tests", testName); - assertTrue(testDir.isDirectory()); + private Path testDir; + + private void run(CayenneGeneratorMojo mojo, String testName) throws Exception { + assertNotNull(mojo); + mojo.execute(); + + testDir = Path.of("target/generated-tests", testName); + assertTrue(Files.isDirectory(testDir), "Not a directory: " + testDir.toAbsolutePath()); } /** * Test single classes with a non-standard template. */ @Test - public void singleClassesCustTemplate() throws Exception { - startTest("single-classes-cust-template"); + public void singleClassesCustTemplate( + @InjectMojo(goal = "cgen", pom = POM_DIR + "single-classes-cust-template-pom.xml") + CayenneGeneratorMojo mojo) throws Exception { + run(mojo, "single-classes-cust-template"); assertContents("org/apache/cayenne/testdo/testmap/Artist.java", "Artist", "org.apache.cayenne.testdo.testmap", "PersistentObject"); - assertExists("org/apache/cayenne/testdo/testmap/_Artist.java"); + assertNotExists("org/apache/cayenne/testdo/testmap/_Artist.java"); } /** Test single classes generation including full package path. */ @Test - public void singleClasses1() throws Exception { - startTest("single-classes1"); + public void singleClasses1(@InjectMojo(goal = "cgen", pom = POM_DIR + "single-classes1-pom.xml") + CayenneGeneratorMojo mojo) throws Exception { + run(mojo, "single-classes1"); assertContents("org/apache/cayenne/testdo/testmap/Artist.java", "Artist", "org.apache.cayenne.testdo.testmap", "PersistentObject"); - assertExists("org/apache/cayenne/testdo/testmap/_Artist.java"); + assertNotExists("org/apache/cayenne/testdo/testmap/_Artist.java"); } /** Test single classes generation ignoring package path. */ @Test - public void singleClasses2() throws Exception { - startTest("single-classes2"); + public void singleClasses2(@InjectMojo(goal = "cgen", pom = POM_DIR + "single-classes2-pom.xml") + CayenneGeneratorMojo mojo) throws Exception { + run(mojo, "single-classes2"); assertContents("Artist.java", "Artist", "org.apache.cayenne.testdo.testmap", "PersistentObject"); - assertExists("_Artist.java"); - assertExists("org/apache/cayenne/testdo/testmap/Artist.java"); + assertNotExists("_Artist.java"); + assertNotExists("org/apache/cayenne/testdo/testmap/Artist.java"); } /** Test pairs generation including full package path. */ @Test - public void pairs1() throws Exception { - startTest("pairs1"); + public void pairs1(@InjectMojo(goal = "cgen", pom = POM_DIR + "pairs1-pom.xml") + CayenneGeneratorMojo mojo) throws Exception { + run(mojo, "pairs1"); assertContents("org/apache/cayenne/testdo/testmap/Artist.java", "Artist", "org.apache.cayenne.testdo.testmap", "_Artist"); @@ -84,21 +100,22 @@ public class CayenneGeneratorIntegrationTest { /** Test pairs generation in the same directory. */ @Test - public void pairs2() throws Exception { - startTest("pairs2"); + public void pairs2(@InjectMojo(goal = "cgen", pom = POM_DIR + "pairs2-pom.xml") + CayenneGeneratorMojo mojo) throws Exception { + run(mojo, "pairs2"); assertContents("Artist.java", "Artist", "org.apache.cayenne.testdo.testmap", "_Artist"); assertContents("_Artist.java", "_Artist", "org.apache.cayenne.testdo.testmap", "PersistentObject"); - assertExists("org/apache/cayenne/testdo/testmap/Artist.java"); + assertNotExists("org/apache/cayenne/testdo/testmap/Artist.java"); } /** - * Test pairs generation including full package path with superclass and - * subclass in different packages. + * Test pairs generation including full package path with superclass and subclass in different packages. */ @Test - public void pairs3() throws Exception { - startTest("pairs3"); + public void pairs3(@InjectMojo(goal = "cgen", pom = POM_DIR + "pairs3-pom.xml") + CayenneGeneratorMojo mojo) throws Exception { + run(mojo, "pairs3"); assertContents("org/apache/cayenne/testdo/testmap/Artist.java", "Artist", "org.apache.cayenne.testdo.testmap", "_Artist"); @@ -107,8 +124,9 @@ public class CayenneGeneratorIntegrationTest { } @Test - public void pairsEmbeddable3() throws Exception { - startTest("pairs-embeddables3"); + public void pairsEmbeddable3(@InjectMojo(goal = "cgen", pom = POM_DIR + "pairs-embeddables3-pom.xml") + CayenneGeneratorMojo mojo) throws Exception { + run(mojo, "pairs-embeddables3"); assertContents("org/apache/cayenne/testdo/embeddable/EmbedEntity1.java", "EmbedEntity1", "org.apache.cayenne.testdo.embeddable", "_EmbedEntity1"); @@ -120,33 +138,26 @@ public class CayenneGeneratorIntegrationTest { "org.apache.cayenne.testdo.embeddable.auto", null); } - private String convertPath(String unixPath) { - return unixPath.replace('/', File.separatorChar); - } - private void assertContents(String filePath, String className, String packageName, String extendsName) throws Exception { - File f = new File(testDir, convertPath(filePath)); - assertTrue(f.isFile(), "Not a file: " + f.getAbsolutePath()); - assertContents(f, className, packageName, extendsName); - } - private void assertExists(String filePath) { - File f = new File(testDir, convertPath(filePath)); - assertFalse(f.exists()); - } + Path file = testDir.resolve(filePath); + assertTrue(Files.isRegularFile(file), "Not a file: " + file.toAbsolutePath()); - private void assertContents(File f, String className, String packageName, String extendsName) throws Exception { - - try(BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(f)))) { + try (BufferedReader in = Files.newBufferedReader(file)) { assertPackage(in, packageName); assertClass(in, className, extendsName); - } + } + } + + private void assertNotExists(String filePath) { + Path file = testDir.resolve(filePath); + assertFalse(Files.exists(file), "Unexpected file: " + file.toAbsolutePath()); } private void assertPackage(BufferedReader in, String packageName) throws Exception { - String s = null; + String s; while ((s = in.readLine()) != null) { if (Pattern.matches("^package\\s+([^\\s;]+);", s)) { assertTrue(s.indexOf(packageName) > 0); @@ -161,11 +172,11 @@ public class CayenneGeneratorIntegrationTest { Pattern classPattern = Pattern.compile("^public\\s+"); - String s = null; + String s; while ((s = in.readLine()) != null) { if (classPattern.matcher(s).find()) { assertTrue(s.indexOf(className) > 0); - if(extendsName != null) { + if (extendsName != null) { assertTrue(s.indexOf(extendsName) > 0); assertTrue(s.indexOf(className) < s.indexOf(extendsName)); } diff --git a/cayenne-maven-plugin-itest/src/test/resources/embeddable.map.xml b/cayenne-maven-plugin/src/test/resources/cgen/output/embeddable.map.xml similarity index 100% rename from cayenne-maven-plugin-itest/src/test/resources/embeddable.map.xml rename to cayenne-maven-plugin/src/test/resources/cgen/output/embeddable.map.xml diff --git a/cayenne-maven-plugin/src/test/resources/cgen/output/pairs-embeddables3-pom.xml b/cayenne-maven-plugin/src/test/resources/cgen/output/pairs-embeddables3-pom.xml new file mode 100644 index 000000000..7897c54be --- /dev/null +++ b/cayenne-maven-plugin/src/test/resources/cgen/output/pairs-embeddables3-pom.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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 + + https://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. +--> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 + http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <name>Test CayenneGeneratorMojo: pairs-embeddables3</name> + + <build> + <plugins> + <plugin> + <artifactId>cayenne-maven-plugin</artifactId> + <configuration> + <map>src/test/resources/cgen/output/embeddable.map.xml</map> + <destDir>target/generated-tests/pairs-embeddables3</destDir> + <makePairs>true</makePairs> + <usePkgPath>true</usePkgPath> + <superPkg>org.apache.cayenne.testdo.embeddable.auto</superPkg> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/cayenne-maven-plugin/src/test/resources/cgen/output/pairs1-pom.xml b/cayenne-maven-plugin/src/test/resources/cgen/output/pairs1-pom.xml new file mode 100644 index 000000000..02b969dd6 --- /dev/null +++ b/cayenne-maven-plugin/src/test/resources/cgen/output/pairs1-pom.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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 + + https://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. +--> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 + http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <name>Test CayenneGeneratorMojo: pairs1</name> + + <build> + <plugins> + <plugin> + <artifactId>cayenne-maven-plugin</artifactId> + <configuration> + <map>src/test/resources/cgen/output/testmap.map.xml</map> + <destDir>target/generated-tests/pairs1</destDir> + <makePairs>true</makePairs> + <usePkgPath>true</usePkgPath> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/cayenne-maven-plugin/src/test/resources/cgen/output/pairs2-pom.xml b/cayenne-maven-plugin/src/test/resources/cgen/output/pairs2-pom.xml new file mode 100644 index 000000000..51f3f0baf --- /dev/null +++ b/cayenne-maven-plugin/src/test/resources/cgen/output/pairs2-pom.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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 + + https://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. +--> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 + http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <name>Test CayenneGeneratorMojo: pairs2</name> + + <build> + <plugins> + <plugin> + <artifactId>cayenne-maven-plugin</artifactId> + <configuration> + <map>src/test/resources/cgen/output/testmap.map.xml</map> + <destDir>target/generated-tests/pairs2</destDir> + <makePairs>true</makePairs> + <usePkgPath>false</usePkgPath> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/cayenne-maven-plugin/src/test/resources/cgen/output/pairs3-pom.xml b/cayenne-maven-plugin/src/test/resources/cgen/output/pairs3-pom.xml new file mode 100644 index 000000000..888629d5b --- /dev/null +++ b/cayenne-maven-plugin/src/test/resources/cgen/output/pairs3-pom.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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 + + https://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. +--> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 + http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <name>Test CayenneGeneratorMojo: pairs3</name> + + <build> + <plugins> + <plugin> + <artifactId>cayenne-maven-plugin</artifactId> + <configuration> + <map>src/test/resources/cgen/output/testmap.map.xml</map> + <destDir>target/generated-tests/pairs3</destDir> + <makePairs>true</makePairs> + <usePkgPath>true</usePkgPath> + <superPkg>org.apache.cayenne.testdo.testmap.superart</superPkg> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/cayenne-maven-plugin/src/test/resources/cgen/output/single-classes-cust-template-pom.xml b/cayenne-maven-plugin/src/test/resources/cgen/output/single-classes-cust-template-pom.xml new file mode 100644 index 000000000..ca02c3c96 --- /dev/null +++ b/cayenne-maven-plugin/src/test/resources/cgen/output/single-classes-cust-template-pom.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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 + + https://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. +--> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 + http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <name>Test CayenneGeneratorMojo: single-classes-cust-template</name> + + <build> + <plugins> + <plugin> + <artifactId>cayenne-maven-plugin</artifactId> + <configuration> + <map>src/test/resources/cgen/output/testmap.map.xml</map> + <destDir>target/generated-tests/single-classes-cust-template</destDir> + <makePairs>false</makePairs> + <usePkgPath>true</usePkgPath> + <template>src/test/resources/cgen/output/velotemplate.vm</template> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/cayenne-maven-plugin/src/test/resources/cgen/output/single-classes1-pom.xml b/cayenne-maven-plugin/src/test/resources/cgen/output/single-classes1-pom.xml new file mode 100644 index 000000000..d2b4e1e20 --- /dev/null +++ b/cayenne-maven-plugin/src/test/resources/cgen/output/single-classes1-pom.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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 + + https://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. +--> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 + http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <name>Test CayenneGeneratorMojo: single-classes1</name> + + <build> + <plugins> + <plugin> + <artifactId>cayenne-maven-plugin</artifactId> + <configuration> + <map>src/test/resources/cgen/output/testmap.map.xml</map> + <destDir>target/generated-tests/single-classes1</destDir> + <makePairs>false</makePairs> + <usePkgPath>true</usePkgPath> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/cayenne-maven-plugin/src/test/resources/cgen/output/single-classes2-pom.xml b/cayenne-maven-plugin/src/test/resources/cgen/output/single-classes2-pom.xml new file mode 100644 index 000000000..be4580bc0 --- /dev/null +++ b/cayenne-maven-plugin/src/test/resources/cgen/output/single-classes2-pom.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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 + + https://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. +--> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 + http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <name>Test CayenneGeneratorMojo: single-classes2</name> + + <build> + <plugins> + <plugin> + <artifactId>cayenne-maven-plugin</artifactId> + <configuration> + <map>src/test/resources/cgen/output/testmap.map.xml</map> + <destDir>target/generated-tests/single-classes2</destDir> + <makePairs>false</makePairs> + <usePkgPath>false</usePkgPath> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/cayenne-maven-plugin-itest/src/test/resources/testmap.map.xml b/cayenne-maven-plugin/src/test/resources/cgen/output/testmap.map.xml similarity index 100% rename from cayenne-maven-plugin-itest/src/test/resources/testmap.map.xml rename to cayenne-maven-plugin/src/test/resources/cgen/output/testmap.map.xml diff --git a/cayenne-maven-plugin-itest/src/test/resources/org/apache/cayenne/tools/velotemplate.vm b/cayenne-maven-plugin/src/test/resources/cgen/output/velotemplate.vm similarity index 100% rename from cayenne-maven-plugin-itest/src/test/resources/org/apache/cayenne/tools/velotemplate.vm rename to cayenne-maven-plugin/src/test/resources/cgen/output/velotemplate.vm diff --git a/pom.xml b/pom.xml index 65306d18a..3a1133884 100644 --- a/pom.xml +++ b/pom.xml @@ -124,7 +124,6 @@ <module>cayenne-velocity</module> <module>cayenne-osgi</module> <module>cayenne-maven-plugin</module> - <module>cayenne-maven-plugin-itest</module> <module>cayenne-wocompat</module> <module>tutorials</module> <module>docs</module>
