This repository has been archived by the owner on Jul 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BZ 1120418] add test for executing multiple jobs, fix bug in loading…
… job queue
- Loading branch information
John Sanda
committed
Aug 12, 2014
1 parent
47fa4be
commit 0816711
Showing
7 changed files
with
161 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
...server/itests-2/src/test/java/org/rhq/enterprise/server/storage/TestCalculatorLookup.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...erver/itests-2/src/test/java/org/rhq/enterprise/server/storage/TestStepRunnerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.rhq.enterprise.server.storage; | ||
|
||
import static org.testng.Assert.assertEquals; | ||
|
||
import java.util.LinkedList; | ||
import java.util.Queue; | ||
|
||
import org.rhq.core.domain.storage.MaintenanceStep; | ||
import org.rhq.enterprise.server.storage.maintenance.MaintenanceStepRunnerFactory; | ||
import org.rhq.enterprise.server.storage.maintenance.step.MaintenanceStepRunner; | ||
|
||
/** | ||
* @author John Sanda | ||
*/ | ||
public class TestStepRunnerFactory implements MaintenanceStepRunnerFactory { | ||
|
||
Queue<FakeStepRunner> queue = new LinkedList<FakeStepRunner>(); | ||
|
||
public TestStepRunnerFactory(FakeStepRunner... stepRunners) { | ||
for (FakeStepRunner stepRunner : stepRunners) { | ||
queue.offer(stepRunner); | ||
} | ||
} | ||
|
||
@Override | ||
public MaintenanceStepRunner newStepRunner(MaintenanceStep step) { | ||
FakeStepRunner next = queue.poll(); | ||
assertEquals(step.getName(), next.stepName, "The step name for " + step + | ||
" does not match the expected value"); | ||
assertEquals(step.getStepNumber(), next.stepNumber, "The step number for " + step + | ||
" does not match the expected value"); | ||
return next; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters