I have generated a new barebone alfresco project with SDK4. But when running the command mvn integration-test I get the error below from the default sample tests. I don't have an instance of the ACS running at this point but shouldn't the tests spin an instance up if it detects that there is none? That's how I interpret the explaination on this link https://docs.alfresco.com/5.2/tasks/sdk-test-acs.html
Or do I have to make some configurations in the pom.xml besides using the default?
[INFO] Running test.dk.platformsample.DemoComponentIT [ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0 s <<< FAILURE! - in test.dk.platformsample.DemoComponentIT [ERROR] testChildNodesCount(test.dk.platformsample.DemoComponentIT) Time elapsed: 0 s <<< ERROR! org.apache.http.conn.HttpHostConnectException: Connect to localhost:8080 [localhost/127.0.0.1] failed: Connection refused (Connection refused) Caused by: java.net.ConnectException: Connection refused (Connection refused)
[ERROR] testGetCompanyHome(test.dk.platformsample.DemoComponentIT) Time elapsed: 0 s <<< ERROR! org.apache.http.conn.HttpHostConnectException: Connect to localhost:8080 [localhost/127.0.0.1] failed: Connection refused (Connection refused) Caused by: java.net.ConnectException: Connection refused (Connection refused)
Project structure using SDK4 include the configurarations for docker. Make sure you have installed docker on your machine and its up and running.
To run the itegration test, you can use the run.bat/run.sh file available as part of project structure. It is the easiest option. You can find the instructions in the ReadMe file on how to use these scripts.
You can this command, e.g. i you have windows:
1- Open command prompt
2- Go to the project directory
3- ./run.bat build_test
This command will: build the whole project, recreate the ACS and Share docker images, start the dockerised environment, execute the integration tests from the integration-tests module and stop the environment.
Additionally, you can run all docker-compose commands to build and start the docker containers and then execute mvn verify on integeration test module. I find run.bat/run.sh script much easier than doing these steps one by one. Its up to you.
I had docker and but it was still failing. Turns out I was missing Docker Compose as well.
Is it only possible to run Integration Tests with Docker? I tried to spin up my own instance of alfresco and use maven command to run the tests. However it failed with the error, unable to find webscript test.xml.