01: package org.uispec4j;
02:
03: import org.uispec4j.utils.UIComponentFactory;
04: import org.uispec4j.xml.XmlAssert;
05:
06: import javax.swing.*;
07:
08: public class ButtonTest extends ButtonTestCase {
09:
10: private JButton jButton = new JButton();
11: private Button button;
12:
13: protected void setUp() throws Exception {
14: super .setUp();
15: button = (Button) UIComponentFactory.createUIComponent(jButton);
16: }
17:
18: protected AbstractButton getButton() {
19: return button;
20: }
21:
22: protected javax.swing.AbstractButton getSwingButton() {
23: return jButton;
24: }
25:
26: public void testGetComponentTypeName() throws Exception {
27: assertEquals("button", button.getDescriptionTypeName());
28: }
29:
30: public void testGetDescription() throws Exception {
31: XmlAssert
32: .assertEquivalent("<button/>", button.getDescription());
33: jButton.setText("toto");
34: XmlAssert.assertEquivalent("<button label='toto'/>", button
35: .getDescription());
36: }
37:
38: public void testFactory() throws Exception {
39: checkFactory(new JButton(), Button.class);
40: }
41: }
|