public class TestDataParser extends Object
CompatibilityTestSuite for a description of the algorithm.CompatibilityTestSuite| Constructor and Description |
|---|
TestDataParser() |
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
findRelativeTestDirectoryNames(String ctsRootPackageName,
String packageFilter,
String pattern)
Find
*.xml files in the classpath and return the list of all resources found, without their filename
extensions. |
List<TestData> |
parseSingleTestData(String syntaxDirectory,
String ctsRootPackageName,
String relativeDirectoryName,
TestDataConfiguration configuration,
ClassLoader classLoader)
Parse data for single test.
|
TestDataConfiguration |
parseTestConfiguration(String syntaxDirectory,
String ctsRootPackageName,
ClassLoader classLoader)
Parse Test configuration by looking for a
config.properties file in the Syntax directory. |
List<TestData> |
parseTestData(String syntaxId,
String ctsRootPackageName,
String packageFilter,
String pattern)
Read all test data.
|
public List<TestData> parseTestData(String syntaxId, String ctsRootPackageName, String packageFilter, String pattern) throws Exception
CompatibilityTestSuite for a detailed explanation of the algorithm.syntaxId - the id of the syntax for which to parse data forctsRootPackageName - the root of the CTS resourcespackageFilter - the regex to filter packagespattern - a regex to decide which *.xml resources should be found. The default should be to
find them allException - in case of error while reading test datapublic List<TestData> parseSingleTestData(String syntaxDirectory, String ctsRootPackageName, String relativeDirectoryName, TestDataConfiguration configuration, ClassLoader classLoader) throws IOException
syntaxDirectory - the syntax directory from where to read syntax test data (eg "xwiki20" for "xwiki/2.0"
syntax)ctsRootPackageName - the root of the CTS resourcesrelativeDirectoryName - the name of the relative directory for a CTS test (eg "/simple/bold/bold1")configuration - the test configurationclassLoader - the class loader from which the test data is read fromIOException - in case of error while reading test datapublic TestDataConfiguration parseTestConfiguration(String syntaxDirectory, String ctsRootPackageName, ClassLoader classLoader) throws Exception
config.properties file in the Syntax directory.syntaxDirectory - the syntax directory under which to look for the configuration filectsRootPackageName - the root of the CTS resourcesclassLoader - the class loader from which the test configuration is read fromException - in case of error while reading test configurationpublic Set<String> findRelativeTestDirectoryNames(String ctsRootPackageName, String packageFilter, String pattern)
*.xml files in the classpath and return the list of all resources found, without their filename
extensions. For example if {ctsDirectoryName}/simple/bold/bold1.*.xml is found, return
simple/bold/bold1.ctsRootPackageName - the root of the CTS resourcespackageFilter - the regex to filter packagespattern - a regex to decide which *.xml resources should be found. The default should be to find
them allCopyright © 2004–2016 XWiki. All rights reserved.