org.apache.wink.test.mock
Class TestUtils

java.lang.Object
  extended by org.apache.wink.test.mock.TestUtils

public class TestUtils
extends java.lang.Object


Constructor Summary
TestUtils()
           
 
Method Summary
static javax.xml.parsers.DocumentBuilder createDocumentBuilder()
           
static java.lang.String diffIgnoreUpdateWithAttributeQualifier(java.lang.String expectedFileName, byte[] actual, java.lang.Class<?> cls)
           
static java.io.InputStream getResourceOfSamePackage(java.lang.String name, java.lang.Class<?> cls)
          appends package to the name and returns it as stream.
static byte[] getResourceOfSamePackageAsBytes(java.lang.String name, java.lang.Class<?> cls)
           
static org.w3c.dom.Document getXML(byte[] bs)
           
protected static org.w3c.dom.Document getXML(java.lang.String fileName, java.lang.Class<?> cls)
          returns xml from file.
static java.lang.String packageToPath(java.lang.String packageName)
           
static java.lang.String printPrettyXML(org.w3c.dom.Document doc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestUtils

public TestUtils()
Method Detail

packageToPath

public static java.lang.String packageToPath(java.lang.String packageName)

createDocumentBuilder

public static javax.xml.parsers.DocumentBuilder createDocumentBuilder()
                                                               throws javax.xml.parsers.ParserConfigurationException
Throws:
javax.xml.parsers.ParserConfigurationException

getResourceOfSamePackage

public static java.io.InputStream getResourceOfSamePackage(java.lang.String name,
                                                           java.lang.Class<?> cls)
appends package to the name and returns it as stream.

Parameters:
name -
cls - TODO
Returns:

getResourceOfSamePackageAsBytes

public static byte[] getResourceOfSamePackageAsBytes(java.lang.String name,
                                                     java.lang.Class<?> cls)
                                              throws java.lang.Exception
Throws:
java.lang.Exception

getXML

protected static org.w3c.dom.Document getXML(java.lang.String fileName,
                                             java.lang.Class<?> cls)
                                      throws java.lang.Exception
returns xml from file. Xml must be located in the same package as the current class.

Parameters:
fileName -
cls - TODO
Returns:
Throws:
java.lang.Exception

getXML

public static org.w3c.dom.Document getXML(byte[] bs)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

diffIgnoreUpdateWithAttributeQualifier

public static java.lang.String diffIgnoreUpdateWithAttributeQualifier(java.lang.String expectedFileName,
                                                                      byte[] actual,
                                                                      java.lang.Class<?> cls)
                                                               throws java.lang.Exception
Throws:
java.lang.Exception

printPrettyXML

public static java.lang.String printPrettyXML(org.w3c.dom.Document doc)
                                       throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2009 The Apache Software Foundation. All Rights Reserved.