Blackbox tests are in ORICD-Source/orcid-integration-test/src/test/java/org/orcid/integration/blackbox
-
Complete the ORCID Development Environment Setup
-
Install Firefox 52 ESR, we suggest putting this into your
~/bin
as to not overwrite the default firefox. -
Verify Firefox installation and locate installation directory
find / -name firefox 2>/dev/null
-
Install the latest geckodriver. We suggest putting this into your
~/bin
.
Test data is set up using a whitebox test located at src/test/java/org/orcid/integration/whitebox/SetUpClientsAndUsers.java
The default test data is in the following config files:
- Users: src/test/resources/test-web.properties
- Members/clients: src/test/resources/test-client.properties
-
Select Run > Run Configurations
-
Right click JUnit and select New
-
In the Test tab, set the following options:
- Run a single test:
True
- Project:
orcid-integration-test
- Test class:
org.orcid.integration.whitebox.SetUpClientsAndUsers
- Test runner:
JUnit 4
- Run a single test:
-
In the Arguments tab, set the following VM arguments
-Xmx2g -Dorg.orcid.config.file=classpath:staging-persistence.properties
-
Click Apply, then click Run
-
Goto project directory
cd ~/git/ORCID-Source
-
Run the test with the following arguments
export MAVEN_OPTS="-Xmx2g"; mvn test \ -Dtest=org.orcid.integration.whitebox.SetUpClientsAndUsers \ -DfailIfNoTests=false \ -Dorg.orcid.config.file='classpath:staging-persistence.properties';
This should setup the test data and then run a test that verifies the data was persisted in the database. If this process succeeds, run the blackbox test as follows.
Note: Test data setup above must be run before each Blackbox test run, so that the data is in the correct state to start the Black box test.
-
Make sure that SOLR is up and running on port 8983, per solr-config/README.md
-
Make sure that the following modules are added to Tomcat (stop Tomcat before adding modules):
orcid-api-web orcid-internal-api orcid-pub-web orcid-scheduler-web orcid-web
-
Start Tomcat and wait for it to be up
-
Select Run > Run Configurations
-
Right click JUnit and select New
-
In the Test tab, set the following options:
- Run a single test:
True
- Project:
orcid-integration-test
- Test class:
org.orcid.integration.blackbox.BlackBoxTestSuite
- Test runner:
JUnit 4
- Run a single test:
-
In the Arguments tab, set the following VM arguments (note that you need to insert your
webdriver.firefox.bin
andwebdriver.gecko.driver
paths)-Xmx2g -Dorg.orcid.persistence.db.url=jdbc:postgresql://localhost:5432/orcid -Dorg.orcid.config.file=classpath:test-web.properties,classpath:test-client.properties -Dorg.orcid.persistence.db.dataSource=simpleDataSource -Dorg.orcid.persistence.statistics.db.dataSource=statisticsSimpleDataSource -Dwebdriver.firefox.bin=[path to firefox executable] -Dwebdriver.gecko.driver=[path to geckodriver executable]
-
Click Apply, then click Run
-
Goto project directory
cd ~/git/ORCID-Source
-
Run the test with the following arguments (note that you need to insert your
webdriver.firefox.bin
andwebdriver.gecko.driver
paths)export MAVEN_OPTS="-Xmx2g"; mvn test -DfailIfNoTests=false \ -Dtest=org.orcid.integration.blackbox.BlackBoxTestSuite \ -Dorg.orcid.config.file='classpath:test-web.properties,classpath:test-client.properties' \ -Dorg.orcid.persistence.db.url=jdbc:postgresql://localhost:5432/orcid \ -Dorg.orcid.persistence.db.dataSource=simpleDataSource \ -Dorg.orcid.persistence.statistics.db.dataSource=statisticsSimpleDataSource \ -Dwebdriver.firefox.bin=[path to firefox executable] \ -Dwebdriver.gecko.driver=[path to geckodriver executable]
VM Argument notes:
-
For best results, use Firefox 45 ESR
-
Common Firefox paths: Win:
C:\Program Files (x86)\Mozilla Firefox\firefox.exe
Mac:/Applications/Firefox.app/Contents/MacOS/firefox-bin
-
To run tests with NGINX, adjust the base URIs in the properties files
See LICENSE