Merge pull request #98 from bsinno/stabilize-eventbus-driven-tests

made progress counter volatile
This commit is contained in:
Michael Hirsch
2016-03-17 12:53:01 +01:00
2 changed files with 4 additions and 8 deletions

View File

@@ -1021,8 +1021,7 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
} }
private static class EventHandlerMock { private static class EventHandlerMock {
private final List<TargetAssignDistributionSetEvent> events = Collections private final List<TargetAssignDistributionSetEvent> events = Collections.synchronizedList(new LinkedList<>());
.synchronizedList(new LinkedList<TargetAssignDistributionSetEvent>());
private final CountDownLatch latch; private final CountDownLatch latch;
private final int expectedNumberOfEvents; private final int expectedNumberOfEvents;
@@ -1050,8 +1049,7 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
} }
private static class CancelEventHandlerMock { private static class CancelEventHandlerMock {
private final List<CancelTargetAssignmentEvent> events = Collections private final List<CancelTargetAssignmentEvent> events = Collections.synchronizedList(new LinkedList<>());
.synchronizedList(new LinkedList<CancelTargetAssignmentEvent>());
private final CountDownLatch latch; private final CountDownLatch latch;
private final int expectedNumberOfEvents; private final int expectedNumberOfEvents;

View File

@@ -64,13 +64,11 @@ import ru.yandex.qatools.allure.annotations.Stories;
@Stories("Artifact Download Resource") @Stories("Artifact Download Resource")
public class ArtifactDownloadTest extends AbstractIntegrationTestWithMongoDB { public class ArtifactDownloadTest extends AbstractIntegrationTestWithMongoDB {
private static final String AUTH_ANOYM = "ROLE_CONTROLLER_ANONYMOUS";
public ArtifactDownloadTest() { public ArtifactDownloadTest() {
LOG = LoggerFactory.getLogger(ArtifactDownloadTest.class); LOG = LoggerFactory.getLogger(ArtifactDownloadTest.class);
} }
private int downLoadProgress = 0; private volatile int downLoadProgress = 0;
@Autowired @Autowired
private EventBus eventBus; private EventBus eventBus;
@@ -364,7 +362,7 @@ public class ArtifactDownloadTest extends AbstractIntegrationTestWithMongoDB {
// create target // create target
Target target = new Target("4712"); Target target = new Target("4712");
target = targetManagement.createTarget(target); target = targetManagement.createTarget(target);
final List<Target> targets = new ArrayList(); final List<Target> targets = new ArrayList<>();
targets.add(target); targets.add(target);
// create ds // create ds