📄 buttontest.java
字号:
package org.uispec4j;
import org.uispec4j.utils.UIComponentFactory;
import org.uispec4j.xml.XmlAssert;
import javax.swing.*;
public class ButtonTest extends ButtonTestCase {
private JButton jButton = new JButton();
private Button button;
protected void setUp() throws Exception {
super.setUp();
button = (Button)UIComponentFactory.createUIComponent(jButton);
}
protected AbstractButton getButton() {
return button;
}
protected javax.swing.AbstractButton getSwingButton() {
return jButton;
}
public void testGetComponentTypeName() throws Exception {
assertEquals("button", button.getDescriptionTypeName());
}
public void testGetDescription() throws Exception {
XmlAssert.assertEquivalent("<button/>", button.getDescription());
jButton.setText("toto");
XmlAssert.assertEquivalent("<button label='toto'/>", button.getDescription());
}
public void testFactory() throws Exception {
checkFactory(new JButton(), Button.class);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -