Writing edits

This commit is contained in:
U-BASIS\dsmyda 2019-08-13 16:09:28 -04:00
parent c975a72ff3
commit 1750e65ed6

View File

@ -1,7 +1,7 @@
/*! \page unit_functional_testing Functional/Unit Testing in Autopsy /*! \page unit_functional_testing Functional/Unit Testing in Autopsy
\section intro_unit Introduction \section intro_unit Introduction
Autopsy has functional and unit tests for the Autopsy Core and Keyword Search NBMs. These tests can be run at the NBM, package or file level. These tests can be run from Netbeans or the command line using Apache Ant. Each section will demonstrate both approaches. Autopsy has both functional and unit tests for the Core and KeywordSearch NBMs. These tests can be run at the NBM, package or file level via Netbeans or Apache Ant. The following sections will demonstrate how to run at each of these granularities with both Netbeans and Apache Ant.
\section nbm Running Tests by NBM \section nbm Running Tests by NBM
- In Netbeans, right click the Autopsy-Core or Keyword Search NBM and click Test. This will run both the unit and functional tests. - In Netbeans, right click the Autopsy-Core or Keyword Search NBM and click Test. This will run both the unit and functional tests.
@ -9,18 +9,18 @@ Autopsy has functional and unit tests for the Autopsy Core and Keyword Search NB
- Run this ant command from within your autopsy directory. Replace {$NBM} with either KeywordSearch or Core. - Run this ant command from within your autopsy directory. Replace {$NBM} with either KeywordSearch or Core.
- $ ant -f {$NBM} test - $ ant -f {$NBM} test
<br> e.g. $ ant -f Core test <br> e.g. ant -f Core test
You may need an internet connection the first time you run Autopsy Core. The ant target will attempt to reach out to Google Drive to download the required test data. This data is stored in autopsy\\Core\\test\\qa-functional\\data. An internet connection may be required the first time the Autopsy Core tests are run. The ant target will attempt to reach out to Google Drive to download the required test data. This data is stored in autopsy\\Core\\test\\qa-functional\\data.
In the event that tests are failing due to missing test data, manually run the “getTestDataFiles” target from the Core/build.xml script. In the event that tests are failing due to missing test data, manually run the “getTestDataFiles” target from the Core/build.xml script.
\section package Running Tests by Package \section package Running Tests by Package
- In Netbeans, right click the package and click Test. The tests are separated into Unit and Functional packages. - In Netbeans, right click the package and click Test. Unit and Functional tests are separated into their own packages.
\image html unit_functional_testing_package.png \image html unit_functional_testing_package.png
- Run this ant command from within the autopsy directory. Replace {$PACKAGE_NAME} with the name of the test package and {$NBM} with either KeywordSearch or Core. - Run this ant command from within the autopsy directory. Replace {$PACKAGE_NAME} with the name of the test package and {$NBM} with either KeywordSearch or Core.
- $ ant -f {$NBM} -Dtest.includes=org/sleuthkit/autopsy/{$PACKAGE_NAME}/"**"/"*"Test.java test-single - $ ant -f {$NBM} -Dtest.includes=org/sleuthkit/autopsy/{$PACKAGE_NAME}/"**"/"*"Test.java test-single
<br> e.g. $ ant -f Core -Dtest.includes=org/sleuthkit/autopsy/ingest/"**"/"*"Test.java test-single <br> e.g. ant -f Core -Dtest.includes=org/sleuthkit/autopsy/ingest/"**"/"*"Test.java test-single
\section file Running Tests by File \section file Running Tests by File
- In Netbeans, right click the File and click “Test File”. - In Netbeans, right click the File and click “Test File”.
@ -28,5 +28,5 @@ In the event that tests are failing due to missing test data, manually run the
- Run this ant command from within the autopsy directory. Replace {$TEST_NAME} with the name of the .java file, {$NBM} with either KeywordSearch or Core and {$PACKAGE_NAME} with the name of the test package. - Run this ant command from within the autopsy directory. Replace {$TEST_NAME} with the name of the .java file, {$NBM} with either KeywordSearch or Core and {$PACKAGE_NAME} with the name of the test package.
- $ ant -f {$NBM} -Dtest.includes=org/sleuthkit/autopsy/{$PACKAGE_NAME}/{$TEST_NAME} test-single - $ ant -f {$NBM} -Dtest.includes=org/sleuthkit/autopsy/{$PACKAGE_NAME}/{$TEST_NAME} test-single
<br> e.g. $ ant -f KeywordSearch -Dtest.includes=org/sleuthkit/autopsy/keywordsearch/CreditCardValidatorTest.java test-single <br> e.g. ant -f KeywordSearch -Dtest.includes=org/sleuthkit/autopsy/keywordsearch/CreditCardValidatorTest.java test-single
*/ */