5adf19852c0d5af7188664bcb9d9e6175b46c7aevboxsync/*
5adf19852c0d5af7188664bcb9d9e6175b46c7aevboxsync * CDDL HEADER START
1484d57fe5c0f7efa25f6c8240ed3aa12a6ad929vboxsync *
5adf19852c0d5af7188664bcb9d9e6175b46c7aevboxsync * The contents of this file are subject to the terms of the
5adf19852c0d5af7188664bcb9d9e6175b46c7aevboxsync * Common Development and Distribution License, Version 1.0 only
5adf19852c0d5af7188664bcb9d9e6175b46c7aevboxsync * (the "License"). You may not use this file except in compliance
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * with the License.
928baac153b00b3b93afa35a974cc3fd52cc978avboxsync *
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * You can obtain a copy of the license at
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * trunk/opends/resource/legal-notices/OpenDS.LICENSE
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * See the License for the specific language governing permissions
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * and limitations under the License.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync *
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * When distributing Covered Code, include this CDDL HEADER in each
c790218a6fe2b6d004a5ba933eecc24552c463aevboxsync * file and include the License file at
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * add the following below this CDDL HEADER, with the fields enclosed
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * by brackets "[]" replaced with your own identifying information:
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * Portions Copyright [yyyy] [name of copyright owner]
5adf19852c0d5af7188664bcb9d9e6175b46c7aevboxsync *
a3adfb382510ac27c1eb1c76fec0d801e8cfeb2avboxsync * CDDL HEADER END
27537ffef7291d0bb3a24e459a6b94c65586defevboxsync *
5adf19852c0d5af7188664bcb9d9e6175b46c7aevboxsync *
a93baf6a4dd93fefbb91dbc1cc45a4ae1bcd18eevboxsync * Copyright 2008 Sun Microsystems, Inc.
a93baf6a4dd93fefbb91dbc1cc45a4ae1bcd18eevboxsync * Portions Copyright 2013 ForgeRock AS
1a8be88b5b9a6353e5efdb82fddd5093dd78b3e3vboxsync */
a93baf6a4dd93fefbb91dbc1cc45a4ae1bcd18eevboxsync
a93baf6a4dd93fefbb91dbc1cc45a4ae1bcd18eevboxsyncThe purpose of the parsing tool is to parse comments from the functional test xml files.
a93baf6a4dd93fefbb91dbc1cc45a4ae1bcd18eevboxsyncThe comments must have preset tags in order for the them to be properly captured by the
a93baf6a4dd93fefbb91dbc1cc45a4ae1bcd18eevboxsyncparsing tool. This README files will describe what is needed in the comments of
a93baf6a4dd93fefbb91dbc1cc45a4ae1bcd18eevboxsyncthe functional test xml files, and how to build and run the parsing tool.
a93baf6a4dd93fefbb91dbc1cc45a4ae1bcd18eevboxsync
a93baf6a4dd93fefbb91dbc1cc45a4ae1bcd18eevboxsync***Function Test XML Files - Test Group Tags***
735540f036965d584304791cceb494511321ab8dvboxsync
de4157257515400c2c25373591135f110227b68cvboxsyncEach directory will be assumed to contain the tests within a test group.
de4157257515400c2c25373591135f110227b68cvboxsyncEach test group needs to have the following tags.......
1a8be88b5b9a6353e5efdb82fddd5093dd78b3e3vboxsync
a93baf6a4dd93fefbb91dbc1cc45a4ae1bcd18eevboxsync#@TestGroupName
ab50347e9a302448690793ae65f61272c491b012vboxsync#@TestGroupPurpose
65acc9a737d682ad726d06327bf6f6ecc6eb7e83vboxsync#@TestSubgroupName [only necessary for some test groups, like Security]
65acc9a737d682ad726d06327bf6f6ecc6eb7e83vboxsync
65acc9a737d682ad726d06327bf6f6ecc6eb7e83vboxsyncIt is not critical in which xml file or where in the xml file these tags are located,
65acc9a737d682ad726d06327bf6f6ecc6eb7e83vboxsyncas long as the xml file is in the proper directory for the test group. For convenience,
65acc9a737d682ad726d06327bf6f6ecc6eb7e83vboxsyncthe tags for the test group should be near the top of the xml file which is used
65acc9a737d682ad726d06327bf6f6ecc6eb7e83vboxsyncfor setting up for the test group test cases.
ab50347e9a302448690793ae65f61272c491b012vboxsync
ab50347e9a302448690793ae65f61272c491b012vboxsyncThe following is an example for the test group, functional-tests/testcases/security/pwd_storage,
ab50347e9a302448690793ae65f61272c491b012vboxsyncand is located in file, security_setup_pwd_storage.xml
ab50347e9a302448690793ae65f61272c491b012vboxsync
ab50347e9a302448690793ae65f61272c491b012vboxsync <!---
ab50347e9a302448690793ae65f61272c491b012vboxsync Place group-specific test information here.
ab50347e9a302448690793ae65f61272c491b012vboxsync #@TestGroupName Security
ab50347e9a302448690793ae65f61272c491b012vboxsync #@TestGroupPurpose To test the security functionality.
ab50347e9a302448690793ae65f61272c491b012vboxsync #@TestSubgroupName Password Storage Schemes
ab50347e9a302448690793ae65f61272c491b012vboxsync -->
a93baf6a4dd93fefbb91dbc1cc45a4ae1bcd18eevboxsync
5adf19852c0d5af7188664bcb9d9e6175b46c7aevboxsyncSome test groups will not have the tag, #@TestSubgroupName.
5adf19852c0d5af7188664bcb9d9e6175b46c7aevboxsync
27537ffef7291d0bb3a24e459a6b94c65586defevboxsyncFor instance, the test group tags for the Backend group are
5adf19852c0d5af7188664bcb9d9e6175b46c7aevboxsync
<!--
Place group-specific test information here.
#@TestGroupName Backends
#@TestGroupPurpose To test the backend functionality.
-->
***Function Test XML Files - Test Suite Tags***
Each xml file will be treated as a test suite. Each file should contain the following tags......
#@TestSuiteName
#@TestSuitePurpose
#@TestSuiteGroup
#@TestScript
The tags should be located near the top of each file. The exact location is not critical.
The following example is from the test suite, MD5 Tests, which is located in
functional-tests/testcases/security/pwd_storage/security_pwd_MD5.xml.
<!---
Place suite-specific test information here.
#@TestSuiteName MD5 Tests
#@TestSuitePurpose Test the MD5 storage scheme.
#@TestSuiteGroup MD5 Storage Scheme Tests
#@TestScript security_pwd_MD5.xml
-->
***Function Test XML Files - Test Case Tags***
Each functional test xml file will have multiple test cases.
Each test case should have the following tags........
#@TestMarker
#@TestName
#@TestIssue
#@TestPurpose
#@TestPreamble
#@TestStep
#@TestPostamble
#@TestResult
The tags should be located near the beginning of each test case.
The #@TestMarker should match the value of #@TestSuiteName. The parsing tool needs this
correlation to match each test case with the proper test suite.
The #@TestIssue should be the number in IssueTracker that corresponds to the feature or defect
which this test case is testing. Do not add the hyperlink to the issue web page.
The parsing tool adds the hyperlink when it runs.
As many #@TestStep tags may used to define the steps that are involved in each test case.
There should be one #@TestStep tag for each step. There is no limit to the number of test
steps which may be defined. Each test step may have multiple lines.
The #@TestResult may have multiple lines.
The following example is from the file,
functional-tests/testcases/security/pwd_storage/security_pwd_MD5.xml
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker MD5 Tests
#@TestName MD5 Preamble
#@TestIssue xyz
#@TestPurpose Change password storage scheme to MD5.
#@TestPreamble none
#@TestStep Client calls ldapmodify
with the filename to the appropriate file.
#@TestPostamble none
#@TestResult Success if OpenDS returns 0
-->
The following is another example from the file,
functional-tests/testcases/security/pwd_storage/security_pwd_MD5.xml
Note that this example contains three test steps.
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker MD5 Tests
#@TestName MD5 Test 1
#@TestIssue xyz
#@TestPurpose Test MD5 password storage scheme.
#@TestPreamble none
#@TestStep Admin changes a user's password to convert
so it is stored as MD5 scheme.
#@TestStep The user binds with the new password.
#@TestStep Admin retrieves the user's password and
checks for the required {MD5} prefix.
#@TestPostamble none
#@TestResult Success if OpenDS returns 0 for the ldap
operations and the password has the {MD5} prefix.
-->
***Building the Parser Tool***
No other packages are necessary for building the java files other than those
that come with the jvm. Java version 1.5.0 was used to build the java files.
Command line build while in the directory containing the java files.....
javac *.java
***Running the Parser Tool***
Three parameters are required to run the parsing tool from the command line, directory-to-testcase-files,
directory-for-output-files, and file format.
Command line execution.....
java -cp [path-to-class-files] GenerateOpenDSTestSpecs [directory-to-testcase-files] [directory-for-output-files] [file format]
The directory-to-testcase-files is the directory from where the parsing tool will begin searching
for functional test files to parse. The parsing tool will only search one or two levels below
the value for this parameter.
The directory-for-output-files is where the parsing tool will place the output xml files.
The file format is necessary because the same code is used for the unit-integration tests where
java files are parsed for test specifications rather than xml files. The file format must be
"xml" for the functional tests.
An example command line execution of the parsing tool would be
java -cp /export/ParseTestCode GenerateOpenDSTestSpecs /export/src/opends/tests/functional-tests/testcases /export/testspecs xml
where
the class files for the parsing tool are in /export/ParseTestCode
the directory-to-testcase-files is /export/src/opends/tests/functional-tests/testcases
the directory-for-output-files is /export/testspecs
the file format is xml.