Unable to get ElasticsearchTestCase to work due to dependency hell

I'm trying to use ElasticsearchTestCase in my test framework to start
getting ES deployed in production.

However, I'm in maven dependency hell and wanted some advice.

I'm trying to use this:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/using-elasticsearch-test-classes.html

but when I extend ElasticsearchTestCase and run the tests I get missing
dependencies (see below)

It seems there are 2-4 problem here all exacerbating the issue:

  1. the lucene.version, lucene.maven.version, and elastisearch.version are
    all undefined in the docs so I have to track down what these should be.

  2. I have to add additional repositories (references in the main project
    pom) to get these to work:

    <repository>
        <id>Codehaus Snapshots</id>
        <url>http://repository.codehaus.org/</url>
    </repository>
    <repository>
        <id>Lucene snapshots</id>
    

https://download.elasticsearch.org/lucenesnapshots/1641343

  1. I don't think test-jar pulls in dependencies properly.
    I've never used this feature and instead put my test infra in foo-test so
    that it's a normal dependency. So something seems fishy.

  2. I seem that you're depending on these jars in the main pom.. but for
    some reason they're not being deployed into my project.

... any advice here would be appreciated.

java.lang.NoClassDefFoundError: org/apache/lucene/index/LeafReader
at __randomizedtesting.SeedInfo.seed([B3DCF11EC4F020A1]:0)
at
org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:35)
at
org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:48)
at
org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:65)
at
org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:55)
at
com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
at
com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:365)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.ClassNotFoundException:
org.apache.lucene.index.LeafReader
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at
org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:35)
at
org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:48)
at
org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:65)
at
org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:55)
at
com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
at
com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:365)
at java.lang.Thread.run(Thread.java:724)

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/a10f3167-c739-4763-abe5-f05369496572%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Kevin,

You should look at some plugins code, such as: https://github.com/elasticsearch/elasticsearch-analysis-icu

I think this should help.

Best.

David

Le 25 nov. 2014 à 20:45, Kevin Burton burtonator@gmail.com a écrit :

I'm trying to use ElasticsearchTestCase in my test framework to start getting ES deployed in production.

However, I'm in maven dependency hell and wanted some advice.

I'm trying to use this:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/using-elasticsearch-test-classes.html

but when I extend ElasticsearchTestCase and run the tests I get missing dependencies (see below)

It seems there are 2-4 problem here all exacerbating the issue:

  1. the lucene.version, lucene.maven.version, and elastisearch.version are all undefined in the docs so I have to track down what these should be.

  2. I have to add additional repositories (references in the main project pom) to get these to work:

    <repository>
        <id>Codehaus Snapshots</id>
        <url>http://repository.codehaus.org/</url>
    </repository>
    <repository>
        <id>Lucene snapshots</id>
        <url>https://download.elasticsearch.org/lucenesnapshots/1641343</url>
    </repository>
    
  3. I don't think test-jar pulls in dependencies properly. I've never used this feature and instead put my test infra in foo-test so that it's a normal dependency. So something seems fishy.

  4. I seem that you're depending on these jars in the main pom.. but for some reason they're not being deployed into my project.

... any advice here would be appreciated.

java.lang.NoClassDefFoundError: org/apache/lucene/index/LeafReader
at __randomizedtesting.SeedInfo.seed([B3DCF11EC4F020A1]:0)
at org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:35)
at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:48)
at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:65)
at org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:55)
at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:365)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.index.LeafReader
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:35)
at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:48)
at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:65)
at org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:55)
at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:365)
at java.lang.Thread.run(Thread.java:724)

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/a10f3167-c739-4763-abe5-f05369496572%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/5D468582-A71F-4D1C-9169-F797D381C539%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

yeah.. doing that I am still getting the following no class def error:

... this really sucks. Should just work out of the box. Testing is kind
of the first thing I would expect most people to want to do...

java.lang.NoClassDefFoundError: org/apache/lucene/index/LeafReader

at __randomizedtesting.SeedInfo.seed([5869799789B6B704]:0)

at
org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:35)

at
org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:48)

at
org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:65)

at
org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:55)

at
com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)

at
com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:365)

at java.lang.Thread.run(Thread.java:724)

Caused by: java.lang.ClassNotFoundException:
org.apache.lucene.index.LeafReader

at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

at
org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:35)

at
org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:48)

at
org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:65)

at
org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:55)

at
com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)

at
com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:365)

at java.lang.Thread.run(Thread.java:724)

On Tuesday, November 25, 2014 12:23:02 PM UTC-8, David Pilato wrote:

Hi Kevin,

You should look at some plugins code, such as:
https://github.com/elasticsearch/elasticsearch-analysis-icu

I think this should help.

Best.

David

Le 25 nov. 2014 à 20:45, Kevin Burton <burto...@gmail.com <javascript:>>
a écrit :

I'm trying to use ElasticsearchTestCase in my test framework to start
getting ES deployed in production.

However, I'm in maven dependency hell and wanted some advice.

I'm trying to use this:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/using-elasticsearch-test-classes.html

but when I extend ElasticsearchTestCase and run the tests I get missing
dependencies (see below)

It seems there are 2-4 problem here all exacerbating the issue:

  1. the lucene.version, lucene.maven.version, and elastisearch.version are
    all undefined in the docs so I have to track down what these should be.

  2. I have to add additional repositories (references in the main project
    pom) to get these to work:

    <repository>
        <id>Codehaus Snapshots</id>
        <url>http://repository.codehaus.org/</url>
    </repository>
    <repository>
        <id>Lucene snapshots</id>
        <url>
    

https://download.elasticsearch.org/lucenesnapshots/1641343

  1. I don't think test-jar pulls in dependencies properly.
    I've never used this feature and instead put my test infra in foo-test so
    that it's a normal dependency. So something seems fishy.

  2. I seem that you're depending on these jars in the main pom.. but for
    some reason they're not being deployed into my project.

... any advice here would be appreciated.

java.lang.NoClassDefFoundError: org/apache/lucene/index/LeafReader
at __randomizedtesting.SeedInfo.seed([B3DCF11EC4F020A1]:0)
at
org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:35)
at
org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:48)
at
org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:65)
at
org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:55)
at
com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
at
com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:365)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.ClassNotFoundException:
org.apache.lucene.index.LeafReader
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at
org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:35)
at
org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:48)
at
org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:65)
at
org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:55)
at
com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
at
com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:365)
at java.lang.Thread.run(Thread.java:724)

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/a10f3167-c739-4763-abe5-f05369496572%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/a10f3167-c739-4763-abe5-f05369496572%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/689a504c-cdd1-4303-80bd-8ae35da685ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ended up resolving this. I had to take the 1.4.0 pom and use the
dependencies there instead of the dependencies from master which was
2.0.0-SNAPSHOT...

... things sort of work now but still running into some small problems.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/5d593d01-fcfe-410c-a2ee-dba1862305e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.