2

I am following this link https://www.elastic.co/guide/en/elasticsearch/reference/1.6/using-elasticsearch-test-classes.html

The dependencies are given for maven style

 <dependencies>
      <dependency>
        <groupId>com.carrotsearch.randomizedtesting</groupId>
        <artifactId>randomizedtesting-runner</artifactId>
        <version>${randomizedtesting-runner.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-test-framework</artifactId>
        <version>${lucene.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <version>${elasticsearch.version}</version>
        <scope>test</scope>
        <type>test-jar</type>
      </dependency>
      <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <version>${elasticsearch.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>

I am using sbt so I tried to do the samein build.sbt I am using ES version 1.6.0

"org.elasticsearch" % "elasticsearch" % "1.6.0",
                "org.elasticsearch" % "elasticsearch" % "1.6.0" % "test",
                "org.apache.lucene" % "lucene-test-framework" % "4.10.4" % "test",
                "com.carrotsearch.randomizedtesting" % "randomizedtesting-runner" % "1.6.0" % "test",
                "org.apache.lucene" % "lucene-codecs" % "4.10.4" % "test",
                "org.apache.logging.log4j" % "log4j-core" % "2.8.2",
                "org.apache.logging.log4j" % "log4j-slf4j-impl" % "2.8.2" ,
                "org.apache.logging.log4j" % "log4j-api" % "2.8.2",

I have two questions

<dependency>
    <groupId>org.elasticsearch</groupId>
    <artifactId>elasticsearch</artifactId>
    <version>${elasticsearch.version}</version>
    <scope>test</scope>
    <type>test-jar</type>
  </dependency>
  <dependency>
    <groupId>org.elasticsearch</groupId>
    <artifactId>elasticsearch</artifactId>
    <version>${elasticsearch.version}</version>
    <scope>test</scope>
  </dependency>

How do i write these in sbt i tried to do it like this

"org.elasticsearch" % "elasticsearch" % "1.6.0" % "test",

but i do not know how to wtite in sbt for the below line

<scope>test</scope>
    <type>test-jar</type>

when i try to extend my class with ElasticsearchIntegrationTest it goves me error not found ElasticsearchIntegrationTest also there is nothing to import for test

import org.elasticsearch.test //doing this gives cmpilation error 

My second question is am i using the correct librabry versions for the ES version i am using which is 1.6.0

**Edit ** Mt first query is resolved by doing

"org.elasticsearch" % "elasticsearch" % "1.6.0" % "test" classifier "tests",

Now my second question remainds unanswered please guide

swaheed
  • 3,671
  • 10
  • 42
  • 103

0 Answers0