Search in sources :

Example 91 with Command

use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.

the class GroupItemTest method testNoNeedToHide.

@Test
public void testNoNeedToHide() {
    when(group.getAlpha()).thenReturn(0d);
    final Command before = mock(Command.class);
    final Command after = mock(Command.class);
    tested.hide(before, after);
    verify(before, never()).execute();
    verify(showExecutor, never()).accept(any(Group.class), any(Command.class));
    verify(hideExecutor, never()).accept(any(Group.class), any(Command.class));
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) Command(org.uberfire.mvp.Command) Test(org.junit.Test)

Example 92 with Command

use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.

the class GroupItemTest method testNoNeedToShow.

@Test
public void testNoNeedToShow() {
    when(group.getAlpha()).thenReturn(1d);
    final Command before = mock(Command.class);
    final Command after = mock(Command.class);
    tested.show(before, after);
    verify(before, never()).execute();
    verify(showExecutor, never()).accept(any(Group.class), any(Command.class));
    verify(hideExecutor, never()).accept(any(Group.class), any(Command.class));
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) Command(org.uberfire.mvp.Command) Test(org.junit.Test)

Example 93 with Command

use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.

the class GroupItemTest method testShow.

@Test
public void testShow() {
    when(group.getAlpha()).thenReturn(0d);
    final Command before = mock(Command.class);
    final Command after = mock(Command.class);
    tested.show(before, after);
    verify(before, times(1)).execute();
    verify(showExecutor, times(1)).accept(eq(group), eq(after));
    verify(hideExecutor, never()).accept(any(Group.class), any(Command.class));
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) Command(org.uberfire.mvp.Command) Test(org.junit.Test)

Example 94 with Command

use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.

the class ButtonGridItemImplTest method testHide.

@Test
public void testHide() {
    final Command before = mock(Command.class);
    final Command after = mock(Command.class);
    tested.hide(before, after);
    verify(toolbox, times(1)).hide(any(Command.class), any(Command.class));
    verify(toolbox, never()).show(any(Command.class), any(Command.class));
    verify(button, times(1)).hide();
    verify(button, never()).show(any(Command.class), any(Command.class));
    verify(before, times(1)).execute();
    verify(after, times(1)).execute();
}
Also used : Command(org.uberfire.mvp.Command) Test(org.junit.Test)

Example 95 with Command

use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.

the class ButtonItemImplTest method testHide.

@Test
public void testHide() {
    final Command before = mock(Command.class);
    final Command after = mock(Command.class);
    tested.hide(before, after);
    verify(groupItem, times(1)).hide(any(Command.class), eq(after));
    verify(groupItem, never()).show(any(Command.class), any(Command.class));
    verify(before, times(1)).execute();
    verify(after, times(1)).execute();
}
Also used : Command(org.uberfire.mvp.Command) Test(org.junit.Test)

Aggregations

Command (org.uberfire.mvp.Command)117 Test (org.junit.Test)66 ParameterizedCommand (org.uberfire.mvp.ParameterizedCommand)15 ClientSessionCommand (org.kie.workbench.common.stunner.core.client.session.command.ClientSessionCommand)11 Group (com.ait.lienzo.client.core.shape.Group)9 YesNoCancelPopup (org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup)9 Before (org.junit.Before)8 HasListSelectorControl (org.kie.workbench.common.dmn.client.widgets.grid.controls.list.HasListSelectorControl)7 Path (org.uberfire.backend.vfs.Path)7 ArrayList (java.util.ArrayList)6 Collection (java.util.Collection)6 PlaceRequest (org.uberfire.mvp.PlaceRequest)5 MenuItem (org.uberfire.workbench.model.menu.MenuItem)5 IsWidget (com.google.gwt.user.client.ui.IsWidget)4 Inject (javax.inject.Inject)4 OrganizationalUnit (org.guvnor.structure.organizationalunit.OrganizationalUnit)4 RemoteCallback (org.jboss.errai.common.client.api.RemoteCallback)4 DeleteHeaderValueCommand (org.kie.workbench.common.dmn.client.commands.general.DeleteHeaderValueCommand)4 SetCellValueCommand (org.kie.workbench.common.dmn.client.commands.general.SetCellValueCommand)4 SetHeaderValueCommand (org.kie.workbench.common.dmn.client.commands.general.SetHeaderValueCommand)4