}
}
private TestSuite[] findTests(String t)
{
JUnitService service = ( JUnitService ) tracker.getService();
if ( service == null ) {
throw new IllegalStateException(JUnitService.class.getName() + " not found");
}
if (t.contains("*"))
{
Pattern p = compile(t);
LinkedList<TestSuite> tests = new LinkedList<TestSuite>();
for (String n : service.getTests())
{
if (p.matcher(n).matches())
{
tests.add(service.createTest(n));
}
}
return tests.toArray(new TestSuite[tests.size()]);
}
else
{
TestSuite test = service.createTest(t);
return test == null ? new TestSuite[0] : new TestSuite[] { test };
}
}