Iterator<TestCase> oTestCaseIterator = in_oTestSuite.getTestCases().iterator();
// create new test suites until the original test suite is completely copied
// while(oTestCaseIterator.hasNext()) {
for(int i = 0; i < Configuration.getNumberOfFilesToSplitOutputTo(); ++i) {
int nTestCaseCounter = 1;
TestSuite oNewTestSuite = new TestSuite();
while((nTestCaseCounter <= nNumberOfTestCasesPerFile + nCountRest) ||
i == Configuration.getNumberOfFilesToSplitOutputTo() - 1) {
++nTestCaseCounter;
if(oTestCaseIterator.hasNext()) {
oNewTestSuite.getTestCases().add(
oTestCaseIterator.next());
}
else {
break;
}
}
nCountRest = (nNumberOfTestCasesPerFile + nCountRest + 1 - nTestCaseCounter);
if(!oNewTestSuite.getTestCases().isEmpty())
colRetValue.add(oNewTestSuite);
}
return colRetValue;
}