From a3e62012b9bae3c38faeec601dd645ee72fb5242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martti=20K=C3=A4=C3=A4rik?= <martti.kaarik@elvior.com> Date: Tue, 11 Apr 2023 14:29:18 +0300 Subject: [PATCH] Plugin for JUnit code generator and runtime environment. --- .../.classpath | 24 +++++++++ .../.gitignore | 1 + .../org.etsi.mts.tdl.execution.java/.project | 34 +++++++++++++ .../.settings/org.eclipse.jdt.core.prefs | 15 ++++++ .../.settings/org.eclipse.m2e.core.prefs | 4 ++ .../META-INF/MANIFEST.MF | 16 ++++++ .../org.etsi.mts.tdl.execution.java/README.md | 11 +++++ .../build.properties | 6 +++ .../plugin.xml | 44 +++++++++++++++++ .../org.etsi.mts.tdl.execution.java/pom.xml | 49 +++++++++++++++++++ .../tdl-execution-java-maven-build.launch | 23 +++++++++ 11 files changed, 227 insertions(+) create mode 100644 plugins/org.etsi.mts.tdl.execution.java/.classpath create mode 100644 plugins/org.etsi.mts.tdl.execution.java/.gitignore create mode 100644 plugins/org.etsi.mts.tdl.execution.java/.project create mode 100644 plugins/org.etsi.mts.tdl.execution.java/.settings/org.eclipse.jdt.core.prefs create mode 100644 plugins/org.etsi.mts.tdl.execution.java/.settings/org.eclipse.m2e.core.prefs create mode 100644 plugins/org.etsi.mts.tdl.execution.java/META-INF/MANIFEST.MF create mode 100644 plugins/org.etsi.mts.tdl.execution.java/README.md create mode 100644 plugins/org.etsi.mts.tdl.execution.java/build.properties create mode 100644 plugins/org.etsi.mts.tdl.execution.java/plugin.xml create mode 100644 plugins/org.etsi.mts.tdl.execution.java/pom.xml create mode 100644 plugins/org.etsi.mts.tdl.execution.java/tdl-execution-java-maven-build.launch diff --git a/plugins/org.etsi.mts.tdl.execution.java/.classpath b/plugins/org.etsi.mts.tdl.execution.java/.classpath new file mode 100644 index 00000000..5d4f8b08 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.execution.java/.classpath @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"> + <attributes> + <attribute name="optional" value="true"/> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="src" path="runtime-src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"> + <attributes> + <attribute name="module" value="true"/> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/> + <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="output" path="target/classes"/> +</classpath> diff --git a/plugins/org.etsi.mts.tdl.execution.java/.gitignore b/plugins/org.etsi.mts.tdl.execution.java/.gitignore new file mode 100644 index 00000000..b83d2226 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.execution.java/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/plugins/org.etsi.mts.tdl.execution.java/.project b/plugins/org.etsi.mts.tdl.execution.java/.project new file mode 100644 index 00000000..8e40f3b0 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.execution.java/.project @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.etsi.mts.tdl.execution.java</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.m2e.core.maven2Nature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.pde.PluginNature</nature> + </natures> +</projectDescription> diff --git a/plugins/org.etsi.mts.tdl.execution.java/.settings/org.eclipse.jdt.core.prefs b/plugins/org.etsi.mts.tdl.execution.java/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..1db26929 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.execution.java/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/plugins/org.etsi.mts.tdl.execution.java/.settings/org.eclipse.m2e.core.prefs b/plugins/org.etsi.mts.tdl.execution.java/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000..f897a7f1 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.execution.java/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/plugins/org.etsi.mts.tdl.execution.java/META-INF/MANIFEST.MF b/plugins/org.etsi.mts.tdl.execution.java/META-INF/MANIFEST.MF new file mode 100644 index 00000000..98d768b5 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.execution.java/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Java +Bundle-SymbolicName: org.etsi.mts.tdl.execution.java;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Automatic-Module-Name: org.etsi.mts.tdl.execution.java +Bundle-RequiredExecutionEnvironment: JavaSE-11 +Export-Package: . +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.core.resources, + org.eclipse.ui, + org.eclipse.ui.ide, + org.eclipse.emf, + org.eclipse.emf.ecore, + org.etsi.mts.tdl.model;bundle-version="1.4.0" diff --git a/plugins/org.etsi.mts.tdl.execution.java/README.md b/plugins/org.etsi.mts.tdl.execution.java/README.md new file mode 100644 index 00000000..9190fdf9 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.execution.java/README.md @@ -0,0 +1,11 @@ +# TDL test execution + +## Development + +- Build library using Maven + +## Runtime project configuration + +- Eclipse Java project (add Java nature and JRE library to build path) +- JUnit library in build path (Classpath) +- TDL execution library (org.etsi.mts.tdl.examples.execution.java) in build path diff --git a/plugins/org.etsi.mts.tdl.execution.java/build.properties b/plugins/org.etsi.mts.tdl.execution.java/build.properties new file mode 100644 index 00000000..5e065f0a --- /dev/null +++ b/plugins/org.etsi.mts.tdl.execution.java/build.properties @@ -0,0 +1,6 @@ +source.. = src/,\ + runtime-src/ +bin.includes = META-INF/,\ + .,\ + plugin.xml +output.. = bin/ diff --git a/plugins/org.etsi.mts.tdl.execution.java/plugin.xml b/plugins/org.etsi.mts.tdl.execution.java/plugin.xml new file mode 100644 index 00000000..c8f00e2f --- /dev/null +++ b/plugins/org.etsi.mts.tdl.execution.java/plugin.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.4"?> +<plugin> + <extension + point="org.eclipse.ui.menus"> + <menuContribution + allPopups="false" + locationURI="popup:org.eclipse.ui.popup.any?after=additions"> + <command + commandId="org.etsi.mts.tdl.execution.java.RenderModel" + style="push"> + <visibleWhen + checkEnabled="false"> + <with + variable="selection"> + <iterate> + <adapt + type="org.eclipse.core.resources.IFile"> + </adapt> + </iterate> + </with> + </visibleWhen> + </command> + </menuContribution> + </extension> + <extension + point="org.eclipse.ui.commands"> + <command + defaultHandler="org.etsi.mts.tdl.execution.java.eclipse.commands.RenderHandler" + id="org.etsi.mts.tdl.execution.java.RenderModel" + name="Render JUnit"> + </command> + </extension> + <extension + point="org.eclipse.ui.propertyPages"> + <page + class="org.etsi.mts.tdl.execution.java.eclipse.ui.PropertyPage" + id="org.etsi.mts.tdl.execution.java.propertyPage" + name="JUnit Rendering" + objectClass="org.eclipse.core.resources.IProject"> + </page> + </extension> + +</plugin> diff --git a/plugins/org.etsi.mts.tdl.execution.java/pom.xml b/plugins/org.etsi.mts.tdl.execution.java/pom.xml new file mode 100644 index 00000000..65b88b7b --- /dev/null +++ b/plugins/org.etsi.mts.tdl.execution.java/pom.xml @@ -0,0 +1,49 @@ +<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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.etsi.mts.tdl.execution.java</groupId> + <artifactId>org.etsi.mts.tdl.execution.java</artifactId> + <version>0.0.1-SNAPSHOT</version> + <build> + <sourceDirectory>runtime-src</sourceDirectory> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.8.1</version> + <configuration> + <release>11</release> + </configuration> + </plugin> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <descriptorRefs> + <descriptorRef>jar-with-dependencies</descriptorRef> + </descriptorRefs> + </configuration> + <executions> + <execution> + <id>make-assembly</id> <!-- this is used for inheritance merges --> + <phase>package</phase> <!-- bind to the packaging phase --> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>com.google.inject</groupId> + <artifactId>guice</artifactId> + <version>5.1.0</version> + </dependency> + <dependency> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-api</artifactId> + <version>5.9.2</version> + </dependency> + </dependencies> +</project> \ No newline at end of file diff --git a/plugins/org.etsi.mts.tdl.execution.java/tdl-execution-java-maven-build.launch b/plugins/org.etsi.mts.tdl.execution.java/tdl-execution-java-maven-build.launch new file mode 100644 index 00000000..14262440 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.execution.java/tdl-execution-java-maven-build.launch @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType"> + <intAttribute key="M2_COLORS" value="0"/> + <booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/> + <stringAttribute key="M2_GOALS" value="clean compile jar:jar assembly:single"/> + <booleanAttribute key="M2_NON_RECURSIVE" value="false"/> + <booleanAttribute key="M2_OFFLINE" value="false"/> + <stringAttribute key="M2_PROFILES" value=""/> + <listAttribute key="M2_PROPERTIES"/> + <stringAttribute key="M2_RUNTIME" value="EMBEDDED"/> + <booleanAttribute key="M2_SKIP_TESTS" value="false"/> + <intAttribute key="M2_THREADS" value="1"/> + <booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/> + <stringAttribute key="M2_USER_SETTINGS" value=""/> + <booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="true"/> + <stringAttribute key="bad_container_name" value="/build-configuration.xml"/> + <booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/> + <booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/> + <booleanAttribute key="org.eclipse.jdt.launching.ATTR_SHOW_CODEDETAILS_IN_EXCEPTION_MESSAGES" value="true"/> + <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/> + <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/> + <stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/org.etsi.mts.tdl.execution.java}"/> +</launchConfiguration> -- GitLab