From acac9bddd638319d2673d7b14c0c9579e792174d Mon Sep 17 00:00:00 2001 From: Henrik Rentz-Reichert Date: Thu, 20 Sep 2012 09:40:17 +0200 Subject: [runtime.java] etUnti expect order array of short in favor of compatibility with runtime.c --- ...org.eclipse.etrice.integration.HandlerTest.room | 2 +- .../integration/ConfigTest/DynTestee_ac.java | 48 +++++++++++----------- .../SubSystemConfigTestVariableService.java | 32 +++++++-------- .../integration/HandlerTest/HandlerUser.java | 2 +- .../etrice/runtime/java/etunit/EtUnitTest.java | 2 +- 5 files changed, 43 insertions(+), 43 deletions(-) (limited to 'tests') diff --git a/tests/org.eclipse.etrice.integration.tests/model/org.eclipse.etrice.integration.HandlerTest.room b/tests/org.eclipse.etrice.integration.tests/model/org.eclipse.etrice.integration.HandlerTest.room index 9b30feb77..00625ff8e 100644 --- a/tests/org.eclipse.etrice.integration.tests/model/org.eclipse.etrice.integration.HandlerTest.room +++ b/tests/org.eclipse.etrice.integration.tests/model/org.eclipse.etrice.integration.HandlerTest.room @@ -65,7 +65,7 @@ RoomModel org.eclipse.etrice.integration.HandlerTest { 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};" + "short 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);" } } diff --git a/tests/org.eclipse.etrice.integration.tests/src-gen/org/eclipse/etrice/integration/ConfigTest/DynTestee_ac.java b/tests/org.eclipse.etrice.integration.tests/src-gen/org/eclipse/etrice/integration/ConfigTest/DynTestee_ac.java index 52da9efb6..2664ced4e 100644 --- a/tests/org.eclipse.etrice.integration.tests/src-gen/org/eclipse/etrice/integration/ConfigTest/DynTestee_ac.java +++ b/tests/org.eclipse.etrice.integration.tests/src-gen/org/eclipse/etrice/integration/ConfigTest/DynTestee_ac.java @@ -43,9 +43,9 @@ public class DynTestee_ac extends ActorClassBase { Dyn_DC1 dc_dump; int int_dump; private DynConfigLock lock_int_i; - private DynConfigLock lock_dc_i; private DynConfigLock lock_blocker; private DynConfigLock lock_blockMe; + private DynConfigLock lock_dc_i; /*--------------------- operations ---------------------*/ //--------------------- construction @@ -74,9 +74,9 @@ public class DynTestee_ac extends ActorClassBase { this.variableService = variableService; lock_int_i = new DynConfigLock(); - lock_dc_i = new DynConfigLock(); lock_blocker = new DynConfigLock(); lock_blockMe = new DynConfigLock(); + lock_dc_i = new DynConfigLock(); } //--------------------- attribute setters and getters @@ -112,25 +112,6 @@ public class DynTestee_ac extends ActorClassBase { public DynConfigLock getInt_iLock(){ return lock_int_i; } - public Dyn_DC1 getDc_i(){ - if(lock_dc_i == null) - return dc_i; - else - synchronized(lock_dc_i){ - return dc_i; - } - } - public void setDc_i(Dyn_DC1 dc_i){ - if(lock_dc_i == null) - this.dc_i = dc_i; - else - synchronized(lock_dc_i){ - this.dc_i = dc_i; - } - } - public DynConfigLock getDc_iLock(){ - return lock_dc_i; - } public boolean getBlocker(){ if(lock_blocker == null) return blocker; @@ -169,14 +150,33 @@ public class DynTestee_ac extends ActorClassBase { public DynConfigLock getBlockMeLock(){ return lock_blockMe; } - public void setAndWriteDc_dump(Dyn_DC1 dc_dump){ - setDc_dump(dc_dump); - variableService.write(this.getInstancePath()+"/dc_dump", dc_dump); + public Dyn_DC1 getDc_i(){ + if(lock_dc_i == null) + return dc_i; + else + synchronized(lock_dc_i){ + return dc_i; + } + } + public void setDc_i(Dyn_DC1 dc_i){ + if(lock_dc_i == null) + this.dc_i = dc_i; + else + synchronized(lock_dc_i){ + this.dc_i = dc_i; + } } + public DynConfigLock getDc_iLock(){ + return lock_dc_i; + } public void setAndWriteInt_dump(int int_dump){ setInt_dump(int_dump); variableService.write(this.getInstancePath()+"/int_dump", int_dump); } + public void setAndWriteDc_dump(Dyn_DC1 dc_dump){ + setDc_dump(dc_dump); + variableService.write(this.getInstancePath()+"/dc_dump", dc_dump); + } //--------------------- port getters public TestCommProtocolConjPort getConj_DynConfigPort (){ diff --git a/tests/org.eclipse.etrice.integration.tests/src-gen/org/eclipse/etrice/integration/ConfigTest/SubSystemConfigTestVariableService.java b/tests/org.eclipse.etrice.integration.tests/src-gen/org/eclipse/etrice/integration/ConfigTest/SubSystemConfigTestVariableService.java index 847038252..f40d3fc7d 100644 --- a/tests/org.eclipse.etrice.integration.tests/src-gen/org/eclipse/etrice/integration/ConfigTest/SubSystemConfigTestVariableService.java +++ b/tests/org.eclipse.etrice.integration.tests/src-gen/org/eclipse/etrice/integration/ConfigTest/SubSystemConfigTestVariableService.java @@ -56,12 +56,12 @@ public class SubSystemConfigTestVariableService extends VariableService{ } try{ boolean changed = false; - id = "/SubSystemConfigTest/top/testee2/dc_i/long_array_i"; - long[] _long_array_i = null; + id = "/SubSystemConfigTest/top/testee2/dc_i/dc_i/double_i"; + Double _double_i = null; object = values.get(id); if(object != null){ - _long_array_i = ensureLongArray(object, 1); - if(!Arrays.equals(_long_array_i, (long[])getDiffMap().get(id))) + _double_i = ensureDouble(object); + if(!_double_i.equals((Double)getDiffMap().get(id))) changed = true; } else warning(id, "is missing"); @@ -74,12 +74,12 @@ public class SubSystemConfigTestVariableService extends VariableService{ changed = true; } else warning(id, "is missing"); - id = "/SubSystemConfigTest/top/testee2/dc_i/dc_i/double_i"; - Double _double_i = null; + id = "/SubSystemConfigTest/top/testee2/dc_i/long_array_i"; + long[] _long_array_i = null; object = values.get(id); if(object != null){ - _double_i = ensureDouble(object); - if(!_double_i.equals((Double)getDiffMap().get(id))) + _long_array_i = ensureLongArray(object, 1); + if(!Arrays.equals(_long_array_i, (long[])getDiffMap().get(id))) changed = true; } else warning(id, "is missing"); @@ -95,17 +95,17 @@ public class SubSystemConfigTestVariableService extends VariableService{ if(changed) synchronized(_top_testee2.getDc_iLock()){ if(_top_testee2.getDc_iLock().isUpdate()){ - if(_long_array_i != null){ - _top_testee2.getDc_i().setLong_array_i(_long_array_i); - getDiffMap().put("/SubSystemConfigTest/top/testee2/dc_i/long_array_i", _long_array_i); + if(_double_i != null){ + _top_testee2.getDc_i().getDc_i().setDouble_i(_double_i); + getDiffMap().put("/SubSystemConfigTest/top/testee2/dc_i/dc_i/double_i", _double_i); } if(_char_i != null){ _top_testee2.getDc_i().getDc_i().setChar_i(_char_i); getDiffMap().put("/SubSystemConfigTest/top/testee2/dc_i/dc_i/char_i", _char_i); } - if(_double_i != null){ - _top_testee2.getDc_i().getDc_i().setDouble_i(_double_i); - getDiffMap().put("/SubSystemConfigTest/top/testee2/dc_i/dc_i/double_i", _double_i); + if(_long_array_i != null){ + _top_testee2.getDc_i().setLong_array_i(_long_array_i); + getDiffMap().put("/SubSystemConfigTest/top/testee2/dc_i/long_array_i", _long_array_i); } if(_int_i != null){ _top_testee2.getDc_i().setInt_i(_int_i); @@ -168,9 +168,9 @@ public class SubSystemConfigTestVariableService extends VariableService{ protected Map getAttributeValues(){ Map values = new HashMap(); values.put("/SubSystemConfigTest/top/testee2/int_i", _top_testee2.getInt_i()); - values.put("/SubSystemConfigTest/top/testee2/dc_i/long_array_i", toObjectArray(_top_testee2.getDc_i().getLong_array_i())); - values.put("/SubSystemConfigTest/top/testee2/dc_i/dc_i/char_i", toObjectArray(_top_testee2.getDc_i().getDc_i().getChar_i())); values.put("/SubSystemConfigTest/top/testee2/dc_i/dc_i/double_i", _top_testee2.getDc_i().getDc_i().getDouble_i()); + values.put("/SubSystemConfigTest/top/testee2/dc_i/dc_i/char_i", toObjectArray(_top_testee2.getDc_i().getDc_i().getChar_i())); + values.put("/SubSystemConfigTest/top/testee2/dc_i/long_array_i", toObjectArray(_top_testee2.getDc_i().getLong_array_i())); values.put("/SubSystemConfigTest/top/testee2/dc_i/int_i", _top_testee2.getDc_i().getInt_i()); values.put("/SubSystemConfigTest/top/testee2/blockMe", _top_testee2.getBlockMe()); values.put("/SubSystemConfigTest/top/testee2/blocker", _top_testee2.getBlocker()); diff --git a/tests/org.eclipse.etrice.integration.tests/src-gen/org/eclipse/etrice/integration/HandlerTest/HandlerUser.java b/tests/org.eclipse.etrice.integration.tests/src-gen/org/eclipse/etrice/integration/HandlerTest/HandlerUser.java index 3c6b43fb6..f80727269 100644 --- a/tests/org.eclipse.etrice.integration.tests/src-gen/org/eclipse/etrice/integration/HandlerTest/HandlerUser.java +++ b/tests/org.eclipse.etrice.integration.tests/src-gen/org/eclipse/etrice/integration/HandlerTest/HandlerUser.java @@ -215,7 +215,7 @@ public class HandlerUser extends ActorClassBase { } protected void action_TRANS_INITIAL_TO__state0_tp2() { 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}; + short 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); } protected void action_TRANS_tr9_FROM_state0_TO_cp1_BY_msg1TestPort1(InterfaceItemBase ifitem, int p1) { diff --git a/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/etunit/EtUnitTest.java b/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/etunit/EtUnitTest.java index 4d5c065ca..eec2360c0 100644 --- a/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/etunit/EtUnitTest.java +++ b/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/etunit/EtUnitTest.java @@ -71,7 +71,7 @@ public class EtUnitTest extends TestCase { } public void doTestOrder(int id) { - int list[] = {1,2,3,4}; + short list[] = {1,2,3,4}; EXPECT_ORDER_START(id, list, list.length); EXPECT_ORDER(id, "id=1", 1); EXPECT_ORDER(id, "id=2", 2); -- cgit v1.2.3