in scala/support/JUnitXmlReporter.scala [234:278]
private def locateSuite(orderedEvents: Array[Event],
endEvent: Event):
(Int, Int) = {
require(orderedEvents.size > 0)
require(endEvent.isInstanceOf[SuiteCompleted] ||
endEvent.isInstanceOf[SuiteAborted])
var startIndex = 0
var endIndex = 0
var idx = 0
while ((idx < orderedEvents.size) && (endIndex == 0)) {
val event = orderedEvents(idx)
event match {
case _: SuiteStarting =>
startIndex = idx
case e: SuiteCompleted =>
if (event == endEvent) {
endIndex = idx
assert(
e.suiteName ==
orderedEvents(startIndex).asInstanceOf[SuiteStarting].
suiteName)
}
case e: SuiteAborted =>
if (event == endEvent) {
endIndex = idx
assert(
e.suiteName ==
orderedEvents(startIndex).asInstanceOf[SuiteStarting].
suiteName)
}
case _ =>
}
idx += 1
}
assert(endIndex > 0)
assert(orderedEvents(startIndex).isInstanceOf[SuiteStarting])
(startIndex, endIndex)
}