|
@ -50,5 +50,24 @@ public class TestEmojiPicker { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
public void testEmojiPickerActionListener() { |
|
|
|
|
|
|
|
|
|
|
|
JTextField textField = new JTextField(); |
|
|
|
|
|
|
|
|
|
|
|
EmojiPicker emojiPicker = new EmojiPicker(textField); |
|
|
|
|
|
|
|
|
|
|
|
Component[] components = emojiPicker.getComponents(); |
|
|
|
|
|
|
|
|
|
|
|
for (Component component : components) { |
|
|
|
|
|
assertTrue(component instanceof JButton); |
|
|
|
|
|
|
|
|
|
|
|
JButton button = (JButton) component; |
|
|
|
|
|
assertNotNull(button.getActionListeners()); |
|
|
|
|
|
|
|
|
|
|
|
assertEquals(1, button.getActionListeners().length); |
|
|
|
|
|
assertTrue(button.getActionListeners()[0] instanceof EmojiPicker.EmojiActionListener); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |