org.apache.wicket.util.diff
Class DiffUtil

java.lang.Object
  extended by org.apache.wicket.util.diff.DiffUtil

public final class DiffUtil
extends Object

This is a utility class. It serves two purposes.

First: compare a string output generated by wicket with a file's content (expected result).

Second: Create/replace the expected result file with the new content, if a system property has be made available like -Dwicket.replace.expected.results=true

Author:
Juergen Donnerstag

Constructor Summary
DiffUtil()
           
 
Method Summary
static void replaceExpectedResultFile(String document, Class<?> clazz, String file)
          Replace the expected result file with the current output.
static boolean validatePage(String document, Class<?> clazz, String file, boolean failWithAssert)
          Compare the output generated by Wicket ("document") with the a previously generated file which contains the expected result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiffUtil

public DiffUtil()
Method Detail

replaceExpectedResultFile

public static final void replaceExpectedResultFile(String document,
                                                   Class<?> clazz,
                                                   String file)
                                            throws IOException
Replace the expected result file with the current output.

Parameters:
document - How the expected result should look like
clazz - Used to load the file (relative to clazz package)
file - The name of the expected result file to be created
Throws:
IOException

validatePage

public static final boolean validatePage(String document,
                                         Class<?> clazz,
                                         String file,
                                         boolean failWithAssert)
                                  throws IOException
Compare the output generated by Wicket ("document") with the a previously generated file which contains the expected result.

Parameters:
document - Current output
file - Expected output
clazz - Used to load the file (relative to clazz package)
failWithAssert -
Returns:
true, if equal
Throws:
IOException


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.