org.apache.shindig.social.dataservice.integration
Class TestUtils

java.lang.Object
  extended by org.apache.shindig.social.dataservice.integration.TestUtils

public class TestUtils
extends java.lang.Object

Collection of utilities to assist in testing.


Constructor Summary
TestUtils()
           
 
Method Summary
static boolean jsonsEqual(java.lang.String json1, java.lang.String json2)
          Tests two JSON strings for equality by performing a deep comparison.
static java.lang.String loadTestFixture(java.lang.String path)
          Loads the contents of the test fixture specified at the given path.
static boolean xmlsEqual(java.lang.String xml1, java.lang.String xml2)
          Tests the DOMs represented by two XML strings for equality by performing a deep comparison.
 
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

loadTestFixture

public static java.lang.String loadTestFixture(java.lang.String path)
                                        throws java.io.IOException
Loads the contents of the test fixture specified at the given path.

Parameters:
path - specifies the file to load the contents of
Returns:
String is the file contents
Throws:
java.io.IOException

jsonsEqual

public static boolean jsonsEqual(java.lang.String json1,
                                 java.lang.String json2)
                          throws java.lang.Exception
Tests two JSON strings for equality by performing a deep comparison.

Parameters:
json1 - represents a JSON object to compare with json2
json2 - represents a JSON object to compare with json1
Returns:
true if the JSON objects are equal, false otherwise
Throws:
java.lang.Exception

xmlsEqual

public static boolean xmlsEqual(java.lang.String xml1,
                                java.lang.String xml2)
                         throws java.lang.Exception
Tests the DOMs represented by two XML strings for equality by performing a deep comparison.

Parameters:
xml1 - represents the XML DOM to compare with xml2
xml2 - represents the XML DOM to compare with xml1 return true if the represented DOMs are equal, false otherwise
Throws:
java.lang.Exception


Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.