Skip to content
This repository has been archived by the owner on Jun 1, 2021. It is now read-only.

Commit

Permalink
Merge pull request #319 from RBMHTechnology/wip-230-spec-failure
Browse files Browse the repository at this point in the history
AbstractEventsourcedProcessorSpec failure fixed
  • Loading branch information
krasserm authored Oct 6, 2016
2 parents ff0e66e + 0941e35 commit 8d35ec3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ public void onWriteFailure(final Throwable cause) {

@Before
public void beforeEach() {
instanceId = getInstanceId();
srcProbe = new TestProbe(system);
targetProbe = new TestProbe(system);
appProbe = new TestProbe(system);
instanceId = getInstanceId();
}

private ActorRef unrecoveredStatelessEventProcessor() {
Expand Down Expand Up @@ -157,20 +157,26 @@ public void shouldProcessEvents() {
}

@Test
public void shouldReportFailureOnFailedRead() {
unrecoveredStatelessEventProcessor();
public void shouldResumeOnFailedRead() {
final ActorRef actor = unrecoveredStatelessEventProcessor();
processReadFailure();

appProbe.expectMsg(FAILURE);

processReadSuccess(0);
processReplay(actor, 1, instanceId + 1, srcProbe, REPLAY_BATCH_SIZE);
}

@Test
public void shouldReportFailureOnFailedWrite() {
public void shouldResumeOnFailedWrite() {
final ActorRef actor = recoveredStatelessEventProcessor();

actor.tell(new Written(eventA), getRef());
processWriteFailure(1, eventA1, eventA2);

appProbe.expectMsg(FAILURE);

processReadSuccess(0);
processReplay(actor, 1, instanceId + 1, srcProbe, REPLAY_BATCH_SIZE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.scalatest.junit.JUnitSuite;
import scala.Option;
import scala.collection.immutable.$colon$colon;
import scala.collection.immutable.List$;
Expand All @@ -36,7 +37,7 @@

import java.util.Arrays;

public abstract class BaseSpec {
public abstract class BaseSpec extends JUnitSuite {

@SuppressWarnings("ThrowableInstanceNeverThrown")
public static final Throwable FAILURE = new NoStackTraceException("failure");
Expand Down
1 change: 0 additions & 1 deletion project/ProjectSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ object ProjectSettings {
)

lazy val testSettings: Seq[Setting[_]] = Seq(
testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v", "-a"),
parallelExecution in Test := false,
fork in Test := true
)
Expand Down

0 comments on commit 8d35ec3

Please sign in to comment.