Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJuergen Haug2012-12-12 15:14:00 +0000
committerJuergen Haug2012-12-12 15:14:00 +0000
commit5d9b58598e7ca37940afb777337975f4afad4dbf (patch)
treeba83942b8814e1658a73b7b243e9982f72441fab /tests
parent72802f3f5250f6632ed0a4e6dc3bedcb9c5ffee4 (diff)
parent7d084613b6dc6ea496e51f70e511126081cdd307 (diff)
downloadorg.eclipse.etrice-5d9b58598e7ca37940afb777337975f4afad4dbf.tar.gz
org.eclipse.etrice-5d9b58598e7ca37940afb777337975f4afad4dbf.tar.xz
org.eclipse.etrice-5d9b58598e7ca37940afb777337975f4afad4dbf.zip
Merge remote-tracking branch 'origin/master' into change/8995/1
Conflicts: plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.xtend plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.java plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zip plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.java.zip plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zip plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.java.zip Change-Id: Iec86201d19ab068e6f2eb9b667e05d3bc3e78786
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/models/TestBindings.room104
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBindings.java83
-rw-r--r--tests/org.eclipse.etrice.generator.c.tests/buckminster.cspec3
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/buckminster.cspec3
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/.classpath8
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/.gitignore6
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/.project17
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/.settings/org.eclipse.jdt.core.prefs11
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/about.html28
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/buckminster.cspec11
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/make.xml360
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/buckminster.cspec3
-rw-r--r--tests/org.eclipse.etrice.runtime.java.tests/buckminster.cspec2
-rw-r--r--tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/messaging/DummyMessageReceiver.java7
-rw-r--r--tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/ActorClassBaseTest.java8
-rw-r--r--tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/PortBaseTest.java13
16 files changed, 660 insertions, 7 deletions
diff --git a/tests/org.eclipse.etrice.core.room.tests/models/TestBindings.room b/tests/org.eclipse.etrice.core.room.tests/models/TestBindings.room
new file mode 100644
index 000000000..47f081898
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.room.tests/models/TestBindings.room
@@ -0,0 +1,104 @@
+RoomModel TestBindings {
+ LogicalSystem Sys {
+ SubSystemRef main: Application
+ }
+
+ SubSystemClass Application {
+ ActorRef ref1: AC1
+ ActorRef ref2: AC2
+
+ // no self connection allowed, ports are indentical
+ Binding ref1.reg and ref1.reg
+
+ // port with multiplicity 1 is already connected
+ Binding ref1.reg and ref2.conj
+ Binding ref1.reg and ref2.conj
+
+ // protocols don't match
+ Binding ref1.reg and ref2.other
+
+ // protocol extends incoming
+ Binding ref1.base and ref2.extin
+
+ // ok
+ Binding ref1.base2 and ref2.extout
+
+ // protocol extends outgoing
+ Binding ref1.base3 and ref2.extout2
+
+ // derived protocols not connectable (both directions extended)
+ Binding ref1.base4 and ref2.extinout
+
+ LogicalThread dflt_thread
+ }
+
+ ActorClass AC1 {
+ Interface {
+ Port reg: PC1
+ Port base: PCBase
+ Port base2: PCBase
+ conjugated Port base3: PCBase
+ conjugated Port base4: PCBase
+ }
+ Structure {
+ external Port reg
+ }
+ Behavior { }
+ }
+
+ ActorClass AC2 {
+ Interface {
+ conjugated Port conj: PC1
+ conjugated Port other: PC2
+ conjugated Port extout: PCExtendOut
+ conjugated Port extin: PCExtendIn
+ Port extout2: PCExtendOut
+ Port extinout: PCExtendInOut
+ }
+ Structure {
+ external Port conj
+ }
+ Behavior { }
+ }
+
+ ProtocolClass PC1 {
+ incoming {
+ Message in1()
+ }
+ }
+
+ ProtocolClass PC2 {
+ incoming {
+ Message in1()
+ }
+ }
+
+ ProtocolClass PCBase {
+ incoming {
+ Message in1()
+ }
+ }
+
+ ProtocolClass PCExtendIn extends PCBase {
+ incoming {
+ Message in2()
+ }
+ }
+
+ ProtocolClass PCExtendOut extends PCBase {
+ outgoing {
+ Message out1()
+ }
+ }
+
+ ProtocolClass PCExtendInOut extends PCBase {
+ incoming {
+ Message in2()
+ }
+ outgoing {
+ // a derived protocol should add either incoming or outgoing messages, not both
+ Message out1()
+ }
+ }
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBindings.java b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBindings.java
new file mode 100644
index 000000000..d370d16b5
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBindings.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2012 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core;
+
+import static org.junit.Assert.*;
+
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.etrice.core.room.Binding;
+import org.eclipse.etrice.core.room.GeneralProtocolClass;
+import org.eclipse.etrice.core.room.RoomModel;
+import org.eclipse.etrice.core.room.SubSystemClass;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author Henrik Rentz-Reichert
+ *
+ */
+public class TestBindings extends TestBase {
+ private Resource resource;
+
+ @Before
+ public void setUp() {
+ prepare();
+
+ resource = getResource("TestBindings.room");
+ }
+
+ @Test
+ public void testBindingValidation() {
+ RoomModel mdl = (RoomModel) resource.getContents().get(0);
+ SubSystemClass ssc = mdl.getSubSystemClasses().get(0);
+ Binding bind = ssc.getBindings().get(0);
+ Diagnostic diag = getDiag(bind).getChildren().get(0);
+ assertEquals("expect error message", "no self connection allowed, ports are indentical", diag.getMessage());
+
+ bind = ssc.getBindings().get(1);
+ diag = getDiag(bind).getChildren().get(0);
+ assertEquals("expect error message", "port with multiplicity 1 is already connected", diag.getMessage());
+
+ bind = ssc.getBindings().get(2);
+ diag = getDiag(bind).getChildren().get(0);
+ assertEquals("expect error message", "port with multiplicity 1 is already connected", diag.getMessage());
+
+ bind = ssc.getBindings().get(3);
+ diag = getDiag(bind).getChildren().get(0);
+ assertEquals("protocols don't match", diag.getMessage());
+
+ bind = ssc.getBindings().get(4);
+ diag = getDiag(bind).getChildren().get(0);
+ assertEquals("protocol extends incoming", diag.getMessage());
+
+ bind = ssc.getBindings().get(6);
+ diag = getDiag(bind).getChildren().get(0);
+ assertEquals("protocol extends outgoing", diag.getMessage());
+
+ bind = ssc.getBindings().get(7);
+ diag = getDiag(bind).getChildren().get(0);
+ assertEquals("derived protocols not connectable (both directions extended)", diag.getMessage());
+ }
+
+ @Test
+ public void testProtocolValidation() {
+ RoomModel mdl = (RoomModel) resource.getContents().get(0);
+ for (GeneralProtocolClass pc : mdl.getProtocolClasses()) {
+ if (pc.getName().equals("PCExtendInOut")) {
+ Diagnostic diag = getDiag(pc).getChildren().get(0);
+ assertEquals("a derived protocol should add either incoming or outgoing messages, not both", diag.getMessage());
+ }
+ }
+ }
+}
diff --git a/tests/org.eclipse.etrice.generator.c.tests/buckminster.cspec b/tests/org.eclipse.etrice.generator.c.tests/buckminster.cspec
index a4ef60acf..562d565a3 100644
--- a/tests/org.eclipse.etrice.generator.c.tests/buckminster.cspec
+++ b/tests/org.eclipse.etrice.generator.c.tests/buckminster.cspec
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<cs:cspec xmlns:cs="http://www.eclipse.org/buckminster/CSpec-1.0" name="org.eclipse.etrice.generator.c.tests" componentType="buckminster" version="0.0.2">
+<?xml version="1.0" encoding="UTF-8"?><cs:cspec xmlns:cs="http://www.eclipse.org/buckminster/CSpec-1.0" name="org.eclipse.etrice.generator.c.tests" componentType="buckminster" version="0.3.0.qualifier">
<cs:actions>
<cs:public name="run_tests" actor="ant">
<cs:actorProperties>
diff --git a/tests/org.eclipse.etrice.generator.common.tests/buckminster.cspec b/tests/org.eclipse.etrice.generator.common.tests/buckminster.cspec
index 8eca211cd..7025f5870 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/buckminster.cspec
+++ b/tests/org.eclipse.etrice.generator.common.tests/buckminster.cspec
@@ -1,2 +1 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<cs:cspec xmlns:cs="http://www.eclipse.org/buckminster/CSpec-1.0" name="org.eclipse.etrice.generator.common.tests" componentType="buckminster" version="0.0.2"/>
+<?xml version="1.0" encoding="UTF-8"?><cs:cspec xmlns:cs="http://www.eclipse.org/buckminster/CSpec-1.0" name="org.eclipse.etrice.generator.common.tests" componentType="buckminster" version="0.3.0.qualifier"/>
diff --git a/tests/org.eclipse.etrice.generator.cpp.tests/.classpath b/tests/org.eclipse.etrice.generator.cpp.tests/.classpath
new file mode 100644
index 000000000..bb2b15cfe
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.cpp.tests/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.etrice.modellib.java"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.etrice.runtime.java"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/org.eclipse.etrice.generator.cpp.tests/.gitignore b/tests/org.eclipse.etrice.generator.cpp.tests/.gitignore
new file mode 100644
index 000000000..04907272d
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.cpp.tests/.gitignore
@@ -0,0 +1,6 @@
+/bin
+/models
+/output
+/results
+/src-gen
+/tmp
diff --git a/tests/org.eclipse.etrice.generator.cpp.tests/.project b/tests/org.eclipse.etrice.generator.cpp.tests/.project
new file mode 100644
index 000000000..2d5f8a80c
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.cpp.tests/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.etrice.generator.cpp.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/org.eclipse.etrice.generator.cpp.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.etrice.generator.cpp.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..54e493c07
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.cpp.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,11 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+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.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/tests/org.eclipse.etrice.generator.cpp.tests/about.html b/tests/org.eclipse.etrice.generator.cpp.tests/about.html
new file mode 100644
index 000000000..82d49bf5f
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.cpp.tests/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/tests/org.eclipse.etrice.generator.cpp.tests/buckminster.cspec b/tests/org.eclipse.etrice.generator.cpp.tests/buckminster.cspec
new file mode 100644
index 000000000..ac05dbe67
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.cpp.tests/buckminster.cspec
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?><cs:cspec xmlns:cs="http://www.eclipse.org/buckminster/CSpec-1.0" name="org.eclipse.etrice.generator.cpp.tests" componentType="buckminster" version="0.3.0.qualifier">
+ <cs:actions>
+ <cs:public name="run_tests" actor="ant">
+ <cs:actorProperties>
+ <cs:property key="buildFile" value="make.xml"/>
+ <cs:property key="target.platform" value="${WORKSPACE}/buildroot/target.platform"/>
+ <cs:property key="targets" value="all"/>
+ </cs:actorProperties>
+ </cs:public>
+ </cs:actions>
+</cs:cspec>
diff --git a/tests/org.eclipse.etrice.generator.cpp.tests/make.xml b/tests/org.eclipse.etrice.generator.cpp.tests/make.xml
new file mode 100644
index 000000000..9913fc97e
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.cpp.tests/make.xml
@@ -0,0 +1,360 @@
+<?xml version="1.0"?>
+<!--
+ Ant makefile for building and running of tests.
+ This includes invocation of the Java code generator and conversion of the etunit
+ results into xunit xml.
+
+ To work locally you should define in your environment
+ ETRICE_TARGET_PLATFORM=path to the eclipse folder of your Juno installation
+ ETRICE_CPP_RUNTIME=path to the org.eclipse.etrice.runtime.cpp folder (relative path doesn't work)
+
+ @author Henrik Rentz-Reichert
+-->
+<project name="project" default="all">
+
+ <property name="cpp.tests.model.path" value="./models"/>
+ <property name="modellib.path" value="../../runtime/org.eclipse.etrice.modellib.cpp"/>
+ <property name="bin.path" value="./bin"/>
+ <property name="xml.output" value="./tmp"/>
+ <property name="output" value="./output"/>
+ <property environment="env"/>
+
+
+ <!--
+ all: copies the models, generates, compiles, runs, converts and copies the results
+ -->
+ <target name="all" depends="convert,copy_results">
+ <echo>done with org.eclipse.etrice.generator.cpp.tests</echo>
+ </target>
+
+ <!--
+ set_tp: get the target.platform property from the environment var ETRICE_TARGET_PLATFORM if not set already
+ -->
+ <target name="set_tp" unless="target.platform">
+ <echo>using local target platform</echo>
+ <property name="target.platform" value="${env.ETRICE_TARGET_PLATFORM}"/>
+ </target>
+
+ <!--
+ set_tr: sets the test.result property if not set already
+ -->
+ <target name="set_tr" unless="test.results">
+ <echo>using local test result folder</echo>
+ <property name="test.results" value="./results"/>
+ </target>
+
+ <!--
+ set_rp: sets the runtime.path from the ETRICE_CPP_RUNTIME environment variable property if not set already
+ -->
+ <target name="set_rp" unless="c-runtime.path,cpp-runtime.path">
+ <echo>using local runtime folder</echo>
+ <property name="cpp-runtime.path" value="${env.ETRICE_CPP_RUNTIME}"/>
+ <property name="c-runtime.path" value="${env.ETRICE_C_RUNTIME}"/>
+ </target>
+
+ <!--
+ clean: deletes all folders created by this script
+ -->
+ <target name="clean" depends="set_tr,set_rp">
+ <delete dir="${bin.path}"/>
+ <delete dir="${c-runtime.path}/bin"/>
+ <delete dir="${cpp-runtime.path}/bin"/>
+ <delete dir="models"/>
+ <delete dir="${output}"/>
+ <delete dir="${test.results}"/>
+ <delete dir="src-gen"/>
+ <delete dir="tmp"/>
+ </target>
+
+ <!--
+ copy_models: copies the models from their original folders to the build location
+ -->
+ <target name="copy_models">
+ <copy todir="models" >
+ <fileset dir="../org.eclipse.etrice.generator.common.tests/models">
+ <include name="*.room"/>
+ </fileset>
+ <fileset dir="${modellib.path}/model">
+ <include name="TimingService.room"/>
+ <include name="Types.room"/>
+ <include name="Language.room"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <!--
+ generate: invokes the Java generator for the ROOM models
+ -->
+ <target name="generate" depends="set_tp,copy_models">
+ <mkdir dir="${output}"/>
+ <path id="clspath">
+ <pathelement location="../../plugins/org.eclipse.etrice.generator.cpp/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.generator.doc/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.generator.config/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.generator/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.core.room/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.core.etphys/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.core.etmap/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.core.config/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.core.genmodel/bin"/>
+ <fileset dir="${target.platform}/plugins/">
+ <include name="org.eclipse.emf.ecore_2.8*.jar" />
+ <include name="org.eclipse.emf.common_2.8*.jar" />
+ <include name="org.eclipse.emf.ecore.xmi_2.8*.jar" />
+ <include name="org.eclipse.xtext_2.*.jar" />
+ <include name="com.google.inject_*.jar" />
+ <include name="com.google.guava_10.*.jar" />
+ <include name="org.eclipse.equinox.common_3.6.*.jar" />
+ <include name="org.eclipse.xtext.util_2.*.jar" />
+ <include name="org.eclipse.xtend.lib_2.*.jar" />
+ <include name="org.eclipse.xtext.xbase.lib_2.*.jar" />
+ <include name="org.apache.log4j_1.2*.jar" />
+ <include name="org.antlr.runtime_3.2*.jar" />
+ <include name="javax.inject_1.0*.jar" />
+ </fileset>
+ </path>
+
+ <java output="${output}/generate.txt" classname="org.eclipse.etrice.generator.cpp.Main" fork="true" failonerror="true">
+ <arg value="${cpp.tests.model.path}/ChoicePointTest.room"/>
+ <arg value="${cpp.tests.model.path}/HandlerTest.room"/>
+ <arg value="-etunit"/>
+ <classpath refid="clspath"/>
+ </java>
+ </target>
+
+ <!--
+ compile_c_runtime: compiles the C runtime library
+ -->
+ <target name="compile_c_runtime" depends="set_rp">
+ <mkdir dir="${c-runtime.path}/bin"/>
+ <mkdir dir="${output}"/>
+ <exec dir="${c-runtime.path}/bin" executable="gcc" failonerror="true" output="${output}/compile_c_runtime.txt">
+ <arg value="-I${c-runtime.path}/src/common"/>
+ <arg value="-I${c-runtime.path}/src/config"/>
+ <arg value="-I${c-runtime.path}/src/platforms/generic"/>
+ <arg value="-c"/>
+ <arg value="-g3"/>
+ <arg value="-O0"/>
+ <arg value="-Wall"/>
+ <arg value="../src/common/debugging/etMSCLogger.c"/>
+ <arg value="../src/common/etUnit/etUnit.c"/>
+ <arg value="../src/common/messaging/etMessage.c"/>
+ <arg value="../src/common/messaging/etMessageQueue.c"/>
+ <arg value="../src/common/messaging/etMessageService.c"/>
+ <arg value="../src/common/modelbase/etActor.c"/>
+ <arg value="../src/common/modelbase/etPort.c"/>
+ <arg value="../src/platforms/generic/etLogger.c"/>
+ <arg value="../src/platforms/generic/etPlatform.c"/>
+ <arg value="../src/platforms/generic/etTimer.c"/>
+ </exec>
+ <exec dir="${c-runtime.path}/bin" executable="ar" failonerror="true" output="${output}/compile_c_runtime.txt" append="true">
+ <arg value="-r"/>
+ <arg value="liborg.eclipse.etrice.runtime.c.a"/>
+ <arg value="etMSCLogger.o"/>
+ <arg value="etUnit.o"/>
+ <arg value="etMessage.o"/>
+ <arg value="etMessageQueue.o"/>
+ <arg value="etMessageService.o"/>
+ <arg value="etActor.o"/>
+ <arg value="etPort.o"/>
+ <arg value="etLogger.o"/>
+ <arg value="etPlatform.o"/>
+ <arg value="etTimer.o"/>
+ </exec>
+ </target>
+
+ <!--
+ compile_runtime: compiles the CPP runtime library
+ -->
+ <target name="compile_runtime" depends="set_rp">
+ <mkdir dir="${cpp-runtime.path}/bin"/>
+ <mkdir dir="${output}"/>
+ <exec dir="${cpp-runtime.path}/bin" executable="gcc" failonerror="true" output="${output}/compile_runtime.txt">
+ <arg value="-I${cpp-runtime.path}/src"/>
+ <arg value="-I${cpp-runtime.path}/src/platforms/generic"/>
+ <arg value="-c"/>
+ <arg value="-g3"/>
+ <arg value="-O0"/>
+ <arg value="-Wall"/>
+ <arg value="../src/common/debugging/DebuggingService.cpp"/>
+ <arg value="../src/common/debugging/MSCFilter.cpp"/>
+ <arg value="../src/common/debugging/MSCLogger.cpp"/>
+ <!--arg value="../src/common/etUnit/etUnit.c"/-->
+ <arg value="../src/common/messaging/Address.cpp"/>
+ <arg value="../src/common/messaging/IMessageReceiver.cpp"/>
+ <arg value="../src/common/messaging/IRTObject.cpp"/>
+ <arg value="../src/common/messaging/Message.cpp"/>
+ <arg value="../src/common/messaging/MessageDispatcher.cpp"/>
+ <arg value="../src/common/messaging/MessageSeQueue.cpp"/>
+ <arg value="../src/common/messaging/MessageService.cpp"/>
+ <arg value="../src/common/messaging/MessageServiceController.cpp"/>
+ <arg value="../src/common/messaging/RTObject.cpp"/>
+ <arg value="../src/common/messaging/RTServices.cpp"/>
+ <arg value="../src/common/messaging/RTSystemServicesProtocol.cpp"/>
+ <arg value="../src/common/modelbase/ActorClassBase.cpp"/>
+ <arg value="../src/common/modelbase/EventReceiver.cpp"/>
+ <arg value="../src/common/modelbase/IEventReceiver.cpp"/>
+ <arg value="../src/common/modelbase/InterfaceItemBase.cpp"/>
+ <arg value="../src/common/modelbase/PortBase.cpp"/>
+ <arg value="../src/common/modelbase/SubSystemClassBase.cpp"/>
+ <arg value="../src/common/modelbase/SubSystemRunnerBase.cpp"/>
+ <arg value="../src/common/modelbase/TestSemaphore.cpp"/>
+ </exec>
+ <exec dir="${cpp-runtime.path}/bin" executable="ar" failonerror="true" output="${output}/compile_runtime.txt" append="true">
+ <arg value="-r"/>
+ <arg value="liborg.eclipse.etrice.runtime.cpp.a"/>
+ <arg value="DebuggingService.o"/>
+ <arg value="MSCFilter.o"/>
+ <arg value="MSCLogger.o"/>
+ <arg value="Address.o"/>
+ <arg value="IMessageReceiver.o"/>
+ <arg value="IRTObject.o"/>
+ <arg value="Message.o"/>
+ <arg value="MessageDispatcher.o"/>
+ <arg value="MessageSeQueue.o"/>
+ <arg value="MessageService.o"/>
+ <arg value="MessageServiceController.o"/>
+ <arg value="RTObject.o"/>
+ <arg value="RTServices.o"/>
+ <arg value="RTSystemServicesProtocol.o"/>
+ <arg value="ActorClassBase.o"/>
+ <arg value="EventReceiver.o"/>
+ <arg value="IEventReceiver.o"/>
+ <arg value="InterfaceItemBase.o"/>
+ <arg value="PortBase.o"/>
+ <arg value="SubSystemClassBase.o"/>
+ <arg value="SubSystemRunnerBase.o"/>
+ <arg value="TestSemaphore.o"/>
+ </exec>
+ </target>
+
+ <!--
+ compile: compiles the generated C sources
+ -->
+ <target name="build" depends="set_rp,compile_c_runtime,compile_runtime,generate">
+
+ <!-- compile and link HandlerTest -->
+ <mkdir dir="bin/HandlerTest"/>
+ <exec dir="bin/HandlerTest" executable="gcc" failonerror="true" output="${output}/build.txt">
+ <arg value="-I../../src-gen/ChoicePointTest"/>
+ <arg value="-I../../src-gen/HandlerTest"/>
+ <arg value="-I../../src-gen"/>
+ <arg value="-I${cpp-runtime.path}/src"/>
+ <arg value="-I${cpp-runtime.path}/src/platforms/generic"/>
+ <arg value="-I${c-runtime.path}/src/common/etUnit"/>
+ <arg value="-c"/>
+ <arg value="-g3"/>
+ <arg value="-O0"/>
+ <arg value="-Wall"/>
+ <arg value="../../src-gen/HandlerTest/HandlerTest_Top.cpp"/>
+ <arg value="../../src-gen/HandlerTest/HandlerUser.cpp"/>
+ <arg value="../../src-gen/HandlerTest/SubSystem_HandlerTest.cpp"/>
+ <arg value="../../src-gen/HandlerTest/SubSystem_HandlerTest_Runner.cpp"/>
+ <arg value="../../src-gen/HandlerTest/Tester.cpp"/>
+ <arg value="../../src-gen/HandlerTest/TestProtocol.cpp"/>
+ </exec>
+ <exec dir="bin/HandlerTest" executable="g++" failonerror="true" output="${output}/build.txt" append="true">
+ <arg value="-L${cpp-runtime.path}/bin"/>
+ <arg value="-L${c-runtime.path}/bin"/>
+ <arg value="-oHandlerTest.exe"/>
+ <arg value="HandlerTest_Top.o"/>
+ <arg value="HandlerUser.o"/>
+ <arg value="SubSystem_HandlerTest.o"/>
+ <arg value="Tester.o"/>
+ <arg value="TestProtocol.o"/>
+ <arg value="SubSystem_HandlerTest_Runner.o"/>
+
+ <!-- library has to be in the last position -->
+ <arg value="-lorg.eclipse.etrice.runtime.cpp"/>
+ <arg value="-lorg.eclipse.etrice.runtime.c"/>
+ </exec>
+
+ <!-- compile and link ChoicepointTest -->
+ <mkdir dir="bin/ChoicePointTest"/>
+ <exec dir="bin/ChoicePointTest" executable="gcc" failonerror="true" output="${output}/build.txt" append="true">
+ <arg value="-I../../src-gen/ChoicePointTest"/>
+ <arg value="-I../../src-gen/HandlerTest"/>
+ <arg value="-I../../src-gen"/>
+ <arg value="-I${cpp-runtime.path}/src"/>
+ <arg value="-I${cpp-runtime.path}/src/platforms/generic"/>
+ <arg value="-I${c-runtime.path}/src/common/etUnit"/>
+ <arg value="-c"/>
+ <arg value="-g3"/>
+ <arg value="-O0"/>
+ <arg value="-Wall"/>
+ <arg value="../../src-gen/ChoicePointTest/CPTest_Top.cpp"/>
+ <arg value="../../src-gen/ChoicePointTest/CPTester.cpp"/>
+ <arg value="../../src-gen/ChoicePointTest/CPUser.cpp"/>
+ <arg value="../../src-gen/ChoicePointTest/SubSystem_CPTest.cpp"/>
+ <arg value="../../src-gen/ChoicePointTest/SubSystem_CPTest_Runner.cpp"/>
+ <arg value="../../src-gen/ChoicePointTest/TestProtocol.cpp"/>
+ </exec>
+ <exec dir="bin/ChoicePointTest" executable="g++" failonerror="true" output="${output}/build.txt" append="true">
+ <arg value="-L${cpp-runtime.path}/bin"/>
+ <arg value="-L${c-runtime.path}/bin"/>
+ <arg value="-oChoicePointTest.exe"/>
+ <arg value="CPTest_Top.o"/>
+ <arg value="CPTester.o"/>
+ <arg value="CPUser.o"/>
+ <arg value="SubSystem_CPTest.o"/>
+ <arg value="SubSystem_CPTest_Runner.o"/>
+ <arg value="TestProtocol.o"/>
+
+ <!-- library has to be in the last position -->
+ <arg value="-lorg.eclipse.etrice.runtime.cpp"/>
+ <arg value="-lorg.eclipse.etrice.runtime.c"/>
+ </exec>
+ </target>
+
+ <!--
+ run: runs all executables
+ -->
+ <target name="run" depends="build">
+ <mkdir dir="tmp/log"/>
+ <exec dir="./" resolveexecutable="true" executable="./bin/HandlerTest/HandlerTest.exe"/>
+ <exec dir="./" resolveexecutable="true" executable="./bin/ChoicePointTest/ChoicePointTest.exe"/>
+ </target>
+
+ <!--
+ convert: converts etu- into xunit xml-format
+ -->
+ <target name="convert" depends="run,set_tp">
+ <path id="clspath">
+ <pathelement location="../../plugins/org.eclipse.etrice.etunit.converter/bin"/>
+ <fileset dir="${target.platform}/plugins/">
+ <include name="org.eclipse.core.runtime_3.8*.jar" />
+ <include name="org.eclipse.emf.ecore_2.8*.jar" />
+ <include name="org.eclipse.emf.ecore.xmi_2.8*.jar" />
+ <include name="org.eclipse.emf.common_2.8*.jar" />
+ </fileset>
+ </path>
+
+ <java output="${output}/convert.txt" append="true" classname="org.eclipse.etrice.etunit.converter.EtUnitReportConverter" fork="true" failonerror="true">
+ <arg value="-suite"/>
+ <arg value="org.eclipse.etrice.generator.c.tests.ChoicePointTest"/>
+ <arg value="./tmp/ChoicePointTest.etu"/>
+ <classpath refid="clspath"/>
+ </java>
+
+ <java output="${output}/convert.txt" append="true" classname="org.eclipse.etrice.etunit.converter.EtUnitReportConverter" fork="true" failonerror="true">
+ <arg value="-suite"/>
+ <arg value="org.eclipse.etrice.generator.c.tests.HandlerTest"/>
+ <arg value="./tmp/HandlerTest.etu"/>
+ <classpath refid="clspath"/>
+ </java>
+ </target>
+
+ <!--
+ copy_results: copies the *.xml results to their final destination
+ -->
+ <target name="copy_results" depends="set_tr">
+ <move file="./tmp/HandlerTest.xml" tofile="./tmp/CPPHandlerTest.xml"/>
+ <move file="./tmp/ChoicePointTest.xml" tofile="./tmp/CPPChoicePointTest.xml"/>
+ <copy todir="${test.results}" >
+ <fileset dir="./tmp">
+ <include name="*.xml"/>
+ </fileset>
+ </copy>
+ </target>
+
+</project>
diff --git a/tests/org.eclipse.etrice.generator.java.tests/buckminster.cspec b/tests/org.eclipse.etrice.generator.java.tests/buckminster.cspec
index 3750c18c2..7219f7c76 100644
--- a/tests/org.eclipse.etrice.generator.java.tests/buckminster.cspec
+++ b/tests/org.eclipse.etrice.generator.java.tests/buckminster.cspec
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<cs:cspec xmlns:cs="http://www.eclipse.org/buckminster/CSpec-1.0" name="org.eclipse.etrice.generator.java.tests" componentType="buckminster" version="0.0.2">
+<?xml version="1.0" encoding="UTF-8"?><cs:cspec xmlns:cs="http://www.eclipse.org/buckminster/CSpec-1.0" name="org.eclipse.etrice.generator.java.tests" componentType="buckminster" version="0.3.0.qualifier">
<cs:actions>
<cs:public name="run_tests" actor="ant">
<cs:actorProperties>
diff --git a/tests/org.eclipse.etrice.runtime.java.tests/buckminster.cspec b/tests/org.eclipse.etrice.runtime.java.tests/buckminster.cspec
index 70fa3dba6..65d50e5bf 100644
--- a/tests/org.eclipse.etrice.runtime.java.tests/buckminster.cspec
+++ b/tests/org.eclipse.etrice.runtime.java.tests/buckminster.cspec
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<cs:cspec xmlns:cs="http://www.eclipse.org/buckminster/CSpec-1.0" name="org.eclipse.etrice.runtime.java.tests" componentType="buckminster" version="1.0.0">
+<cs:cspec xmlns:cs="http://www.eclipse.org/buckminster/CSpec-1.0" name="org.eclipse.etrice.runtime.java.tests" componentType="buckminster" version="0.3.0.qualifier">
<cs:dependencies>
<cs:dependency name="org.eclipse.etrice.runtime.java" componentType="buckminster"/>
</cs:dependencies>
diff --git a/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/messaging/DummyMessageReceiver.java b/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/messaging/DummyMessageReceiver.java
index fdf28bf90..663941a04 100644
--- a/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/messaging/DummyMessageReceiver.java
+++ b/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/messaging/DummyMessageReceiver.java
@@ -36,11 +36,18 @@ public class DummyMessageReceiver implements IMessageReceiver {
private Message last_received_message = null;
private Address address = null;
+ @Override
+ public String getInstancePath(char delim) {
+ return null;
+ }
+
+ @Override
public String getInstancePath() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String getInstancePathName() {
// TODO Auto-generated method stub
return null;
diff --git a/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/ActorClassBaseTest.java b/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/ActorClassBaseTest.java
index 6bec2d712..83a43da48 100644
--- a/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/ActorClassBaseTest.java
+++ b/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/ActorClassBaseTest.java
@@ -34,6 +34,14 @@ public class ActorClassBaseTest extends TestCase {
public String getInstancePathName() {
return "TOP_PathName";
}
+
+ @Override
+ public String getInstancePath(char delim) {
+ if (delim == IRTObject.PATH_DELIM)
+ return getInstancePath();
+ else
+ return getInstancePathName();
+ }
}
diff --git a/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/PortBaseTest.java b/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/PortBaseTest.java
index da792e661..c1937d2c3 100644
--- a/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/PortBaseTest.java
+++ b/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/PortBaseTest.java
@@ -29,6 +29,14 @@ public class PortBaseTest extends TestCase {
public String getInstancePathName() {
return "TOP_PathName";
}
+
+ @Override
+ public String getInstancePath(char delim) {
+ if (delim == IRTObject.PATH_DELIM)
+ return getInstancePath();
+ else
+ return getInstancePathName();
+ }
@Override
public void receiveEvent(InterfaceItemBase ifitem, int evt, Object data) {
@@ -46,6 +54,11 @@ public class PortBaseTest extends TestCase {
public String getInstancePathName() {
return "TOP_PathName";
}
+
+ @Override
+ public String getInstancePath(char delim) {
+ return null;
+ }
}

Back to the top