TestResult error1 = new TestResult(null, "error", "", "", "testcase2", "test6", 0f);
TestResult error2 = new TestResult(null, "error", "", "", "testcase", "test7", 0f);
public void testSelect() throws Exception {
ViewerFilter filter = new FailureOnlyViewerFilter();
ResultModel model = new EclipseJstdBrowserRunResult(null, "browser");
model.addTestResult(passing1);
model.addTestResult(passing2);
model.addTestResult(failed1);
model.addTestResult(failed2);
model.addTestResult(error1);
model.addTestResult(error2);
Iterator<? extends ResultModel> iterator = model.getChildren().iterator();
ResultModel testcase1 = iterator.next();
ResultModel testcase3 = iterator.next();
ResultModel testcase2 = iterator.next();
assertTrue(filter.select(null, null, model));
assertTrue(filter.select(null, null, testcase1));
assertTrue(filter.select(null, null, testcase2));
assertFalse(filter.select(null, null, testcase3));
assertTrue(filter.select(null, null, testcase1.getChildren().iterator().next()));
iterator = testcase2.getChildren().iterator();
assertTrue(filter.select(null, null, iterator.next()));
assertTrue(filter.select(null, null, iterator.next()));
assertFalse(filter.select(null, null, iterator.next()));
assertFalse(filter.select(null, null, testcase3.getChildren().iterator().next()));