FEST

Add support for editable JComboBoxes as JTable editors (issue 312)

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: FEST-Swing 1.1
  • Fix Version/s: FEST-Swing 1.2a3
  • Component/s: Swing
  • Labels:
    None
  • Number of attachments :
    0

Description

From darioconsoli:

What steps will reproduce the problem?

  1. Create a table having a DefaultCellEditor made out of a JComboBox.
  2. Set this combo box enable and editable
  3. In your test, use:
JTableFixture activationFixture = 
asEditScreen.table(JTableFromColumnsNameMatcher.withColumns("Days","Configuration"));
JTableComboBoxEditorCellWriter textWriter = new 
JTableComboBoxEditorCellWriter(robot);
textWriter.enterValue(activationFixture.target, 3, 3, "PIPPO");

Where "PIPPO" is not among the list of possible values of the combo box.

What is the expected output? What do you see instead?
Normally it should be accepted, as you could enter a new value in the combo box. Instead, while running the test, I get

org.fest.swing.exception.LocationUnavailableException: Unable to find item 
'PIPPO' among the JComboBox contents (['CFE1W1', 'CFE2W3', 'CFE2W2', 
'CFE4W3', 'CF3EW3', 'CF3HW3', 'CFE1W2', 'CFE2W1'])
	at 
org.fest.swing.driver.JComboBoxDriver.selectItem(JComboBoxDriver.java:108)
	at 
org.fest.swing.driver.JTableComboBoxEditorCellWriter.enterValue(JTableComboBoxEditorCellWriter.java:49)
	at 
company.division.project.controller.env.datasheet.as.MyTestClass.myTest(MyTestClass.java:60)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at 
org.junit.internal.runners.statements.FailOnTimeout$1.call(FailOnTimeout.java:32)
	at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
	at java.util.concurrent.FutureTask.run(FutureTask.java:123)
	at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
	at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
	at java.lang.Thread.run(Thread.java:595)

What version of the product are you using? On what operating system?
FEST Swing 1.0 under WIN XP


Original report at Google Code.

Activity

Hide
Alex Ruiz added a comment -

Updated bug summary to reflect that is a new feature (or improvement,) instead of a bug.

Show
Alex Ruiz added a comment - Updated bug summary to reflect that is a new feature (or improvement,) instead of a bug.

People

Vote (2)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: