Package com.vaadin.flow.testutil
Class TestUtils
java.lang.Object
com.vaadin.flow.testutil.TestUtils
Shared code to use in the unit tests.
- Since:
- 1.0.
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptionstatic FilegetTestFolder(String name) Gets a test folder by its resource name usinggetTestResource(String).static FileAn easy way to get a test jar.static FilegetTestJar(String jarName) Gets a test jar file by its resource name usinggetTestResource(String).static URLgetTestResource(String resourceName) Gets a test resouce by its name using usingClassLoader.getResource(String).listFilesRecursively(File directory) Lists all file (not directories) paths in directory specified.
-
Method Details
-
getTestJar
An easy way to get a test jar. Fails if the file was not found.- Returns:
- test jar file
-
getTestJar
Gets a test jar file by its resource name usinggetTestResource(String).- Parameters:
jarName- the resource name of a jar file- Returns:
- corresponding test jar file
-
getTestFolder
Gets a test folder by its resource name usinggetTestResource(String).- Parameters:
name- the resource name of the folder- Returns:
- corresponding folder
-
getTestResource
Gets a test resouce by its name using usingClassLoader.getResource(String). Fails if the file was not found (null).- Parameters:
resourceName- the resource name- Returns:
- corresponding resource url
-
listFilesRecursively
Lists all file (not directories) paths in directory specified. Fails if directory specified does not exist or is not a directory.- Parameters:
directory- directory to list files in- Returns:
- list of paths, relative to the directory specified
-