@Test public void testRun() throws BeanException { String value = "test val"; Class type = String.class; String keyName = "key"; JTextComponent textComponent = mock( JTextComponent.class ); ParameterUpdateContext updateContext = mock( ParameterUpdateContext.class ); doReturn( value ).when( textComponent ).getText(); doReturn( Color.YELLOW ).when( textComponent ).getBackground(); TextComponentEditHandler handler = spy( new TextComponentEditHandler( type, keyName, textComponent, updateContext, null ) ); handler.run(); verify( textComponent ).setBackground( Color.YELLOW ); verify( updateContext ).setParameterValue( keyName, value, false ); doThrow( BeanException.class ).when( handler ).convertValue( value ); handler.run(); verify( textComponent ).setBackground( Color.RED ); }
public void run() { convert( false ); }
TextComponentEditHandler implements Runnable, DocumentListener, ActionListener { public void run() { convert( false ); } }
TextComponentEditHandler implements Runnable, DocumentListener, ActionListener { public void run() { convert( false ); } TextComponentEditHandler( final Class type, final String keyName, final JTextComponent textComponent,
      final ParameterUpdateContext updateContext, final Format formatter ); }
TextComponentEditHandler implements Runnable, DocumentListener, ActionListener { public void run() { convert( false ); } TextComponentEditHandler( final Class type, final String keyName, final JTextComponent textComponent,
      final ParameterUpdateContext updateContext, final Format formatter ); boolean isAdjustingToExternalInput(); void setAdjustingToExternalInput( final boolean adjustingToExternalInput ); void insertUpdate( final DocumentEvent e ); void removeUpdate( final DocumentEvent e ); void changedUpdate( final DocumentEvent e ); void run(); void actionPerformed( final ActionEvent e ); static TimeZone createTimeZone( final String selectedItem, final TimeZone defaultValue ); static Format createFormat( final String formatString, final Locale locale, final TimeZone timeZone,
      final Class parameterType ); }
TextComponentEditHandler implements Runnable, DocumentListener, ActionListener { public void run() { convert( false ); } TextComponentEditHandler( final Class type, final String keyName, final JTextComponent textComponent,
      final ParameterUpdateContext updateContext, final Format formatter ); boolean isAdjustingToExternalInput(); void setAdjustingToExternalInput( final boolean adjustingToExternalInput ); void insertUpdate( final DocumentEvent e ); void removeUpdate( final DocumentEvent e ); void changedUpdate( final DocumentEvent e ); void run(); void actionPerformed( final ActionEvent e ); static TimeZone createTimeZone( final String selectedItem, final TimeZone defaultValue ); static Format createFormat( final String formatString, final Locale locale, final TimeZone timeZone,
      final Class parameterType );  }