cancel
Showing results for 
Search instead for 
Did you mean: 

Maven build in sdk 2.2 fails to run junit tests that access Solr

marco_altieri
Star Contributor
Star Contributor

I used the archetype for "all-in-one" and I modified the sample test case adding a simple lucene query as shown in the attached java file.

When I execute:

   mvn test

the test fails because it seems that Alfresco cannot access Solr (see attached maven.log file).

In this log, I also found a warning:

[INFO] --- alfresco-maven-plugin:2.2.0:refresh (refresh-webscripts-repo-and-share) @ marco-repo-amp ---

[WARNING] Connection failed to localhost:8080, null webapp refresh aborted

Is this the expected behaviour ? What can I do to run a test that accesses solr ?

1 ACCEPTED ANSWER

jego
Star Contributor
Star Contributor

There are 2 alternatives:

I hope this helps.

View answer in original post

3 REPLIES 3

ycoulon
Employee
Employee

Hi,

I was able to reproduce.

The issue is that SolR is not run during the test phase. That's why you get the "java.net.ConnectException: Connection refused" error.

I don't know if there is a way to get SolR run during the test phase.

Maybe you could create an issue on github GitHub - Alfresco/alfresco-sdk: The Alfresco SDK based on Apache Maven, includes support for rapid a...

Development team of the SDK will answer you.

Marco Altieri a écrit:



In this log, I also found a warning:

[INFO] --- alfresco-maven-plugin:2.2.0:refresh (refresh-webscripts-repo-and-share) @ marco-repo-amp ---

[WARNING] Connection failed to localhost:8080, null webapp refresh aborted

That is linked to the hot reloading feature. That feature is for RAD for more information about RAD see : Rapid Application Development (RAD) | Alfresco Documentation

Yann

jego
Star Contributor
Star Contributor

There are 2 alternatives:

I hope this helps.

Thank you Jens.

I did not realise that the issue that you mentioned was closed on a newer version of the SDK.

I guess that with the current SDK 2.2 the workaround is still necessary.