diff --git a/akka-persistence/src/test/scala/akka/persistence/ChannelSpec.scala b/akka-persistence/src/test/scala/akka/persistence/ChannelSpec.scala index 1de0863789..a36a86e297 100644 --- a/akka-persistence/src/test/scala/akka/persistence/ChannelSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/ChannelSpec.scala @@ -186,6 +186,6 @@ abstract class ChannelSpec(config: Config) extends AkkaSpec(config) with Persist } } -class LeveldbChannelSpec extends ChannelSpec(PersistenceSpec.config("leveldb", "channel")) -class InmemChannelSpec extends ChannelSpec(PersistenceSpec.config("inmem", "channel")) +class LeveldbChannelSpec extends ChannelSpec(PersistenceSpec.config("leveldb", "LeveldbChannelSpec")) +class InmemChannelSpec extends ChannelSpec(PersistenceSpec.config("inmem", "InmemChannelSpec")) diff --git a/akka-persistence/src/test/scala/akka/persistence/EventsourcedSpec.scala b/akka-persistence/src/test/scala/akka/persistence/EventsourcedSpec.scala index 35a978cfe2..dd9a609cb1 100644 --- a/akka-persistence/src/test/scala/akka/persistence/EventsourcedSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/EventsourcedSpec.scala @@ -337,5 +337,5 @@ abstract class EventsourcedSpec(config: Config) extends AkkaSpec(config) with Pe } } -class LeveldbEventsourcedSpec extends EventsourcedSpec(PersistenceSpec.config("leveldb", "eventsourced")) -class InmemEventsourcedSpec extends EventsourcedSpec(PersistenceSpec.config("inmem", "eventsourced")) +class LeveldbEventsourcedSpec extends EventsourcedSpec(PersistenceSpec.config("leveldb", "LeveldbEventsourcedSpec")) +class InmemEventsourcedSpec extends EventsourcedSpec(PersistenceSpec.config("inmem", "InmemEventsourcedSpec")) diff --git a/akka-persistence/src/test/scala/akka/persistence/PerformanceSpec.scala b/akka-persistence/src/test/scala/akka/persistence/PerformanceSpec.scala index 87abc6a903..250a0cbd6c 100644 --- a/akka-persistence/src/test/scala/akka/persistence/PerformanceSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/PerformanceSpec.scala @@ -120,7 +120,7 @@ object PerformanceSpec { } } -class PerformanceSpec extends AkkaSpec(PersistenceSpec.config("leveldb", "performance", serialization = "off").withFallback(ConfigFactory.parseString(PerformanceSpec.config))) with PersistenceSpec with ImplicitSender { +class PerformanceSpec extends AkkaSpec(PersistenceSpec.config("leveldb", "PerformanceSpec", serialization = "off").withFallback(ConfigFactory.parseString(PerformanceSpec.config))) with PersistenceSpec with ImplicitSender { import PerformanceSpec._ val warmupCycles = system.settings.config.getInt("akka.persistence.performance.cycles.warmup") diff --git a/akka-persistence/src/test/scala/akka/persistence/PersistenceSpec.scala b/akka-persistence/src/test/scala/akka/persistence/PersistenceSpec.scala index 6becf0bc8d..387b0fd1f0 100644 --- a/akka-persistence/src/test/scala/akka/persistence/PersistenceSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/PersistenceSpec.scala @@ -32,7 +32,7 @@ trait PersistenceSpec extends BeforeAndAfterEach with Cleanup { this: AkkaSpec /** * Prefix for generating a unique name per test. */ - def namePrefix: String = "test" + def namePrefix: String = system.name /** * Creates a processor with current name as constructor argument. @@ -52,8 +52,8 @@ object PersistenceSpec { akka.actor.serialize-messages = ${serialization} akka.persistence.publish-plugin-commands = on akka.persistence.journal.plugin = "akka.persistence.journal.${plugin}" - akka.persistence.journal.leveldb.dir = "target/journal-${test}-spec" - akka.persistence.snapshot-store.local.dir = "target/snapshots-${test}-spec/" + akka.persistence.journal.leveldb.dir = "target/journal-${test}" + akka.persistence.snapshot-store.local.dir = "target/snapshots-${test}/" """) } @@ -68,7 +68,12 @@ trait Cleanup { this: AkkaSpec ⇒ } override protected def afterTermination() { - storageLocations.foreach(FileUtils.deleteDirectory) + storageLocations.foreach { dir ⇒ + if (dir.exists && !FileUtils.deleteQuietly(dir)) { + println(s"Failed to delete [$dir], will try again on exit") + FileUtils.forceDeleteOnExit(dir) + } + } } } diff --git a/akka-persistence/src/test/scala/akka/persistence/PersistentChannelSpec.scala b/akka-persistence/src/test/scala/akka/persistence/PersistentChannelSpec.scala index 9892f82f5f..6e7d57e57d 100644 --- a/akka-persistence/src/test/scala/akka/persistence/PersistentChannelSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/PersistentChannelSpec.scala @@ -98,6 +98,6 @@ abstract class PersistentChannelSpec(config: Config) extends ChannelSpec(config) } } -class LeveldbPersistentChannelSpec extends PersistentChannelSpec(PersistenceSpec.config("leveldb", "persistent-channel")) -class InmemPersistentChannelSpec extends PersistentChannelSpec(PersistenceSpec.config("inmem", "persistent-channel")) +class LeveldbPersistentChannelSpec extends PersistentChannelSpec(PersistenceSpec.config("leveldb", "LeveldbPersistentChannelSpec")) +class InmemPersistentChannelSpec extends PersistentChannelSpec(PersistenceSpec.config("inmem", "InmemPersistentChannelSpec")) diff --git a/akka-persistence/src/test/scala/akka/persistence/ProcessorChannelSpec.scala b/akka-persistence/src/test/scala/akka/persistence/ProcessorChannelSpec.scala index 852967a2ff..88116d6d21 100644 --- a/akka-persistence/src/test/scala/akka/persistence/ProcessorChannelSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/ProcessorChannelSpec.scala @@ -157,6 +157,6 @@ abstract class ProcessorChannelSpec(config: Config) extends AkkaSpec(config) wit } } -class LeveldbProcessorChannelSpec extends ProcessorChannelSpec(PersistenceSpec.config("leveldb", "channel")) -class InmemProcessorChannelSpec extends ProcessorChannelSpec(PersistenceSpec.config("inmem", "channel")) +class LeveldbProcessorChannelSpec extends ProcessorChannelSpec(PersistenceSpec.config("leveldb", "LeveldbProcessorChannelSpec")) +class InmemProcessorChannelSpec extends ProcessorChannelSpec(PersistenceSpec.config("inmem", "InmemProcessorChannelSpec")) diff --git a/akka-persistence/src/test/scala/akka/persistence/ProcessorSpec.scala b/akka-persistence/src/test/scala/akka/persistence/ProcessorSpec.scala index 1e1baa2d02..b46bd6538b 100644 --- a/akka-persistence/src/test/scala/akka/persistence/ProcessorSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/ProcessorSpec.scala @@ -346,5 +346,5 @@ abstract class ProcessorSpec(config: Config) extends AkkaSpec(config) with Persi } } -class LeveldbProcessorSpec extends ProcessorSpec(PersistenceSpec.config("leveldb", "processor")) -class InmemProcessorSpec extends ProcessorSpec(PersistenceSpec.config("inmem", "processor")) +class LeveldbProcessorSpec extends ProcessorSpec(PersistenceSpec.config("leveldb", "LeveldbProcessorSpec")) +class InmemProcessorSpec extends ProcessorSpec(PersistenceSpec.config("inmem", "InmemProcessorSpec")) diff --git a/akka-persistence/src/test/scala/akka/persistence/ProcessorStashSpec.scala b/akka-persistence/src/test/scala/akka/persistence/ProcessorStashSpec.scala index def5001a7e..bedf4c9c6b 100644 --- a/akka-persistence/src/test/scala/akka/persistence/ProcessorStashSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/ProcessorStashSpec.scala @@ -128,5 +128,5 @@ abstract class ProcessorStashSpec(config: Config) extends AkkaSpec(config) with } } -class LeveldbProcessorStashSpec extends ProcessorStashSpec(PersistenceSpec.config("leveldb", "processor-stash")) -class InmemProcessorStashSpec extends ProcessorStashSpec(PersistenceSpec.config("inmem", "processor-stash")) +class LeveldbProcessorStashSpec extends ProcessorStashSpec(PersistenceSpec.config("leveldb", "LeveldbProcessorStashSpec")) +class InmemProcessorStashSpec extends ProcessorStashSpec(PersistenceSpec.config("inmem", "InmemProcessorStashSpec")) diff --git a/akka-persistence/src/test/scala/akka/persistence/SnapshotSpec.scala b/akka-persistence/src/test/scala/akka/persistence/SnapshotSpec.scala index a6d1c0d14c..1898d7578f 100644 --- a/akka-persistence/src/test/scala/akka/persistence/SnapshotSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/SnapshotSpec.scala @@ -41,7 +41,7 @@ object SnapshotSpec { } } -class SnapshotSpec extends AkkaSpec(PersistenceSpec.config("leveldb", "snapshot")) with PersistenceSpec with ImplicitSender { +class SnapshotSpec extends AkkaSpec(PersistenceSpec.config("leveldb", "SnapshotSpec")) with PersistenceSpec with ImplicitSender { import SnapshotSpec._ import SnapshotProtocol._ diff --git a/akka-persistence/src/test/scala/akka/persistence/journal/leveldb/SharedLeveldbJournalSpec.scala b/akka-persistence/src/test/scala/akka/persistence/journal/leveldb/SharedLeveldbJournalSpec.scala index b97150b724..b971169d34 100644 --- a/akka-persistence/src/test/scala/akka/persistence/journal/leveldb/SharedLeveldbJournalSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/journal/leveldb/SharedLeveldbJournalSpec.scala @@ -20,9 +20,9 @@ object SharedLeveldbJournalSpec { persistence { journal { plugin = "akka.persistence.journal.leveldb-shared" - leveldb-shared.store.dir = target/shared-journal + leveldb-shared.store.dir = target/journal-SharedLeveldbJournalSpec } - snapshot-store.local.dir = target/snapshot-store + snapshot-store.local.dir = target/snapshots-SharedLeveldbJournalSpec } remote { enabled-transports = ["akka.remote.netty.tcp"] @@ -63,11 +63,19 @@ object SharedLeveldbJournalSpec { class SharedLeveldbJournalSpec extends AkkaSpec(SharedLeveldbJournalSpec.config) with Cleanup { import SharedLeveldbJournalSpec._ + val storeSystem = ActorSystem("store", ConfigFactory.parseString(SharedLeveldbJournalSpec.config)) + val processorASystem = ActorSystem("processorA", ConfigFactory.parseString(SharedLeveldbJournalSpec.config)) + val processorBSystem = ActorSystem("processorB", ConfigFactory.parseString(SharedLeveldbJournalSpec.config)) + + override protected def afterTermination() { + shutdown(storeSystem) + shutdown(processorASystem) + shutdown(processorBSystem) + super.afterTermination() + } + "A LevelDB store" can { "be shared by multiple actor systems" in { - val storeSystem = ActorSystem("store", ConfigFactory.parseString(SharedLeveldbJournalSpec.config)) - val processorASystem = ActorSystem("processorA", ConfigFactory.parseString(SharedLeveldbJournalSpec.config)) - val processorBSystem = ActorSystem("processorB", ConfigFactory.parseString(SharedLeveldbJournalSpec.config)) val processorAProbe = new TestProbe(processorASystem) val processorBProbe = new TestProbe(processorBSystem) diff --git a/project/AkkaBuild.scala b/project/AkkaBuild.scala index 33ad115091..8366a4ae4b 100644 --- a/project/AkkaBuild.scala +++ b/project/AkkaBuild.scala @@ -1184,7 +1184,7 @@ object Dependencies { object Test { val commonsMath = "org.apache.commons" % "commons-math" % "2.1" % "test" // ApacheV2 - val commonsIo = "commons-io" % "commons-io" % "2.0.1" % "test" // ApacheV2 + val commonsIo = "commons-io" % "commons-io" % "2.4" % "test" // ApacheV2 val commonsCodec = "commons-codec" % "commons-codec" % "1.7" % "test" // ApacheV2 val junit = "junit" % "junit" % "4.10" % "test" // Common Public License 1.0 val logback = "ch.qos.logback" % "logback-classic" % "1.0.13" % "test" // EPL 1.0 / LGPL 2.1