Search in sources :

Example 6 with Handler

use of org.linkki.util.handler.Handler in project linkki by linkki-framework.

the class BindingContextTest method testUpdateUIBindingsAndValidate.

@Test
public void testUpdateUIBindingsAndValidate() {
    Handler afterUpdateUi = setUpPmoWithAfterUpdateUiHandler();
    setUpBinding1();
    binding1 = spy(binding1);
    context.add(binding1);
    context.updateUI();
    verify(binding1).updateFromPmo();
    verify(afterUpdateUi).apply();
}
Also used : Handler(org.linkki.util.handler.Handler) Test(org.junit.Test)

Example 7 with Handler

use of org.linkki.util.handler.Handler in project linkki by linkki-framework.

the class BindingContextTest method testUpdateUIBindings.

@Test
public void testUpdateUIBindings() {
    Handler afterUpdateUi = setUpPmoWithAfterUpdateUiHandler();
    setUpBinding1();
    binding1 = spy(binding1);
    context.add(binding1);
    context.uiUpdated();
    verify(binding1).updateFromPmo();
    verify(afterUpdateUi, never()).apply();
}
Also used : Handler(org.linkki.util.handler.Handler) Test(org.junit.Test)

Example 8 with Handler

use of org.linkki.util.handler.Handler in project linkki by linkki-framework.

the class ComponentBindingTest method testUpdateFromPmo_updateAspect.

@Test
public void testUpdateFromPmo_updateAspect() {
    Handler componentUpdater = mock(Handler.class);
    LinkkiAspectDefinition aspectDefinition = mock(LinkkiAspectDefinition.class);
    when(aspectDefinition.createUiUpdater(any(), any())).thenReturn(componentUpdater);
    ComponentBinding fieldBinding = new ComponentBinding(new LabelComponentWrapper(label, field), propertyDispatcherValue, Handler.NOP_HANDLER, Arrays.asList(aspectDefinition));
    fieldBinding.updateFromPmo();
    verify(componentUpdater).apply();
}
Also used : Handler(org.linkki.util.handler.Handler) LinkkiAspectDefinition(org.linkki.core.binding.aspect.definition.LinkkiAspectDefinition) LabelComponentWrapper(org.linkki.core.ui.components.LabelComponentWrapper) Test(org.junit.Test)

Aggregations

Handler (org.linkki.util.handler.Handler)8 Test (org.junit.Test)7 Label (com.vaadin.ui.Label)1 LinkkiAspectDefinition (org.linkki.core.binding.aspect.definition.LinkkiAspectDefinition)1 MessageList (org.linkki.core.message.MessageList)1 LabelComponentWrapper (org.linkki.core.ui.components.LabelComponentWrapper)1