tablecomponenttest.java
来自「基于Junit的 功能和单元测试的的测试工具。只支持Swing.」· Java 代码 · 共 41 行
JAVA
41 行
package org.uispec4j;
import org.uispec4j.utils.UIComponentFactory;
import org.uispec4j.xml.XmlAssert;
import javax.swing.*;
public class TableComponentTest extends UIComponentTestCase {
private Table table;
private JTable jTable;
protected void setUp() throws Exception {
super.setUp();
init(new JTable(new String[][]{}, new String[]{}));
}
private void init(JTable table) {
jTable = table;
jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jTable.setName("myTable");
jTable.setDefaultEditor(Integer.class, new DefaultCellEditor(new JComboBox(new Object[]{new Integer(3), new Integer(4), new Integer(5)})));
this.table = (Table)UIComponentFactory.createUIComponent(jTable);
}
public void testGetComponentTypeName() throws Exception {
assertEquals("table", table.getDescriptionTypeName());
}
public void testGetDescription() throws Exception {
XmlAssert.assertEquivalent("<table name='myTable'/>", table.getDescription());
}
public void testFactory() throws Exception {
checkFactory(new JTable(), Table.class);
}
protected UIComponent createComponent() {
return table;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?