List of usage examples for javax.swing JTextArea getColumns
public int getColumns()
From source file:org.pentaho.reporting.engine.classic.core.modules.gui.base.parameters.TextAreaParameterComponentTest.java
@Before public void setUp() { ParameterDefinitionEntry entry = mock(ParameterDefinitionEntry.class); ParameterContext parameterContext = mock(ParameterContext.class); updateContext = mock(ParameterUpdateContext.class); ResourceBundleFactory resourceBundleFactory = mock(ResourceBundleFactory.class); Locale locale = new Locale("test_test"); doReturn(ENTRY_NAME).when(entry).getName(); doReturn(Number.class).when(entry).getValueType(); doReturn("#,###,##0.00").when(entry).getParameterAttribute(ParameterAttributeNames.Core.NAMESPACE, ParameterAttributeNames.Core.DATA_FORMAT, parameterContext); doReturn("#,###,##0.00").when(entry).getTranslatedParameterAttribute(ParameterAttributeNames.Core.NAMESPACE, ParameterAttributeNames.Core.DATA_FORMAT, parameterContext); doReturn("utc").when(entry).getParameterAttribute(ParameterAttributeNames.Core.NAMESPACE, ParameterAttributeNames.Core.TIMEZONE, parameterContext); doReturn(resourceBundleFactory).when(parameterContext).getResourceBundleFactory(); doReturn(locale).when(resourceBundleFactory).getLocale(); doReturn(TimeZone.getDefault()).when(resourceBundleFactory).getTimeZone(); comp = new TextAreaParameterComponent(entry, parameterContext, updateContext); verify(updateContext).addChangeListener(any(ChangeListener.class)); JTextArea textArea = findTextArea(comp); assertThat(textArea, is(notNullValue())); assertThat(textArea.getColumns(), is(equalTo(60))); assertThat(textArea.getRows(), is(equalTo(10))); }