|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectro.isdc.wro.util.WroTestUtils
public class WroTestUtils
WroTestUtils.
| Constructor Summary | |
|---|---|
WroTestUtils()
|
|
| Method Summary | |
|---|---|
static void |
compare(InputStream expected,
InputStream actual)
Compare if content of expected stream is the same as content of the actual stream. |
static void |
compare(InputStream input,
InputStream expected,
ResourcePostProcessor processor)
|
static void |
compare(Reader resultReader,
Reader expectedReader,
ResourcePostProcessor processor)
Compare contents of two resources (files) by performing some sort of processing on input resource. |
static void |
compare(String expected,
String actual)
Compares two strings by removing trailing spaces & tabs for correct comparison. |
static void |
compareFromDifferentFolders(File sourceFolder,
File targetFolder,
org.apache.commons.io.filefilter.IOFileFilter fileFilter,
ResourcePostProcessor processor)
Process and compare the files which a located in different folders. |
static void |
compareFromDifferentFolders(File sourceFolder,
File targetFolder,
org.apache.commons.io.filefilter.IOFileFilter fileFilter,
Transformer<String> toTargetFileName,
ResourcePostProcessor processor)
|
static void |
compareFromDifferentFolders(File sourceFolder,
File targetFolder,
org.apache.commons.io.filefilter.IOFileFilter fileFilter,
Transformer<String> toTargetFileName,
ResourcePreProcessor preProcessor)
Process and compare the files which a located in different folders. |
static void |
compareFromDifferentFolders(File sourceFolder,
File targetFolder,
ResourcePostProcessor processor)
|
static void |
compareFromDifferentFolders(File sourceFolder,
File targetFolder,
ResourcePreProcessor processor)
Process and compare all the files from the sourceFolder and compare them with the files from the targetFolder. |
static void |
compareFromDifferentFoldersByExtension(File sourceFolder,
File targetFolder,
String extension,
ResourcePostProcessor processor)
TODO run tests in parallel |
static void |
compareFromDifferentFoldersByExtension(File sourceFolder,
File targetFolder,
String extension,
ResourcePreProcessor processor)
|
static void |
compareFromSameFolder(File sourceFolder,
org.apache.commons.io.filefilter.IOFileFilter sourceFileFilter,
Transformer<String> toTargetFileName,
ResourcePostProcessor processor)
Process and compare files from the same folder. |
static void |
compareFromSameFolder(File sourceFolder,
org.apache.commons.io.filefilter.IOFileFilter sourceFileFilter,
Transformer<String> toTargetFileName,
ResourcePreProcessor processor)
|
static void |
compareProcessedResourceContents(String inputResourceUri,
String expectedContentResourceUri,
ResourcePostProcessor processor)
Compare contents of two resources (files) by performing some sort of processing on input resource. |
static void |
compareProcessedResourceContents(String inputResourceUri,
String expectedContentResourceUri,
ResourcePreProcessor processor)
|
static void |
compareSameFolderByExtension(File sourceFolder,
String sourceFileExtension,
String targetFileExtension,
ResourcePostProcessor processor)
Process and compare files from the same folder. |
static void |
compareSameFolderByExtension(File sourceFolder,
String sourceFileExtension,
String targetFileExtension,
ResourcePreProcessor processor)
|
static void |
compareSameFolderByExtension(File sourceFolder,
String sourceFileExtension,
Transformer<String> toTargetFileName,
ResourcePostProcessor processor)
|
static InputStream |
getInputStream(String uri)
|
static InputStream |
getPropertiesStream(Properties properties)
|
static void |
init(WroModelFactory factory)
|
static void |
initProcessor(ResourcePostProcessor processor)
|
static void |
initProcessor(ResourcePreProcessor processor)
|
static void |
runConcurrently(Callable<Void> task)
Runs a task concurrently. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WroTestUtils()
| Method Detail |
|---|
public static InputStream getPropertiesStream(Properties properties)
properties - Properties object to get stream from.
InputStream of the provided properties object.
public static void compareProcessedResourceContents(String inputResourceUri,
String expectedContentResourceUri,
ResourcePostProcessor processor)
throws IOException
inputResourceUri - uri of the resource to process.expectedContentResourceUri - uri of the resource to compare with processed content.processor - a closure used to process somehow the input content.
IOException
public static void compareProcessedResourceContents(String inputResourceUri,
String expectedContentResourceUri,
ResourcePreProcessor processor)
throws IOException
IOException
public static InputStream getInputStream(String uri)
throws IOException
IOExceptionpublic static void init(WroModelFactory factory)
public static void initProcessor(ResourcePreProcessor processor)
public static void initProcessor(ResourcePostProcessor processor)
public static void compare(Reader resultReader,
Reader expectedReader,
ResourcePostProcessor processor)
throws IOException
inputResourceUri - uri of the resource to process.expectedContentResourceUri - uri of the resource to compare with processed content.processor - a closure used to process somehow the input content.
IOException
public static void compare(InputStream input,
InputStream expected,
ResourcePostProcessor processor)
throws IOException
IOException
public static void compare(InputStream expected,
InputStream actual)
throws IOException
expected - InputStream of the expected content.actual - InputStream of the actual content.
IOException
public static void compare(String expected,
String actual)
public static void compareSameFolderByExtension(File sourceFolder,
String sourceFileExtension,
String targetFileExtension,
ResourcePostProcessor processor)
throws IOException
sourceFolder - the folder where the files to compare resides.sourceFileExtension - the extension of the files used to process.targetFileExtension - the extension of the files used to compare with the processed result.processor - ResourcePostProcessor to apply on input files.
IOException
public static void compareSameFolderByExtension(File sourceFolder,
String sourceFileExtension,
String targetFileExtension,
ResourcePreProcessor processor)
throws IOException
IOException
public static void compareSameFolderByExtension(File sourceFolder,
String sourceFileExtension,
Transformer<String> toTargetFileName,
ResourcePostProcessor processor)
throws IOException
sourceFolder - sourceFileExtension - toTargetFileName - processor -
IOExceptionSame as
{@link WroTestUtils#compareSameFolderByExtension(File, String, String, ResourcePostProcessor)}, but let you
define the way target file name is named.
public static void compareFromSameFolder(File sourceFolder,
org.apache.commons.io.filefilter.IOFileFilter sourceFileFilter,
Transformer<String> toTargetFileName,
ResourcePostProcessor processor)
throws IOException
sourceFolder - the folder where the files to compare resides.sourceFileFilter - the IOFileFilter used to select source files (files to be processed).toTargetFileName - the Transformer which creates the name of the target file used to compare with the
source processed content.processor - ResourcePostProcessor to apply on source files.
IOException
public static void compareFromSameFolder(File sourceFolder,
org.apache.commons.io.filefilter.IOFileFilter sourceFileFilter,
Transformer<String> toTargetFileName,
ResourcePreProcessor processor)
throws IOException
IOException
public static void compareFromDifferentFolders(File sourceFolder,
File targetFolder,
org.apache.commons.io.filefilter.IOFileFilter fileFilter,
ResourcePostProcessor processor)
throws IOException
IOException
public static void compareFromDifferentFolders(File sourceFolder,
File targetFolder,
ResourcePreProcessor processor)
throws IOException
IOException
public static void compareFromDifferentFolders(File sourceFolder,
File targetFolder,
ResourcePostProcessor processor)
throws IOException
IOException
public static void compareFromDifferentFoldersByExtension(File sourceFolder,
File targetFolder,
String extension,
ResourcePreProcessor processor)
throws IOException
IOException
public static void compareFromDifferentFoldersByExtension(File sourceFolder,
File targetFolder,
String extension,
ResourcePostProcessor processor)
throws IOException
IOException
public static void compareFromDifferentFolders(File sourceFolder,
File targetFolder,
org.apache.commons.io.filefilter.IOFileFilter fileFilter,
Transformer<String> toTargetFileName,
ResourcePostProcessor processor)
throws IOException
IOException
public static void compareFromDifferentFolders(File sourceFolder,
File targetFolder,
org.apache.commons.io.filefilter.IOFileFilter fileFilter,
Transformer<String> toTargetFileName,
ResourcePreProcessor preProcessor)
throws IOException
sourceFolder - folder where the source files are located.targetFolder - folder where the target files are located.fileFilter - filter used to select files to process.toTargetFileName - Transformer used to identify the target file name based on source file name.preProcessor - ResourcePreProcessor used to process the source files.
IOException
public static void runConcurrently(Callable<Void> task)
throws Exception
task - a Callable to run concurrently.
Exception - if any of the executed tasks fails.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||