Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2011-02-23 17:45:55 -0500
committerHenrik Rentz-Reichert2011-03-05 01:01:49 -0500
commitd66136ce125984a439edc01928452f008d74d687 (patch)
tree1355562cfa1d5be484f27e2471a55b56635bbdf6
parentd70354487c598440ffb52d84547dd77eac9f2b5d (diff)
downloadorg.eclipse.etrice-d66136ce125984a439edc01928452f008d74d687.tar.gz
org.eclipse.etrice-d66136ce125984a439edc01928452f008d74d687.tar.xz
org.eclipse.etrice-d66136ce125984a439edc01928452f008d74d687.zip
integration.tests: fixed test after introduction of multi-threading
(cf. https://bugs.eclipse.org/bugs/show_bug.cgi?id=337075). Minor changes else.
-rw-r--r--modellib/org.eclipse.etrice.modellib/models/TimingService.room145
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageService.java1
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageServiceController.java1
-rw-r--r--tests/org.eclipse.etrice.integration.tests/model/org.eclipse.etrice.integration.tests.room2
-rw-r--r--tests/org.eclipse.etrice.integration.tests/model/org.eclipse.etrice.integration.tests.trp16
-rw-r--r--tests/org.eclipse.etrice.integration.tests/src/org/eclipse/etrice/integration/tests/IntegrationTestFSMGenerator.java3
-rw-r--r--tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/PortBaseTest.java2
7 files changed, 87 insertions, 83 deletions
diff --git a/modellib/org.eclipse.etrice.modellib/models/TimingService.room b/modellib/org.eclipse.etrice.modellib/models/TimingService.room
index a7f4d5b4b..fbd392452 100644
--- a/modellib/org.eclipse.etrice.modellib/models/TimingService.room
+++ b/modellib/org.eclipse.etrice.modellib/models/TimingService.room
@@ -1,71 +1,5 @@
-RoomModel room.basic.service.timing { ActorClass ATimingService {
- Interface {
- SPP timer: PTimer
- SPP timeout: PTimeout
- }
- Structure {
- usercode1 {
- "import java.util.Timer;"
- }
- usercode2 {
- "private Timer timerService = null;"
- "private int taskCount = 0;"
- "private static final int PURGE_LIMIT = 1000;"
- }
- ServiceImplementation of timer
- ServiceImplementation of timeout
- }
- Behavior {
- Operation stop() {
- "System.out.println(toString() + \"::stop()\");"
- "timerService.cancel();"
- "timerService = null;"
- }
- StateMachine { Transition tr0: initial -> Operational {
- action {
- "timerService = new Timer();"
- }
- }
- Transition tr1: Operational -> Operational {
- triggers {
- <Start:timeout>
- }
- action {
- "// start timeout"
- "taskCount++;"
- "if (taskCount>PURGE_LIMIT) timerService.purge();"
- "timerService.schedule(((PTimeoutPort)ifitem).getTask(), time_ms);"
- }
- }
- Transition tr2: Operational -> Operational {
- triggers {
- <Kill:timeout>
- }
- // nothing to do to kill timeout (handled by timerService)
- }
- Transition tr3: Operational -> Operational {
- triggers {
- <Start:timer>
- }
- action {
- "// start timer"
- "taskCount++;"
- "if (taskCount>PURGE_LIMIT) timerService.purge();"
- "timerService.scheduleAtFixedRate(((PTimerPort)ifitem).getTask(), time_ms, time_ms);"
- }
- }
- Transition tr4: Operational -> Operational {
- triggers {
- <Kill:timer>
- }
- // nothing to do to kill timer (handled by timer)
- } State Operational {
- entry {
- "// prepare"
- }
- }}
- }
- }ProtocolClass PTimer {
+RoomModel room.basic.service.timing {
+ ProtocolClass PTimer {
usercode1 {
"import java.util.TimerTask;"
}
@@ -302,4 +236,77 @@ RoomModel room.basic.service.timing { ActorClass ATimingService {
}"
}
}
- }} \ No newline at end of file
+ }
+
+ ActorClass ATimingService {
+ Interface {
+ SPP timer: PTimer
+ SPP timeout: PTimeout
+ }
+ Structure {
+ usercode1 {
+ "import java.util.Timer;"
+ }
+ usercode2 {
+ "private Timer timerService = null;"
+ "private int taskCount = 0;"
+ "private static final int PURGE_LIMIT = 1000;"
+ }
+ ServiceImplementation of timer
+ ServiceImplementation of timeout
+ }
+ Behavior {
+ Operation stop() {
+ "System.out.println(toString() + \"::stop()\");"
+ "timerService.cancel();"
+ "timerService = null;"
+ }
+ StateMachine {
+ State Operational {
+ entry {
+ "// prepare"
+ }
+ }
+ Transition tr0: initial -> Operational {
+ action {
+ "timerService = new Timer();"
+ }
+ }
+ Transition tr1: Operational -> Operational {
+ triggers {
+ <Start:timeout>
+ }
+ action {
+ "// start timeout"
+ "taskCount++;"
+ "if (taskCount>PURGE_LIMIT) timerService.purge();"
+ "timerService.schedule(((PTimeoutPort)ifitem).getTask(), time_ms);"
+ }
+ }
+ Transition tr2: Operational -> Operational {
+ triggers {
+ <Kill:timeout>
+ }
+ // nothing to do to kill timeout (handled by timerService)
+ }
+ Transition tr3: Operational -> Operational {
+ triggers {
+ <Start:timer>
+ }
+ action {
+ "// start timer"
+ "taskCount++;"
+ "if (taskCount>PURGE_LIMIT) timerService.purge();"
+ "timerService.scheduleAtFixedRate(((PTimerPort)ifitem).getTask(), time_ms, time_ms);"
+ }
+ }
+ Transition tr4: Operational -> Operational {
+ triggers {
+ <Kill:timer>
+ }
+ // nothing to do to kill timer (handled by timer)
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageService.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageService.java
index a12463a3c..97802da16 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageService.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageService.java
@@ -74,7 +74,6 @@ public class MessageService extends Thread implements IMessageReceiver,
}
else {
lastMessageTimestamp = System.currentTimeMillis();
- //System.out.printf("%i. msgServ %i addr.Thread \n",address.threadID,msg.getAddress().threadID);
messageDispatcher.receive(msg);
}
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageServiceController.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageServiceController.java
index 20986d0ba..16bb75075 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageServiceController.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageServiceController.java
@@ -19,6 +19,7 @@ import java.util.List;
* The MessageServiceController controls lifecycle of and access to all MessageServices in one SubSystem
*
* @author Thomas Schuetz
+ * @author Thomas Jung
*
*/
diff --git a/tests/org.eclipse.etrice.integration.tests/model/org.eclipse.etrice.integration.tests.room b/tests/org.eclipse.etrice.integration.tests/model/org.eclipse.etrice.integration.tests.room
index 856285d87..bb8aa6fae 100644
--- a/tests/org.eclipse.etrice.integration.tests/model/org.eclipse.etrice.integration.tests.room
+++ b/tests/org.eclipse.etrice.integration.tests/model/org.eclipse.etrice.integration.tests.room
@@ -254,7 +254,7 @@ RoomModel org.eclipse.etrice.integration.tests {
State State7 {}
State TestPass {
entry {
- "SubSystemClassBase.getInstance().terminate();"
+ "getMsgsvc().terminate();"
}
}
Transition tr0: initial -> State1 {}
diff --git a/tests/org.eclipse.etrice.integration.tests/model/org.eclipse.etrice.integration.tests.trp b/tests/org.eclipse.etrice.integration.tests/model/org.eclipse.etrice.integration.tests.trp
index aa86d08d1..e4275ee71 100644
--- a/tests/org.eclipse.etrice.integration.tests/model/org.eclipse.etrice.integration.tests.trp
+++ b/tests/org.eclipse.etrice.integration.tests/model/org.eclipse.etrice.integration.tests.trp
@@ -3662,9 +3662,9 @@ t
f
f
0
-1292974899
+1298500810
5
-+SubSystemClassBase.getInstance().terminate();
++getMsgsvc().terminate();
-
-
-1
@@ -4659,27 +4659,27 @@ f
1
-ViewMemento
0
-1292975199
+1298500813
0
t
-<20101222004639-2
+<20110223234013-263
-bs_RefCounter
0
-<20101222004639-3
+<20110223234013-264
-bs_ViewMemento
3
-
f
f
0
-1292975199
+1298500813
1
2
-1
+3
100
100
742
-489
+488
>20100829182239-355
>20100829182239-356
>20100829182239-372
diff --git a/tests/org.eclipse.etrice.integration.tests/src/org/eclipse/etrice/integration/tests/IntegrationTestFSMGenerator.java b/tests/org.eclipse.etrice.integration.tests/src/org/eclipse/etrice/integration/tests/IntegrationTestFSMGenerator.java
index ff7d5f9fb..6403e2c71 100644
--- a/tests/org.eclipse.etrice.integration.tests/src/org/eclipse/etrice/integration/tests/IntegrationTestFSMGenerator.java
+++ b/tests/org.eclipse.etrice.integration.tests/src/org/eclipse/etrice/integration/tests/IntegrationTestFSMGenerator.java
@@ -50,9 +50,6 @@ public class IntegrationTestFSMGenerator {
RTServices.getInstance().getMsgSvcCtrl().waitTerminate();
- // TODOTS: Test broken -> repair after changes for multi threading
-// main_component.waitTerminate();
-
assertEquals(a_HFSM_Tester.STATE_TestPass ,main_component.getInstance("/MainComponent/application/HFSM_Tests/Tester").getState());
// end the lifecycle
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 1be4960ef..ff07673aa 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
@@ -47,7 +47,7 @@ public class PortBaseTest extends TestCase {
class MyPortBase extends PortBase {
public MyPortBase(IEventReceiver parent, String name, int localId, int idx, Address address,
Address peerAddress, IMessageReceiver msgReceiver) {
- super(parent, name, localId, idx, address, peerAddress/*, msgReceiver*/);
+ super(parent, name, localId, idx, address, peerAddress);
}
public void receive(Message msg) {

Back to the top