Skip to content

Instantly share code, notes, and snippets.

@sc6l6d3v
Created October 19, 2016 22:00
Show Gist options
  • Save sc6l6d3v/e5d26561463e41fb02ce068407a0c5a8 to your computer and use it in GitHub Desktop.
Save sc6l6d3v/e5d26561463e41fb02ce068407a0c5a8 to your computer and use it in GitHub Desktop.
package org.vz.watercourse.downstream
import akka.testkit._
import akka.actor.Actor._
import scala.util.{Failure, Success}
import akka.actor._
import org.vz.watercourse.common.model.domain.{Favorite, Purchase, ResumePoint}
import org.vz.watercourse.downstream.actors.lifecycle.Category
import org.vz.watercourse.downstream.runtime.{AppConfig, AppRuntime}
import org.vz.watercourse.downstream.actors.data._
import org.vz.watercourse.downstream.actors.data.reader._
import org.vz.watercourse.downstream.actors.lifecycle.CoordinationActor
import org.vz.watercourse.downstream.services.reals.{RealQueue, realDomain}
import scala.concurrent.Await
import scala.concurrent.duration._
import scala.language.postfixOps
/**
* Created by hkatz on 10/17/16.
*/
object ReaderActorsSpec {
}
class ReaderActorsSpec extends AbsBaseSpec with AppRuntime with AppConfig {
import scala.concurrent.ExecutionContext.Implicits.global
def findRef(path: String): Option[ActorRef] =
try {
Some(Await.result(rtSystem.actorSelection(s"/user/$path").resolveOne(1.second), 10.second))
} catch {
case ex: Throwable => None
}
val ctx = createContext(config)
val coordRef = rtSystem.actorOf(Props(classOf[CoordinationActor], ctx, config), "coordinator")
val coordCheck = findRef("coordinator")
val favReaderRef = findRef("favorites-PIL")
val resPtReaderRef = findRef("resume-points-PIL")
val purReaderRef = findRef("purchases-PIL")
val pildir = Category.Pil
// all refs are from coordinator
//val favReaderRef = system.actorOf(Props(classOf[FavoriteReaderActor], favQueue, coordRef, ctx.reader, pildir))
//val resPtReaderRef = system.actorOf(Props(classOf[ResumePointReaderActor], resPtQueue, coordRef, ctx.reader, pildir))
//val purchReaderRef = system.actorOf(Props(classOf[PurchaseReaderActor], purchQueue, coordRef, ctx.reader, pildir))
override def afterAll: Unit = TestKit.shutdownActorSystem(system)
"A coordinator actor" must {
"have a top config certificate" in {
assert(topconfig.hasPath("certificate"))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment