Index: build.xml
===================================================================
--- build.xml (revision 446554)
+++ build.xml (working copy)
@@ -187,7 +187,6 @@
-
Index: src/test/api/java/common/javax/swing/JComboBoxRTest.java
===================================================================
--- src/test/api/java/common/javax/swing/JComboBoxRTest.java (revision 448199)
+++ src/test/api/java/common/javax/swing/JComboBoxRTest.java (working copy)
@@ -19,9 +19,14 @@
*/
package javax.swing;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
import junit.framework.TestCase;
public class JComboBoxRTest extends TestCase {
+ private boolean eventFired;
+
public void testJComboBox() throws Exception {
new JComboBox();
}
@@ -40,8 +45,8 @@
public void testKeyboardActionsEnabled() throws Exception {
JComboBox cb = new JComboBox(new String[] {"1", "2", "4"});
checkActionState(cb, "hidePopup", false);
- checkActionState(cb, "enterPressed", false);
- checkActionState(cb, "selectPrevious", false);
+ checkActionState(cb, "enterPressed", true);
+ checkActionState(cb, "selectPrevious", true);
checkActionState(cb, "togglePopup", true);
checkActionState(cb, "spacePopup", true);
@@ -53,4 +58,17 @@
assertNotNull(action);
assertEquals(expectedState, action.isEnabled());
}
+
+ public void testSetSelectedItem() {
+ // regression test HARMONY-1533
+ String item = "item";
+ JComboBox jcb = new JComboBox(new String[]{item});
+ jcb.addActionListener(new ActionListener(){
+ public void actionPerformed(ActionEvent ae) {
+ eventFired = true;
+ }
+ });
+ jcb.setSelectedItem(item);
+ assertTrue("action performed", eventFired);
+ }
}