private void assertTitle(String expectedTitle, RootPaneContainer container) { JTextField source = new JTextField(); container.getContentPane().add(source); assertContext.setGuiComponent(GuiComponentFactory.newGuiComponent(source)); assertFrame.execute(); Statement resultAssert = assertContext.getPostedAssert(); assertNotNull("un assertion est défini", resultAssert); assertEquals("<assertFrame title=\"" + expectedTitle + "\"/>", resultAssert.toXml()); }
public void test_assert_exists() throws Exception { JTree source = buildJTree(new TreePath(new Object[] {"root", "child"}), "treeName"); context.setGuiComponent(GuiComponentFactory.newGuiComponent(source)); context.setPoint(new Point(1, 1)); assertTree.execute(); Statement resultAssert = context.getPostedAssert(); assertNotNull("un assertion est défini", resultAssert); assertEquals( "<assertTree name=\"treeName\" path=\"root:child\" exists=\"true\"/>", resultAssert.toXml()); }