@Test public void selectedIndexTest() throws Exception { assertEquals(2, tabbox.getSelectedIndex()); XulTabs tabs = (XulTabs) doc.getElementById("tabs"); XulTab tab = (XulTab) doc.getElementById("tab1"); }
@Test public void removeTabpanelTest() throws Exception { XulTabpanels panels = (XulTabpanels) doc.getElementById("tabpanels"); XulTabpanel panel = (XulTabpanel) doc.getElementById("panel3"); panels.removeChild(panel); assertEquals(3, panels.getChildNodes().size()); }
@Test public void removeTabTest() throws Exception { XulTabs tabs = (XulTabs) doc.getElementById("tabs"); XulTab tab = (XulTab) doc.getElementById("tab1"); tabs.removeChild(tab); assertEquals(3, tabs.getTabCount()); }
@Test public void disableTabTest() throws Exception { XulTabs tabs = (XulTabs) doc.getElementById("tabs"); XulTab tab = (XulTab) doc.getElementById("tab1"); tab.setDisabled(false); assertTrue(tab.isDisabled() == false); }
protected void configureDisableTableOnEmptyFile() { final Document doc = getXulDomContainer().getDocumentRoot(); final XulComponent paramTableElement = doc.getElementById("parameter-table"); // NON-NLS if (paramTableElement instanceof XulDrillDownParameterTable == false) { return; } getWrapper() .getModel() .addPropertyChangeListener( DrillDownModel.DRILL_DOWN_PATH_PROPERTY, new CheckEmptyPathHandler(paramTableElement)); }
@Test public void testItemLabel() throws Exception { XulListitem item1 = (XulListitem) doc.getElementById("listItem1"); assertEquals("ODBC", item1.getLabel()); item1.setLabel("foo"); assertEquals("foo", item1.getLabel()); }
@Before public void setUp() throws Exception { container = new SwingXulLoader().loadXul("resource/documents/tabpanel.xul"); doc = container.getDocumentRoot(); tabbox = (XulTabbox) doc.getElementById("myTabList"); }
@Test public void testGetSelectedItems() throws Exception { list.setSelectedIndex(2); XulListitem item = (XulListitem) doc.getElementById("listItem2"); Object[] selectedItems = list.getSelectedItems(); assertEquals(1, selectedItems.length); assertEquals(selectedItems[0], item.getLabel()); }
@Before public void setUp() throws Exception { // Do not run on headless environment Assume.assumeTrue(!GraphicsEnvironment.isHeadless()); container = new SwingXulLoader().loadXul("resource/documents/menulist.xul"); doc = container.getDocumentRoot(); list = (XulMenuList) doc.getElementById("list"); }
@Test public void testBindings() throws Exception { List<TestClass> items = new ArrayList<TestClass>(); XulMenuList list2 = (XulMenuList) doc.getElementById("list2"); items.add(new TestClass("foo")); items.add(new TestClass("bar")); items.add(new TestClass("baz")); items.add(new TestClass("bang")); list2.setElements(items); assertEquals(4, list2.getElements().size()); }
@Test public void testSetSelecetdIndex() throws Exception { XulMenuitem item = (XulMenuitem) doc.getElementById("sales"); list.setSelectedIndex(0); assertEquals(list.getSelectedItem().toString(), item.getLabel()); }
@Test public void testGetSelectedItem() throws Exception { XulMenuitem item = (XulMenuitem) doc.getElementById("regions"); assertEquals(list.getSelectedItem().toString(), item.getLabel()); }
@Test public void testItemValue() throws Exception { XulListitem item1 = (XulListitem) doc.getElementById("listItem1"); item1.setValue("bar"); assertEquals("bar", item1.getValue()); }
@Test public void getSelectedPanelTest() throws Exception { XulTabpanel panel = (XulTabpanel) doc.getElementById("panel3"); assertEquals(panel, tabbox.getSelectedPanel()); }
@Test public void getTabPanelsTest() throws Exception { XulTabpanels panels = (XulTabpanels) doc.getElementById("tabpanels"); assertEquals(panels, tabbox.getTabpanels()); }
@Test public void getTabsTest() throws Exception { XulTabs tabs = (XulTabs) doc.getElementById("tabs"); assertEquals(tabs, tabbox.getTabs()); }
@Test public void tabCountTest() throws Exception { XulTabs tabs = (XulTabs) doc.getElementById("tabs"); assertEquals(4, tabs.getTabCount()); }
@Test public void testGetSelectedValue() throws Exception { list.setSelectedIndex(2); XulListitem item = (XulListitem) doc.getElementById("listItem2"); assertEquals(item.getLabel(), list.getSelectedItem()); }