diff options
27 files changed, 885 insertions, 230 deletions
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend index 5116c584e..0795e4576 100644 --- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend +++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend @@ -14,26 +14,27 @@ package org.eclipse.etrice.generator.java.gen import com.google.inject.Inject import com.google.inject.Singleton +import java.util.HashMap +import org.eclipse.etrice.core.genmodel.builder.GenmodelConstants import org.eclipse.etrice.core.genmodel.etricegen.ExpandedActorClass import org.eclipse.etrice.core.genmodel.etricegen.Root +import org.eclipse.etrice.core.genmodel.etricegen.WiredActorClass +import org.eclipse.etrice.core.room.ActorClass +import org.eclipse.etrice.core.room.ActorCommunicationType +import org.eclipse.etrice.core.room.Attribute +import org.eclipse.etrice.core.room.EnumerationType +import org.eclipse.etrice.core.room.ReferenceType import org.eclipse.etrice.generator.base.AbstractGenerator +import org.eclipse.etrice.generator.base.FileSystemHelpers import org.eclipse.etrice.generator.base.IDataConfiguration import org.eclipse.etrice.generator.base.IGeneratorFileIo import org.eclipse.etrice.generator.generic.GenericActorClassGenerator import org.eclipse.etrice.generator.generic.ProcedureHelpers import org.eclipse.etrice.generator.generic.RoomExtensions +import org.eclipse.etrice.generator.generic.TypeHelpers +import org.eclipse.etrice.generator.java.Main import static extension org.eclipse.etrice.core.room.util.RoomHelpers.* -import org.eclipse.etrice.core.room.ReferenceType -import org.eclipse.etrice.core.room.Attribute -import org.eclipse.etrice.generator.java.Main -import org.eclipse.etrice.core.genmodel.builder.GenmodelConstants -import org.eclipse.etrice.core.genmodel.etricegen.WiredActorClass -import org.eclipse.etrice.core.room.ActorClass -import java.util.HashMap -import org.eclipse.etrice.generator.generic.TypeHelpers -import org.eclipse.etrice.generator.base.FileSystemHelpers -import org.eclipse.etrice.core.room.EnumerationType @Singleton class ActorClassGen extends GenericActorClassGenerator { @@ -192,6 +193,11 @@ class ActorClassGen extends GenericActorClassGenerator { «if (wire.dataDriven) "DataPortBase" else "InterfaceItemBase"».connect(this, "«wire.path1.join('/')»", "«wire.path2.join('/')»"); «ENDFOR» + «IF ac.commType == ActorCommunicationType::ASYNCHRONOUS || ac.commType == ActorCommunicationType::DATA_DRIVEN» + // activate polling for data-driven communication + RTServices.getInstance().getMsgSvcCtrl().getMsgSvc(getThread()).addPollingMessageReceiver(this); + «ENDIF» + «IF ctor!=null» { @@ -243,6 +249,9 @@ class ActorClassGen extends GenericActorClassGenerator { «IF Main::settings.generateMSCInstrumentation» DebuggingService.getInstance().addMessageActorDestroy(this); «ENDIF» + «IF ac.commType == ActorCommunicationType::ASYNCHRONOUS || ac.commType == ActorCommunicationType::DATA_DRIVEN» + RTServices.getInstance().getMsgSvcCtrl().getMsgSvc(getThread()).removePollingMessageReceiver(this); + «ENDIF» super.destroy(); } «ENDIF» @@ -283,6 +292,11 @@ class ActorClassGen extends GenericActorClassGenerator { «ELSE» «IF ac.hasNonEmptyStateMachine» «xpac.genStateMachine()» + «IF ac.commType == ActorCommunicationType::DATA_DRIVEN» + public void receiveEvent(InterfaceItemBase ifitem, int evt, Object generic_data) { + handleSystemEvent(ifitem, evt, generic_data); + } + «ENDIF» «ELSEIF xpac.stateMachine.empty» ««« no state machine in the super classes //--------------------- no state machine @@ -293,6 +307,14 @@ class ActorClassGen extends GenericActorClassGenerator { public void executeInitTransition() {} «ENDIF» «ENDIF» + + «IF ac.commType == ActorCommunicationType::ASYNCHRONOUS || ac.commType == ActorCommunicationType::DATA_DRIVEN» + @Override + public void receive(Message msg) { + receiveEvent(«IF ac.commType == ActorCommunicationType::ASYNCHRONOUS»null, -1, null«ENDIF»); + } + «ENDIF» + «IF Main::settings.generatePersistenceInterface» @Override diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java index 358a53bb0..a7e1d1c22 100644 --- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java +++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java @@ -23,6 +23,7 @@ import org.eclipse.etrice.core.genmodel.etricegen.Wire; import org.eclipse.etrice.core.genmodel.etricegen.WiredActorClass; import org.eclipse.etrice.core.genmodel.etricegen.WiredStructureClass; import org.eclipse.etrice.core.room.ActorClass; +import org.eclipse.etrice.core.room.ActorCommunicationType; import org.eclipse.etrice.core.room.ActorRef; import org.eclipse.etrice.core.room.Attribute; import org.eclipse.etrice.core.room.DataType; @@ -702,6 +703,28 @@ public class ActorClassGen extends GenericActorClassGenerator { _builder.append("\t\t"); _builder.newLine(); { + boolean _or_1 = false; + ActorCommunicationType _commType = ac.getCommType(); + boolean _equals_1 = Objects.equal(_commType, ActorCommunicationType.ASYNCHRONOUS); + if (_equals_1) { + _or_1 = true; + } else { + ActorCommunicationType _commType_1 = ac.getCommType(); + boolean _equals_2 = Objects.equal(_commType_1, ActorCommunicationType.DATA_DRIVEN); + _or_1 = _equals_2; + } + if (_or_1) { + _builder.append("\t\t"); + _builder.append("// activate polling for data-driven communication"); + _builder.newLine(); + _builder.append("\t\t"); + _builder.append("RTServices.getInstance().getMsgSvcCtrl().getMsgSvc(getThread()).addPollingMessageReceiver(this);"); + _builder.newLine(); + } + } + _builder.append("\t\t"); + _builder.newLine(); + { boolean _notEquals_3 = (!Objects.equal(ctor, null)); if (_notEquals_3) { _builder.append("\t\t"); @@ -727,19 +750,19 @@ public class ActorClassGen extends GenericActorClassGenerator { } _builder.newLine(); { - boolean _or_1 = false; + boolean _or_2 = false; List<Attribute> _dynConfigReadAttributes_2 = this.dataConfigExt.getDynConfigReadAttributes(ac); boolean _isEmpty_2 = _dynConfigReadAttributes_2.isEmpty(); boolean _not_2 = (!_isEmpty_2); if (_not_2) { - _or_1 = true; + _or_2 = true; } else { List<Attribute> _dynConfigWriteAttributes = this.dataConfigExt.getDynConfigWriteAttributes(ac); boolean _isEmpty_3 = _dynConfigWriteAttributes.isEmpty(); boolean _not_3 = (!_isEmpty_3); - _or_1 = _not_3; + _or_2 = _not_3; } - if (_or_1) { + if (_or_2) { { List<Attribute> _dynConfigReadAttributes_3 = this.dataConfigExt.getDynConfigReadAttributes(ac); for(final Attribute a_1 : _dynConfigReadAttributes_3) { @@ -877,6 +900,24 @@ public class ActorClassGen extends GenericActorClassGenerator { _builder.newLine(); } } + { + boolean _or_3 = false; + ActorCommunicationType _commType_2 = ac.getCommType(); + boolean _equals_3 = Objects.equal(_commType_2, ActorCommunicationType.ASYNCHRONOUS); + if (_equals_3) { + _or_3 = true; + } else { + ActorCommunicationType _commType_3 = ac.getCommType(); + boolean _equals_4 = Objects.equal(_commType_3, ActorCommunicationType.DATA_DRIVEN); + _or_3 = _equals_4; + } + if (_or_3) { + _builder.append("\t"); + _builder.append("\t"); + _builder.append("RTServices.getInstance().getMsgSvcCtrl().getMsgSvc(getThread()).removePollingMessageReceiver(this);"); + _builder.newLine(); + } + } _builder.append("\t"); _builder.append("\t"); _builder.append("super.destroy();"); @@ -1071,6 +1112,22 @@ public class ActorClassGen extends GenericActorClassGenerator { CharSequence _genStateMachine = this._stateMachineGen.genStateMachine(xpac); _builder.append(_genStateMachine, "\t"); _builder.newLineIfNotEmpty(); + { + ActorCommunicationType _commType_4 = ac.getCommType(); + boolean _equals_5 = Objects.equal(_commType_4, ActorCommunicationType.DATA_DRIVEN); + if (_equals_5) { + _builder.append("\t"); + _builder.append("public void receiveEvent(InterfaceItemBase ifitem, int evt, Object generic_data) {"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("\t"); + _builder.append("handleSystemEvent(ifitem, evt, generic_data);"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("}"); + _builder.newLine(); + } + } } else { StateGraph _stateMachine = xpac.getStateMachine(); boolean _isEmpty_4 = RoomHelpers.isEmpty(_stateMachine); @@ -1098,6 +1155,45 @@ public class ActorClassGen extends GenericActorClassGenerator { } } } + _builder.append("\t"); + _builder.newLine(); + { + boolean _or_4 = false; + ActorCommunicationType _commType_5 = ac.getCommType(); + boolean _equals_6 = Objects.equal(_commType_5, ActorCommunicationType.ASYNCHRONOUS); + if (_equals_6) { + _or_4 = true; + } else { + ActorCommunicationType _commType_6 = ac.getCommType(); + boolean _equals_7 = Objects.equal(_commType_6, ActorCommunicationType.DATA_DRIVEN); + _or_4 = _equals_7; + } + if (_or_4) { + _builder.append("\t"); + _builder.append("@Override"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("public void receive(Message msg) {"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("\t"); + _builder.append("receiveEvent("); + { + ActorCommunicationType _commType_7 = ac.getCommType(); + boolean _equals_8 = Objects.equal(_commType_7, ActorCommunicationType.ASYNCHRONOUS); + if (_equals_8) { + _builder.append("null, -1, null"); + } + } + _builder.append(");"); + _builder.newLineIfNotEmpty(); + _builder.append("\t"); + _builder.append("}"); + _builder.newLine(); + } + } + _builder.append("\t"); + _builder.newLine(); { GlobalSettings _settings_8 = Main.getSettings(); boolean _isGeneratePersistenceInterface_2 = _settings_8.isGeneratePersistenceInterface(); diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip Binary files differindex f441557a2..6e8e5cdd2 100644 --- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip +++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zip Binary files differindex c39da4e20..035a3cde6 100644 --- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zip +++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zip diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC/etDatatypes.h b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC/etDatatypes.h index aabc4ca8b..e6bd14c83 100644 --- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC/etDatatypes.h +++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC/etDatatypes.h @@ -61,6 +61,12 @@ typedef bool boolean; #ifndef FALSE #define FALSE 0 #endif +#ifndef true + #define true 1 +#endif +#ifndef false + #define false 0 +#endif #define ALIGNMENT 8 /* power of 2 and >= sizeof(int) ! */ diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etDatatypes.h b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etDatatypes.h index a9c754848..0f207242a 100644 --- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etDatatypes.h +++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etDatatypes.h @@ -58,6 +58,12 @@ typedef char bool; /* TODO: bool, Bool, Boolean, and boolean are already define #ifndef FALSE #define FALSE 0 #endif +#ifndef true + #define true 1 +#endif +#ifndef false + #define false 0 +#endif #define ALIGNMENT 8 /* power of 2 and >= sizeof(int) ! */ diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_CoretexM3_Euros_GCCELF_SK_FM3_176PMC_Ethernet/etDatatypes.h b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_CoretexM3_Euros_GCCELF_SK_FM3_176PMC_Ethernet/etDatatypes.h index 490a103a5..674fe5daf 100644 --- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_CoretexM3_Euros_GCCELF_SK_FM3_176PMC_Ethernet/etDatatypes.h +++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_CoretexM3_Euros_GCCELF_SK_FM3_176PMC_Ethernet/etDatatypes.h @@ -47,6 +47,12 @@ typedef bool boolean; #ifndef FALSE #define FALSE 0 #endif +#ifndef true + #define true 1 +#endif +#ifndef false + #define false 0 +#endif /* * typedefs for eTrice Runtime and Testing diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_F5438_CCS5_EXP430F5438/etDatatypes.h b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_F5438_CCS5_EXP430F5438/etDatatypes.h index aa948e6b4..2f23b2ef5 100644 --- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_F5438_CCS5_EXP430F5438/etDatatypes.h +++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_F5438_CCS5_EXP430F5438/etDatatypes.h @@ -47,6 +47,12 @@ typedef bool boolean; #ifndef FALSE #define FALSE 0 #endif +#ifndef true + #define true 1 +#endif +#ifndef false + #define false 0 +#endif /* * typedefs for eTrice Runtime and Testing diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_F5438_CCS5_HWElevator/etDatatypes.h b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_F5438_CCS5_HWElevator/etDatatypes.h index aa948e6b4..2f23b2ef5 100644 --- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_F5438_CCS5_HWElevator/etDatatypes.h +++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_F5438_CCS5_HWElevator/etDatatypes.h @@ -47,6 +47,12 @@ typedef bool boolean; #ifndef FALSE #define FALSE 0 #endif +#ifndef true + #define true 1 +#endif +#ifndef false + #define false 0 +#endif /* * typedefs for eTrice Runtime and Testing diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etDatatypes.h b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etDatatypes.h index aa948e6b4..2f23b2ef5 100644 --- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etDatatypes.h +++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etDatatypes.h @@ -47,6 +47,12 @@ typedef bool boolean; #ifndef FALSE #define FALSE 0 #endif +#ifndef true + #define true 1 +#endif +#ifndef false + #define false 0 +#endif /* * typedefs for eTrice Runtime and Testing diff --git a/runtime/org.eclipse.etrice.runtime.java.aspects/dist/org.eclipse.etrice.runtime.java.aspects.jar b/runtime/org.eclipse.etrice.runtime.java.aspects/dist/org.eclipse.etrice.runtime.java.aspects.jar Binary files differindex ff5abb1db..a732cb214 100644 --- a/runtime/org.eclipse.etrice.runtime.java.aspects/dist/org.eclipse.etrice.runtime.java.aspects.jar +++ b/runtime/org.eclipse.etrice.runtime.java.aspects/dist/org.eclipse.etrice.runtime.java.aspects.jar diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/AbstractMessageService.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/AbstractMessageService.java index dcd836fc3..58e7bbd12 100644 --- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/AbstractMessageService.java +++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/AbstractMessageService.java @@ -60,6 +60,16 @@ public abstract class AbstractMessageService extends RTObject implements IMessag public void removeMessageReceiver(IMessageReceiver receiver) { messageDispatcher.removeMessageReceiver(receiver); } + + @Override + public void addPollingMessageReceiver(IMessageReceiver receiver) { + messageDispatcher.addPollingMessageReceiver(receiver); + } + + @Override + public void removePollingMessageReceiver(IMessageReceiver receiver) { + messageDispatcher.removePollingMessageReceiver(receiver); + } protected MessageSeQueue getMessageQueue() { return messageQueue; diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/IMessageService.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/IMessageService.java index b47fd9063..f5f67697d 100644 --- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/IMessageService.java +++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/IMessageService.java @@ -31,6 +31,9 @@ public interface IMessageService extends IRTObject, IMessageReceiver, Runnable { void addMessageReceiver(IMessageReceiver receiver); void removeMessageReceiver(IMessageReceiver receiver); + void addPollingMessageReceiver(IMessageReceiver receiver); + void removePollingMessageReceiver(IMessageReceiver receiver); + /** * set the thread of this service * (also sets the thread priority) diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageDispatcher.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageDispatcher.java index 68794ef31..5d72de448 100644 --- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageDispatcher.java +++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageDispatcher.java @@ -8,8 +8,10 @@ package org.eclipse.etrice.runtime.java.messaging; +import java.util.HashSet; import java.util.LinkedList; import java.util.HashMap; +import java.util.Set; /** * The message dispatcher class used by the MessageService. @@ -22,6 +24,7 @@ public class MessageDispatcher extends RTObject implements IMessageReceiver { private HashMap<Number, IMessageReceiver> local_map = new HashMap<Number, IMessageReceiver>(); private LinkedList<Address> freeAdresses = new LinkedList<Address>(); + private Set<IMessageReceiver> pollingMessageReceiver = new HashSet<IMessageReceiver>(); private Address address = null; private int nextFreeObjId; @@ -30,6 +33,8 @@ public class MessageDispatcher extends RTObject implements IMessageReceiver { super(parent, name); address = addr; nextFreeObjId = addr.objectID+1; + + local_map.put(address.objectID, this); } public Address getFreeAddress() { @@ -64,12 +69,23 @@ public class MessageDispatcher extends RTObject implements IMessageReceiver { } } + public void addPollingMessageReceiver(IMessageReceiver receiver){ + pollingMessageReceiver.add(receiver); + } + + public void removePollingMessageReceiver(IMessageReceiver receiver){ + pollingMessageReceiver.remove(receiver); + } + @Override public void receive(Message msg) { if (msg.getAddress().nodeID == address.nodeID && msg.getAddress().threadID == address.threadID) { IMessageReceiver receiver = local_map.get(msg.getAddress().objectID); - if(receiver!=null) { + if(receiver == this){ + for(IMessageReceiver rcv : pollingMessageReceiver) + rcv.receive(new Message(getAddress())); + }else if(receiver!=null) { receiver.receive(msg); } else { 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 9f55bfae1..89379d42d 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 @@ -13,6 +13,10 @@ package org.eclipse.etrice.runtime.java.messaging; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + /** * The MessageService is the backbone of the asynchronous communication inside a SubSystem @@ -29,6 +33,9 @@ public class MessageService extends AbstractMessageService { private Thread thread; private int priority; private long lastMessageTimestamp; + + private int pollingInterval = -1; + private ScheduledExecutorService pollingScheduler = null; public MessageService(IRTObject parent, ExecMode mode, int node, int thread, String name) { this(parent, mode, 0, node, thread, name, Thread.NORM_PRIORITY); @@ -45,11 +52,21 @@ public class MessageService extends AbstractMessageService { assert priority >= Thread.MIN_PRIORITY : ("priority smaller than Thread.MIN_PRIORITY (1)"); assert priority <= Thread.MAX_PRIORITY : ("priority bigger than Thread.MAX_PRIORITY (10)"); + + if(mode == ExecMode.MIXED || mode == ExecMode.POLLED){ + pollingInterval = nsec; + pollingScheduler = Executors.newScheduledThreadPool(1); + + assert pollingInterval > 0 : ("polling interval is 0 or negative"); + } } public void run() { running = true; + if(pollingScheduler != null) + pollingScheduler.scheduleAtFixedRate(new PollingTask(), pollingInterval, pollingInterval, TimeUnit.NANOSECONDS); + while (running) { Message msg = null; @@ -113,6 +130,16 @@ public class MessageService extends AbstractMessageService { super.removeMessageReceiver(receiver); } + @Override + public synchronized void addPollingMessageReceiver(IMessageReceiver receiver) { + super.addPollingMessageReceiver(receiver); + } + + @Override + public synchronized void removePollingMessageReceiver(IMessageReceiver receiver) { + super.removePollingMessageReceiver(receiver); + } + /* (non-Javadoc) * @see org.eclipse.etrice.runtime.java.messaging.AbstractMessageService#freeAddress(org.eclipse.etrice.runtime.java.messaging.Address) */ @@ -126,6 +153,9 @@ public class MessageService extends AbstractMessageService { running = false; notifyAll(); } + + if(pollingScheduler != null) + pollingScheduler.shutdown(); } /* (non-Javadoc) @@ -147,5 +177,17 @@ public class MessageService extends AbstractMessageService { protected long getLastMessageTimestamp() { return lastMessageTimestamp; } + + private class PollingTask implements Runnable{ + + @Override + public void run() { + if(running){ + Message msg = new Message(getMessageDispatcher().getAddress()); + receive(msg); + } + } + + } } diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ActorClassBase.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ActorClassBase.java index 9cd0075e4..849dfe05a 100644 --- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ActorClassBase.java +++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ActorClassBase.java @@ -137,7 +137,7 @@ public abstract class ActorClassBase extends SystemPortOwner implements IMessage } protected boolean handleSystemEvent(InterfaceItemBase ifitem, int evt, Object generic_data){ - if (ifitem.getLocalId()!=0){ + if (ifitem == null || ifitem.getLocalId()!=0){ return false; } diff --git a/tests/org.eclipse.etrice.generator.c.tests/make.xml b/tests/org.eclipse.etrice.generator.c.tests/make.xml index d5d3dc8c9..20aecd681 100644 --- a/tests/org.eclipse.etrice.generator.c.tests/make.xml +++ b/tests/org.eclipse.etrice.generator.c.tests/make.xml @@ -136,6 +136,7 @@ <include name="org.antlr.runtime_3.2*.jar" /> <include name="javax.inject_1.0*.jar" /> </fileset> + <!-- If some plugins are located in user folder, then duplicate fileset with own path --> </path> <java output="${output}/generate.txt" error="${output}/generate_err.txt" classname="org.eclipse.etrice.generator.c.Main" fork="true" failonerror="true"> @@ -484,6 +485,51 @@ <arg value="-lpthread"/> <arg value="-lrt"/> </exec> + + <!-- compile and link ActorCommunicationTest --> + <mkdir dir="bin/ActorCommunicationTest"/> + <exec dir="bin/ActorCommunicationTest" executable="${gcc.path}/gcc" failonerror="true" output="${output}/build.txt" append="true"> + <arg value="-I../../src-gen/"/> + <arg value="-I${c-runtime.path}/src/common"/> + <arg value="-I${c-runtime.path}/src/config"/> + <arg value="-I${c-runtime.path}/src/platforms/${runtime.platform}"/> + <arg value="-c"/> + <arg value="-g3"/> + <arg value="-O0"/> + <arg value="-Wall"/> + <!--<arg value="-ansi"/>--> + <arg value="../../src-gen/ActorCommunicationTest/Appl.c"/> + <arg value="../../src-gen/ActorCommunicationTest/Async_Testee.c"/> + <arg value="../../src-gen/ActorCommunicationTest/Datadriven_Testee.c"/> + <arg value="../../src-gen/ActorCommunicationTest/Eventdriven_Testee.c"/> + <arg value="../../src-gen/ActorCommunicationTest/Tester.c"/> + <arg value="../../src-gen/ActorCommunicationTest/node8_acTest.c"/> + <arg value="../../src-gen/ActorCommunicationTest/node8_acTest_Runner.c"/> + <arg value="../../src-gen/ActorCommunicationTest/Datadriven_PC.c"/> + <arg value="../../src-gen/ActorCommunicationTest/Eventdriven_PC.c"/> + <arg value="../../src-gen/room/basic/service/timing/ATimingService.c"/> + <arg value="../../src-gen/room/basic/service/timing/PTimer.c"/> + </exec> + <exec dir="bin/ActorCommunicationTest" executable="${gcc.path}/gcc" failonerror="true" output="${output}/build.txt" append="true"> + <arg value="-L${c-runtime.path}/bin"/> + <arg value="-oActorCommunicationTest.exe"/> + <arg value="Appl.o"/> + <arg value="Async_Testee.o"/> + <arg value="Datadriven_Testee.o"/> + <arg value="Eventdriven_Testee.o"/> + <arg value="Tester.o"/> + <arg value="node8_acTest.o"/> + <arg value="node8_acTest_Runner.o"/> + <arg value="Datadriven_PC.o"/> + <arg value="Eventdriven_PC.o"/> + <arg value="ATimingService.o"/> + <arg value="PTimer.o"/> + + <!-- library has to be in the last position --> + <arg value="-lorg.eclipse.etrice.runtime.c"/> + <arg value="-lpthread"/> + <arg value="-lrt"/> + </exec> </target> <!-- @@ -523,6 +569,11 @@ <arg value="-run_as_test"/> </exec> <echo>end DataDrivenTest</echo> + <echo>start ActorCommunicationTest</echo> + <exec dir="./" resolveexecutable="true" executable="./bin/ActorCommunicationTest/ActorCommunicationTest.exe"> + <arg value="-run_as_test"/> + </exec> + <echo>end ActorCommunicationTest</echo> </target> <!-- @@ -582,6 +633,13 @@ <arg value="./tmp/DataDrivenTest.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.ActorCommunicationTest"/> + <arg value="./tmp/ActorCommunicationTest.etu"/> + <classpath refid="clspath"/> + </java> </target> <!-- @@ -596,6 +654,7 @@ --> <move file="./tmp/StaticConfigTest.xml" tofile="./tmp/CStaticConfigTest.xml"/> <move file="./tmp/DataDrivenTest.xml" tofile="./tmp/CDataDrivenTest.xml"/> + <move file="./tmp/ActorCommunicationTest.xml" tofile="./tmp/CActorCommunicationTest.xml"/> <copy todir="${test.results}" > <fileset dir="./tmp"> <include name="*.xml"/> diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/ActorCommunicationTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/ActorCommunicationTest.room new file mode 100644 index 000000000..c4263ba24 --- /dev/null +++ b/tests/org.eclipse.etrice.generator.common.tests/models/ActorCommunicationTest.room @@ -0,0 +1,325 @@ +RoomModel ActorCommunicationTest { + + import room.basic.types.* from "Types.room" + import room.basic.service.timing.* from "TimingService.room" + + SubSystemClass SubSystem_ActorCommunicationTest { + ActorRef singleThread_Appl: Appl + ActorRef timing: ATimingService + LayerConnection ref singleThread_Appl satisfied_by timing.timer + + // all unmapped instances are mapped to the default *physical* thread + LogicalThread dflt_thread + ActorInstanceMapping timing -> dflt_thread + ActorInstanceMapping singleThread_Appl -> dflt_thread + } + + /* + * On each timing event Tester sends a message with a counter to all Testees + * From counter=1-9: each Testee does an expect order + * On counter=10: each Testee sends finish message to Tester, that does last expect order + */ + ActorClass Appl { + Structure { + ActorRef tester: Tester + ActorRef datadriven_Testee: Datadriven_Testee + ActorRef eventdriven_Testee: Eventdriven_Testee + ActorRef async_Testee: Async_Testee + Binding tester.data_counter and datadriven_Testee.data_counter + Binding tester.data_counter_finish and datadriven_Testee.counter_finish + Binding tester.event_counter and eventdriven_Testee.event_counter + Binding tester.async_counter1 and async_Testee.event_counter + Binding tester.async_counter2 and async_Testee.data_counter + } + Behavior { } + } + + async ActorClass Tester { + Interface { + conjugated Port event_counter: Eventdriven_PC + conjugated Port data_counter: Datadriven_PC + Port data_counter_finish: Datadriven_PC + conjugated Port async_counter1: Eventdriven_PC + conjugated Port async_counter2: Datadriven_PC + } + Structure { + external Port event_counter + external Port data_counter + external Port data_counter_finish + external Port async_counter1 + external Port async_counter2 + SAP timer: PTimer + Attribute data_caseId: int32 + Attribute event_caseId: int32 + Attribute async_caseId: int32 + Attribute counter: int32 + Attribute finish_counter: int32 + Attribute data_finish_flag: boolean + Attribute data_result [ 10 ]: int16 = "{1,2,3,4,5,6,7,8,9,10}" + Attribute event_result [ 10 ]: int16 = "{101,102,103,104,105,106,107,108,109,110}" + Attribute async_result [ 10 ]: int16 = "{1051,1002,1053,1004,1055,1006,1057,1008,1059,1010}" + } + Behavior { + Operation Tester() { + "etUnit_open(\"tmp\", \"ActorCommunicationTest\");" + "etUnit_openTestSuite(\"org.eclipse.etrice.generator.common.tests\");" + } + Operation ~Tester() { + "etUnit_closeTestSuite();" + "etUnit_close();" + } + StateMachine { + Transition init: initial -> tester_run { + action { + "data_caseId = etUnit_openTestCase(\"Datadriven ActorCommunicationTest\");" + "event_caseId = etUnit_openTestCase(\"Eventdriven ActorCommunicationTest\");" + "async_caseId = etUnit_openTestCase(\"Async ActorCommunicationTest\");" + "" + "event_counter.caseId(event_caseId);" + "data_counter.caseId(data_caseId);" + "async_counter2.caseId(async_caseId);" + "" + "counter = 0;" + "finish_counter = 0;" + "data_finish_flag = false;" + "EXPECT_ORDER_START(data_caseId, data_result, 10);" + "EXPECT_ORDER_START(event_caseId, event_result, 10);" + "EXPECT_ORDER_START(async_caseId, async_result, 10);" + "timer.startTimer(400);" + } + } + Transition tr0: tester_run -> tester_run { + triggers { + <timeout: timer guard { + "counter < 10" + }> + } + action { + "counter++;" + // "System.out.println(\"Timer: \"+counter);" + "event_counter.in1(counter);" + "data_counter.in1(counter);" + "async_counter1.in1(counter);" + "async_counter2.in1(counter);" + } + } + Transition tr1: tester_run -> tester_run { + triggers { + <finish: event_counter> + } + action { + // "System.out.println(\"Finish event\");" + "EXPECT_ORDER_END(event_caseId,\"<|MODEL_LOCATION|>\", 110);" + "etUnit_closeTestCase(event_caseId);" + "finish_counter++;" + } + } + Transition tr2: tester_run -> tester_run { + guard { + "data_counter_finish.finish == true && data_finish_flag == false" + } + action { + + //"System.out.println(\"Finish data\");" + "data_finish_flag = true;" + "EXPECT_ORDER_END(data_caseId,\"<|MODEL_LOCATION|>\", 10);" + "etUnit_closeTestCase(data_caseId);" + "finish_counter++;" + } + } + Transition tr3: tester_run -> tester_run { + triggers { + <finish: async_counter1> + } + action { + //"System.out.println(\"Finish async\");" + "EXPECT_ORDER_END(async_caseId,\"<|MODEL_LOCATION|>\", 1010);" + "etUnit_closeTestCase(async_caseId);" + "finish_counter++;" + } + } + Transition terminate: my tp0 -> my tp0 { + guard { + "finish_counter == 3" + } + action { + "etUnit_testFinished(event_caseId);" + } + } + TransitionPoint tp0 + State tester_run + } + } + } + + async ActorClass Async_Testee { + Interface { + Port event_counter: Eventdriven_PC + Port data_counter: Datadriven_PC + } + Structure { + external Port event_counter + external Port data_counter + Attribute counter: int32 + } + Behavior { + StateMachine { + Transition init: initial -> Idle { + action { + "counter = 0;" + } + } + Transition tr0: Idle -> Idle { + guard { + "data_counter.in1 != counter && data_counter.in1 % 2 == 1" + } + action { + "counter = data_counter.in1;" + + //"System.out.println(\"Async data \"+counter);" + "EXPECT_ORDER(data_counter.caseId,\"<|MODEL_LOCATION|>\", counter + 1050);" + } + } + Transition tr1: Idle -> Idle { + triggers { + <in1: event_counter guard { + "data % 2 == 0 && data < 10" + }> + } + action { + "counter = data;" + + //"System.out.println(\"Async event \"+counter);" + "EXPECT_ORDER(data_counter.caseId,\"<|MODEL_LOCATION|>\", counter + 1000);" + } + } + Transition tr2: Idle -> state0 { + triggers { + <in1: event_counter guard { + "data == 10" + }> + } + action { + "event_counter.finish();" + } + } + State Idle + State state0 + } + } + } + + ActorClass Eventdriven_Testee { + Interface { + Port event_counter: Eventdriven_PC + } + Structure { + external Port event_counter + Attribute caseId: int32 + Attribute counter: int32 + } + Behavior { + StateMachine { + Transition init: initial -> state0 { + action { + "counter = 0;" + } + } + Transition tr0: state0 -> state0 { + triggers { + <in1: event_counter guard { + "data < 10" + }> + } + action { + + //"System.out.println(\"event \"+data);" + "EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", data+100);" + } + } + Transition tr1: state0 -> state1 { + triggers { + <in1: event_counter guard { + "data == 10" + }> + } + action { + "event_counter.finish();" + } + } + Transition tr2: state0 -> state0 { + triggers { + <caseId: event_counter> + } + action { + "caseId = data;" + } + } + State state0 + State state1 + } + } + } + + datadriven ActorClass Datadriven_Testee { + Interface { + Port data_counter: Datadriven_PC + conjugated Port counter_finish: Datadriven_PC + } + Structure { + external Port data_counter + external Port counter_finish + Attribute counter: int32 + } + Behavior { + StateMachine { + Transition init: initial -> state0 { + action { + "counter = 0;" + "counter_finish.finish(false);" + } + } + Transition tr0: state0 -> state1 { + guard { + "data_counter.in1 == 10" + } + action { + "counter_finish.finish(true);" + } + } + Transition tr1: state0 -> state0 { + guard { + "data_counter.in1 != counter && counter < 10" + } + action { + "counter = data_counter.in1;" + + //"System.out.println(\"data \"+counter);" + "EXPECT_ORDER(data_counter.caseId, \"<|MODEL_LOCATION|>\", counter);" + } + } + State state0 + State state1 + } + } + } + + datadriven ProtocolClass Datadriven_PC { + incoming { + Message caseId(data: int32) + Message in1(data: int32) + Message finish(data: boolean) + } + } + + ProtocolClass Eventdriven_PC { + incoming { + Message caseId(data: int32) + Message in1(data: int32) + } + outgoing { + Message finish() + } + } + +}
\ No newline at end of file diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/DataDrivenTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/DataDrivenTest.room index 1793eec49..e627355bb 100644 --- a/tests/org.eclipse.etrice.generator.common.tests/models/DataDrivenTest.room +++ b/tests/org.eclipse.etrice.generator.common.tests/models/DataDrivenTest.room @@ -59,7 +59,6 @@ RoomModel DataDrivenTest { } Structure { external Port p0 - SAP timer: PTimer Attribute caseId: int32 Attribute counter: int32 @@ -75,7 +74,6 @@ RoomModel DataDrivenTest { StateMachine { Transition init: initial -> Idle { action { - "timer.startTimer(20);" "counter = 0;" } } diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/generator.c.tests.etmap b/tests/org.eclipse.etrice.generator.common.tests/models/generator.c.tests.etmap index 4b351714f..8062644a6 100644 --- a/tests/org.eclipse.etrice.generator.common.tests/models/generator.c.tests.etmap +++ b/tests/org.eclipse.etrice.generator.common.tests/models/generator.c.tests.etmap @@ -25,5 +25,8 @@ MappingModel CGenTest { SubSystemMapping enTest -> node7 { ThreadMapping defaultThread -> DfltThread } + SubSystemMapping acTest -> node8 { + ThreadMapping dflt_thread -> MixedThread + } } }
\ No newline at end of file diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/generator.c.tests.room b/tests/org.eclipse.etrice.generator.common.tests/models/generator.c.tests.room index 31b424062..9e92ac2dd 100644 --- a/tests/org.eclipse.etrice.generator.common.tests/models/generator.c.tests.room +++ b/tests/org.eclipse.etrice.generator.common.tests/models/generator.c.tests.room @@ -7,6 +7,8 @@ RoomModel CGenTests { import HandlerTest.* from "HandlerTest.room" import SendingDataTestC.* from "SendingDataTestC.room" import StaticConfigTest.* from "StaticConfigTest.room" + import ActorCommunicationTest.* from "ActorCommunicationTest.room" + LogicalSystem CGenTests { SubSystemRef cpTest: SubSystem_CPTest @@ -16,5 +18,6 @@ RoomModel CGenTests { SubSystemRef hdTest: SubSystem_HandlerTest SubSystemRef sdTest: SubSystem_SendingData SubSystemRef scTest: SubSystem_StaticConfigTest + SubSystemRef acTest: SubSystem_ActorCommunicationTest } }
\ No newline at end of file diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/generator.java.tests.etmap b/tests/org.eclipse.etrice.generator.common.tests/models/generator.java.tests.etmap index a2f816eca..12426afe4 100644 --- a/tests/org.eclipse.etrice.generator.common.tests/models/generator.java.tests.etmap +++ b/tests/org.eclipse.etrice.generator.common.tests/models/generator.java.tests.etmap @@ -67,5 +67,8 @@ MappingModel JavaGenTest { SubSystemMapping stTest -> node19 { ThreadMapping defaultThread -> DfltThread } + SubSystemMapping acTest -> node20 { + ThreadMapping dflt_thread -> MixedThread + } } }
\ No newline at end of file diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/generator.java.tests.room b/tests/org.eclipse.etrice.generator.common.tests/models/generator.java.tests.room index 9ee97a6a2..849670af9 100644 --- a/tests/org.eclipse.etrice.generator.common.tests/models/generator.java.tests.room +++ b/tests/org.eclipse.etrice.generator.common.tests/models/generator.java.tests.room @@ -12,6 +12,7 @@ RoomModel JavaGenTests { import StaticConfigTest.* from "StaticConfigTest.room" import DynamicConfigTest.* from "DynamicConfigTest_Java.room" import DataDrivenTest.* from "DataDrivenTest.room" + import ActorCommunicationTest.* from "ActorCommunicationTest.room" import DynamicActorTest1.* from "DynamicActorTest1.room" import DynamicActorTest2.* from "DynamicActorTest2.room" import DynamicActorTest3.* from "DynamicActorTest3.room" @@ -33,6 +34,7 @@ RoomModel JavaGenTests { SubSystemRef scTest: SubSystem_StaticConfigTest SubSystemRef dcTest: SubSystem_DynamicConfigTest SubSystemRef ddTest: SubSystem_DataDriven + SubSystemRef acTest: SubSystem_ActorCommunicationTest SubSystemRef da1Test: SubSystem_DynamicActorTest1 SubSystemRef da2Test: SubSystem_DynamicActorTest2 SubSystemRef da3Test: SubSystem_DynamicActorTest3 diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/standard.etphys b/tests/org.eclipse.etrice.generator.common.tests/models/standard.etphys index f31b064b8..88e5855ce 100644 --- a/tests/org.eclipse.etrice.generator.common.tests/models/standard.etphys +++ b/tests/org.eclipse.etrice.generator.common.tests/models/standard.etphys @@ -20,6 +20,7 @@ PhysicalModel Standard { NodeRef node17: PC NodeRef node18: PC NodeRef node19: PC + NodeRef node20: PC } NodeClass PC { diff --git a/tests/org.eclipse.etrice.generator.java.tests/make.xml b/tests/org.eclipse.etrice.generator.java.tests/make.xml index 174ad1750..983376fcf 100644 --- a/tests/org.eclipse.etrice.generator.java.tests/make.xml +++ b/tests/org.eclipse.etrice.generator.java.tests/make.xml @@ -10,15 +10,15 @@ @author Henrik Rentz-Reichert --> <project name="project" default="all"> - - <property name="java.tests.model.path" value="./models"/> - <property name="modellib.path" value="../../runtime/org.eclipse.etrice.modellib.java"/> - <property name="runtime.path" value="../../runtime/org.eclipse.etrice.runtime.java"/> - <property name="bin.path" value="./bin"/> - <property name="xml.output" value="./tmp"/> - <property name="output" value="./output"/> - <property environment="env"/> - + + <property name="java.tests.model.path" value="./models" /> + <property name="modellib.path" value="../../runtime/org.eclipse.etrice.modellib.java" /> + <property name="runtime.path" value="../../runtime/org.eclipse.etrice.runtime.java" /> + <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 --> @@ -31,7 +31,7 @@ --> <target name="set_tp" unless="target.platform"> <echo>using local target platform</echo> - <property name="target.platform" value="${env.ETRICE_TARGET_PLATFORM}"/> + <property name="target.platform" value="${env.ETRICE_TARGET_PLATFORM}" /> </target> <!-- @@ -39,58 +39,58 @@ --> <target name="set_tr" unless="test.results"> <echo>using local test result folder</echo> - <property name="test.results" value="./results"/> + <property name="test.results" value="./results" /> </target> - + <!-- clean: deletes all folders created by this script --> <target name="clean" depends="set_tr"> - <delete dir="${bin.path}"/> - <delete dir="models"/> - <delete dir="${output}"/> - <delete dir="src-gen"/> - <delete dir="tmp"/> + <delete dir="${bin.path}" /> + <delete dir="models" /> + <delete dir="${output}" /> + <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" depends="clean"> - <copy todir="models" > + <copy todir="models"> <fileset dir="../org.eclipse.etrice.generator.common.tests/models"> - <include name="*.room"/> - <include name="*.config"/> - <include name="*.etmap"/> - <include name="*.etphys"/> - <include name="*.rt-config"/> + <include name="*.room" /> + <include name="*.config" /> + <include name="*.etmap" /> + <include name="*.etphys" /> + <include name="*.rt-config" /> </fileset> <fileset dir="../../runtime/org.eclipse.etrice.modellib.java/model"> - <include name="TimingService.room"/> - <include name="Types.room"/> - <include name="TcpService.room"/> - <include name="Language.room"/> + <include name="TimingService.room" /> + <include name="Types.room" /> + <include name="TcpService.room" /> + <include name="Language.room" /> </fileset> </copy> - <move file="models/StaticConfigTest_Java.room" toFile="models/StaticConfigTest.room"/> + <move file="models/StaticConfigTest_Java.room" toFile="models/StaticConfigTest.room" /> </target> - + <!-- generate: invokes the Java generator for the ROOM models --> <target name="generate" depends="set_tp,copy_models"> - <mkdir dir="${output}"/> + <mkdir dir="${output}" /> <path id="clspath"> - <pathelement location="../../plugins/org.eclipse.etrice.generator.java/bin"/> - <pathelement location="../../plugins/org.eclipse.etrice.generator.config/bin"/> - <pathelement location="../../plugins/org.eclipse.etrice.generator.doc/bin"/> - <pathelement location="../../plugins/org.eclipse.etrice.generator/bin"/> - <pathelement location="../../plugins/org.eclipse.etrice.core.common/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"/> + <pathelement location="../../plugins/org.eclipse.etrice.generator.java/bin" /> + <pathelement location="../../plugins/org.eclipse.etrice.generator.config/bin" /> + <pathelement location="../../plugins/org.eclipse.etrice.generator.doc/bin" /> + <pathelement location="../../plugins/org.eclipse.etrice.generator/bin" /> + <pathelement location="../../plugins/org.eclipse.etrice.core.common/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.9*.jar" /> <include name="org.eclipse.emf.common_2.9*.jar" /> @@ -107,19 +107,20 @@ <include name="org.antlr.runtime_3.2*.jar" /> <include name="javax.inject_1.0*.jar" /> </fileset> + <!-- If some plugins are located in user folder, then duplicate fileset with own path --> </path> <java output="${output}/generate.txt" error="${output}/generate_err.txt" classname="org.eclipse.etrice.generator.java.Main" fork="true" failonerror="true"> - <arg value="${java.tests.model.path}/generator.java.tests.config"/> - <arg value="${java.tests.model.path}/generator.java.tests.etmap"/> - <arg value="-persistable"/> - <arg value="-storeDataObj"/> - <arg value="-gen_as_verbose"/> - <arg value="-msc_instr"/> - <classpath refid="clspath"/> + <arg value="${java.tests.model.path}/generator.java.tests.config" /> + <arg value="${java.tests.model.path}/generator.java.tests.etmap" /> + <arg value="-persistable" /> + <arg value="-storeDataObj" /> + <arg value="-gen_as_verbose" /> + <arg value="-msc_instr" /> + <classpath refid="clspath" /> </java> </target> - + <!-- compile: compiles the generated Java sources --> @@ -131,142 +132,143 @@ <!-- set debug and verbose to on to produce more output --> <target name="logged_compile"> - <mkdir dir="${bin.path}"/> - <javac srcdir="src-gen:src" - destdir="${bin.path}" - classpath="${runtime.path}/target/classes" - debug="off" - verbose="off" - /> + <mkdir dir="${bin.path}" /> + <javac srcdir="src-gen:src" destdir="${bin.path}" classpath="${runtime.path}/target/classes" debug="off" verbose="off" /> </target> - + <!-- run: runs all executables --> <target name="run" depends="compile"> - <mkdir dir="tmp/log"/> + <mkdir dir="tmp/log" /> + <echo>start ActorCommunicationTest</echo> + <java output="${output}/runActorCommunicationTest.txt" classname="ActorCommunicationTest.Node_node20_acTestRunner" fork="true" failonerror="true"> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> + </java> + <echo>end ActorCommunicationTest</echo> <echo>start PingPongThreadTestReplPort</echo> <java output="${output}/runPingPongThreadReplPortTest.txt" classname="PingPongThreadTestReplPort.Node_node7_prTestRunner" fork="true" failonerror="true"> - <arg value="-headless"/> - <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin"/> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> </java> <echo>end PingPongThreadTestReplPort</echo> <echo>start HandlerTest</echo> <java output="${output}/runHandlerTest.txt" classname="HandlerTest.Node_node3_hdTestRunner" fork="true" failonerror="true"> - <arg value="-headless"/> - <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin"/> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> </java> <echo>end HandlerTest</echo> <echo>start ChoicePointTest</echo> <java output="${output}/runChoicePointTest.txt" classname="ChoicePointTest.Node_node1_cpTestRunner" fork="true" failonerror="true"> - <arg value="-headless"/> - <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin"/> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> </java> <echo>end ChoicePointTest</echo> <echo>start EnumTest</echo> <java output="${output}/runEnumTest.txt" classname="EnumTest.Node_node18_enTestRunner" fork="true" failonerror="true"> - <arg value="-headless"/> - <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin"/> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> </java> <echo>end EnumTest</echo> <echo>start StoreRestore</echo> <java output="${output}/runStoreRestore.txt" classname="StoreRestore.Node_node19_stTestRunner" fork="true" failonerror="true"> - <arg value="-headless"/> - <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin"/> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> </java> <echo>end StoreRestore</echo> <echo>start ChoicePointTestExtended</echo> - <java output="${output}/runChoicePointTestExtended.txt" classname="ChoicePointTestExtended.Node_node17_cpExtTestRunner" fork="true" failonerror="true"> - <arg value="-headless"/> - <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin"/> - </java> + <java output="${output}/runChoicePointTestExtended.txt" classname="ChoicePointTestExtended.Node_node17_cpExtTestRunner" fork="true" failonerror="true"> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> + </java> <echo>end ChoicePointTestExtended</echo> <echo>start PingPongThreadTest</echo> <java output="${output}/runPingPongThreadTest.txt" classname="PingPongThreadTest.Node_node6_ppTestRunner" fork="true" failonerror="true"> - <arg value="-headless"/> - <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin"/> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> </java> <echo>end PingPongThreadTest</echo> <echo>start SendingDataTestJava</echo> <java output="${output}/runSendingDataTestJava.txt" classname="SendingDataTestJava.Node_node4_sdTestRunner" fork="true" failonerror="true"> - <arg value="-headless"/> - <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin"/> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> </java> <echo>end SendingDataTestJava</echo> <echo>start TCPTest</echo> <java output="${output}/runTCPTest.txt" classname="TCPTest.Node_node8_tcTestRunner" fork="true" failonerror="true"> - <arg value="-headless"/> - <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin"/> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> </java> <echo>end TCPTest</echo> <echo>start StaticConfigTest</echo> <java output="${output}/runStaticConfigTest.txt" classname="StaticConfigTest.Node_node5_scTestRunner" fork="true" failonerror="true"> - <arg value="-headless"/> - <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin"/> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> </java> <echo>end StaticConfigTest</echo> <echo>start DynamicConfigTest</echo> <java output="${output}/runDynamicConfigTest.txt" classname="DynamicConfigTest.Node_node9_dcTestRunner" fork="true" failonerror="true"> - <arg value="-headless"/> - <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin"/> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> </java> <echo>end DynamicConfigTest</echo> <echo>start DataDrivenTest</echo> <java output="${output}/runDataDrivenTest.txt" classname="DataDrivenTest.Node_node2_ddTestRunner" fork="true" failonerror="true"> - <arg value="-headless"/> - <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin"/> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> </java> <echo>end DataDrivenTest</echo> <echo>start DynamicActorTest1</echo> <java output="${output}/runDynamicActorTest1.txt" classname="DynamicActorTest1.Node_node10_da1TestRunner" fork="true" failonerror="true"> - <arg value="-headless"/> - <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin"/> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> </java> <echo>end DynamicActorTest1</echo> <echo>start DynamicActorTest2</echo> <java output="${output}/runDynamicActorTest2.txt" classname="DynamicActorTest2.Node_node11_da2TestRunner" fork="true" failonerror="true"> - <arg value="-headless"/> - <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin"/> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> </java> <echo>end DynamicActorTest2</echo> <echo>start DynamicActorTest3</echo> <java output="${output}/runDynamicActorTest3.txt" classname="DynamicActorTest3.Node_node12_da3TestRunner" fork="true" failonerror="true"> - <arg value="-headless"/> - <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin"/> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> </java> <echo>end DynamicActorTest3</echo> <echo>start DynamicActorTest4</echo> <java output="${output}/runDynamicActorTest4.txt" classname="DynamicActorTest4.Node_node13_da4TestRunner" fork="true" failonerror="true"> - <arg value="-headless"/> - <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin"/> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> </java> <echo>end DynamicActorTest4</echo> <echo>start DynamicActorTest5</echo> <java output="${output}/runDynamicActorTest5.txt" classname="DynamicActorTest5.Node_node14_da5TestRunner" fork="true" failonerror="true"> - <arg value="-headless"/> - <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin"/> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> </java> <echo>end DynamicActorTest5</echo> <echo>start DynamicActorTest6</echo> <java output="${output}/runDynamicActorTest6.txt" classname="DynamicActorTest6.Node_node15_da6TestRunner" fork="true" failonerror="true"> - <arg value="-headless"/> - <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin"/> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> </java> <echo>end DynamicActorTest6</echo> <echo>start DynamicActorTest7</echo> <java output="${output}/runDynamicActorTest7.txt" classname="DynamicActorTest7.Node_node16_da7TestRunner" fork="true" failonerror="true"> - <arg value="-headless"/> - <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin"/> + <arg value="-headless" /> + <classpath path="${bin.path};${runtime.path}/target/classes;${modellib.path}/bin" /> </java> <echo>end DynamicActorTest7</echo> </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"/> + <pathelement location="../../plugins/org.eclipse.etrice.etunit.converter/bin" /> <fileset dir="${target.platform}/plugins/"> <include name="org.eclipse.core.runtime_3.9*.jar" /> <include name="org.eclipse.emf.ecore_2.9*.jar" /> @@ -275,156 +277,165 @@ </fileset> </path> + <java output="${output}/convert.txt" classname="org.eclipse.etrice.etunit.converter.EtUnitReportConverter" fork="true" failonerror="true"> - <arg value="-suite"/> - <arg value="org.eclipse.etrice.generator.java.tests.ChoicePointTest"/> - <arg value="./tmp/ChoicePointTest.etu"/> - <classpath refid="clspath"/> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.ActorCommunicationTest" /> + <arg value="./tmp/ActorCommunicationTest.etu" /> + <classpath refid="clspath" /> </java> <java output="${output}/convert.txt" classname="org.eclipse.etrice.etunit.converter.EtUnitReportConverter" fork="true" failonerror="true"> - <arg value="-suite"/> - <arg value="org.eclipse.etrice.generator.java.tests.EnumTest"/> - <arg value="./tmp/EnumTest.etu"/> - <classpath refid="clspath"/> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.ChoicePointTest" /> + <arg value="./tmp/ChoicePointTest.etu" /> + <classpath refid="clspath" /> </java> <java output="${output}/convert.txt" classname="org.eclipse.etrice.etunit.converter.EtUnitReportConverter" fork="true" failonerror="true"> - <arg value="-suite"/> - <arg value="org.eclipse.etrice.generator.java.tests.StoreRestore"/> - <arg value="./tmp/StoreRestore.etu"/> - <classpath refid="clspath"/> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.EnumTest" /> + <arg value="./tmp/EnumTest.etu" /> + <classpath refid="clspath" /> </java> - + + <java output="${output}/convert.txt" classname="org.eclipse.etrice.etunit.converter.EtUnitReportConverter" fork="true" failonerror="true"> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.StoreRestore" /> + <arg value="./tmp/StoreRestore.etu" /> + <classpath refid="clspath" /> + </java> + <java output="${output}/convert.txt" classname="org.eclipse.etrice.etunit.converter.EtUnitReportConverter" fork="true" failonerror="true"> - <arg value="-suite"/> - <arg value="org.eclipse.etrice.generator.java.tests.ChoicePointTestExtended"/> - <arg value="./tmp/ChoicePointTestExtended.etu"/> - <classpath refid="clspath"/> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.ChoicePointTestExtended" /> + <arg value="./tmp/ChoicePointTestExtended.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.java.tests.HandlerTest"/> - <arg value="./tmp/HandlerTest.etu"/> - <classpath refid="clspath"/> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.HandlerTest" /> + <arg value="./tmp/HandlerTest.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.java.tests.PingPongThreadTest"/> - <arg value="./tmp/PingPongThreadTest.etu"/> - <classpath refid="clspath"/> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.PingPongThreadTest" /> + <arg value="./tmp/PingPongThreadTest.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.java.tests.PingPongThreadTestReplPort"/> - <arg value="./tmp/PingPongThreadTestReplPort.etu"/> - <classpath refid="clspath"/> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.PingPongThreadTestReplPort" /> + <arg value="./tmp/PingPongThreadTestReplPort.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.java.tests.SendingDataTest"/> - <arg value="./tmp/SendingDataTestJava.etu"/> - <classpath refid="clspath"/> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.SendingDataTest" /> + <arg value="./tmp/SendingDataTestJava.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.java.tests.TCPTest"/> - <arg value="./tmp/TCPTest.etu"/> - <classpath refid="clspath"/> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.TCPTest" /> + <arg value="./tmp/TCPTest.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.java.tests.StaticConfigTest"/> - <arg value="./tmp/StaticConfigTest.etu"/> - <classpath refid="clspath"/> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.StaticConfigTest" /> + <arg value="./tmp/StaticConfigTest.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.java.tests.DynamicConfigTest"/> - <arg value="./tmp/DynamicConfigTest.etu"/> - <classpath refid="clspath"/> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.DynamicConfigTest" /> + <arg value="./tmp/DynamicConfigTest.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.java.tests.DataDrivenTest"/> - <arg value="./tmp/DataDrivenTest.etu"/> - <classpath refid="clspath"/> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.DataDrivenTest" /> + <arg value="./tmp/DataDrivenTest.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.java.tests.DynamicActorTest1"/> - <arg value="./tmp/DynamicActorTest1.etu"/> - <classpath refid="clspath"/> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.DynamicActorTest1" /> + <arg value="./tmp/DynamicActorTest1.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.java.tests.DynamicActorTest2"/> - <arg value="./tmp/DynamicActorTest2.etu"/> - <classpath refid="clspath"/> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.DynamicActorTest2" /> + <arg value="./tmp/DynamicActorTest2.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.java.tests.DynamicActorTest3"/> - <arg value="./tmp/DynamicActorTest3.etu"/> - <classpath refid="clspath"/> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.DynamicActorTest3" /> + <arg value="./tmp/DynamicActorTest3.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.java.tests.DynamicActorTest4"/> - <arg value="./tmp/DynamicActorTest4.etu"/> - <classpath refid="clspath"/> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.DynamicActorTest4" /> + <arg value="./tmp/DynamicActorTest4.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.java.tests.DynamicActorTest5"/> - <arg value="./tmp/DynamicActorTest5.etu"/> - <classpath refid="clspath"/> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.DynamicActorTest5" /> + <arg value="./tmp/DynamicActorTest5.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.java.tests.DynamicActorTest6"/> - <arg value="./tmp/DynamicActorTest6.etu"/> - <classpath refid="clspath"/> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.DynamicActorTest6" /> + <arg value="./tmp/DynamicActorTest6.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.java.tests.DynamicActorTest7"/> - <arg value="./tmp/DynamicActorTest7.etu"/> - <classpath refid="clspath"/> + <arg value="-suite" /> + <arg value="org.eclipse.etrice.generator.java.tests.DynamicActorTest7" /> + <arg value="./tmp/DynamicActorTest7.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/JavaHandlerTest.xml"/> - <move file="./tmp/EnumTest.xml" tofile="./tmp/JavaEnumTest.xml"/> - <move file="./tmp/ChoicePointTest.xml" tofile="./tmp/JavaChoicePointTest.xml"/> - <move file="./tmp/ChoicePointTestExtended.xml" tofile="./tmp/JavaChoicePointTestExtended.xml"/> - <move file="./tmp/StaticConfigTest.xml" tofile="./tmp/JavaStaticConfigTest.xml"/> - <move file="./tmp/DynamicConfigTest.xml" tofile="./tmp/JavaDynamicConfigTest.xml"/> - <move file="./tmp/DataDrivenTest.xml" tofile="./tmp/JavaDataDrivenTest.xml"/> - <copy todir="${test.results}" > + <move file="./tmp/ActorCommunicationTest.xml" tofile="./tmp/JavaActorCommunicationTest.xml" /> + <move file="./tmp/HandlerTest.xml" tofile="./tmp/JavaHandlerTest.xml" /> + <move file="./tmp/EnumTest.xml" tofile="./tmp/JavaEnumTest.xml" /> + <move file="./tmp/ChoicePointTest.xml" tofile="./tmp/JavaChoicePointTest.xml" /> + <move file="./tmp/ChoicePointTestExtended.xml" tofile="./tmp/JavaChoicePointTestExtended.xml" /> + <move file="./tmp/StaticConfigTest.xml" tofile="./tmp/JavaStaticConfigTest.xml" /> + <move file="./tmp/DynamicConfigTest.xml" tofile="./tmp/JavaDynamicConfigTest.xml" /> + <move file="./tmp/DataDrivenTest.xml" tofile="./tmp/JavaDataDrivenTest.xml" /> + <copy todir="${test.results}"> <fileset dir="./tmp"> - <include name="*.xml"/> + <include name="*.xml" /> </fileset> </copy> </target> - + </project> diff --git a/tests/org.eclipse.etrice.runtime.c.tests/.cproject b/tests/org.eclipse.etrice.runtime.c.tests/.cproject index 9aa4383d4..9e7423dea 100644 --- a/tests/org.eclipse.etrice.runtime.c.tests/.cproject +++ b/tests/org.eclipse.etrice.runtime.c.tests/.cproject @@ -1,18 +1,16 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?fileVersion 4.0.0?> - -<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> +<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> <storageModule moduleId="org.eclipse.cdt.core.settings"> <cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.debug.1638834921"> <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1638834921" moduleId="org.eclipse.cdt.core.settings" name="PosixDebug"> <externalSettings/> <extensions> - <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> </extensions> </storageModule> <storageModule moduleId="cdtBuildSystem" version="4.0.0"> @@ -43,8 +41,8 @@ <listOptionValue builtIn="false" value="rt"/> </option> <option id="gnu.c.link.option.paths.1505328291" name="Library search path (-L)" superClass="gnu.c.link.option.paths" valueType="libPaths"> - <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/Debug}""/> - <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/PosixDebug}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/DebugMinGW}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/MinGWDebug}""/> </option> <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.154971939" superClass="cdt.managedbuild.tool.gnu.c.linker.input"> <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> @@ -66,8 +64,8 @@ <externalSettings containerId="org.eclipse.etrice.runtime.c;" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier"> <externalSetting> <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.runtime.c"/> - <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/Debug"/> - <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/PosixDebug"/> + <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/DebugMinGW"/> + <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/MinGWDebug"/> <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.runtime.c" srcPrefixMapping="" srcRootPath=""/> </externalSetting> </externalSettings> @@ -77,10 +75,10 @@ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1638834921.786066887" moduleId="org.eclipse.cdt.core.settings" name="MinGWDebug"> <externalSettings/> <extensions> - <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/> <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/> </extensions> </storageModule> <storageModule moduleId="cdtBuildSystem" version="4.0.0"> @@ -116,8 +114,8 @@ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="org.eclipse.etrice.runtime.c"/> </option> <option id="gnu.c.link.option.paths.714773418" name="Library search path (-L)" superClass="gnu.c.link.option.paths" valueType="libPaths"> - <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/Debug}""/> - <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/PosixDebug}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/DebugMinGW}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/MinGWDebug}""/> </option> <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1024087368" superClass="cdt.managedbuild.tool.gnu.c.linker.input"> <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> @@ -133,8 +131,8 @@ <externalSettings containerId="org.eclipse.etrice.runtime.c;" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier"> <externalSetting> <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.runtime.c"/> - <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/Debug"/> - <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/PosixDebug"/> + <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/DebugMinGW"/> + <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/MinGWDebug"/> <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.runtime.c" srcPrefixMapping="" srcRootPath=""/> </externalSetting> </externalSettings> diff --git a/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/messaging/MessageServiceTest.java b/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/messaging/MessageServiceTest.java index e23bb0b0d..b4e668b68 100644 --- a/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/messaging/MessageServiceTest.java +++ b/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/messaging/MessageServiceTest.java @@ -92,9 +92,13 @@ public class MessageServiceTest extends TestCase { int max_iter=10; // create and register message receivers + Address firstAddress = null; DummyMessageReceiver receiver[]=new DummyMessageReceiver[max]; for (int i=0; i<max; i++){ - receiver[i] = new DummyMessageReceiver(new Address(0,0,1+i)); + Address address = msg_service.getFreeAddress(); + if(i==0) + firstAddress = address; + receiver[i] = new DummyMessageReceiver(address); msg_service.getMessageDispatcher().addMessageReceiver(receiver[i]); } @@ -103,7 +107,7 @@ public class MessageServiceTest extends TestCase { Message msg[][]=new Message[max][max_iter]; for (int j=0; j<max_iter; j++){ for (int i=0; i<max; i++){ - msg[i][j] = new Message(new Address(0,0,i+1)); + msg[i][j] = new Message(new Address(firstAddress.nodeID, firstAddress.threadID, firstAddress.objectID + i)); } } @@ -133,6 +137,29 @@ public class MessageServiceTest extends TestCase { } } + + public void testPollingMessage() throws InterruptedException{ + { + MessageService msg_service = new MessageService(null, ExecMode.POLLED, 100, 0, 0, "MessageService"); + start(msg_service); + DummyMessageReceiver dummyReceiver = new DummyMessageReceiver(msg_service.getFreeAddress()); + msg_service.addPollingMessageReceiver(dummyReceiver); + + Thread.sleep(300); + assertNotNull(dummyReceiver.getLastReceivedMessage()); + msg_service.destroy(); + } + { + MessageService msg_service = new MessageService(null, ExecMode.MIXED, 100, 0, 0, "MessageService"); + start(msg_service); + DummyMessageReceiver dummyReceiver = new DummyMessageReceiver(msg_service.getFreeAddress()); + msg_service.addPollingMessageReceiver(dummyReceiver); + + Thread.sleep(300); + assertNotNull(dummyReceiver.getLastReceivedMessage()); + msg_service.destroy(); + } + } public void testMessageService() { Address addr = new Address(0,0,0); |