Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 10 additions & 24 deletions datamodel/odata-v4/odata-v4-generator-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>odata-generator-utility</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<!-- scope "provided" -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
Expand All @@ -60,16 +65,15 @@
<artifactId>maven-plugin-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- scope "provided" -->
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<scope>provided</scope>
</dependency>
<!-- scope "test" -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -78,19 +82,11 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<groupId>com.sap.cloud.sdk.testutil</groupId>
<artifactId>testutil-maven-plugin</artifactId>
<version>5.0.0-alpha-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
Expand All @@ -115,16 +111,6 @@
<goalPrefix>odata-v4-generator</goalPrefix>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<ignoredUnusedDeclaredDependencies>
<!-- Runtime dependency testing the plugin -->
<ignoredUnusedDeclaredDependency>org.apache.maven:maven-compat</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,27 @@

package com.sap.cloud.sdk.datamodel.odatav4.generator;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.SoftAssertions.assertSoftly;

import java.io.File;
import java.net.URL;

import org.apache.maven.plugin.testing.MojoRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import com.sap.cloud.sdk.datamodel.odata.utility.NameSource;
import com.sap.cloud.sdk.datamodel.odata.utility.S4HanaNamingStrategy;
import com.sap.cloud.sdk.datamodel.odatav4.generator.annotation.DefaultAnnotationStrategy;
import com.sap.cloud.sdk.testutil.MavenPluginExtension;

public class DataModelGeneratorMojoTest
{
@Rule
public MojoRule rule = new MojoRule();
@RegisterExtension
static MavenPluginExtension extension =
new MavenPluginExtension().withClass(DataModelGeneratorMojoTest.class).withGoal("generate");

//void testMe( @MojoForGoal("generate") final DataModelGeneratorMojo mojo )
@Test
public void test()
throws Exception
void testMe()
{
final URL resource = getClass().getClassLoader().getResource(getClass().getSimpleName());
assertThat(resource).isNotNull();

final File pomFile = new File(resource.getFile());

final DataModelGeneratorMojo mojo = (DataModelGeneratorMojo) rule.lookupConfiguredMojo(pomFile, "generate");
final DataModelGeneratorMojo mojo = extension.getMojo();
final DataModelGenerator generator = mojo.getDataModelGenerator();

assertSoftly(softly -> {
Expand Down
1 change: 1 addition & 0 deletions testutil/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
</developers>
<modules>
<module>testutil-core</module>
<module>testutil-maven-plugin</module>
</modules>
<scm>
<connection />
Expand Down
5 changes: 5 additions & 0 deletions testutil/testutil-maven-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/target/
/.settings/
/.project
/src/main/generated
/.classpath
141 changes: 141 additions & 0 deletions testutil/testutil-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.sap.cloud.sdk.testutil</groupId>
<artifactId>testutil-parent</artifactId>
<version>5.0.0-alpha-SNAPSHOT</version>
</parent>
<artifactId>testutil-maven-plugin</artifactId>
<name>Test Utilities - Maven Plugin</name>
<description>Convenience utilities for testing.</description>
<url>https://sap.github.io/cloud-sdk/docs/java/getting-started</url>
<organization>
<name>SAP SE</name>
<url>https://www.sap.com</url>
</organization>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<name>SAP</name>
<email>[email protected]</email>
<organization>SAP SE</organization>
<organizationUrl>https://www.sap.com</organizationUrl>
</developer>
</developers>
<scm>
<connection />
<url />
</scm>
<properties>
<x-sap-release-audience>None</x-sap-release-audience>
<x-sap-release-maturity>Stable</x-sap-release-maturity>
<x-sap-exclude-from-blackduck-scan>true</x-sap-exclude-from-blackduck-scan>
<enforcer.skipBanWiremockCompileScope>true</enforcer.skipBanWiremockCompileScope>
<java.failOnWarning>false</java.failOnWarning>
<!-- allow scope compile for Java EE dependencies -->
<enforcer.skipEnforceScopeJavaEE>true</enforcer.skipEnforceScopeJavaEE>
</properties>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.2.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-classworlds</artifactId>
<version>2.6.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
<version>0.3.4</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>plexus-classworlds</artifactId>
<groupId>org.codehaus.plexus</groupId>
</exclusion>
<exclusion>
<artifactId>plexus-utils</artifactId>
<groupId>org.codehaus.plexus</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-api</artifactId>
<version>1.6.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.jupiter.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${maven-plugin.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>${maven-plugin.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${maven-plugin.version}</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>plexus-utils</artifactId>
<groupId>org.codehaus.plexus</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-resolver-provider</artifactId>
<version>${maven-plugin.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>${maven-plugin.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<!-- ignore cast warnings since Lombok's @Builder has a redundant cast for Java 9 -->
<!-- see here: https://github.com/rzwitserloot/lombok/issues/1363 -->
<arg>-Xlint:-cast</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading