All Downloads are FREE. Search and download functionalities are using the official Maven repository.

im.yagni.driveby.tracking.Event.scala Maven / Gradle / Ivy

The newest version!
package im.yagni.driveby.tracking

import im.yagni.driveby.{Example, Specification}

trait Event {
  val at = System.currentTimeMillis()
  //TODO: this blows, use traits to determine types
  val exampleId = -1L
  val browserId = -1L
  val specificationId = -1L
}

case class BrowserOpenRequested(browserType: String, override val browserId: Long) extends Event
case class BrowserOpened(browserType: String, override val browserId: Long) extends Event
case class BrowserOpenFailed(browserType: String) extends Event
case class BrowserCloseFailed(override val browserId: Long) extends Event
case class BrowserClosed(override val browserId: Long) extends Event
case class BrowserWritten(override val exampleId: Long, override val browserId: Long) extends Event
case class BrowserTaken(override val exampleId: Long, override val browserId: Long) extends Event
case class BrowserTakeRequested(override val exampleId: Long) extends Event

case class Info(message: String, override val exampleId: Long) extends Event

case class SpecificationStarted(specification: Specification) extends Event {
  def name = specification.name
  override val specificationId = specification.id
}
case class SpecificationFinished(specification: Specification) extends Event {
  override val specificationId = specification.id
}

case class ExampleStarted(specification: Specification, example: Example) extends Event {
  def name = specification.name + "." + example.description
  override val exampleId = example.id
}

case class ExampleFinished(specification: Specification, example: Example) extends Event {
  def name = specification.name + "." + example.description
  override val exampleId = example.id
}

case class ExampleFailed(specification: Specification, example: Example) extends Event {
  def name = specification.name + "." + example.description
  override val exampleId = example.id
}

case class BrowserCommand(command: String, override val exampleId: Long) extends Event




© 2015 - 2024 Weber Informatics LLC | Privacy Policy