Supports functional testing of AWT or Swing {@code Component}s.
Note: This class is intended for internal use only. Please use the classes in the package {@link org.fest.swing.fixture} in your tests.
81828384858687
super(selfType, robot, type); } @Override protected @Nonnull ComponentDriver createDriver(@Nonnull Robot robot) { return new ComponentDriver(robot); }
152153154155156157158159160161162
} @Test public void should_delegate_to_fontOf_in_driver() { Font font = mock(Font.class); ComponentDriver driver = fixture.driver(); Component component = fixture.target(); when(driver.fontOf(component)).thenReturn(font); assertThat(fixture.font().target()).isSameAs(font); verify(driver).fontOf(component); }
161162163164165166167168169170171
verify(driver).fontOf(component); } @Test public void should_delegate_to_backgroundOf_in_driver() { ComponentDriver driver = fixture.driver(); Component component = fixture.target(); when(driver.backgroundOf(component)).thenReturn(BLUE); assertThat(fixture.background().target()).isSameAs(BLUE); verify(driver).backgroundOf(component); }
170171172173174175176177178179180
verify(driver).backgroundOf(component); } @Test public void should_delegate_to_foregroundOf_in_driver() { ComponentDriver driver = fixture.driver(); Component component = fixture.target(); when(driver.foregroundOf(component)).thenReturn(BLUE); assertThat(fixture.foreground().target()).isSameAs(BLUE); verify(driver).foregroundOf(component); }
84858687888990
super(selfType, robot, name, type); } @Override protected @Nonnull ComponentDriver createDriver(@Nonnull Robot robot) { return new ComponentDriver(robot); }
69707172737475
super(selfType, robot, target); } @Override protected @Nonnull ComponentDriver createDriver(@Nonnull Robot robot) { return new ComponentDriver(robot); }
66676869707172
* @param target the target <code>Component</code> to be managed by this fixture. * @throws NullPointerException if <code>robot</code> is <code>null</code>. * @throws NullPointerException if <code>target</code> is <code>null</code>. */ public GenericComponentFixture(Robot robot, T target) { this(robot, new ComponentDriver(robot), target); }