You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by krishan goyal <kr...@gmail.com> on 2020/09/10 07:00:56 UTC

Unable to get test cases running in Intellij via maven / ant

Hi,

I downloaded the solr source from https://github.com/apache/lucene-solr and
checked out to branch_7_7

Configured intellij using the steps on
https://cwiki.apache.org/confluence/display/LUCENE/HowtoConfigureIntelliJ.
Configured the project SDK too as mentioned.

Facing the following problems

   - Unable to navigate from one class to another. "Find usages" of any
   public method doesn't return any result. Unable to open any class by
   searching for it. Have to navigate in the project structure to open any
   class
   - Not getting the Run/Debug option on any test case
   - Executing any pre configured test configuration fails with the single
   error "Error Running <configuration>. No junit.jar". Have added junit in
   Project Structure -> Modules

I also tried setting it up via maven using steps in
https://github.com/apache/lucene-solr/blob/branch_7_7/dev-tools/maven/README.maven

   - ant generate-maven-artifacts
   - ant get-maven-poms
   - cd maven-build
   - mvn install -DskipTests

I don't think I can execute test cases from inside the maven-build folder
as they are all inside the target of their respective modules.

There are dependency errors in intelliJ if i open either the root folder
(lucene-solr) or the sub folder maven-build in IntelliJ

Root folder - "Package name org.apache.solr.ltr does not correspond to file
path test.org.apache.solr.ltr"
maven-build folder - Facing same issue as with ant and unable to navigate /
find usages. Getting the Run option but Run configuration is broken as it
says
"Class org.apache.solr.ltr.feature.TestEdisMaxSolrFeature not found in
module solr-ltr"

What am I doing wrong and how do I run test cases like TestEdisMaxSolrFeature
on IntelliJ ?

Re: Unable to get test cases running in Intellij via maven / ant

Posted by Erick Erickson <er...@gmail.com>.
I’ve had IntelliJ be uncooperative. Here are some things to try:

1> just try again. First close the project, then  “git -dxf” at the top level will get rid of _everything_ not in Git. Then “ant idea”. Then open/import

2> Invalidate the IntelliJ caches (file>>invalidate caches) and restart IntelliJ

3> build the entire project outside Intellij “cd solr; ant server dist”

This latter is weird and I have no clue whether it really does anything, it’s usually a sign of frustration.

And, of course, no matter what you have to wait until all the indexes are built when you open the project for the first time, see the lower right.

Best,
Erick 

> On Sep 10, 2020, at 3:00 AM, krishan goyal <kr...@gmail.com> wrote:
> 
> Hi,
> 
> I downloaded the solr source from https://github.com/apache/lucene-solr and
> checked out to branch_7_7
> 
> Configured intellij using the steps on
> https://cwiki.apache.org/confluence/display/LUCENE/HowtoConfigureIntelliJ.
> Configured the project SDK too as mentioned.
> 
> Facing the following problems
> 
>   - Unable to navigate from one class to another. "Find usages" of any
>   public method doesn't return any result. Unable to open any class by
>   searching for it. Have to navigate in the project structure to open any
>   class
>   - Not getting the Run/Debug option on any test case
>   - Executing any pre configured test configuration fails with the single
>   error "Error Running <configuration>. No junit.jar". Have added junit in
>   Project Structure -> Modules
> 
> I also tried setting it up via maven using steps in
> https://github.com/apache/lucene-solr/blob/branch_7_7/dev-tools/maven/README.maven
> 
>   - ant generate-maven-artifacts
>   - ant get-maven-poms
>   - cd maven-build
>   - mvn install -DskipTests
> 
> I don't think I can execute test cases from inside the maven-build folder
> as they are all inside the target of their respective modules.
> 
> There are dependency errors in intelliJ if i open either the root folder
> (lucene-solr) or the sub folder maven-build in IntelliJ
> 
> Root folder - "Package name org.apache.solr.ltr does not correspond to file
> path test.org.apache.solr.ltr"
> maven-build folder - Facing same issue as with ant and unable to navigate /
> find usages. Getting the Run option but Run configuration is broken as it
> says
> "Class org.apache.solr.ltr.feature.TestEdisMaxSolrFeature not found in
> module solr-ltr"
> 
> What am I doing wrong and how do I run test cases like TestEdisMaxSolrFeature
> on IntelliJ ?