< prev index next >

test/sanity/client/SwingSet/src/ToggleButtonDemoTest.java

Print this page

        

*** 54,63 **** --- 54,64 ---- * selected. * * @library /sanity/client/lib/jemmy/src * @library /sanity/client/lib/Extensions/src * @library /sanity/client/lib/SwingSet3/src + * @modules java.desktop * @build org.jemmy2ext.JemmyExt * @build com.sun.swingset3.demos.togglebutton.ToggleButtonDemo * @run testng ToggleButtonDemoTest */ @Listeners(GuiTestListener.class)
*** 123,138 **** assertFalse("Radio Button " + i + " is initially not selected", jrbo[i].isSelected()); } } for (int i = 0; i < radioButtonCount; i++) { ! jrbo[i].doClick(); ! assertTrue("Radio Button " + i + " is selected", jrbo[i].isSelected()); for (int j = 0; j < radioButtonCount; j++) { if (i != j) { ! assertFalse("Radio Button " + j + " is not selected", jrbo[j].isSelected()); } } } } --- 124,139 ---- assertFalse("Radio Button " + i + " is initially not selected", jrbo[i].isSelected()); } } for (int i = 0; i < radioButtonCount; i++) { ! jrbo[i].push(); ! jrbo[i].waitSelected(true); for (int j = 0; j < radioButtonCount; j++) { if (i != j) { ! jrbo[j].waitSelected(false); } } } }
*** 144,170 **** * @param expectedValue * @throws Exception */ private void testCheckBox(ContainerOperator<?> parent, String text, boolean expectedValue) { parent.setComparator(EXACT_STRING_COMPARATOR); JCheckBoxOperator jcbo = new JCheckBoxOperator(parent, text); ! assertEquals("Initial selection state of the checkbox '" + text + "'", expectedValue, jcbo.isSelected()); // click check box (toggle the state) ! jcbo.doClick(); ! assertEquals("Selection state of the checkbox '" + text + "' after click", !expectedValue, jcbo.isSelected()); ! if (jcbo.isSelected()) { ! // toggle back to not-selected state ! jcbo.doClick(); ! assertFalse("Check Box '" + text + "' is not selected", jcbo.isSelected()); ! } else { ! // toggle back to selected state ! jcbo.doClick(); ! assertTrue("Check Box '" + text + "' is selected", jcbo.isSelected()); ! } } /* * testDirectionRadioButtons(JFrameOperator) will toggle each position of --- 145,165 ---- * @param expectedValue * @throws Exception */ private void testCheckBox(ContainerOperator<?> parent, String text, boolean expectedValue) { + System.out.println("Testing " + text); parent.setComparator(EXACT_STRING_COMPARATOR); JCheckBoxOperator jcbo = new JCheckBoxOperator(parent, text); ! jcbo.waitSelected(expectedValue); // click check box (toggle the state) ! jcbo.push(); ! jcbo.waitSelected(!expectedValue); ! jcbo.push(); ! jcbo.waitSelected(expectedValue); } /* * testDirectionRadioButtons(JFrameOperator) will toggle each position of
< prev index next >