Modified:
trunk/smart-load-test/smart-load-test-engine-impl/src/main/java/com/smartitengineering/loadtest/engine/impl/management/DefaultTestCaseBatchCreator.java
Log:
Fix next batch provider's state validator and creation ended event firing
Batch provider's state validation logic was opposite thus fixed it.
Wrong operation was called to notify about creation ended event, thus fixed
that as well.
Signed-off-by: Imran M Yousuf <imyo...@smartitengineering.com>
Modified:
trunk/smart-load-test/smart-load-test-engine-impl/src/main/java/com/smartitengineering/loadtest/engine/impl/management/DefaultTestCaseBatchCreator.java
==============================================================================
---
trunk/smart-load-test/smart-load-test-engine-impl/src/main/java/com/smartitengineering/loadtest/engine/impl/management/DefaultTestCaseBatchCreator.java
(original)
+++
trunk/smart-load-test/smart-load-test-engine-impl/src/main/java/com/smartitengineering/loadtest/engine/impl/management/DefaultTestCaseBatchCreator.java
Wed Oct 29 04:02:46 2008
@@ -22,6 +22,7 @@
import
com.smartitengineering.loadtest.engine.management.TestCaseBatchCreator.Batch;
import java.lang.ref.WeakReference;
import java.util.AbstractMap;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -52,7 +53,7 @@
public Batch getNextBatch()
throws IllegalStateException {
- if (isInitialized() && isNextBatchAvailable()) {
+ if (!isInitialized() || !isNextBatchAvailable()) {
throw new IllegalStateException();
}
return currentBatch;
@@ -80,6 +81,7 @@
for (int stepCount = 0; stepCount < nextStepSize;
++stepCount) {
TestCase testCase =
getTestCaseCreationFactory().getTestCase(
initalProperties);
+ testCase.initTestCase();
if (testCase == null) {
continue;
}
@@ -98,8 +100,8 @@
}
Batch batch =
getBatch(new AbstractMap.SimpleEntry<ThreadGroup,
Map<Thread, TestCase>>(
- new ThreadGroup(""), new HashMap<Thread, TestCase>()));
- fireBatchEvent(new BatchEvent(batch, name));
+ new ThreadGroup(""), Collections.<Thread,
TestCase>emptyMap()));
+ fireBatchEndedEvent(new BatchEvent(batch, name));
}
}
}