README revision f71f7a61dec7c9089378d14493ad564a1dedf0b5
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync/*
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync * CDDL HEADER START
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync *
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync * The contents of this file are subject to the terms of the
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync * Common Development and Distribution License, Version 1.0 only
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync * (the "License"). You may not use this file except in compliance
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync * with the License.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync *
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync * You can obtain a copy of the license at
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync * trunk/opends/resource/legal-notices/OpenDS.LICENSE
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync * See the License for the specific language governing permissions
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync * and limitations under the License.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync *
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync * When distributing Covered Code, include this CDDL HEADER in each
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync * file and include the License file at
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync * add the following below this CDDL HEADER, with the fields enclosed
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync * by brackets "[]" replaced with your own identifying information:
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync * Portions Copyright [yyyy] [name of copyright owner]
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync *
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync * CDDL HEADER END
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync *
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync *
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync * Portions Copyright 2007 Sun Microsystems, Inc.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync */
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncThe purpose of the parsing tool is to parse comments from the functional test xml files.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncThe comments must have preset tags in order for the them to be properly captured by the
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncparsing tool. This README files will describe what is needed in the comments of
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncthe functional test xml files, and how to build and run the parsing tool.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync***Function Test XML Files - Test Group Tags***
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncEach directory will be assumed to contain the tests within a test group.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncEach test group needs to have the following tags.......
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync#@TestGroupName
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync#@TestGroupPurpose
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync#@TestSubgroupName [only necessary for some test groups, like Security]
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncIt is not critical in which xml file or where in the xml file these tags are located,
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncas long as the xml file is in the proper directory for the test group. For convenience,
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncthe tags for the test group should be near the top of the xml file which is used
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncfor setting up for the test group test cases.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncThe following is an example for the test group, functional-tests/testcases/security/pwd_storage,
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncand is located in file, security_setup_pwd_storage.xml
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync <!---
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync Place group-specific test information here.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestGroupName Security
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestGroupPurpose To test the security functionality.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestSubgroupName Password Storage Schemes
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync -->
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncSome test groups will not have the tag, #@TestSubgroupName.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncFor instance, the test group tags for the Backend group are
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync <!--
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync Place group-specific test information here.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestGroupName Backends
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestGroupPurpose To test the backend functionality.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync -->
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync***Function Test XML Files - Test Suite Tags***
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncEach xml file will be treated as a test suite. Each file should contain the following tags......
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync#@TestSuiteName
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync#@TestSuitePurpose
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync#@TestSuiteGroup
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync#@TestScript
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncThe tags should be located near the top of each file. The exact location is not critical.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncThe following example is from the test suite, MD5 Tests, which is located in
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncfunctional-tests/testcases/security/pwd_storage/security_pwd_MD5.xml.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync <!---
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync Place suite-specific test information here.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestSuiteName MD5 Tests
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestSuitePurpose Test the MD5 storage scheme.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestSuiteGroup MD5 Storage Scheme Tests
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestScript security_pwd_MD5.xml
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync -->
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync***Function Test XML Files - Test Case Tags***
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncEach functional test xml file will have multiple test cases.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncEach test case should have the following tags........
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync#@TestMarker
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync#@TestName
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync#@TestIssue
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync#@TestPurpose
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync#@TestPreamble
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync#@TestStep
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync#@TestPostamble
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync#@TestResult
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncThe tags should be located near the beginning of each test case.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncThe #@TestMarker should match the value of #@TestSuiteName. The parsing tool needs this
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsynccorrelation to match each test case with the proper test suite.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncThe #@TestIssue should be the number in IssueTracker that corresponds to the feature or defect
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncwhich this test case is testing. Do not add the hyperlink to the issue web page.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncThe parsing tool adds the hyperlink when it runs.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncAs many #@TestStep tags may used to define the steps that are involved in each test case.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncThere should be one #@TestStep tag for each step. There is no limit to the number of test
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncsteps which may be defined. Each test step may have multiple lines.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncThe #@TestResult may have multiple lines.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncThe following example is from the file,
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncfunctional-tests/testcases/security/pwd_storage/security_pwd_MD5.xml
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync <!---
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync Place test-specific test information here.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync The tag, TestMarker, must be the same as the tag, TestSuiteName.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestMarker MD5 Tests
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestName MD5 Preamble
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestIssue 312
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestPurpose Change password storage scheme to MD5.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestPreamble none
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestStep Client calls ldapmodify
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync with the filename to the appropriate file.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestPostamble none
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestResult Success if OpenDS returns 0
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync -->
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncThe following is another example from the file,
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncfunctional-tests/testcases/security/pwd_storage/security_pwd_MD5.xml
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncNote that this example contains three test steps.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync <!---
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync Place test-specific test information here.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync The tag, TestMarker, must be the same as the tag, TestSuiteName.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestMarker MD5 Tests
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestName MD5 Test 1
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestIssue 312
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestPurpose Test MD5 password storage scheme.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestPreamble none
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestStep Admin changes a user's password to convert
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync so it is stored as MD5 scheme.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestStep The user binds with the new password.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestStep Admin retrieves the user's password and
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync checks for the required {MD5} prefix.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestPostamble none
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync #@TestResult Success if OpenDS returns 0 for the ldap
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync operations and the password has the {MD5} prefix.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync -->
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync***Building the Parser Tool***
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncNo other packages are necessary for building the java files other than those
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncthat come with the jvm. Java version 1.5.0 was used to build the java files.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncCommand line build while in the directory containing the java files.....
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncjavac *.java
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync***Running the Parser Tool***
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncThree parameters are required to run the parsing tool from the command line, directory-to-testcase-files,
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncdirectory-for-output-files, and file format.
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsync
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncCommand line execution.....
a206862a46bd0211b89cdd8bb347517c93e1e683vboxsyncjava -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.