}
try {
String algText = propPart+INDENT+testedTask;
logTstParsing(algText);
Benchmark benchmark = new Benchmark(new StringReader(algText));
Algorithm alg = benchmark.getAlgorithm();
ArrayList algTasks = alg.extractTasks();
// must find a task with this name in the algorithm
boolean foundName = false;
boolean foundPar = false;
String theTask = singleTaskAlgs[i].replaceAll(" +"," ").trim();
for (Iterator iter = algTasks.iterator(); iter.hasNext();) {
PerfTask task = (PerfTask) iter.next();
foundName |= (task.toString().indexOf(theTask)>=0);
foundPar |= (task instanceof TaskSequence && ((TaskSequence)task).isParallel());
}
assertTrue("Task "+testedTask+" was not found in "+alg.toString(),foundName);
if (parOrSeq) {
if (par) {
assertTrue("Task "+testedTask+" was supposed to be parallel in "+alg.toString(),foundPar);
} else {
assertFalse("Task "+testedTask+" was not supposed to be parallel in "+alg.toString(),foundPar);
}
}
} catch (Exception e) {
System.out.flush();
e.printStackTrace();