use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class ButtonItemImplTest method testShow.
@Test
public void testShow() {
final Command before = mock(Command.class);
final Command after = mock(Command.class);
tested.show(before, after);
verify(groupItem, times(1)).show(eq(before), eq(after));
verify(groupItem, never()).hide(any(Command.class), any(Command.class));
verify(before, times(1)).execute();
verify(after, times(1)).execute();
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class FocusableGroupTest method testShow.
@Test
public void testShow() {
final Command before = mock(Command.class);
final Command after = mock(Command.class);
tested.show(before, after);
verify(groupItem, times(1)).show(any(Command.class), eq(after));
verify(groupItem, never()).hide(any(Command.class), any(Command.class));
verify(before, times(1)).execute();
verify(after, times(1)).execute();
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class GroupImplTest 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(eq(before), any(Command.class));
verify(groupItem, never()).show(any(Command.class), any(Command.class));
verify(before, times(1)).execute();
verify(after, times(1)).execute();
verify(decorator, times(3)).hide();
verify(tooltip, times(2)).hide();
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class ItemGridImplTest method testShow.
@Test
public void testShow() {
final Command before = mock(Command.class);
final Command after = mock(Command.class);
tested.show(before, after);
verify(groupItem, times(1)).show(any(Command.class), eq(after));
verify(groupItem, never()).hide(any(Command.class), any(Command.class));
verify(before, times(1)).execute();
verify(after, times(1)).execute();
// Button1
ArgumentCaptor<Point2D> p1Captor = ArgumentCaptor.forClass(Point2D.class);
verify(button1Prim, times(3)).setLocation(p1Captor.capture());
final Point2D p1 = p1Captor.getValue();
assertEquals(0, p1.getX(), 0);
assertEquals(-15, p1.getY(), 0);
verify(button1, times(1)).show();
// Button2.
ArgumentCaptor<Point2D> p2Captor = ArgumentCaptor.forClass(Point2D.class);
verify(button2Prim, times(2)).setLocation(p2Captor.capture());
final Point2D p2 = p2Captor.getValue();
assertEquals(15, p2.getX(), 0);
assertEquals(-15, p2.getY(), 0);
verify(button2, times(1)).show();
verify(refreshCallback, times(1)).execute();
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class ItemImplTest method Command.
@Test
public void Command() {
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();
verify(focusGroupExecutor, times(1)).unFocus();
verify(focusGroupExecutor, never()).focus();
verify(focusGroupExecutor, never()).accept(any(Group.class), any(Command.class));
}
Aggregations