Object

akka.persistence.cassandra.testkit

CassandraLauncher

Related Doc: package testkit

Permalink

object CassandraLauncher

Starts Cassandra in current JVM. There can only be one Cassandra instance per JVM, but keyspaces can be used for isolation.

Source
CassandraLauncher.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CassandraLauncher
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class CleanFailedException extends RuntimeException

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val DefaultTestConfigResource: String

    Permalink

    Default config for testing "test-embedded-cassandra.yaml"

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def classpathForResources(resources: String*): Seq[String]

    Permalink

    Use this to locate classpath elements from the current classpath to add to the classpath of the launched Cassandra.

    Use this to locate classpath elements from the current classpath to add to the classpath of the launched Cassandra.

    This is particularly useful if you want a custom logging, you can use this to ensure that the directory that your log file is in is on the classpath of the forked Cassandra process, for example:

    CassandraLauncher.start( cassandraDirectory, CassandraLauncher.DefaultTestConfigResource, clean = true, port = 0, CassandraLauncher.classpathForResources("logback.xml") )

    Files ending with assembly.jar are not included in the result because an assembly jar will likely contain incompatible classes that shouldn't be on the classpath of the Cassandra server, such as incompatible dependency of Guava. Assembly jars are used when running multi-node testing.

    Annotations
    @varargs()
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  11. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. def main(args: Array[String]): Unit

    Permalink

    Main method to start Cassandra, see #start.

    Main method to start Cassandra, see #start. Note that cassandra-all jar must be in classpath.

    port can be defined with -DCassandraLauncher.port=4000, default is the randomPort clean can be defined with -DCassandraLauncher.clean=true, default is false directory can be defined with -DCassandraLauncher.directory=target/embedded-cassandra, default is target/embedded-cassandra configResource yaml configuration loaded from classpath, can be defined with -DCassandraLauncher.configResource=test-embedded-cassandra.yaml, default is defined in CassandraLauncher#DefaultTestConfigResource, i.e. test-embedded-cassandra.yaml

  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  17. lazy val randomPort: Int

    Permalink

    The random free port that will be used if port=0 is specified in the start method.

    The random free port that will be used if port=0 is specified in the start method.

    Calling randomPort before start is not recommended. It will fix the value and won't necessarily reflect the value that is effectively used by the launcher.

  18. def start(cassandraDirectory: File, configResource: String, clean: Boolean, port: Int, classpath: Seq[String], host: Option[String]): Unit

    Permalink

    Start Cassandra

    Start Cassandra

    cassandraDirectory

    the data directory to use

    configResource

    yaml configuration loaded from classpath, default configuration for testing is defined in CassandraLauncher#DefaultTestConfigResource

    clean

    if true all files in the data directory will be deleted before starting Cassandra

    port

    the native_transport_port to use, if 0 a random free port is used, which can be retrieved (before starting) with CassandraLauncher.randomPort.

    classpath

    Any additional jars/directories to add to the classpath. Use CassandraLauncher#classpathForResources to assist in calculating this.

    host

    the host to bind the embeded Cassandra to. If None, then 127.0.0.1 is used.

    Exceptions thrown

    akka.persistence.cassandra.testkit.CassandraLauncher.CleanFailedException if clean is true and removal of the directory fails

  19. def start(cassandraDirectory: File, configResource: String, clean: Boolean, port: Int, classpath: Seq[String]): Unit

    Permalink

    Start Cassandra

    Start Cassandra

    cassandraDirectory

    the data directory to use

    configResource

    yaml configuration loaded from classpath, default configuration for testing is defined in CassandraLauncher#DefaultTestConfigResource

    clean

    if true all files in the data directory will be deleted before starting Cassandra

    port

    the native_transport_port to use, if 0 a random free port is used, which can be retrieved (before starting) with CassandraLauncher.randomPort.

    classpath

    Any additional jars/directories to add to the classpath. Use CassandraLauncher#classpathForResources to assist in calculating this.

    Exceptions thrown

    akka.persistence.cassandra.testkit.CassandraLauncher.CleanFailedException if clean is true and removal of the directory fails

  20. def start(cassandraDirectory: File, configResource: String, clean: Boolean, port: Int): Unit

    Permalink

    Start Cassandra

    Start Cassandra

    cassandraDirectory

    the data directory to use

    configResource

    yaml configuration loaded from classpath, default configuration for testing is defined in CassandraLauncher#DefaultTestConfigResource

    clean

    if true all files in the data directory will be deleted before starting Cassandra

    port

    the native_transport_port to use, if 0 a random free port is used, which can be retrieved (before starting) with CassandraLauncher.randomPort.

    Exceptions thrown

    akka.persistence.cassandra.testkit.CassandraLauncher.CleanFailedException if clean is true and removal of the directory fails

  21. def stop(): Unit

    Permalink

    Stops Cassandra.

    Stops Cassandra. However, it will not be possible to start Cassandra again in same JVM.

  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  23. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

  2. def freePort(): Int

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.104) Internal API, will be removed in future release

Inherited from AnyRef

Inherited from Any

Ungrouped