@OpenApi
public class TestEnvironment
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
TestEnvironment.ProjectFilenameFilter
File name filter to filter MagicDraw loadable files (mdzip, mdxml, zip.xml, and etc).
|
Modifier and Type | Method and Description |
---|---|
static java.io.File |
createFileNameWithPrefix(java.io.File file,
java.lang.String prefix)
Insert specific prefix after file name before file extension.
|
static java.util.List<java.io.File> |
getFiles(java.io.File rootDirectory,
java.io.FilenameFilter filter,
java.util.Collection<java.lang.String> skipNames)
Collects files from root directory and inner directories recursively except those specified to skip.
|
static java.io.File |
getFileWithExtension(java.io.File file,
java.lang.String extension)
Replace MagicDraw project file extension by the given one.
|
static java.io.File |
getOutputDir(java.lang.Class clazz)
Get default directory for specific test case output.
|
static java.util.List<java.io.File> |
getProjects(java.io.File rootDirectory)
Collects MagicDraw project files from specific directory and from its inner directories recursively.
|
static java.util.List<java.io.File> |
getProjects(java.io.File rootDirectory,
java.util.Collection<java.lang.String> skipNames)
Collects MagicDraw projects files from root directory and inner directories recursively except those specified
to skip.
|
static java.util.List<java.io.File> |
getProjects(java.lang.String directory)
Collects MagicDraw projects recursively from the given directory of resource directory.
|
static java.io.File |
getRelativeOutputFile(java.lang.Class clazz,
java.io.File resourceFile)
Creates output file relative to given resource file in specific test case output directory.
|
static java.io.File |
getResourceDir()
Returns test framework resources directory specified by "tests.resources" system property.
|
static java.lang.String[] |
splitFileName(java.lang.String fileName)
Splits MagicDraw project file name to file name and extension.
|
@OpenApi public static java.io.File getResourceDir()
@OpenApi public static java.io.File getRelativeOutputFile(java.lang.Class clazz, java.io.File resourceFile)
clazz
- test case class to create related output file for.resourceFile
- resource file to create related output file for.@OpenApi public static java.io.File getOutputDir(java.lang.Class clazz)
clazz
- Test case class to get output directory for.@OpenApi public static java.util.List<java.io.File> getProjects(java.io.File rootDirectory)
rootDirectory
- Root directory to collect project files recursively from.@OpenApi public static java.io.File createFileNameWithPrefix(java.io.File file, java.lang.String prefix)
file
- file to insert prefix to.prefix
- prefix to insert.@OpenApi public static java.io.File getFileWithExtension(java.io.File file, java.lang.String extension)
file
- File to replace extension.extension
- new extension.@OpenApi public static java.util.List<java.io.File> getFiles(java.io.File rootDirectory, java.io.FilenameFilter filter, @CheckForNull java.util.Collection<java.lang.String> skipNames)
rootDirectory
- Root directory to collect project files recursively from.filter
- only files matching this filter will be returnedskipNames
- the Collection of project file names to skip. Project file is skipped if it
name contains any name defined in skipNames collection or skip.txt file.@OpenApi public static java.util.List<java.io.File> getProjects(java.io.File rootDirectory, @CheckForNull java.util.Collection<java.lang.String> skipNames)
rootDirectory
- Root directory to collect project files recursively from.skipNames
- the Collection of project file names to skip. Project file is skipped if it
name contains any name defined in skipNames collection or skip.txt file.@OpenApi public static java.util.List<java.io.File> getProjects(java.lang.String directory)
directory
- directory name in the resource directory@CheckForNull @OpenApi public static java.lang.String[] splitFileName(java.lang.String fileName)
fileName
- MagicDraw project file name to split.