jmgarridopaz / bluezone

An example application implementing Hexagonal Architecture

Home Page:https://jmgarridopaz.github.io/content/hexagonalarchitecture-ig/intro.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test Results

valentinacupac opened this issue · comments

I have executed the instructions in README for running the project. My next question is - where can I see the test report (i.e., showing tests passing/failing). Thanks in advance!

"ForParkingCars" port tests:

I use Cucumber. It generates an URL with the report that looks like this:

https://reports.cucumber.io/reports/d8b5cadb-5625-4ac0-a06b-5ed9e0f0ddcb

The long uuid changes for each execution.

The concrete URL of your execution is output in the console when you run the script "run_bluezone.sh":

cucumber_report

"ForCheckingCars" port tests:

I use TestNG. It generates reports at the following folder in the computer where you run the script:

<path_to_the_current_user_home_directory>/.testng/reports

For example: /home/jmgarrido/.testng/reports

It is said in the output console when you run the script "run_bluezone.sh":

testng_output

In that folder you can open either the file "index.html" or "emailable-report.html". They are both tests reports of the same execution, but presenting results in different formats.

testng_folder

I am using IntelliJ, I have the plugins: Gherkin & Cucumber.

I tried to run "ForParkingCars Test" by going to Maven -> "BlueZone - ForParkingCars Test Driver" -> Lifecycle -> Test

image

The output I receive is:

image

Perhaps I am running something wrong, so if you could let me know which commands you're using on the terminal, or on IDE UI...

I don't integrate the tests in the maven life cycle. I program the tests as any other drivers. They are modules on its own, they are not on the "test" folder of the project they are testing, they are not run in the test phase of maven.

I haven't seen anybody doing this like I do. People put tests in the test folder of the hexagon. Me not, my understanding of Hexagonal Architecture is to treat tests as any other driving program that uses the hexagon, they uses it for testing its behavior.

So I launch tests from the startup module (main method of BlueZoneRunner class), configuring the "ports-adapters.properties" file (which is an arg of main), located at the "scripts" folder:

pa_file

I run it from the command line of the operating system (not from the IDE), launching the scripts following the instructions on readme file:

run_instructions

The "build.sh" script runs maven to compile, package, and copy the java 9 modules to a module path.

The "run_bluezone.sh" script launches java (with the module path previously built) for running BlueZoneRunner class (with the "ports-adapters.properties" file as an arg). This class runs the drivers configured in the file, using the driven adapters configured in the file also.

Thanks for the explanation; it works now.