Remove warnings in persistence-tck (#27286)

This commit is contained in:
Christopher Batey 2019-07-09 13:54:31 +01:00 committed by Johan Andrén
parent 51e443ec72
commit 88e6933ba0
4 changed files with 8 additions and 11 deletions

View file

@ -20,14 +20,14 @@ object JournalPerfSpec {
var counter = 0 var counter = 0
override def receiveCommand: Receive = { override def receiveCommand: Receive = {
case c @ Cmd("p", payload) => case c @ Cmd("p", _) =>
persist(c) { d => persist(c) { d =>
counter += 1 counter += 1
require(d.payload == counter, s"Expected to receive [$counter] yet got: [${d.payload}]") require(d.payload == counter, s"Expected to receive [$counter] yet got: [${d.payload}]")
if (counter == replyAfter) replyTo ! d.payload if (counter == replyAfter) replyTo ! d.payload
} }
case c @ Cmd("pa", payload) => case c @ Cmd("pa", _) =>
persistAsync(c) { d => persistAsync(c) { d =>
counter += 1 counter += 1
require(d.payload == counter, s"Expected to receive [$counter] yet got: [${d.payload}]") require(d.payload == counter, s"Expected to receive [$counter] yet got: [${d.payload}]")
@ -41,7 +41,7 @@ object JournalPerfSpec {
} }
if (counter == replyAfter) replyTo ! payload if (counter == replyAfter) replyTo ! payload
case c @ Cmd("n", payload) => case Cmd("n", payload) =>
counter += 1 counter += 1
require(payload == counter, s"Expected to receive [$counter] yet got: [${payload}]") require(payload == counter, s"Expected to receive [$counter] yet got: [${payload}]")
if (counter == replyAfter) replyTo ! payload if (counter == replyAfter) replyTo ! payload

View file

@ -7,13 +7,11 @@ package akka.persistence.journal
import akka.persistence.scalatest.{ MayVerb, OptionalTests } import akka.persistence.scalatest.{ MayVerb, OptionalTests }
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.collection.immutable.Seq
import akka.actor._ import akka.actor._
import akka.persistence._ import akka.persistence._
import akka.persistence.JournalProtocol._ import akka.persistence.JournalProtocol._
import akka.testkit._ import akka.testkit._
import akka.util.unused
import com.typesafe.config._ import com.typesafe.config._
object JournalSpec { object JournalSpec {
@ -68,7 +66,7 @@ abstract class JournalSpec(config: Config)
* test case. `pid` is the `persistenceId` that will be used in the test. * test case. `pid` is the `persistenceId` that will be used in the test.
* This method may be needed to clean pre-existing events from the log. * This method may be needed to clean pre-existing events from the log.
*/ */
def preparePersistenceId(pid: String): Unit = () def preparePersistenceId(@unused pid: String): Unit = ()
/** /**
* Implementation may override and return false if it does not * Implementation may override and return false if it does not
@ -79,7 +77,7 @@ abstract class JournalSpec(config: Config)
def journal: ActorRef = def journal: ActorRef =
extension.journalFor(null) extension.journalFor(null)
def replayedMessage(snr: Long, deleted: Boolean = false, confirms: Seq[String] = Nil): ReplayedMessage = def replayedMessage(snr: Long, deleted: Boolean = false): ReplayedMessage =
ReplayedMessage(PersistentImpl(s"a-${snr}", snr, pid, "", deleted, Actor.noSender, writerUuid)) ReplayedMessage(PersistentImpl(s"a-${snr}", snr, pid, "", deleted, Actor.noSender, writerUuid))
def writeMessages(fromSnr: Int, toSnr: Int, pid: String, sender: ActorRef, writerUuid: String): Unit = { def writeMessages(fromSnr: Int, toSnr: Int, pid: String, sender: ActorRef, writerUuid: String): Unit = {
@ -203,7 +201,7 @@ abstract class JournalSpec(config: Config)
receiverProbe.expectMsg(replayedMessage(i)) receiverProbe.expectMsg(replayedMessage(i))
} }
receiverProbe2.expectNoMsg(200.millis) receiverProbe2.expectNoMessage(200.millis)
} }
"not reset highestSequenceNr after message deletion" in { "not reset highestSequenceNr after message deletion" in {

View file

@ -19,7 +19,7 @@ trait OptionalTests {
if (flag.value) if (flag.value)
try test try test
catch { catch {
case ex: Exception => case _: Exception =>
throw new AssertionError( throw new AssertionError(
"Implementation did not pass this spec. " + "Implementation did not pass this spec. " +
"If your journal will be (by definition) unable to abide the here tested rule, you can disable this test," + "If your journal will be (by definition) unable to abide the here tested rule, you can disable this test," +

View file

@ -24,7 +24,6 @@ object AkkaDisciplinePlugin extends AutoPlugin with ScalafixSupport {
"akka-actor-typed-tests", "akka-actor-typed-tests",
"akka-bench-jmh", "akka-bench-jmh",
"akka-bench-jmh-typed", "akka-bench-jmh-typed",
"akka-persistence-tck",
"akka-stream-tests-tck") "akka-stream-tests-tck")
val strictProjects = Set("akka-discovery", "akka-protobuf", "akka-coordination") val strictProjects = Set("akka-discovery", "akka-protobuf", "akka-coordination")