diff --git a/.project b/.project index b7eb1a43..190ceb32 100644 --- a/.project +++ b/.project @@ -1,6 +1,6 @@ - gemoc-studio_root + gemoc-studio diff --git a/dev_support/launchconf/gemoc-studio full_compilation (tycho).launch b/dev_support/launchconf/gemoc-studio full_compilation (tycho).launch new file mode 100644 index 00000000..2caf6d17 --- /dev/null +++ b/dev_support/launchconf/gemoc-studio full_compilation (tycho).launch @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/dev_support/launchconf/gemoc-studio pomfirst.launch b/dev_support/launchconf/gemoc-studio pomfirst.launch new file mode 100644 index 00000000..323c2441 --- /dev/null +++ b/dev_support/launchconf/gemoc-studio pomfirst.launch @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/dev_support/pomfirst/pom.xml b/dev_support/pomfirst/pom.xml new file mode 100644 index 00000000..5c69d345 --- /dev/null +++ b/dev_support/pomfirst/pom.xml @@ -0,0 +1,21 @@ + + 4.0.0 + org.eclipse.gemoc.gemoc_studio + org.eclipse.gemoc.gemoc_studio.pomfirst + 1.0.0-SNAPSHOT + + pom + + + + + + ../../official_samples/K3FSM/pomfirst + ../../../gemoc-studio-modeldebugging/pomfirst + ../../../gemoc-studio-execution-java/pomfirst + + + + \ No newline at end of file diff --git a/official_samples/K3FSM/language_workbench/org.eclipse.gemoc.example.k3fsm.k3dsa/META-INF/MANIFEST.MF b/official_samples/K3FSM/language_workbench/org.eclipse.gemoc.example.k3fsm.k3dsa/META-INF/MANIFEST.MF index c081d118..b97eb745 100644 --- a/official_samples/K3FSM/language_workbench/org.eclipse.gemoc.example.k3fsm.k3dsa/META-INF/MANIFEST.MF +++ b/official_samples/K3FSM/language_workbench/org.eclipse.gemoc.example.k3fsm.k3dsa/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Automatic-Module-Name: org.eclipse.gemoc.example.k3fsm.k3dsa Bundle-SymbolicName: org.eclipse.gemoc.example.k3fsm.k3dsa; singleton:=true Export-Package: org.eclipse.gemoc.example.k3fsm.k3dsa Bundle-Name: org.eclipse.gemoc.example.k3fsm.k3dsa -Bundle-Version: 1.0.0 +Bundle-Version: 1.0.0.qualifier Bundle-ClassPath: . Require-Bundle: fr.inria.diverse.k3.al.annotationprocessor.plugin;bundle-version="3.0.0";visibility:="reexport", org.eclipse.xtend.lib;bundle-version="2.6.0";visibility:="private", diff --git a/official_samples/K3FSM/language_workbench/org.eclipse.gemoc.example.k3fsm.xdsml/META-INF/MANIFEST.MF b/official_samples/K3FSM/language_workbench/org.eclipse.gemoc.example.k3fsm.xdsml/META-INF/MANIFEST.MF index 247d3714..61e33e40 100644 --- a/official_samples/K3FSM/language_workbench/org.eclipse.gemoc.example.k3fsm.xdsml/META-INF/MANIFEST.MF +++ b/official_samples/K3FSM/language_workbench/org.eclipse.gemoc.example.k3fsm.xdsml/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Automatic-Module-Name: org.eclipse.gemoc.example.k3fsm.xdsml Bundle-SymbolicName: org.eclipse.gemoc.example.k3fsm.xdsml; singleton:=true Bundle-Name: org.eclipse.gemoc.example.k3fsm.xdsml -Bundle-Version: 1.0.0 +Bundle-Version: 1.0.0.qualifier Bundle-ClassPath: . Require-Bundle: org.eclipse.xtend.lib;bundle-version="2.7.0";visibility:="private", org.eclipse.xtext.xbase.lib;bundle-version="2.7.0";visibility:="private", diff --git a/official_samples/K3FSM/language_workbench/org.eclipse.gemoc.example.k3fsm/META-INF/MANIFEST.MF b/official_samples/K3FSM/language_workbench/org.eclipse.gemoc.example.k3fsm/META-INF/MANIFEST.MF index 647534bf..fdf5ed24 100644 --- a/official_samples/K3FSM/language_workbench/org.eclipse.gemoc.example.k3fsm/META-INF/MANIFEST.MF +++ b/official_samples/K3FSM/language_workbench/org.eclipse.gemoc.example.k3fsm/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.gemoc.example.k3fsm;singleton:=true -Bundle-Version: 0.1.0.qualifier +Bundle-Version: 1.0.0.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/official_samples/K3FSM/language_workbench/pom.xml b/official_samples/K3FSM/language_workbench/pom.xml index 49a97021..b68426d4 100644 --- a/official_samples/K3FSM/language_workbench/pom.xml +++ b/official_samples/K3FSM/language_workbench/pom.xml @@ -4,18 +4,28 @@ http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - + org.eclipse.gemoc.gemoc_studio org.eclipse.gemoc.example.k3fsm.lwb.bundles - + 3.2.0-SNAPSHOT pom - + + + 1.5.1 + UTF-8 + 2.14.0 + http://download.eclipse.org/releases/photon + http://www.kermeta.org/k3/update_2018-09-05 + http://melange.inria.fr/updatesite/nightly/update_2018-12-03/ + + true + org.eclipse.gemoc.example.k3fsm @@ -44,20 +54,188 @@ p2 ${melange.p2.url} - - - - - - - - - - - - - - - + + + + + org.eclipse.tycho + tycho-maven-plugin + ${tycho-version} + true + + + + org.eclipse.tycho + tycho-source-plugin + ${tycho-version} + + + plugin-source + + plugin-source + + + + + + + org.eclipse.tycho.extras + tycho-source-feature-plugin + ${tycho-version} + + + source-feature + package + + source-feature + + + + + + org.eclipse.tycho + tycho-p2-plugin + ${tycho-version} + + + attach-p2-metadata + package + + p2-metadata + + + + + + + org.eclipse.tycho + target-platform-configuration + ${tycho-version} + + + + + linux + gtk + x86_64 + + + + win32 + win32 + x86_64 + + + macosx + cocoa + x86_64 + + + + + + org.eclipse.xtend + xtend-maven-plugin + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 1.8 + 1.8 + ${project.build.sourceEncoding} + + + + org.eclipse.xtend + xtend-maven-plugin + ${xtend.version} + + + + compile + xtend-install-debug-info + testCompile + xtend-test-install-debug-info + + + xtend-gen + + + + + + + + + org.eclipse.jdt + org.eclipse.jdt.core + 3.13.102 + + + org.eclipse.jdt + org.eclipse.jdt.compiler.apt + 1.3.110 + + + org.eclipse.jdt + org.eclipse.jdt.compiler.tool + 1.2.101 + + + org.eclipse.emf + org.eclipse.emf.codegen + 2.11.0 + + + + + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-antrun-plugin + 1.8 + + + + \ No newline at end of file diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.classpath b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.classpath new file mode 100644 index 00000000..119f0ade --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.classpath @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.gitignore b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.gitignore new file mode 100644 index 00000000..89540d82 --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.gitignore @@ -0,0 +1 @@ +/dependency-reduced-pom.xml diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.mvn/wrapper/MavenWrapperDownloader.java b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 00000000..c32394f1 --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,117 @@ +/* + * Copyright 2007-present the original author or authors. + * + * Licensed 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 + * + * http://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. + */ +import java.net.*; +import java.io.*; +import java.nio.channels.*; +import java.util.Properties; + +public class MavenWrapperDownloader { + + private static final String WRAPPER_VERSION = "0.5.5"; + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if(mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if(mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if(!outputFile.getParentFile().exists()) { + if(!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.mvn/wrapper/maven-wrapper.jar b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 00000000..0d5e6498 Binary files /dev/null and b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.mvn/wrapper/maven-wrapper.jar differ diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.mvn/wrapper/maven-wrapper.properties b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 00000000..fa87ad7d --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.1/apache-maven-3.6.1-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.project b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.project new file mode 100644 index 00000000..d57ebb57 --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.project @@ -0,0 +1,29 @@ + + + org.eclipse.gemoc.example.k3fsm.mep.server + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.xtext.ui.shared.xtextNature + + diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.settings/org.eclipse.jdt.core.prefs b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..b8947ec6 --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.settings/org.eclipse.m2e.core.prefs b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000..f897a7f1 --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.settings/org.eclipse.xtend.core.Xtend.prefs b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.settings/org.eclipse.xtend.core.Xtend.prefs new file mode 100644 index 00000000..9682a4c0 --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/.settings/org.eclipse.xtend.core.Xtend.prefs @@ -0,0 +1,7 @@ +//outlet.DEFAULT_OUTPUT.sourceFolder.src/main/java.directory=xtend-gen +//outlet.DEFAULT_OUTPUT.sourceFolder.src/test/java.directory=src/test/generated-sources/xtend +BuilderConfiguration.is_project_specific=true +eclipse.preferences.version=1 +outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true +outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false +outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/README.md b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/README.md new file mode 100644 index 00000000..59479a6d --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/README.md @@ -0,0 +1,94 @@ +# k3fsm_mep + +K3FSM language with Model Execution Protocol (dev of MEP concept on a smaller example: StateMachine but still with xtext and java engine) + + +Note: due to tycho limitation, pom-first and manifest-first (plugins) cannot be built in the same maven reactor (cf. https://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts) + + +It uses lsp4j.debug 0.8.0 and xtext/xtend 2.19.0 (correspond to DAP 1.35.0) + +Warning: make sure to use consistent versions (ex: version of xtend used by lsp4j) + + +Some notes about the K3FSM MEP server + +Run the server: + +``` +mvn compile quarkus:dev +``` + +it should open a socket on port 8090 + +ex: http://localhost:8090/mep/k3fsm + + +using a websocket client (for ex written in python, notebook or directly in a browser extension) + +example requests with SimpleWebSocket client for mozilla https://github.com/WangFenjin/Simple-WebSocket-Client +(replace the `/home/rhiobet/gemoc-glose/k3fsm_mep/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server` with the actual location on your disk) + +``` +{"type":"request", "command":"initialize"} +{"type":"request","command":"initialize","arguments":{"clientName":"MEPIntegrationTest.testInitialize()"}} +{"type":"request","command":"launch","arguments":{"myKey":"myValue"}} + +{"type":"request", + "command":"launch", + "arguments":{ + "modelURI":"file:/home/rhiobet/gemoc-glose/k3fsm_mep/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/resources/tests/xtext/models/TwoStatesUpcast.k3fsm", + "modelEntryPoint":"/", + "initializationMethod":"org.eclipse.gemoc.example.k3fsm.k3dsa.FSMAspect.initializeModel", + "initializationArguments":"abababa", + "methodEntryPoint":"public static void org.eclipse.gemoc.example.k3fsm.k3dsa.FSMAspect.main(org.eclipse.gemoc.example.k3fsm.FSM)" + } +} + +{"type":"request", + "command":"next", + "arguments":{} +} + +{"type":"request", + "command":"stepIn", + "arguments":{} +} + +{"type":"request", + "command":"stepOut", + "arguments":{} +} + +{"type":"request", + "command":"terminate", + "arguments":{} +} + +{"type":"request", + "command":"restart", + "arguments":{} +} + +{"type":"request", + "command":"variables", + "arguments":{} +} + +{"type":"request", + "command":"setBreakpoints", + "arguments": { + "breakpoints": [ + { "line": 13 }, + { "line": 4 } + ] + } +} + +{"type":"request", + "command":"continue", + "arguments":{} +} +``` + + diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/lib_not_correctly_deployed/org.eclipse.emf.transaction_1.9.1.201805140824.jar b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/lib_not_correctly_deployed/org.eclipse.emf.transaction_1.9.1.201805140824.jar new file mode 100644 index 00000000..99968c2e Binary files /dev/null and b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/lib_not_correctly_deployed/org.eclipse.emf.transaction_1.9.1.201805140824.jar differ diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/pom.xml b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/pom.xml new file mode 100644 index 00000000..d71fb11e --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/pom.xml @@ -0,0 +1,365 @@ + + 4.0.0 + org.eclipse.gemoc.gemoc_studio + org.eclipse.gemoc.example.k3fsm.mep.server + 1.0.0-SNAPSHOT + + + 1.8 + 1.8 + 2.22.0 + 0.21.1 + 2.18.0 + 0.8.0 + + + + + + io.quarkus + quarkus-bom + ${quarkus.version} + pom + import + + + org.eclipse.lsp4j + org.eclipse.lsp4j + ${lsp4j.version} + + + org.eclipse.lsp4j + org.eclipse.lsp4j.debug + ${lsp4j.version} + + + + + + + + + + io.quarkus + quarkus-resteasy + + + io.quarkus + quarkus-junit5 + test + + + io.rest-assured + rest-assured + test + + + io.quarkus + quarkus-undertow-websockets + + + + + org.eclipse.xtext + org.eclipse.xtext + ${xtend.version} + + + org.eclipse.xtext + org.eclipse.xtext.ide + ${xtend.version} + + + org.eclipse.emf + org.eclipse.emf.mwe.utils + 1.5.1 + + + + + org.eclipse.gemoc.executionframework + org.eclipse.gemoc.executionframework.mep + 1.0.0-SNAPSHOT + + + org.eclipse.gemoc.execution.sequential.javaengine + org.eclipse.gemoc.execution.sequential.javaengine.headless + 1.0.0-SNAPSHOT + + + org.eclipse.gemoc.pomfirst + org.eclipse.gemoc.commons.utils + 1.0.0-SNAPSHOT + + + + + org.eclipse.gemoc.gemoc_studio + org.eclipse.gemoc.example.k3fsm + 1.0.0-SNAPSHOT + + + org.eclipse.gemoc.gemoc_studio + org.eclipse.gemoc.example.k3fsm.xtext + 1.0.0-SNAPSHOT + + + org.eclipse.gemoc.gemoc_studio + org.eclipse.gemoc.example.k3fsm.xtext.ide + 1.0.0-SNAPSHOT + + + org.eclipse.gemoc.gemoc_studio + org.eclipse.gemoc.example.k3fsm.k3dsa + 1.0.0-SNAPSHOT + + + + + + org.eclipse.gemoc.pomfirst + org.eclipse.gemoc.execution.sequential.javaengine + 4.0.0-SNAPSHOT + + + fr.inria.diverse.k3.al + fr.inria.diverse.k3.al.annotationprocessor + 3.2.3-SNAPSHOT + + + org.eclipse.gemoc.pomfirst + org.eclipse.gemoc.trace.commons.model + 3.0.1-SNAPSHOT + + + org.eclipse.gemoc.pomfirst + org.eclipse.gemoc.trace.commons + 3.0.1-SNAPSHOT + + + org.eclipse.gemoc.pomfirst + org.eclipse.gemoc.executionframework.debugger + 4.0.0-SNAPSHOT + + + org.eclipse.gemoc.pomfirst + org.eclipse.gemoc.executionframework.engine + 4.0.0-SNAPSHOT + + + + + + org.eclipse.emf + org.eclipse.emf.transaction + 1.9.1.201805140824 + system + ${basedir}/lib_not_correctly_deployed/org.eclipse.emf.transaction_1.9.1.201805140824.jar + + + + + + org.eclipse.platform + org.eclipse.debug.core + 3.12.0 + + + + + + + + org.eclipse.xtend + xtend-maven-plugin + ${xtend.version} + + + + compile + xtend-install-debug-info + testCompile + xtend-test-install-debug-info + + + xtend-gen + + + + + + + + + org.eclipse.jdt + org.eclipse.jdt.core + 3.13.102 + + + org.eclipse.jdt + org.eclipse.jdt.compiler.apt + 1.3.110 + + + org.eclipse.jdt + org.eclipse.jdt.compiler.tool + 1.2.101 + + + org.eclipse.emf + org.eclipse.emf.codegen + 2.11.0 + + + + + + io.quarkus + quarkus-maven-plugin + ${quarkus.version} + + + + build + + + + + + maven-surefire-plugin + ${surefire-plugin.version} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + + ${basedir}/src/main/xtend-gen + + **/* + + + + + + + org.apache.maven.plugins + maven-shade-plugin + 1.7.1 + + + package + + shade + + + + + *:* + + META-INF/*.SF + META-INF/*.RSA + META-INF/*.MF + + + + + + + + + + + + nexus-eclipse-gemoc + Nexus Eclipse GEMOC + + true + + + true + + https://repo.eclipse.org/content/groups/gemoc/ + + + >maven.inria.fr + Maven Inria + + true + + + true + + http://maven.inria.fr/artifactory/public/ + + + \ No newline at end of file diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/java/org/eclipse/gemoc/example/k3fsm/mep/server/CustomServerModule.xtend b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/java/org/eclipse/gemoc/example/k3fsm/mep/server/CustomServerModule.xtend new file mode 100644 index 00000000..b78ff55f --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/java/org/eclipse/gemoc/example/k3fsm/mep/server/CustomServerModule.xtend @@ -0,0 +1,26 @@ +package org.eclipse.gemoc.example.k3fsm.mep.server + +import com.google.inject.AbstractModule +import java.util.concurrent.ExecutorService +import org.eclipse.xtext.ide.ExecutorServiceProvider +import org.eclipse.xtext.ide.server.DefaultProjectDescriptionFactory +import org.eclipse.xtext.ide.server.IProjectDescriptionFactory +import org.eclipse.xtext.ide.server.IWorkspaceConfigFactory +import org.eclipse.xtext.ide.server.ProjectWorkspaceConfigFactory +import org.eclipse.xtext.resource.IContainer +import org.eclipse.xtext.resource.IResourceServiceProvider +import org.eclipse.xtext.resource.ResourceServiceProviderServiceLoader +import org.eclipse.xtext.resource.containers.ProjectDescriptionBasedContainerManager + +class CustomServerModule extends AbstractModule { + + override protected configure() { + + binder.bind(ExecutorService).toProvider(ExecutorServiceProvider) + bind(IResourceServiceProvider.Registry).toProvider(ResourceServiceProviderServiceLoader) + bind(IWorkspaceConfigFactory).to(ProjectWorkspaceConfigFactory) + bind(IProjectDescriptionFactory).to(DefaultProjectDescriptionFactory) + bind(IContainer.Manager).to(ProjectDescriptionBasedContainerManager) + // bind(IRenameService).to(RenameService) + } +} diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/java/org/eclipse/gemoc/example/k3fsm/mep/server/K3FSMGemocMEPServerImpl.java b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/java/org/eclipse/gemoc/example/k3fsm/mep/server/K3FSMGemocMEPServerImpl.java new file mode 100644 index 00000000..e0664b77 --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/java/org/eclipse/gemoc/example/k3fsm/mep/server/K3FSMGemocMEPServerImpl.java @@ -0,0 +1,62 @@ +package org.eclipse.gemoc.example.k3fsm.mep.server; + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.gemoc.example.k3fsm.K3FSMStandaloneSetup; +import org.eclipse.gemoc.example.k3fsm.K3fsmPackage; +import org.eclipse.gemoc.execution.sequential.javaengine.headless.AbstractHeadlessExecutionContext; +import org.eclipse.gemoc.execution.sequential.javaengine.headless.HeadlessExecutionPlatform; +import org.eclipse.gemoc.execution.sequential.javaengine.headless.HeadlessExecutionWorkspace; +import org.eclipse.gemoc.execution.sequential.javaengine.headless.mep.K3GemocMEPServerImpl; +import org.eclipse.gemoc.executionframework.engine.commons.EngineContextException; +import org.eclipse.gemoc.executionframework.engine.commons.sequential.ISequentialRunConfiguration; +import org.eclipse.gemoc.xdsmlframework.api.core.ExecutionMode; +import org.eclipse.xtext.resource.XtextResource; +import org.eclipse.xtext.resource.XtextResourceSet; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.inject.Injector; + +public class K3FSMGemocMEPServerImpl extends K3GemocMEPServerImpl { + + private static final Logger LOGGER = LoggerFactory.getLogger(K3FSMGemocMEPServerImpl.class); + + public K3FSMGemocMEPServerImpl() { + super(); + languageDefinition = new K3FSMLanguageDefinitionExtension(); + } + + /** + * use K3FSM xtext resourceSet + * TODO see if the Sirius modelLoader allows to generalize/avoid that + */ + @Override + public ResourceSet createResourceSet() { + + K3fsmPackage.eINSTANCE.eClass(); + + new org.eclipse.emf.mwe.utils.StandaloneSetup().setPlatformUri("../"); + Injector injector = new K3FSMStandaloneSetup().createInjectorAndDoEMFRegistration(); + XtextResourceSet resourceSet = injector.getInstance(XtextResourceSet.class); + resourceSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE); + LOGGER.info("created K3FSM XtextResourceSet"); + return resourceSet; + } + + @Override + protected AbstractHeadlessExecutionContext newExecutionContext(Resource resourceModel) throws EngineContextException { + return new AbstractHeadlessExecutionContext( + runConfiguration, + ExecutionMode.Run, + languageDefinition, + new HeadlessExecutionWorkspace(), + new HeadlessExecutionPlatform()){ + @Override + public void initializeResourceModel() { + _resourceModel = resourceModel; + } + }; + } + +} diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/java/org/eclipse/gemoc/example/k3fsm/mep/server/K3FSMLanguageDefinitionExtension.java b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/java/org/eclipse/gemoc/example/k3fsm/mep/server/K3FSMLanguageDefinitionExtension.java new file mode 100644 index 00000000..460a7ce4 --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/java/org/eclipse/gemoc/example/k3fsm/mep/server/K3FSMLanguageDefinitionExtension.java @@ -0,0 +1,10 @@ +package org.eclipse.gemoc.example.k3fsm.mep.server; + +import org.eclipse.gemoc.xdsmlframework.api.extensions.languages.LanguageDefinitionExtension; + +public class K3FSMLanguageDefinitionExtension extends LanguageDefinitionExtension { + @Override + public String getName() { + return "org.eclipse.gemoc.example.k3fsm.K3fsm"; + } +} diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/java/org/eclipse/gemoc/example/k3fsm/mep/server/K3FSMMEPModule.xtend b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/java/org/eclipse/gemoc/example/k3fsm/mep/server/K3FSMMEPModule.xtend new file mode 100644 index 00000000..9a6e3c2f --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/java/org/eclipse/gemoc/example/k3fsm/mep/server/K3FSMMEPModule.xtend @@ -0,0 +1,43 @@ + +package org.eclipse.gemoc.example.k3fsm.mep.server + +import com.google.inject.Guice +import org.eclipse.xtext.util.Modules2 +import com.google.inject.Injector +import org.eclipse.emf.ecore.EPackage +import org.eclipse.xtext.resource.IResourceServiceProvider +import org.eclipse.gemoc.example.k3fsm.K3FSMStandaloneSetupGenerated +import org.eclipse.gemoc.example.k3fsm.K3FSMRuntimeModule +import org.eclipse.gemoc.example.k3fsm.ide.K3FSMIdeModule +import org.eclipse.gemoc.example.k3fsm.K3fsmPackage + +/** + * Initialization support for running FCL language as Execution server using xtext. + */ +class K3FSMMEPModule extends K3FSMStandaloneSetupGenerated { + +/* override createInjector() { + Guice.createInjector(Modules2.mixin(new FCLRuntimeModule, new FCLIdeModule)) + }*/ + + override createInjector() { + Guice.createInjector( + Modules2.mixin( + new K3FSMRuntimeModule, + new K3FSMIdeModule, + new CustomServerModule, + [bind(IResourceServiceProvider.Registry).toProvider(IResourceServiceProvider.Registry.RegistryProvider)] + ) + ) + } + + + + override register(Injector injector) { + super.register(injector) + if (!EPackage.Registry.INSTANCE.containsKey("http://www.inria.fr/glose/fcl")) { + EPackage.Registry.INSTANCE.put("http://www.inria.fr/glose/fcl", K3fsmPackage.eINSTANCE); + } + } + +} diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/java/org/eclipse/gemoc/example/k3fsm/mep/server/K3FSMMEPServerEndpoint.java b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/java/org/eclipse/gemoc/example/k3fsm/mep/server/K3FSMMEPServerEndpoint.java new file mode 100644 index 00000000..7b7a6d3b --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/java/org/eclipse/gemoc/example/k3fsm/mep/server/K3FSMMEPServerEndpoint.java @@ -0,0 +1,190 @@ +package org.eclipse.gemoc.example.k3fsm.mep.server; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.io.UnsupportedEncodingException; +import java.util.HashMap; +import java.util.Map; + +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.event.Observes; +import javax.websocket.OnClose; +import javax.websocket.OnError; +import javax.websocket.OnMessage; +import javax.websocket.OnOpen; +import javax.websocket.Session; +import javax.websocket.server.ServerEndpoint; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.gemoc.commons.utils.ExtensibleInputStream; +import org.eclipse.gemoc.example.k3fsm.K3FSMStandaloneSetupGenerated; +import org.eclipse.gemoc.executionframework.mep.launch.GemocMEPServerImpl; +import org.eclipse.gemoc.executionframework.mep.launch.MEPLauncher; +import org.eclipse.gemoc.executionframework.mep.services.IModelExecutionProtocolClient; +import org.eclipse.gemoc.executionframework.mep.services.IModelExecutionProtocolServer; +import org.eclipse.lsp4j.jsonrpc.Launcher; +import org.eclipse.lsp4j.launch.LSPLauncher; +import org.eclipse.lsp4j.services.LanguageClient; +import org.eclipse.xtext.ide.server.LanguageServerImpl; +import org.eclipse.xtext.resource.XtextResource; +import org.eclipse.xtext.resource.XtextResourceSet; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import io.quarkus.runtime.StartupEvent; + + + +@ServerEndpoint("/mep/k3fsm") +@ApplicationScoped +public class K3FSMMEPServerEndpoint { + + private static final Logger LOGGER = LoggerFactory.getLogger(K3FSMMEPServerEndpoint.class); + + boolean supportHeader = true; + + Map activeSessions = new HashMap(); + +// LanguageServerImpl server = new LogoIdeSetup().createInjectorAndDoEMFRegistration().getInstance(LanguageServerImpl.class); + + K3FSMGemocMEPServerImpl server; + + public K3FSMGemocMEPServerImpl getOrCreateServer() { + if(server == null) { + server = new K3FSMMEPModule().createInjectorAndDoEMFRegistration().getInstance(K3FSMGemocMEPServerImpl.class); + } + return server; + } + + void onStart(@Observes StartupEvent ev) { + LOGGER.info("The K3FSMMEPServerEndpoint is starting..."); + // this is a check, in a correctly configured pom/classloader, this should pass + // otherwise you may obtain error it the classloader/ + // we don this check here because error in onOpen tend to be captured and hidden to the user (+ a timeout) + LOGGER.debug("Creating server..."); + try{ + //LOGGER.error("pause 5000ms in order to connect debugger before continuing..."); + //Thread.sleep(5000); + LOGGER.debug("Creating K3FSMMEPModule..."); + getOrCreateServer(); + LOGGER.debug("K3FSMMEPModule created"); + //} catch (InterruptedException e) { + } catch (Exception e) { + LOGGER.error("failed to create Xtext K3FSMMEPModule, classpath may be inconsistent"); + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + e.printStackTrace(pw); + LOGGER.error(sw.toString()); + + throw e; + } + ServerEndpoint[] sepAnnot = this.getClass().getAnnotationsByType(ServerEndpoint.class); + if(sepAnnot.length > 0) { + LOGGER.debug("ServerEndpoint created "+sepAnnot[0].value()); + } else { + + LOGGER.debug("ServerEndpoint created"); + } + } + + @OnOpen + public void onOpen(Session session) { + + LOGGER.info("Starting connection..."); + + try { + LOGGER.debug("Creating server..."); + getOrCreateServer(); + LOGGER.debug("Server created"); + + ExtensibleInputStream in = new ExtensibleInputStream(); + activeSessions.put(session, in); + + OutputStream outputstream = new OutputStream() { + + ByteArrayOutputStream internal = new ByteArrayOutputStream(); + + @Override + public void write(int b) throws IOException { + internal.write(b); + } + + @Override + public void flush() throws IOException { + String response = new String(internal.toByteArray(), "UTF-8"); + if(!supportHeader) { //LSP specifies that there is a header but messages from Monaco do not have a header + response = response.substring(response.indexOf("{")); + } + session.getBasicRemote().sendText(response); + internal.reset(); + + System.out.println("[DEBUG] Sent: " + response); + } + }; + + Launcher serverSideLauncher = MEPLauncher.createLauncher(server, IModelExecutionProtocolClient.class, in, outputstream); + server.connect(serverSideLauncher.getRemoteProxy()); + + LOGGER.info("Start listening"); + + serverSideLauncher.startListening(); + + //Launcher serverSideLauncher = MEPLauncher.createLauncher(server, IModelExecutionProtocolServer.class, in, outputstream); + LOGGER.info("Connection success"); + LOGGER.debug("Session "+session.getId()+" "+session.getRequestURI()+" opened"); + } catch (Exception e) { + e.printStackTrace(); + LOGGER.error("Connection failed", e); + } catch (Throwable e) { + if(e instanceof NoSuchFieldError) + LOGGER.error("NoSuchFieldError detected during MEPLauncher.createLauncher"); + LOGGER.error("Please check jar versions consistency, most probably org.eclipse.lsp4j "); + throw e; + } + + } + + @OnClose + public void onClose(Session session) { + activeSessions.remove(session); + LOGGER.debug("Closing session "+session.getId()+" "+session.getRequestURI()); + } + + @OnError + public void onError(Session session, Throwable throwable) { + LOGGER.error("Error "+throwable.getMessage()+" on session "+session.getId()+" "+session.getRequestURI(), throwable); + } + + @OnMessage + public void onMessage(String message, Session session) { + + if(!message.startsWith("Content-Length:")) { //LSP specifies that there is a header but messages from Monaco do not have a header + supportHeader = false; + message = addHeader(message); + } + + System.out.println("[DEBUG] Message: " + message); + + ExtensibleInputStream inputStream = activeSessions.get(session); + if(inputStream != null) { + inputStream.addMessage(message); + } + } + + public String addHeader(String requestContent) { + String header = ""; + try { + int length = requestContent.getBytes("UTF-8").length; + header = "Content-Length: " + length + "\n\n"; + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + return header + requestContent; + } + +} diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/java/org/eclipse/gemoc/example/k3fsm/mep/server/MockClientMain.java b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/java/org/eclipse/gemoc/example/k3fsm/mep/server/MockClientMain.java new file mode 100644 index 00000000..cf4ac4c9 --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/java/org/eclipse/gemoc/example/k3fsm/mep/server/MockClientMain.java @@ -0,0 +1,226 @@ +package org.eclipse.gemoc.example.k3fsm.mep.server; + +import java.util.List; +import java.util.concurrent.CompletableFuture; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.gemoc.executionframework.mep.launch.GemocMEPServerImpl; +import org.eclipse.gemoc.executionframework.mep.services.IModelExecutionProtocolClient; +import org.eclipse.lsp4j.DidOpenTextDocumentParams; +import org.eclipse.lsp4j.DocumentFormattingParams; +import org.eclipse.lsp4j.FormattingOptions; +import org.eclipse.lsp4j.InitializeParams; +import org.eclipse.lsp4j.InitializedParams; +import org.eclipse.lsp4j.Location; +import org.eclipse.lsp4j.MessageActionItem; +import org.eclipse.lsp4j.MessageParams; +import org.eclipse.lsp4j.Position; +import org.eclipse.lsp4j.PublishDiagnosticsParams; +import org.eclipse.lsp4j.ReferenceContext; +import org.eclipse.lsp4j.ReferenceParams; +import org.eclipse.lsp4j.RenameParams; +import org.eclipse.lsp4j.ShowMessageRequestParams; +import org.eclipse.lsp4j.TextDocumentIdentifier; +import org.eclipse.lsp4j.TextDocumentItem; +import org.eclipse.lsp4j.TextEdit; +import org.eclipse.lsp4j.WorkspaceEdit; +import org.eclipse.lsp4j.debug.BreakpointEventArguments; +import org.eclipse.lsp4j.debug.CapabilitiesEventArguments; +import org.eclipse.lsp4j.debug.ContinuedEventArguments; +import org.eclipse.lsp4j.debug.ExitedEventArguments; +import org.eclipse.lsp4j.debug.InitializeRequestArguments; +import org.eclipse.lsp4j.debug.LoadedSourceEventArguments; +import org.eclipse.lsp4j.debug.ModuleEventArguments; +import org.eclipse.lsp4j.debug.OutputEventArguments; +import org.eclipse.lsp4j.debug.ProcessEventArguments; +import org.eclipse.lsp4j.debug.StoppedEventArguments; +import org.eclipse.lsp4j.debug.TerminatedEventArguments; +import org.eclipse.lsp4j.debug.ThreadEventArguments; +import org.eclipse.lsp4j.debug.services.IDebugProtocolClient; +import org.eclipse.lsp4j.services.LanguageClient; +import org.eclipse.xtext.ide.server.LanguageServerImpl; +import org.eclipse.xtext.nodemodel.INode; +import org.eclipse.xtext.resource.XtextResource; + + + +public class MockClientMain { + + public static void main(String[] args) { + try { + GemocMEPServerImpl server = new K3FSMMEPModule().createInjectorAndDoEMFRegistration().getInstance(GemocMEPServerImpl.class); + +// new LogoIdeSetup().createInjectorAndDoEMFRegistration(); +// ASMPackage rootPkg = ASMPackage.eINSTANCE; +// ResourceSet rs = new ResourceSetImpl(); +// Resource res = rs.getResource(URI.createURI("/home/fcoulon/tree.logo"),true); +// System.out.println(res.getContents().get(0)); +// +// XtextResource xRes = (XtextResource) res; +// Iterable it = xRes.getParseResult().getSyntaxErrors(); +// it.iterator().forEachRemaining(node -> { +// System.out.println(node.getSyntaxErrorMessage()); +// }); + + + IModelExecutionProtocolClient mockClient = new IModelExecutionProtocolClient() { + + @Override + public void initialized() { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.initialized(); + } + + @Override + public void stopped(StoppedEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.stopped(args); + } + + @Override + public void continued(ContinuedEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.continued(args); + } + + @Override + public void exited(ExitedEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.exited(args); + } + + @Override + public void terminated(TerminatedEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.terminated(args); + } + + @Override + public void thread(ThreadEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.thread(args); + } + + @Override + public void output(OutputEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.output(args); + } + + @Override + public void breakpoint(BreakpointEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.breakpoint(args); + } + + @Override + public void module(ModuleEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.module(args); + } + + @Override + public void loadedSource(LoadedSourceEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.loadedSource(args); + } + + @Override + public void process(ProcessEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.process(args); + } + + @Override + public void capabilities(CapabilitiesEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.capabilities(args); + } + + + + }; + + server.connect(mockClient); + + InitializeRequestArguments initParam = new InitializeRequestArguments(); + server.initialize(initParam); + + /*DidOpenTextDocumentParams openParam = new DidOpenTextDocumentParams( + new TextDocumentItem("/home/fcoulon/tree.logo", "logo", 1, "LogoProgram {\n" + + " Proc Square(size) {\n" + + " PenDown;\n" + + " Repeat 4.0 {\n" + + " Forward size;\n" + + " Left 90.0\n" + + " };\n" + + " PenUp\n" + + " };\n" + + "\n" + + " Proc Tree(baseSize, depth, direction) {\n" + + "\n" + + " Proc SubSquareSize(size, angle) {\n" + + " Return size * Cos angle\n" + + " };\n" + + "\n" + + " Left 90.0;\n" + + " Forward baseSize;\n" + + " Right 45.0 - direction;\n" + + " Square(SubSquareSize(baseSize, 45.0 + direction));\n" + + " If depth > 0.0 {\n" + + " Tree(SubSquareSize(baseSize, 45.0 + direction), depth - 1.0, 0.0)\n" + + " };\n" + + " Right 45.0 + direction;\n" + + " Forward baseSize;\n" + + " Right 45.0 - direction;\n" + + " Back baseSize;\n" + + " Square(SubSquareSize(baseSize, 45.0 - direction));\n" + + " If depth > 0.0 {\n" + + " Tree(SubSquareSize(baseSize, 45.0 - direction), depth - 1.0, 0.0)\n" + + " };\n" + + " Forward SubSquareSize(baseSize, 45.0 - direction);\n" + + " Left 45.0 - direction;\n" + + " Back baseSize;\n" + + " Left 90.0;\n" + + " Back baseSize;\n" + + " Right 90.0\n" + + " };\n" + + "\n" + + " Square(150.0);\n" + + " Tree(150.0, 8.0, 5.0)\n" + + "}\n" + + "")); + server.didOpen(openParam); + */ + + + synchronized (server) { + server.wait(); + } + + +// RenameParams param = new RenameParams(new TextDocumentIdentifier("/home/fcoulon/tree.logo"), new Position(1,9), "foobar"); +// CompletableFuture reply = server.rename(param); +// System.out.println(reply.get()); +// +// ReferenceParams refParam = new ReferenceParams(new ReferenceContext()); +// refParam.setTextDocument(new TextDocumentIdentifier("/home/fcoulon/tree.logo")); +// refParam.setPosition(new Position(1,9)); +// CompletableFuture> replyRef = server.references(refParam); +// System.out.println(replyRef.get()); + +// DocumentFormattingParams formatParam = new DocumentFormattingParams(new TextDocumentIdentifier("/home/fcoulon/tree.logo"), new FormattingOptions()); +// CompletableFuture> replyFormat = server.formatting(formatParam); +// System.out.println(replyFormat.get()); + + } catch (Exception e) { + e.printStackTrace(); + } + + System.out.println("DONE"); + } + +} diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/resources/application.properties b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/resources/application.properties new file mode 100644 index 00000000..f38ade56 --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/resources/application.properties @@ -0,0 +1,507 @@ + +# +# The name of the application. +# If not set, defaults to the name of the project. +# +#quarkus.application.name= + +# +# The version of the application. +# If not set, defaults to the version of the project +# +#quarkus.application.version= + +# +# If set to true '@Inject' is automatically added to all non-static fields that are annotated with +# one of the annotations defined by {@link AutoInjectAnnotationBuildItem}. +# +#quarkus.arc.auto-inject-fields=true + +# +# If set to all (or true) the container will attempt to remove all unused beans. +# +# An unused bean: +# +# - is not a built-in bean or interceptor, +# - is not eligible for injection to any injection point, +# - is not excluded by any extension, +# - does not have a name, +# - does not declare an observer, +# - does not declare any producer which is eligible for injection to any injection point, +# - is not directly eligible for injection into any {@link javax.enterprise.inject.Instance} injection point +# +# +# If set to none (or false) no beans will ever be removed even if they are unused (according to the criteria +# set out above) +# +# If set to fwk, then all unused beans will be removed, except the unused beans whose classes are declared +# in the application code +# +# @see UnremovableBeanBuildItem +# +#quarkus.arc.remove-unused-beans=all + +# + +# +#quarkus.hot-reload.password= + +# + +# +#quarkus.hot-reload.url= + +# +# Enable the CORS filter. +# +#quarkus.http.cors=false + +# +# HTTP headers exposed in CORS +# +# Comma separated list of valid headers. ex: X-Custom,Content-Disposition +# +# default: +# +#quarkus.http.cors.exposed-headers= + +# +# HTTP headers allowed for CORS +# +# Comma separated list of valid headers. ex: X-Custom,Content-Disposition +# The filter allows any header if this is not set. +# +# default: returns any requested header as valid +# +#quarkus.http.cors.headers= + +# +# HTTP methods allowed for CORS +# +# Comma separated list of valid methods. ex: GET,PUT,POST +# The filter allows any method if this is not set. +# +# default: returns any requested method as valid +# +#quarkus.http.cors.methods= + +# +# Origins allowed for CORS +# +# Comma separated list of valid URLs. ex: http://www.quarkus.io,http://localhost:3000 +# The filter allows any origin if this is not set. +# +# default: returns any requested origin as valid +# +#quarkus.http.cors.origins= + +# +# The HTTP host +# +#quarkus.http.host=0.0.0.0 + +# +# The number if IO threads used to perform IO. This will be automatically set to a reasonable value based on +# the number of CPU cores if it is not provided +# +#quarkus.http.io-threads= + +# +# The HTTP port +# +quarkus.http.port=8090 +dev.quarkus.http.port=8090 + +# +# The HTTPS port +# +#quarkus.http.ssl-port=8443 + +# +# The file path to a server certificate or certificate chain in PEM format. +# +#quarkus.http.ssl.certificate.file= + +# +# The file path to the corresponding certificate private key file in PEM format. +# +#quarkus.http.ssl.certificate.key-file= + +# +# An optional key store which holds the certificate information instead of specifying separate files. +# +#quarkus.http.ssl.certificate.key-store-file= + +# +# An optional parameter to specify type of the key store file. If not given, the type is automatically detected +# based on the file name. +# +#quarkus.http.ssl.certificate.key-store-file-type= + +# +# A parameter to specify the password of the key store file. If not given, the default ("password") is used. +# +#quarkus.http.ssl.certificate.key-store-password=password + +# +# The cipher suites to use. If none is given, a reasonable default is selected. +# +#quarkus.http.ssl.cipher-suites= + +# +# The list of protocols to explicitly enable. +# +#quarkus.http.ssl.protocols=TLSv1.3,TLSv1.2 + +# +# The SSL provider name to use. If none is given, the platform default is used. +# +#quarkus.http.ssl.provider-name= + +# +# The SSL session cache size. If not given, the platform default is used. +# +#quarkus.http.ssl.session-cache-size= + +# +# The SSL session cache timeout. If not given, the platform default is used. +# +#quarkus.http.ssl.session-timeout= + +# +# The HTTP port used to run tests +# +#quarkus.http.test-port=8081 + +# +# The HTTPS port used to run tests +# +#quarkus.http.test-ssl-port=8444 + +# +# The maven artifactId of the artifact to index +# +#quarkus.index-dependency.{*}.artifact-id= + +# +# The maven classifier of the artifact to index +# +#quarkus.index-dependency.{*}.classifier= + +# +# The maven groupId of the artifact to index +# +#quarkus.index-dependency.{*}.group-id= + +# +# Enable JNI support. +# +#quarkus.jni.enable=false + +# +# Paths of library to load. +# +#quarkus.jni.library-paths= + +# +# The log level level for this category +# +#quarkus.log.category.{*}.level=inherit +quarkus.log.category."io.quarkus".level=DEBUG +quarkus.log.category."org.eclipse".level=DEBUG + + +# +# The minimum level that this category can be set to +# +#quarkus.log.category.{*}.min-level=inherit + +# +# Indicates whether to log asynchronously +# +#quarkus.log.console.async=false + +# +# Determine whether to block the publisher (rather than drop the message) when the queue is full +# +#quarkus.log.console.async.overflow=block + +# +# The queue length to use before flushing writing +# +#quarkus.log.console.async.queue-length=512 + +# +# If the console logging should be in color +# +#quarkus.log.console.color=true + +# +# Specify how much the colors should be darkened +# +#quarkus.log.console.darken=0 + +# +# If console logging should be enabled +# +#quarkus.log.console.enable=true + +# +# The log format +# +#quarkus.log.console.format=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c{3.}] (%t) %s%e%n + +# +# The console log level +# +#quarkus.log.console.level=ALL + +# +# Indicates whether to log asynchronously +# +#quarkus.log.file.async=false + +# +# Determine whether to block the publisher (rather than drop the message) when the queue is full +# +#quarkus.log.file.async.overflow=block + +# +# The queue length to use before flushing writing +# +#quarkus.log.file.async.queue-length=512 + +# +# If file logging should be enabled +# +#quarkus.log.file.enable=false + +# +# The log format +# +#quarkus.log.file.format=%d{yyyy-MM-dd HH:mm:ss,SSS} %h %N[%i] %-5p [%c{3.}] (%t) %s%e%n + +# +# The level of logs to be written into the file. +# +#quarkus.log.file.level=ALL + +# +# The name of the file in which logs will be written. +# +#quarkus.log.file.path=quarkus.log + +# +# File handler rotation file suffix. +# +# Example fileSuffix: .yyyy-MM-dd +# +#quarkus.log.file.rotation.file-suffix= + +# +# The maximum number of backups to keep. +# +#quarkus.log.file.rotation.max-backup-index=1 + +# +# The maximum file size of the log file after which a rotation is executed. +# +#quarkus.log.file.rotation.max-file-size= + +# +# Indicates whether to rotate log files on server initialization. +# +#quarkus.log.file.rotation.rotate-on-boot=true + +# +# The message starts to match +# +#quarkus.log.filter.{*}.if-starts-with=inherit + +# +# The default log level +# +#quarkus.log.level= + +# +# The default minimum log level +# +#quarkus.log.min-level=INFO +#quarkus.log.min-level=DEBUG + +# +# The app name used when formatting the message in RFC5424 format +# +#quarkus.log.syslog.app-name= + +# +# Indicates whether to log asynchronously +# +#quarkus.log.syslog.async=false + +# +# Determine whether to block the publisher (rather than drop the message) when the queue is full +# +#quarkus.log.syslog.async.overflow=block + +# +# The queue length to use before flushing writing +# +#quarkus.log.syslog.async.queue-length=512 + +# +# Enables or disables blocking when attempting to reconnect a +# {@link org.jboss.logmanager.handlers.SyslogHandler.Protocol#TCP +# TCP} or {@link org.jboss.logmanager.handlers.SyslogHandler.Protocol#SSL_TCP SSL TCP} protocol +# +#quarkus.log.syslog.block-on-reconnect=false + +# +# If syslog logging should be enabled +# +#quarkus.log.syslog.enable=false + +# +# The IP address and port of the syslog server +# +#quarkus.log.syslog.endpoint=localhost:514 + +# +# Sets the facility used when calculating the priority of the message as defined by RFC-5424 and RFC-3164 +# +#quarkus.log.syslog.facility=USER_LEVEL + +# +# The log message format +# +#quarkus.log.syslog.format=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c{3.}] (%t) %s%e%n + +# +# The name of the host the messages are being sent from +# +#quarkus.log.syslog.hostname= + +# +# The log level specifying, which message levels will be logged by syslog logger +# +#quarkus.log.syslog.level=ALL + +# +# Sets the protocol used to connect to the syslog server +# +#quarkus.log.syslog.protocol=TCP + +# +# Set the {@link SyslogType syslog type} this handler should use to format the message sent +# +#quarkus.log.syslog.syslog-type=RFC5424 + +# +# Set to 'true' if the message should be truncated +# +#quarkus.log.syslog.truncate=true + +# +# Set to 'true' if the message being sent should be prefixed with the size of the message +# +#quarkus.log.syslog.use-counting-framing=false + +# +# If gzip is enabled +# +#quarkus.resteasy.gzip.enabled=false + +# +# Maximum deflated file bytes size +# +# If the limit is exceeded, Resteasy will return Response +# with status 413("Request Entity Too Large") +# +#quarkus.resteasy.gzip.max-input=10M + +# +# Set this to override the default path for JAX-RS resources if there are no +# annotated application classes. +# +#quarkus.resteasy.path=/ + +# +# If this is true then JAX-RS will use only a single instance of a resource +# class to service all requests. +# +# If this is false then it will create a new instance of the resource per +# request. +# +# If the resource class has an explicit CDI scope annotation then the value of +# this annotation will always be used to control the lifecycle of the resource +# class. +# +# IMPLEMENTATION NOTE: 'javax.ws.rs.Path' turns into a CDI stereotype +# with singleton scope. As a result, if a user annotates a JAX-RS resource with +# a stereotype which has a different default scope the deployment fails with +# IllegalStateException. +# +#quarkus.resteasy.singleton-resources=true + +# +# The context path to serve all Servlet context from. This will also affect any resources +# that run as a Servlet, e.g. JAX-RS +# +#quarkus.servlet.context-path= + +# +# Enable native SSL support. +# +#quarkus.ssl.native= + +# +# The core thread pool size. This number of threads will always be kept alive. +# +#quarkus.thread-pool.core-threads=1 + +# +# The executor growth resistance. +# +# A resistance factor applied after the core pool is full; values applied here will cause that fraction +# of submissions to create new threads when no idle thread is available. A value of '0.0f' implies that +# threads beyond the core size should be created as aggressively as threads within it; a value of '1.0f' +# implies that threads beyond the core size should never be created. +# +#quarkus.thread-pool.growth-resistance=0 + +# +# The amount of time a thread will stay alive with no work. +# +#quarkus.thread-pool.keep-alive-time=30 + +# +# The maximum number of threads. If this is not specified then +# it will be automatically sized to 8 * the number of available processors +# +#quarkus.thread-pool.max-threads= + +# +# The queue size. For most applications this should be unbounded +# +#quarkus.thread-pool.queue-size= + +# +# The frequency at which the status of the thread pool should be checked during shutdown. Information about +# waiting tasks and threads will be checked and possibly logged at this interval. Setting this key to an empty +# value disables the shutdown check interval. +# +#quarkus.thread-pool.shutdown-check-interval=5 + +# +# The amount of time to wait for thread pool shutdown before tasks should be interrupted. If this value is +# greater than or equal to the value for 'shutdown-timeout', then tasks will not be interrupted before +# the shutdown timeout occurs. +# +#quarkus.thread-pool.shutdown-interrupt=10 + +# +# The shutdown timeout. If all pending work has not been completed by this time +# then additional threads will be spawned to attempt to finish any pending tasks, and the shutdown process will +# continue +# +#quarkus.thread-pool.shutdown-timeout=1M diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/resources/application.properties.example b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/resources/application.properties.example new file mode 100644 index 00000000..6bead13a --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/main/resources/application.properties.example @@ -0,0 +1,502 @@ + +# +# The name of the application. +# If not set, defaults to the name of the project. +# +#quarkus.application.name= + +# +# The version of the application. +# If not set, defaults to the version of the project +# +#quarkus.application.version= + +# +# If set to true '@Inject' is automatically added to all non-static fields that are annotated with +# one of the annotations defined by {@link AutoInjectAnnotationBuildItem}. +# +#quarkus.arc.auto-inject-fields=true + +# +# If set to all (or true) the container will attempt to remove all unused beans. +# +# An unused bean: +# +# - is not a built-in bean or interceptor, +# - is not eligible for injection to any injection point, +# - is not excluded by any extension, +# - does not have a name, +# - does not declare an observer, +# - does not declare any producer which is eligible for injection to any injection point, +# - is not directly eligible for injection into any {@link javax.enterprise.inject.Instance} injection point +# +# +# If set to none (or false) no beans will ever be removed even if they are unused (according to the criteria +# set out above) +# +# If set to fwk, then all unused beans will be removed, except the unused beans whose classes are declared +# in the application code +# +# @see UnremovableBeanBuildItem +# +#quarkus.arc.remove-unused-beans=all + +# + +# +#quarkus.hot-reload.password= + +# + +# +#quarkus.hot-reload.url= + +# +# Enable the CORS filter. +# +#quarkus.http.cors=false + +# +# HTTP headers exposed in CORS +# +# Comma separated list of valid headers. ex: X-Custom,Content-Disposition +# +# default: +# +#quarkus.http.cors.exposed-headers= + +# +# HTTP headers allowed for CORS +# +# Comma separated list of valid headers. ex: X-Custom,Content-Disposition +# The filter allows any header if this is not set. +# +# default: returns any requested header as valid +# +#quarkus.http.cors.headers= + +# +# HTTP methods allowed for CORS +# +# Comma separated list of valid methods. ex: GET,PUT,POST +# The filter allows any method if this is not set. +# +# default: returns any requested method as valid +# +#quarkus.http.cors.methods= + +# +# Origins allowed for CORS +# +# Comma separated list of valid URLs. ex: http://www.quarkus.io,http://localhost:3000 +# The filter allows any origin if this is not set. +# +# default: returns any requested origin as valid +# +#quarkus.http.cors.origins= + +# +# The HTTP host +# +#quarkus.http.host=0.0.0.0 + +# +# The number if IO threads used to perform IO. This will be automatically set to a reasonable value based on +# the number of CPU cores if it is not provided +# +#quarkus.http.io-threads= + +# +# The HTTP port +# +#quarkus.http.port=8080 + +# +# The HTTPS port +# +#quarkus.http.ssl-port=8443 + +# +# The file path to a server certificate or certificate chain in PEM format. +# +#quarkus.http.ssl.certificate.file= + +# +# The file path to the corresponding certificate private key file in PEM format. +# +#quarkus.http.ssl.certificate.key-file= + +# +# An optional key store which holds the certificate information instead of specifying separate files. +# +#quarkus.http.ssl.certificate.key-store-file= + +# +# An optional parameter to specify type of the key store file. If not given, the type is automatically detected +# based on the file name. +# +#quarkus.http.ssl.certificate.key-store-file-type= + +# +# A parameter to specify the password of the key store file. If not given, the default ("password") is used. +# +#quarkus.http.ssl.certificate.key-store-password=password + +# +# The cipher suites to use. If none is given, a reasonable default is selected. +# +#quarkus.http.ssl.cipher-suites= + +# +# The list of protocols to explicitly enable. +# +#quarkus.http.ssl.protocols=TLSv1.3,TLSv1.2 + +# +# The SSL provider name to use. If none is given, the platform default is used. +# +#quarkus.http.ssl.provider-name= + +# +# The SSL session cache size. If not given, the platform default is used. +# +#quarkus.http.ssl.session-cache-size= + +# +# The SSL session cache timeout. If not given, the platform default is used. +# +#quarkus.http.ssl.session-timeout= + +# +# The HTTP port used to run tests +# +#quarkus.http.test-port=8081 + +# +# The HTTPS port used to run tests +# +#quarkus.http.test-ssl-port=8444 + +# +# The maven artifactId of the artifact to index +# +#quarkus.index-dependency.{*}.artifact-id= + +# +# The maven classifier of the artifact to index +# +#quarkus.index-dependency.{*}.classifier= + +# +# The maven groupId of the artifact to index +# +#quarkus.index-dependency.{*}.group-id= + +# +# Enable JNI support. +# +#quarkus.jni.enable=false + +# +# Paths of library to load. +# +#quarkus.jni.library-paths= + +# +# The log level level for this category +# +#quarkus.log.category.{*}.level=inherit + +# +# The minimum level that this category can be set to +# +#quarkus.log.category.{*}.min-level=inherit + +# +# Indicates whether to log asynchronously +# +#quarkus.log.console.async=false + +# +# Determine whether to block the publisher (rather than drop the message) when the queue is full +# +#quarkus.log.console.async.overflow=block + +# +# The queue length to use before flushing writing +# +#quarkus.log.console.async.queue-length=512 + +# +# If the console logging should be in color +# +#quarkus.log.console.color=true + +# +# Specify how much the colors should be darkened +# +#quarkus.log.console.darken=0 + +# +# If console logging should be enabled +# +#quarkus.log.console.enable=true + +# +# The log format +# +#quarkus.log.console.format=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c{3.}] (%t) %s%e%n + +# +# The console log level +# +#quarkus.log.console.level=ALL + +# +# Indicates whether to log asynchronously +# +#quarkus.log.file.async=false + +# +# Determine whether to block the publisher (rather than drop the message) when the queue is full +# +#quarkus.log.file.async.overflow=block + +# +# The queue length to use before flushing writing +# +#quarkus.log.file.async.queue-length=512 + +# +# If file logging should be enabled +# +#quarkus.log.file.enable=false + +# +# The log format +# +#quarkus.log.file.format=%d{yyyy-MM-dd HH:mm:ss,SSS} %h %N[%i] %-5p [%c{3.}] (%t) %s%e%n + +# +# The level of logs to be written into the file. +# +#quarkus.log.file.level=ALL + +# +# The name of the file in which logs will be written. +# +#quarkus.log.file.path=quarkus.log + +# +# File handler rotation file suffix. +# +# Example fileSuffix: .yyyy-MM-dd +# +#quarkus.log.file.rotation.file-suffix= + +# +# The maximum number of backups to keep. +# +#quarkus.log.file.rotation.max-backup-index=1 + +# +# The maximum file size of the log file after which a rotation is executed. +# +#quarkus.log.file.rotation.max-file-size= + +# +# Indicates whether to rotate log files on server initialization. +# +#quarkus.log.file.rotation.rotate-on-boot=true + +# +# The message starts to match +# +#quarkus.log.filter.{*}.if-starts-with=inherit + +# +# The default log level +# +#quarkus.log.level= + +# +# The default minimum log level +# +#quarkus.log.min-level=INFO + +# +# The app name used when formatting the message in RFC5424 format +# +#quarkus.log.syslog.app-name= + +# +# Indicates whether to log asynchronously +# +#quarkus.log.syslog.async=false + +# +# Determine whether to block the publisher (rather than drop the message) when the queue is full +# +#quarkus.log.syslog.async.overflow=block + +# +# The queue length to use before flushing writing +# +#quarkus.log.syslog.async.queue-length=512 + +# +# Enables or disables blocking when attempting to reconnect a +# {@link org.jboss.logmanager.handlers.SyslogHandler.Protocol#TCP +# TCP} or {@link org.jboss.logmanager.handlers.SyslogHandler.Protocol#SSL_TCP SSL TCP} protocol +# +#quarkus.log.syslog.block-on-reconnect=false + +# +# If syslog logging should be enabled +# +#quarkus.log.syslog.enable=false + +# +# The IP address and port of the syslog server +# +#quarkus.log.syslog.endpoint=localhost:514 + +# +# Sets the facility used when calculating the priority of the message as defined by RFC-5424 and RFC-3164 +# +#quarkus.log.syslog.facility=USER_LEVEL + +# +# The log message format +# +#quarkus.log.syslog.format=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c{3.}] (%t) %s%e%n + +# +# The name of the host the messages are being sent from +# +#quarkus.log.syslog.hostname= + +# +# The log level specifying, which message levels will be logged by syslog logger +# +#quarkus.log.syslog.level=ALL + +# +# Sets the protocol used to connect to the syslog server +# +#quarkus.log.syslog.protocol=TCP + +# +# Set the {@link SyslogType syslog type} this handler should use to format the message sent +# +#quarkus.log.syslog.syslog-type=RFC5424 + +# +# Set to 'true' if the message should be truncated +# +#quarkus.log.syslog.truncate=true + +# +# Set to 'true' if the message being sent should be prefixed with the size of the message +# +#quarkus.log.syslog.use-counting-framing=false + +# +# If gzip is enabled +# +#quarkus.resteasy.gzip.enabled=false + +# +# Maximum deflated file bytes size +# +# If the limit is exceeded, Resteasy will return Response +# with status 413("Request Entity Too Large") +# +#quarkus.resteasy.gzip.max-input=10M + +# +# Set this to override the default path for JAX-RS resources if there are no +# annotated application classes. +# +#quarkus.resteasy.path=/ + +# +# If this is true then JAX-RS will use only a single instance of a resource +# class to service all requests. +# +# If this is false then it will create a new instance of the resource per +# request. +# +# If the resource class has an explicit CDI scope annotation then the value of +# this annotation will always be used to control the lifecycle of the resource +# class. +# +# IMPLEMENTATION NOTE: 'javax.ws.rs.Path' turns into a CDI stereotype +# with singleton scope. As a result, if a user annotates a JAX-RS resource with +# a stereotype which has a different default scope the deployment fails with +# IllegalStateException. +# +#quarkus.resteasy.singleton-resources=true + +# +# The context path to serve all Servlet context from. This will also affect any resources +# that run as a Servlet, e.g. JAX-RS +# +#quarkus.servlet.context-path= + +# +# Enable native SSL support. +# +#quarkus.ssl.native= + +# +# The core thread pool size. This number of threads will always be kept alive. +# +#quarkus.thread-pool.core-threads=1 + +# +# The executor growth resistance. +# +# A resistance factor applied after the core pool is full; values applied here will cause that fraction +# of submissions to create new threads when no idle thread is available. A value of '0.0f' implies that +# threads beyond the core size should be created as aggressively as threads within it; a value of '1.0f' +# implies that threads beyond the core size should never be created. +# +#quarkus.thread-pool.growth-resistance=0 + +# +# The amount of time a thread will stay alive with no work. +# +#quarkus.thread-pool.keep-alive-time=30 + +# +# The maximum number of threads. If this is not specified then +# it will be automatically sized to 8 * the number of available processors +# +#quarkus.thread-pool.max-threads= + +# +# The queue size. For most applications this should be unbounded +# +#quarkus.thread-pool.queue-size= + +# +# The frequency at which the status of the thread pool should be checked during shutdown. Information about +# waiting tasks and threads will be checked and possibly logged at this interval. Setting this key to an empty +# value disables the shutdown check interval. +# +#quarkus.thread-pool.shutdown-check-interval=5 + +# +# The amount of time to wait for thread pool shutdown before tasks should be interrupted. If this value is +# greater than or equal to the value for 'shutdown-timeout', then tasks will not be interrupted before +# the shutdown timeout occurs. +# +#quarkus.thread-pool.shutdown-interrupt=10 + +# +# The shutdown timeout. If all pending work has not been completed by this time +# then additional threads will be spawned to attempt to finish any pending tasks, and the shutdown process will +# continue +# +#quarkus.thread-pool.shutdown-timeout=1M diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/java/org/eclipse/gemoc/example/k3fsm/mep/server/tests/commands/MockTestClient.java b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/java/org/eclipse/gemoc/example/k3fsm/mep/server/tests/commands/MockTestClient.java new file mode 100644 index 00000000..31cab22a --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/java/org/eclipse/gemoc/example/k3fsm/mep/server/tests/commands/MockTestClient.java @@ -0,0 +1,89 @@ +package org.eclipse.gemoc.example.k3fsm.mep.server.tests.commands; + +import org.eclipse.gemoc.executionframework.mep.services.IModelExecutionProtocolClient; +import org.eclipse.lsp4j.debug.BreakpointEventArguments; +import org.eclipse.lsp4j.debug.CapabilitiesEventArguments; +import org.eclipse.lsp4j.debug.ContinuedEventArguments; +import org.eclipse.lsp4j.debug.ExitedEventArguments; +import org.eclipse.lsp4j.debug.LoadedSourceEventArguments; +import org.eclipse.lsp4j.debug.ModuleEventArguments; +import org.eclipse.lsp4j.debug.OutputEventArguments; +import org.eclipse.lsp4j.debug.ProcessEventArguments; +import org.eclipse.lsp4j.debug.StoppedEventArguments; +import org.eclipse.lsp4j.debug.TerminatedEventArguments; +import org.eclipse.lsp4j.debug.ThreadEventArguments; + +public class MockTestClient implements IModelExecutionProtocolClient { + @Override + public void initialized() { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.initialized(); + } + + @Override + public void stopped(StoppedEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.stopped(args); + } + + @Override + public void continued(ContinuedEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.continued(args); + } + + @Override + public void exited(ExitedEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.exited(args); + } + + @Override + public void terminated(TerminatedEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.terminated(args); + } + + @Override + public void thread(ThreadEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.thread(args); + } + + @Override + public void output(OutputEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.output(args); + } + + @Override + public void breakpoint(BreakpointEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.breakpoint(args); + } + + @Override + public void module(ModuleEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.module(args); + } + + @Override + public void loadedSource(LoadedSourceEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.loadedSource(args); + } + + @Override + public void process(ProcessEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.process(args); + } + + @Override + public void capabilities(CapabilitiesEventArguments args) { + // TODO Auto-generated method stub + IModelExecutionProtocolClient.super.capabilities(args); + } + +} diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/java/org/eclipse/gemoc/example/k3fsm/mep/server/tests/dap/commands/InitializeCommandTest.java b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/java/org/eclipse/gemoc/example/k3fsm/mep/server/tests/dap/commands/InitializeCommandTest.java new file mode 100644 index 00000000..0a0f91ce --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/java/org/eclipse/gemoc/example/k3fsm/mep/server/tests/dap/commands/InitializeCommandTest.java @@ -0,0 +1,33 @@ +package org.eclipse.gemoc.example.k3fsm.mep.server.tests.dap.commands; + + +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +import org.eclipse.gemoc.example.k3fsm.mep.server.K3FSMGemocMEPServerImpl; +import org.eclipse.gemoc.example.k3fsm.mep.server.K3FSMMEPModule; +import org.eclipse.gemoc.example.k3fsm.mep.server.tests.commands.MockTestClient; +import org.eclipse.gemoc.executionframework.mep.launch.GemocMEPServerImpl; +import org.eclipse.gemoc.executionframework.mep.services.IModelExecutionProtocolClient; +import org.eclipse.lsp4j.debug.Capabilities; +import org.eclipse.lsp4j.debug.InitializeRequestArguments; +import org.junit.jupiter.api.Test; + +public class InitializeCommandTest { + @Test + void checkCapabilitiesTest() throws InterruptedException, ExecutionException { + + GemocMEPServerImpl server = new K3FSMMEPModule().createInjectorAndDoEMFRegistration().getInstance(K3FSMGemocMEPServerImpl.class); + IModelExecutionProtocolClient mockClient = new MockTestClient(); + server.connect(mockClient); + + InitializeRequestArguments initParam = new InitializeRequestArguments(); + CompletableFuture futureCapabilities = server.initialize(initParam); + + // check capabilities + Capabilities capabilities = futureCapabilities.get(); + assertTrue( capabilities.getSupportsTerminateRequest(), "capabilities.getSupportsTerminateRequest() returned false"); + } +} diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/java/org/eclipse/gemoc/example/k3fsm/mep/server/tests/dap/commands/LaunchCommandTest.java b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/java/org/eclipse/gemoc/example/k3fsm/mep/server/tests/dap/commands/LaunchCommandTest.java new file mode 100644 index 00000000..093e88ce --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/java/org/eclipse/gemoc/example/k3fsm/mep/server/tests/dap/commands/LaunchCommandTest.java @@ -0,0 +1,42 @@ +package org.eclipse.gemoc.example.k3fsm.mep.server.tests.dap.commands; + + +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +import org.eclipse.gemoc.example.k3fsm.mep.server.K3FSMGemocMEPServerImpl; +import org.eclipse.gemoc.example.k3fsm.mep.server.K3FSMMEPModule; +import org.eclipse.gemoc.example.k3fsm.mep.server.tests.commands.MockTestClient; +import org.eclipse.gemoc.executionframework.mep.launch.GemocMEPServerImpl; +import org.eclipse.gemoc.executionframework.mep.services.IModelExecutionProtocolClient; +import org.eclipse.lsp4j.debug.Capabilities; +import org.eclipse.lsp4j.debug.InitializeRequestArguments; +import org.eclipse.lsp4j.debug.LaunchRequestArguments; +import org.junit.jupiter.api.Test; + +public class LaunchCommandTest { + @Test + void checkCapabilitiesTest() throws InterruptedException, ExecutionException { + + GemocMEPServerImpl server = new K3FSMMEPModule().createInjectorAndDoEMFRegistration().getInstance(K3FSMGemocMEPServerImpl.class); + IModelExecutionProtocolClient mockClient = new MockTestClient(); + server.connect(mockClient); + + InitializeRequestArguments initParam = new InitializeRequestArguments(); + CompletableFuture futureCapabilities = server.initialize(initParam); + + + LaunchRequestArguments launchParam = new LaunchRequestArguments(); + Map args = new HashMap(); + + server.launch(args); + + // check capabilities + Capabilities capabilities = futureCapabilities.get(); + assertTrue( capabilities.getSupportsTerminateRequest(), "capabilities.getSupportsTerminateRequest() returned false"); + } +} diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/java/org/eclipse/gemoc/example/k3fsm/mep/server/tests/integration/commands/MEPIntegrationTest.java b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/java/org/eclipse/gemoc/example/k3fsm/mep/server/tests/integration/commands/MEPIntegrationTest.java new file mode 100644 index 00000000..1f09eb2e --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/java/org/eclipse/gemoc/example/k3fsm/mep/server/tests/integration/commands/MEPIntegrationTest.java @@ -0,0 +1,137 @@ +package org.eclipse.gemoc.example.k3fsm.mep.server.tests.integration.commands; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.PipedInputStream; +import java.io.PipedOutputStream; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.eclipse.emf.common.util.URI; +import org.eclipse.gemoc.example.k3fsm.mep.server.K3FSMGemocMEPServerImpl; +import org.eclipse.gemoc.example.k3fsm.mep.server.K3FSMMEPModule; +import org.eclipse.gemoc.example.k3fsm.mep.server.tests.integration.commands.TestClient.Status; +import org.eclipse.gemoc.executionframework.mep.launch.GemocMEPServerImpl; +import org.eclipse.gemoc.executionframework.mep.launch.MEPLaunchParameterKey; +import org.eclipse.gemoc.executionframework.mep.launch.MEPLauncher; +import org.eclipse.gemoc.executionframework.mep.services.IModelExecutionProtocolClient; +import org.eclipse.gemoc.executionframework.mep.services.IModelExecutionProtocolServer; +import org.eclipse.lsp4j.debug.Capabilities; +import org.eclipse.lsp4j.debug.ContinueResponse; +import org.eclipse.lsp4j.debug.ContinuedEventArguments; +import org.eclipse.lsp4j.debug.ExitedEventArguments; +import org.eclipse.lsp4j.debug.InitializeRequestArguments; +import org.eclipse.lsp4j.debug.StoppedEventArguments; +import org.eclipse.lsp4j.debug.TerminatedEventArguments; +import org.eclipse.lsp4j.jsonrpc.Launcher; +import org.junit.jupiter.api.Test; +import org.wildfly.common.Assert; + +public class MEPIntegrationTest { + private static final long TIMEOUT = 200000; + + @Test + public void testInitializeAndLaunch() throws Exception { + // create client side + PipedInputStream in = new PipedInputStream(); + PipedOutputStream out = new PipedOutputStream(); + PipedInputStream in2 = new PipedInputStream(); + PipedOutputStream out2 = new PipedOutputStream(); + + in.connect(out2); + out.connect(in2); + + boolean[] inComputeAsync = new boolean[1]; + boolean[] launchHappened = new boolean[1]; + + + + TestClient client = new TestClient(); + Launcher clientSideLauncher = MEPLauncher.createLauncher(client, IModelExecutionProtocolServer.class, in, out); + + + + K3FSMGemocMEPServerImpl server = new K3FSMMEPModule().createInjectorAndDoEMFRegistration().getInstance(K3FSMGemocMEPServerImpl.class); + Launcher serverSideLauncher = MEPLauncher.createLauncher(server, IModelExecutionProtocolClient.class, in2, out2); + + + server.connect(serverSideLauncher.getRemoteProxy()); + + clientSideLauncher.startListening(); + serverSideLauncher.startListening(); + + InitializeRequestArguments initializeRequestArguments = new InitializeRequestArguments(); + initializeRequestArguments.setClientName("MEPIntegrationTest.testInitialize()"); + CompletableFuture initFuture = clientSideLauncher.getRemoteProxy().initialize(initializeRequestArguments); + Thread.sleep(100); + Capabilities cap = initFuture.get(TIMEOUT, TimeUnit.MILLISECONDS); + System.out.println(""+cap); + Assert.assertTrue(cap.getSupportsTerminateRequest()); + + // TODO find how to assert answer from clientSide + + Map launchRequestArguments = new HashMap(); + launchRequestArguments.put(MEPLaunchParameterKey.modelContent.name(), loadModelContent("tests/xtext/models/TwoStatesUpcast.k3fsm")); + + + URI uri = URI.createFileURI(getFileFromResources("tests/xtext/models/TwoStatesUpcast.k3fsm").getAbsolutePath()); + launchRequestArguments.put(MEPLaunchParameterKey.modelURI.name(), uri.toString()); + launchRequestArguments.put(MEPLaunchParameterKey.language.name(), "org.eclipse.gemoc.example.k3fsm.K3fsm"); + launchRequestArguments.put(MEPLaunchParameterKey.modelEntryPoint.name(), "/"); + launchRequestArguments.put(MEPLaunchParameterKey.initializationMethod.name(), "org.eclipse.gemoc.example.k3fsm.k3dsa.FSMAspect.initializeModel"); + launchRequestArguments.put(MEPLaunchParameterKey.initializationArguments.name(), "abababa"); + launchRequestArguments.put(MEPLaunchParameterKey.methodEntryPoint.name(), "public static void org.eclipse.gemoc.example.k3fsm.k3dsa.FSMAspect.main(org.eclipse.gemoc.example.k3fsm.FSM)"); + + CompletableFuture launchFuture = clientSideLauncher.getRemoteProxy().launch(launchRequestArguments); + Thread.sleep(100); + launchFuture.get(TIMEOUT, TimeUnit.MILLISECONDS); + + for (int i = 0; i < 3; i++) { + CompletableFuture doStepInFuture = clientSideLauncher.getRemoteProxy().stepIn(null); + doStepInFuture.get(TIMEOUT, TimeUnit.MILLISECONDS); + } + + assertEquals(Status.Stopped, client.currentStatus); + CompletableFuture continueFuture = clientSideLauncher.getRemoteProxy().continue_(null); + continueFuture.get(TIMEOUT, TimeUnit.MILLISECONDS); + //assertEquals(Status.Continuing, client.currentStatus); + + // TODO improve how to assert notifications from clientSide (ex: end of the execution) + Thread.sleep(1000); // ugly + assertEquals(Status.Terminated, client.currentStatus); + + } + + + public File getFileFromResources(String fileName) { + ClassLoader classLoader = getClass().getClassLoader(); + + URL resource = classLoader.getResource(fileName); + if (resource == null) { + throw new IllegalArgumentException("file is not found!"); + } else { + return new File(resource.getFile()); + } + } + + public String loadModelContent(String filePathInResourceFolder) throws IOException { + ClassLoader classLoader = getClass().getClassLoader(); + + try (InputStream inputStream = classLoader.getResourceAsStream(filePathInResourceFolder)) { + + String result = IOUtils.toString(inputStream, StandardCharsets.UTF_8); + return result; + + } catch (IOException e) { + throw e; + } + } +} diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/java/org/eclipse/gemoc/example/k3fsm/mep/server/tests/integration/commands/TestClient.java b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/java/org/eclipse/gemoc/example/k3fsm/mep/server/tests/integration/commands/TestClient.java new file mode 100644 index 00000000..58789095 --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/java/org/eclipse/gemoc/example/k3fsm/mep/server/tests/integration/commands/TestClient.java @@ -0,0 +1,36 @@ +package org.eclipse.gemoc.example.k3fsm.mep.server.tests.integration.commands; + +import org.eclipse.gemoc.executionframework.mep.services.IModelExecutionProtocolClient; +import org.eclipse.lsp4j.debug.ContinuedEventArguments; +import org.eclipse.lsp4j.debug.ExitedEventArguments; +import org.eclipse.lsp4j.debug.StoppedEventArguments; +import org.eclipse.lsp4j.debug.TerminatedEventArguments; + +public class TestClient implements IModelExecutionProtocolClient { + public enum Status {Unknown, Initialized, Continuing, Stopped, Terminated, Exited} + public Status currentStatus = Status.Unknown; + + @Override + public void stopped(StoppedEventArguments args) { + IModelExecutionProtocolClient.super.stopped(args); + currentStatus= Status.Stopped; + } + + @Override + public void continued(ContinuedEventArguments args) { + IModelExecutionProtocolClient.super.continued(args); + currentStatus= Status.Continuing; + } + + @Override + public void exited(ExitedEventArguments args) { + IModelExecutionProtocolClient.super.exited(args); + currentStatus= Status.Exited; + } + + @Override + public void terminated(TerminatedEventArguments args) { + IModelExecutionProtocolClient.super.terminated(args); + currentStatus= Status.Terminated; + } +} diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/resources/.gitkeep b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/resources/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/resources/tests/xtext/models/TwoStatesUpcast.k3fsm b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/resources/tests/xtext/models/TwoStatesUpcast.k3fsm new file mode 100644 index 00000000..b5e0f53b --- /dev/null +++ b/official_samples/K3FSM/pomfirst/org.eclipse.gemoc.example.k3fsm.mep.server/src/test/resources/tests/xtext/models/TwoStatesUpcast.k3fsm @@ -0,0 +1,23 @@ +FSM TwoStateUpcast { + initialState S1 + ownedStates { + State S1 { + outgoingTransitions { + Transition "S1_2" { + input "a" + output "A" + target S2 + } + } + }, + State S2 { + outgoingTransitions { + Transition S2_1 { + input "b" + output "B" + target S1 + } + } + } + } +} \ No newline at end of file diff --git a/official_samples/K3FSM/pomfirst/pom.xml b/official_samples/K3FSM/pomfirst/pom.xml new file mode 100644 index 00000000..b3f803da --- /dev/null +++ b/official_samples/K3FSM/pomfirst/pom.xml @@ -0,0 +1,86 @@ + + 4.0.0 + org.eclipse.gemoc.gemoc_studio + org.eclipse.gemoc.gemoc_studio.officialexample.k3fsm.pomfirst + 1.0.0-SNAPSHOT + + pom + + + 1.8 + 1.8 + 2.22.0 + 0.21.1 + 2.14.0 + 1.5.1 + + http://download.eclipse.org/releases/photon + http://www.kermeta.org/k3/update_2018-09-05 + http://www.kermeta.org/ale-lang/updates/2019-11-13 + http://melange.inria.fr/updatesite/nightly/update_2018-12-03/ + + + + + + org.eclipse.gemoc.example.k3fsm.mep.server + + + + + + org.eclipse.tycho + tycho-maven-plugin + ${tycho.version} + true + + + + org.eclipse.xtend + xtend-maven-plugin + ${xtend.version} + + + + compile + xtend-install-debug-info + testCompile + xtend-test-install-debug-info + + + xtend-gen + + + + + + + + + org.eclipse.jdt + org.eclipse.jdt.core + 3.13.102 + + + org.eclipse.jdt + org.eclipse.jdt.compiler.apt + 1.3.110 + + + org.eclipse.jdt + org.eclipse.jdt.compiler.tool + 1.2.101 + + + org.eclipse.emf + org.eclipse.emf.codegen + 2.11.0 + + + + + + + \ No newline at end of file