Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2012-09-19 07:11:42 +0000
committerHenrik Rentz-Reichert2012-09-19 07:11:42 +0000
commit3057ec0e9e80569351ff1f8bd72d2a0b255da971 (patch)
treed084b3c33ae9623a6fcf24ede39c2aab49562d52 /tests
parent8f9a073f8b762d6833ab7cc4a79ac478c6c02744 (diff)
downloadorg.eclipse.etrice-3057ec0e9e80569351ff1f8bd72d2a0b255da971.tar.gz
org.eclipse.etrice-3057ec0e9e80569351ff1f8bd72d2a0b255da971.tar.xz
org.eclipse.etrice-3057ec0e9e80569351ff1f8bd72d2a0b255da971.zip
[generator.common.tests, generator.java.tests] added ChoicePointTest
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTest.room11
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/HandlerTest.room48
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/make.xml15
3 files changed, 19 insertions, 55 deletions
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTest.room
index dfa0042b2..464aae65c 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTest.room
@@ -1,4 +1,4 @@
-RoomModel ChoicePointTest {
+RoomModel org.eclipse.etrice.generator.common.tests.ChoicePointTest {
import room.basic.types.* from "Types.room"
@@ -30,11 +30,16 @@ RoomModel ChoicePointTest {
}
Behavior {
+ Operation CPUser() {
+ "caseId = etUnit_openAll(\"tmp\", \"ChoicePointTest.etu\", \"org.eclipse.etrice.generator.common.tests.ChoicePointTest\", \"ChoicePointTest_case\");"
+ }
+ Operation ~CPUser() {
+ "etUnit_closeAll(caseId);"
+ }
StateMachine {
Transition init: initial -> cp cp0 {
action {
"counter = 0;"
- "caseId = etUnit_openAll(\"tmp\", \"ChoicePointTest.etu\", \"org.eclipse.etrice.generator.common.tests.ChoicePointTest\", \"ChoicePointTest_case\");"
"int list[] = {1,2,3,4,5,6,3,4,5,7,8,10,11,12,9,16,3,4,5,17,8,13,15,11,19,12,9,18,20};"
"EXPECT_ORDER_START(caseId,list,list.length);"
"EXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 1);"
@@ -171,7 +176,7 @@ RoomModel ChoicePointTest {
State testOk {
entry {
"EXPECT_ORDER_END(caseId,\"<|MODEL_LOCATION|>\", 20);"
- "etUnit_closeAll(caseId);"
+ "etUnit_testFinished(caseId);"
}
}
}
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/HandlerTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/HandlerTest.room
index bb9bb9761..888468f75 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/HandlerTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/HandlerTest.room
@@ -48,7 +48,6 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
<msg1: TestPort1>
}
action {
- "System.out.println(\"top level handler action no guard \");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 11);"
}
}
@@ -59,13 +58,11 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
}>
}
action {
- "System.out.println(\"top level self transition action P1=>3\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 12);"
}
}
Transition init: initial -> tp2 of state0 {
action {
- "System.out.println(\"top level initial transition\");"
"int list[] = {13,15,16,22,23,11,24,17,14,12,13,16,23,70,24,17,14,114,113,111,11,70,24,17,120,16,23,24,17,121,18,19,25,18,20,19,21,18,19,25,18,19,14,117};"
"EXPECT_ORDER_START(caseId, list, list.length);"
}
@@ -77,7 +74,6 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
}>
}
action {
- "System.out.println(\"tr9 transition action\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 114);"
}
}
@@ -88,7 +84,6 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
}>
}
action {
- "System.out.println(\"top level self transition action P1=>4\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 50);"
}
}
@@ -99,7 +94,6 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
}>
}
action {
- "System.out.println(\"top level handler action p1=>7 \");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 70);"
}
}
@@ -110,13 +104,11 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
}>
}
action {
- "System.out.println(\"top level handler action p1=>12 \");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 110);"
}
}
Transition tr8: cp cp1 -> state1 {
action {
- "System.out.println(\"tr8 transition action\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 113);"
}
}
@@ -125,7 +117,6 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
"p1!=4"
}
action {
- "System.out.println(\"tr4 transition action\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 115);"
}
}
@@ -134,7 +125,6 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
<msg6: TestPort1>
}
action {
- "System.out.println(\"tp1 transition to choice action\");"
"EXPECT_ORDER_END(caseId, \"<|MODEL_LOCATION|>\", 117);"
}
}
@@ -143,11 +133,9 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
TransitionPoint tp1
State state0 {
entry {
- "System.out.println(\"state 0 entry action\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 13);"
}
exit {
- "System.out.println(\"state 0 exit action\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 14);"
}
subgraph {
@@ -161,7 +149,6 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
<msg3: TestPort1>
}
action {
- "System.out.println(\"state 0 handler action no guard\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 20);"
}
}
@@ -170,7 +157,6 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
<msg4: TestPort1>
}
action {
- "System.out.println(\"state 0 tp1 self transition action\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 21);"
}
}
@@ -179,13 +165,11 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
<msg1: TestPort1>
}
action {
- "System.out.println(\"state 0/2 self transition action\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 25);"
}
}
Transition tr4: my tp2 -> tp0 of state1 {
action {
- "System.out.println(\"state 0 tp2 transition action\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 15);"
}
}
@@ -196,13 +180,11 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
}>
}
action {
- "System.out.println(\"state 0 handler action P1 => 5\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 52);"
}
}
Transition init: initial -> state2 {
action {
- "System.out.println(\"state 0 initial transition\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 53);"
}
}
@@ -213,7 +195,6 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
}>
}
action {
- "System.out.println(\"state 0/1 self transition\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 54);"
}
}
@@ -224,7 +205,6 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
}>
}
action {
- "System.out.println(\"state 0 tp1 p1=>5\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 120);"
}
}
@@ -235,7 +215,6 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
}>
}
action {
- "System.out.println(\"state 0 tp1 action P1 => 6\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 121);"
}
}
@@ -244,34 +223,28 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
EntryPoint tp2
State state1 {
entry {
- "System.out.println(\"state 0/1 entry action\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 16);"
}
exit {
- "System.out.println(\"state 0/1 exit action\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 17);"
}
subgraph {
Transition tr0: my tp0 -> state7 {
action {
- "System.out.println(\"state 0/1 transition entry action\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 22);"
}
}
Transition init: initial -> state7 {
action {
- "System.out.println(\"state 0/1 initial transition\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 121);"
}
}
EntryPoint tp0
State state7 {
entry {
- "System.out.println(\"state 0/1/7 entry action\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 23);"
}
exit {
- "System.out.println(\"state 0/1/7 exit action\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 24);"
}
}
@@ -279,11 +252,9 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
}
State state2 {
entry {
- "System.out.println(\"state 0/2 entry action\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 18);"
}
exit {
- "System.out.println(\"state 0/2 exit action\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 19);"
}
}
@@ -291,17 +262,14 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
}
State testOk {
entry {
- "System.out.println(\"Test ok\");"
"etUnit_testFinished(caseId);"
}
}
State state1 {
entry {
- "System.out.println(\"state 1 entry action\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 111);"
}
exit {
- "System.out.println(\"state 1 exit action\");"
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 112);"
}
}
@@ -322,34 +290,18 @@ RoomModel org.eclipse.etrice.generator.common.tests.HandlerTest {
Transition init: initial -> state0 {
action {
"TestPort1.msg1(2);"
- "System.out.println(\"msg1(2) sent \");"
"TestPort1.msg1(3);"
- "System.out.println(\"msg1(3) sent \");"
"TestPort1.msg1(7);"
- "System.out.println(\"msg1(7) sent \");"
"TestPort1.msg1(4);"
- "System.out.println(\"msg1(4) sent \");"
"TestPort1.msg1(5);"
- "System.out.println(\"msg1(5) sent \");"
"TestPort1.msg1(7);"
- "System.out.println(\"msg1(7) sent \");"
"TestPort1.msg2(5);"
- "System.out.println(\"msg2(5) sent \");"
"TestPort1.msg2(6);"
- "System.out.println(\"msg2(6) sent \");"
- ""
- ""
- ""
"TestPort1.msg1(5);"
- "System.out.println(\"msg1(5) sent \");"
"TestPort1.msg3();"
- "System.out.println(\"msg3() sent \");"
"TestPort1.msg4();"
- "System.out.println(\"msg4() sent \");"
"TestPort1.msg1(8);"
- "System.out.println(\"msg1(8) sent \");"
"TestPort1.msg6(12);"
- "System.out.println(\"msg6(12) sent \");"
}
}
State state0
diff --git a/tests/org.eclipse.etrice.generator.java.tests/make.xml b/tests/org.eclipse.etrice.generator.java.tests/make.xml
index 9ae381f87..cb2158d37 100644
--- a/tests/org.eclipse.etrice.generator.java.tests/make.xml
+++ b/tests/org.eclipse.etrice.generator.java.tests/make.xml
@@ -14,6 +14,7 @@
<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
@@ -23,11 +24,11 @@
</target>
<!--
- set_tp: set the target.platform property to local if not set already
+ set_tp: get the target.platform property from the environment var TARGET_PLATFORM if not set already
-->
<target name="set_tp" unless="target.platform">
<echo>using local target platform</echo>
- <property name="target.platform" value="C:\Users\hrentz\Downloads\eclipse\Juno\eclipse-modeling-juno-win32\eclipse"/>
+ <property name="target.platform" value="${env.TARGET_PLATFORM}"/>
</target>
<!--
@@ -96,6 +97,7 @@
<java output="${output}/generate.txt" classname="org.eclipse.etrice.generator.java.Main" fork="true" failonerror="true">
<arg value="${java.tests.model.path}/HandlerTest.room"/>
+ <arg value="${java.tests.model.path}/ChoicePointTest.room"/>
<arg value="${modellib.path}/models/TimingService.room"/>
<arg value="${modellib.path}/models/Types.room"/>
<classpath refid="clspath"/>
@@ -119,7 +121,11 @@
-->
<target name="run" depends="compile">
<mkdir dir="tmp/log"/>
- <java output="${output}/run.txt" classname="org.eclipse.etrice.generator.common.tests.HandlerTest.SubSystem_HandlerTestRunner" fork="true" failonerror="true">
+ <java output="${output}/runHandlerTest.txt" classname="org.eclipse.etrice.generator.common.tests.HandlerTest.SubSystem_HandlerTestRunner" fork="true" failonerror="true">
+ <arg value="-run_as_test"/>
+ <classpath path="${bin.path};${runtime.path}/bin;${modellib.path}/bin"/>
+ </java>
+ <java output="${output}/runChoicePointTest.txt" classname="org.eclipse.etrice.generator.common.tests.ChoicePointTest.SubSystem_CPTestRunner" fork="true" failonerror="true">
<arg value="-run_as_test"/>
<classpath path="${bin.path};${runtime.path}/bin;${modellib.path}/bin"/>
</java>
@@ -140,13 +146,14 @@
</path>
<java output="${output}/convert.txt" classname="org.eclipse.etrice.etunit.converter.EtUnitReportConverter" fork="true" failonerror="true">
+ <arg value="./tmp/ChoicePointTest.etu"/>
<arg value="./tmp/HandlerTest.etu"/>
<classpath refid="clspath"/>
</java>
</target>
<!--
- copy_rsults: copies the *.xml results to their final destination
+ copy_results: copies the *.xml results to their final destination
-->
<target name="copy_results" depends="set_tr">
<copy todir="${test.results}" >

Back to the top