2788N/A/*
2788N/A * CDDL HEADER START
2788N/A *
2788N/A * The contents of this file are subject to the terms of the
2788N/A * Common Development and Distribution License, Version 1.0 only
2788N/A * (the "License"). You may not use this file except in compliance
2788N/A * with the License.
2788N/A *
6982N/A * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
6982N/A * or http://forgerock.org/license/CDDLv1.0.html.
2788N/A * See the License for the specific language governing permissions
2788N/A * and limitations under the License.
2788N/A *
2788N/A * When distributing Covered Code, include this CDDL HEADER in each
6982N/A * file and include the License file at legal-notices/CDDLv1_0.txt.
6982N/A * If applicable, add the following below this CDDL HEADER, with the
6982N/A * fields enclosed by brackets "[]" replaced with your own identifying
6982N/A * information:
2788N/A * Portions Copyright [yyyy] [name of copyright owner]
2788N/A *
2788N/A * CDDL HEADER END
2788N/A *
2788N/A *
3215N/A * Copyright 2008 Sun Microsystems, Inc.
6184N/A * Portions Copyright 2013 ForgeRock AS
2788N/A */
2788N/A
2788N/AThe purpose of the parsing tool is to parse comments from the functional test xml files.
2788N/AThe comments must have preset tags in order for the them to be properly captured by the
2788N/Aparsing tool. This README files will describe what is needed in the comments of
2788N/Athe functional test xml files, and how to build and run the parsing tool.
2788N/A
2788N/A***Function Test XML Files - Test Group Tags***
2788N/A
2788N/AEach directory will be assumed to contain the tests within a test group.
2788N/AEach test group needs to have the following tags.......
2788N/A
2788N/A#@TestGroupName
2788N/A#@TestGroupPurpose
2788N/A#@TestSubgroupName [only necessary for some test groups, like Security]
2788N/A
2788N/AIt is not critical in which xml file or where in the xml file these tags are located,
2788N/Aas long as the xml file is in the proper directory for the test group. For convenience,
2788N/Athe tags for the test group should be near the top of the xml file which is used
2788N/Afor setting up for the test group test cases.
2788N/A
2788N/AThe following is an example for the test group, functional-tests/testcases/security/pwd_storage,
2788N/Aand is located in file, security_setup_pwd_storage.xml
2788N/A
2788N/A <!---
2788N/A Place group-specific test information here.
2788N/A #@TestGroupName Security
2788N/A #@TestGroupPurpose To test the security functionality.
2788N/A #@TestSubgroupName Password Storage Schemes
2788N/A -->
2788N/A
2788N/ASome test groups will not have the tag, #@TestSubgroupName.
2788N/A
2788N/AFor instance, the test group tags for the Backend group are
2788N/A
2788N/A <!--
2788N/A Place group-specific test information here.
2788N/A #@TestGroupName Backends
2788N/A #@TestGroupPurpose To test the backend functionality.
2788N/A -->
2788N/A
2788N/A***Function Test XML Files - Test Suite Tags***
2788N/A
2788N/AEach xml file will be treated as a test suite. Each file should contain the following tags......
2788N/A
2788N/A#@TestSuiteName
2788N/A#@TestSuitePurpose
2788N/A#@TestSuiteGroup
2788N/A#@TestScript
2788N/A
2788N/AThe tags should be located near the top of each file. The exact location is not critical.
2788N/A
2788N/AThe following example is from the test suite, MD5 Tests, which is located in
2788N/Afunctional-tests/testcases/security/pwd_storage/security_pwd_MD5.xml.
2788N/A
2788N/A <!---
2788N/A Place suite-specific test information here.
2788N/A #@TestSuiteName MD5 Tests
2788N/A #@TestSuitePurpose Test the MD5 storage scheme.
2788N/A #@TestSuiteGroup MD5 Storage Scheme Tests
2788N/A #@TestScript security_pwd_MD5.xml
2788N/A -->
2788N/A
2788N/A***Function Test XML Files - Test Case Tags***
2788N/A
2788N/AEach functional test xml file will have multiple test cases.
2788N/AEach test case should have the following tags........
2788N/A
2788N/A#@TestMarker
2788N/A#@TestName
2788N/A#@TestIssue
2788N/A#@TestPurpose
2788N/A#@TestPreamble
2788N/A#@TestStep
2788N/A#@TestPostamble
2788N/A#@TestResult
2788N/A
2788N/AThe tags should be located near the beginning of each test case.
2788N/A
2788N/AThe #@TestMarker should match the value of #@TestSuiteName. The parsing tool needs this
2788N/Acorrelation to match each test case with the proper test suite.
2788N/A
2788N/AThe #@TestIssue should be the number in IssueTracker that corresponds to the feature or defect
2788N/Awhich this test case is testing. Do not add the hyperlink to the issue web page.
2788N/AThe parsing tool adds the hyperlink when it runs.
2788N/A
2788N/AAs many #@TestStep tags may used to define the steps that are involved in each test case.
2788N/AThere should be one #@TestStep tag for each step. There is no limit to the number of test
2788N/Asteps which may be defined. Each test step may have multiple lines.
2788N/A
2788N/AThe #@TestResult may have multiple lines.
2788N/A
2788N/AThe following example is from the file,
2788N/Afunctional-tests/testcases/security/pwd_storage/security_pwd_MD5.xml
2788N/A
2788N/A <!---
2788N/A Place test-specific test information here.
2788N/A The tag, TestMarker, must be the same as the tag, TestSuiteName.
2788N/A #@TestMarker MD5 Tests
2788N/A #@TestName MD5 Preamble
6184N/A #@TestIssue xyz
2788N/A #@TestPurpose Change password storage scheme to MD5.
2788N/A #@TestPreamble none
2788N/A #@TestStep Client calls ldapmodify
2788N/A with the filename to the appropriate file.
2788N/A #@TestPostamble none
2788N/A #@TestResult Success if OpenDS returns 0
2788N/A -->
2788N/A
2788N/AThe following is another example from the file,
2788N/Afunctional-tests/testcases/security/pwd_storage/security_pwd_MD5.xml
2788N/ANote that this example contains three test steps.
2788N/A
2788N/A <!---
2788N/A Place test-specific test information here.
2788N/A The tag, TestMarker, must be the same as the tag, TestSuiteName.
2788N/A #@TestMarker MD5 Tests
2788N/A #@TestName MD5 Test 1
6184N/A #@TestIssue xyz
2788N/A #@TestPurpose Test MD5 password storage scheme.
2788N/A #@TestPreamble none
2788N/A #@TestStep Admin changes a user's password to convert
2788N/A so it is stored as MD5 scheme.
2788N/A #@TestStep The user binds with the new password.
2788N/A #@TestStep Admin retrieves the user's password and
2788N/A checks for the required {MD5} prefix.
2788N/A #@TestPostamble none
2788N/A #@TestResult Success if OpenDS returns 0 for the ldap
2788N/A operations and the password has the {MD5} prefix.
2788N/A -->
2788N/A
2788N/A***Building the Parser Tool***
2788N/A
2788N/ANo other packages are necessary for building the java files other than those
2788N/Athat come with the jvm. Java version 1.5.0 was used to build the java files.
2788N/A
2788N/ACommand line build while in the directory containing the java files.....
2788N/Ajavac *.java
2788N/A
2788N/A***Running the Parser Tool***
2788N/A
2788N/AThree parameters are required to run the parsing tool from the command line, directory-to-testcase-files,
2788N/Adirectory-for-output-files, and file format.
2788N/A
2788N/ACommand line execution.....
2788N/Ajava -cp [path-to-class-files] GenerateOpenDSTestSpecs [directory-to-testcase-files] [directory-for-output-files] [file format]
2788N/A
2788N/AThe directory-to-testcase-files is the directory from where the parsing tool will begin searching
2788N/Afor functional test files to parse. The parsing tool will only search one or two levels below
2788N/Athe value for this parameter.
2788N/A
2788N/AThe directory-for-output-files is where the parsing tool will place the output xml files.
2788N/A
2788N/AThe file format is necessary because the same code is used for the unit-integration tests where
2788N/Ajava files are parsed for test specifications rather than xml files. The file format must be
2788N/A"xml" for the functional tests.
2788N/A
2788N/AAn example command line execution of the parsing tool would be
2788N/Ajava -cp /export/ParseTestCode GenerateOpenDSTestSpecs /export/src/opends/tests/functional-tests/testcases /export/testspecs xml
2788N/A
2788N/Awhere
2788N/Athe class files for the parsing tool are in /export/ParseTestCode
2788N/Athe directory-to-testcase-files is /export/src/opends/tests/functional-tests/testcases
2788N/Athe directory-for-output-files is /export/testspecs
2788N/Athe file format is xml.
2788N/A
2788N/A
2788N/A
2788N/A