-
Notifications
You must be signed in to change notification settings - Fork 5
/
SETUP_INSTRUCTIONS.txt
38 lines (28 loc) · 2.06 KB
/
SETUP_INSTRUCTIONS.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
HOW TO DEPLOY:
Make sure you have Java and Maven installed!
If you want to run different Java versions, be sure to set your %JAVA_HOME% and %PATH% variables accordingly.
When doing so, make sure the <maven.compiler.source/> and <maven.compiler.target/> elements in the pom.xml are set accordingly.
(Note: Earlier Java versions may give errors if incompatible with certain XXE fixes)
Setup (Do this only once):
- run: mvn initialize - This installs various custom XML parser JAR files required by some of the unit tests
- run: setExternalSpringConfig.sh - This sets up some config variables used by the Spring framework in the test cases.
To run test cases out of the command line:
- Run mvnTestReport.bat or mvnTestReport.sh
To run test cases out of a web browser:
- Run mvnDeployWebApp.bat or mvnDeployWebApp.sh
- When it gets to "[INFO] Press Ctrl-C to stop the container...", open the UnitTestsWebApp URL shortcut (or navigate to http://localhost:8080/java-security-unit-tests)
- Press Ctrl-C in the command line when done and then terminate the batch job
To run test cases with Contrast:
- Place your contrast.jar file in the base directory (security-unit-tests)
- Run mvnDeployWebAppWithContrast.bat or mvnDeployWebAppWithContrast.sh
- When it gets to "[INFO] Press Ctrl-C to stop the container...", open the UnitTestsWebApp URL shortcut (or navigate to http://localhost:8080/java-security-unit-tests)
- You should see the app running in Contrast
- Press Ctrl-C in the command line when done and then terminate the batch job
NOTE: The custom jar files in the lib folder remove the META-INF/services folder that the respective libraries use to override classes that exist in other test cases.
HOW TO RUN ALL TESTS AUTOMATICALLY:
Make sure you have Python installed and in your path!
- Make sure you have Chrome installed.
- Download ChromeDriver at https://sites.google.com/chromium.org/driver/downloads
- Unzip the executable into the project base directory (or add it to your path manually)
- Deploy the web app
- Run RunAllTests.bat or RunAllTests.sh