[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.technology.ercp] CaptionedControl junit test problem.
|
Hi....All
In "Test_org_eclipse_ercp_swt_mobile_CaptionedControl" junit test, since
CaptionedControl is a subclass of Composite, this junit also tests the
testcases of Test_org_eclipse_swt_widgets_Composite.
However, for test_getChildren() of composite, it always failed.
The failure is not valid. CaptionedControl is a subclass of Composite, but
does not provide the same level of function as a Composite does.
CaptionedControl could accommodate only one control except Composite, but
this testcase tried to put more than one control and composite in it.
Could we discard this testcase(test_getChildren()) from CaptionedControl
junit test??
Below is test codes.
test_getChildren()
public void test_getChildren() {
assertEquals(":a:", new Control[]{}, composite.getChildren());
Composite c1 = new Composite(composite, 0);
assertEquals(":b:", new Control[]{c1}, composite.getChildren());
List c2 = new List(composite, 0);
assertEquals(":c:", new Control[]{c1, c2}, composite.getChildren());
Button c3 = new Button(composite, 0);
assertEquals(":d:", new Control[]{c1, c2, c3}, composite.getChildren());
c2.dispose();
assertEquals(":e:", new Control[]{c1, c3}, composite.getChildren());
Control[] children = composite.getChildren();
for (int i = 0; i < children.length; i++)
children[i].dispose();
assertEquals(":f:", new Control[]{}, composite.getChildren());
}
Thanks.
Eric.