Skip to content

Commit

Permalink
working on initial commit tests; still failing but executing
Browse files Browse the repository at this point in the history
  • Loading branch information
Damon Rolfs committed Sep 25, 2014
1 parent 547340c commit e4e9d7e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
17 changes: 13 additions & 4 deletions examples/src/test/scala/blog/post/PostModuleSpec.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package blog.post

import akka.testkit.{TestActorRef, TestKit}
import contoso.conference.registration.OrderModule
import akka.testkit.{TestProbe, TestActorRef, TestKit}
//import contoso.conference.registration.OrderModule
import demesne._
import demesne.testkit.{AggregateRootSpec, DemesneModuleFixture}
import org.scalatest.{Suite, Tag}
Expand Down Expand Up @@ -37,11 +37,20 @@ class PostModuleSpec extends AggregateRootSpec[PostModuleSpec]( testkit.system )

"Post Module should" should {
"add content" taggedAs( WIP ) in {
val author = TestProbe()
val id = PostModule.nextId
val content = PostContent( author = "Damon", title = "Add Content", body = "add body content" )
val real = TestActorRef[OrderModule.Order].underlyingActor
real.receive( AddPost(id, content) )
val real = TestActorRef[PostModule.Post](
PostModule.Post.props(
meta = PostModule.aggregateRootType,
authorListing = author.ref
)
).underlyingActor
real receive AddPost(id, content)
real.state shouldBe PostState( id = id, content = content, published = false )
author.expectMsgPF( hint = "PostAdded event (ignored in practice)" ) {
case ReliableMessage( _, Envelope( payload: PostAdded, _ ) ) => payload.content shouldBe content
}
}

"follow happy path" in {
Expand Down
13 changes: 7 additions & 6 deletions project/BuildSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ object BuildSettings {

val VERSION = "0.1.0-SNAPSHOT"

lazy val noPublishing = seq(
lazy val noPublishing = Seq(
publish := (),
publishLocal := ()
)

lazy val basicSettings = seq(
lazy val basicSettings = Seq(
version := VERSION,
organization := "com.github.dmrolfs",
description := "",
startYear := Some(2013),
licenses := Seq("Apache 2" -> new URL("http://www.apache.org/licenses/LICENSE-2.0.txt")),
scalaVersion := "2.11.2",
resolvers ++= Dependencies.resolutionRepos,
coverallsTokenFile := "~/.sbt/peds-coveralls-token.txt",
coverallsTokenFile := "~/.sbt/demesne-coveralls-token.txt",
scalacOptions := Seq(
"-encoding",
"-encoding",
"utf8",
// "-Xlog-implicits",
"-feature",
Expand All @@ -35,10 +35,11 @@ object BuildSettings {
"-Xlog-reflective-calls",
"-Ywarn-adapted-args",
"-Xfatal-warnings"
)
),
testOptions in Test += Tests.Argument( "-oF" )
)

lazy val moduleSettings = basicSettings ++ instrumentSettings ++ coverallsSettings ++ seq(
lazy val moduleSettings = basicSettings ++ instrumentSettings ++ coverallsSettings ++ Seq(
version := VERSION,
isSnapshot := true,
publishTo := Some( Resolver.file("file", new File( Path.userHome.absolutePath + "/dev/dmrolfs.github.com/snapshots" ) ) )
Expand Down
11 changes: 3 additions & 8 deletions testkit/src/main/scala/demesne/testkit/AggregateRootSpec.scala
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
package demesne.testkit

import demesne.{AggregateRootModule, DomainModel}
import org.scalatest.mock.MockitoSugar
import org.scalatest._

import akka.actor.{ActorRef, ActorSystem, PoisonPill, Terminated}
import akka.testkit.{ EventFilter, ImplicitSender, TestKit, TestProbe }
import akka.testkit.{ImplicitSender, TestKit}
import akka.util.Timeout
import org.scalatest._
import org.scalatest.mock.MockitoSugar

import scala.concurrent.duration._
import scala.concurrent.{Await, Future}
import scala.reflect.ClassTag
import scala.util.Failure





/**
* Created by damonrolfs on 9/17/14.
*/
Expand Down

0 comments on commit e4e9d7e

Please sign in to comment.