コード例 #1
0
 @Test
 public void should_fail_if_visible_JSpinner_not_found_by_type() {
   thrown.expect(ComponentLookupException.class);
   thrown.expectMessageToContain(
       "Unable to find component using matcher", "type=javax.swing.JSpinner, requireShowing=true");
   fixture.spinner();
 }
コード例 #2
0
 @Test
 public void should_find_visible_JSpinner_by_Matcher() {
   robot.showWindow(window);
   JSpinnerFixture spinner =
       fixture.spinner(
           new GenericTypeMatcher<JSpinner>(JSpinner.class) {
             @Override
             protected boolean isMatching(@Nonnull JSpinner s) {
               return s.getValue().equals(8);
             }
           });
   assertThat(spinner.target()).isSameAs(window.spinner);
 }
コード例 #3
0
 @Test
 public void should_fail_if_visible_JSpinner_not_found_by_Matcher() {
   thrown.expect(ComponentLookupException.class);
   thrown.expectMessageToContain("Unable to find component using matcher");
   fixture.spinner(neverMatches(JSpinner.class));
 }
コード例 #4
0
 @Test
 public void should_find_visible_JSpinner_by_type() {
   robot.showWindow(window);
   JSpinnerFixture spinner = fixture.spinner();
   assertThat(spinner.target()).isSameAs(window.spinner);
 }