Eclipse Scout Neon unit test of execChangedMasterValue -


i have 2 fields connected master-slave relationship :

public class slave extends abstractlistbox<string> {    @override   protected class<? extends ivaluefield> getconfiguredmasterfield() {      return master.class;   }    @override   protected void execchangedmastervalue(final object newmastervalue) {     this.function() // -> here put debugging break point   } }  public class master extends abstractbooleanfield {    @override   protected void execchangedvalue() {      super.execchangedvalue(); // -> break point 2    } } 

i write unit test relationship, inside unit test execchangedmastervalue never called.

my unit test looks :

@test public void test() {      this.box.getmaster.setvalue(true)     assert.assertfalse(... function slave ...) } 

unit tests failed, , if put breakpoints described above, debugger stops on second break point never on first one.

in "real" world, function called , works should.

is there reason execchangedmastervalue not called? behaviour of execchangedmastervalue different changedvalue()?

i cannot reproduce describing. took scout helloworld project (the 1 generated when create new project).

in helloworldform have added "slave" field in mainbox:

@order(2000) public class lengthfield extends abstractintegerfield {     @override     protected string getconfiguredlabel() {         return texts.get("length");     }      @override     protected class<? extends ivaluefield<?>> getconfiguredmasterfield() {         return messagefield.class;     }      @override     protected void execchangedmastervalue(object newmastervalue) {         if(newmastervalue instanceof string) {             string s = (string) newmastervalue;             setvalue(s.length());         } else {             setvalue(0);         }     } } 

and in example unit test helloworldformtest, have added additional check testmessagecorrectlyimported():

/**  * tests {@link messagefield} correctly filled after start.  */ @test public void testmessagecorrectlyimported() {     helloworldform frm = new helloworldform();     frm.start();      assert.assertequals("message field", message_value, frm.getmessagefield().getvalue());     assert.assertequals("length field", integer.valueof(message_value.length()) , frm.getlengthfield().getvalue());      frm.getmessagefield().setvalue("abcdef");     assert.assertequals("length field (after update)", integer.valueof("abcdef".length()), frm.getlengthfield().getvalue()); } 

everything works expected…


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -