Java Doc for DifferenceEngine.java in  » Testing » XMLUnit » org » custommonkey » xmlunit » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » XMLUnit » org.custommonkey.xmlunit 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.custommonkey.xmlunit.DifferenceEngine

DifferenceEngine
public class DifferenceEngine implements DifferenceConstants(Code)
Class that has responsibility for comparing Nodes and notifying a DifferenceListener of any differences or dissimilarities that are found. Knows how to compare namespaces and nested child nodes, but currently only compares nodes of type ELEMENT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_TYPE_NODE, PROCESSING_INSTRUCTION_NODE and TEXT_NODE. Nodes of other types (eg ENTITY_NODE) will be skipped.
Examples and more at xmlunit. sourceforge.net
See Also:   DifferenceListener.differenceFound(Difference)

Inner Class :final protected static class DifferenceFoundException extends Exception


Constructor Summary
public  DifferenceEngine(ComparisonController controller)
    

Method Summary
public  voidcompare(Node control, Node test, DifferenceListener listener, ElementQualifier elementQualifier)
     Entry point for Node comparison testing.
Parameters:
  control - Control XML to compare
Parameters:
  test - Test XML to compare
Parameters:
  listener - Notified of any Difference differences detectedduring node comparison testing
Parameters:
  elementQualifier - Used to determine which elements qualify forcomparison e.g.
protected  voidcompare(Object expected, Object actual, Node control, Node test, DifferenceListener listener, Difference difference)
     If the expected and actual values are unequal then inform the listener of a difference and throw a DifferenceFoundException.
protected  voidcompareAttribute(Attr control, Attr test, DifferenceListener listener)
    
protected  voidcompareCDataSection(CDATASection control, CDATASection test, DifferenceListener listener)
    
protected  voidcompareComment(Comment control, Comment test, DifferenceListener listener)
    
protected  voidcompareDocument(Document control, Document test, DifferenceListener listener, ElementQualifier elementQualifier)
    
protected  voidcompareDocumentType(DocumentType control, DocumentType test, DifferenceListener listener)
    
protected  voidcompareElement(Element control, Element test, DifferenceListener listener)
    
 voidcompareElementAttributes(Element control, Element test, NamedNodeMap controlAttr, NamedNodeMap testAttr, DifferenceListener listener)
    
protected  voidcompareHasChildNodes(Node control, Node test, DifferenceListener listener)
     Compare the number of children, and if the same, compare the actual children via their NodeLists.
protected  voidcompareNode(Node control, Node test, DifferenceListener listener, ElementQualifier elementQualifier)
     First point of call: if nodes are comparable it compares node values then recurses to compare node children.
protected  booleancompareNodeBasics(Node control, Node test, DifferenceListener listener)
    
protected  voidcompareNodeChildren(Node control, Node test, DifferenceListener listener, ElementQualifier elementQualifier)
     Compare the number of children, and if the same, compare the actual children via their NodeLists.
protected  voidcompareNodeList(NodeList control, NodeList test, int numNodes, DifferenceListener listener, ElementQualifier elementQualifier)
     Compare the contents of two node list one by one, assuming that order of children is NOT important: matching begins at same position in test list as control list.
protected  voidcompareNodeList(List controlChildren, List testChildren, int numNodes, DifferenceListener listener, ElementQualifier elementQualifier)
     Compare the contents of two node list one by one, assuming that order of children is NOT important: matching begins at same position in test list as control list.
protected  voidcompareProcessingInstruction(ProcessingInstruction control, ProcessingInstruction test, DifferenceListener listener)
    
protected  voidcompareRecognizedXMLSchemaInstanceAttribute(Attr control, Attr test, DifferenceListener listener)
    
protected  voidcompareText(Text control, Text test, DifferenceListener listener)
    
protected  voidcompareText(CharacterData control, CharacterData test, DifferenceListener listener)
    
static  ListnodeList2List(NodeList nl)
     Returns the NodeList's Nodes as List, taking ignoreComments into account.
final static  StringnormalizeWhitespace(String orig)
     Replace all whitespace characters with SPACE and collapse consecutive whitespace chars to a single SPACE.


Constructor Detail
DifferenceEngine
public DifferenceEngine(ComparisonController controller)(Code)
Simple constructor
Parameters:
  controller - the instance used to determine whether a Differencedetected by this class should halt further comparison or not
See Also:   ComparisonController.haltComparison(Difference)




Method Detail
compare
public void compare(Node control, Node test, DifferenceListener listener, ElementQualifier elementQualifier)(Code)
Entry point for Node comparison testing.
Parameters:
  control - Control XML to compare
Parameters:
  test - Test XML to compare
Parameters:
  listener - Notified of any Difference differences detectedduring node comparison testing
Parameters:
  elementQualifier - Used to determine which elements qualify forcomparison e.g. when a node has repeated child elements that may occurin any sequence and that sequence is not considered important.



compare
protected void compare(Object expected, Object actual, Node control, Node test, DifferenceListener listener, Difference difference) throws DifferenceFoundException(Code)
If the expected and actual values are unequal then inform the listener of a difference and throw a DifferenceFoundException.
Parameters:
  expected -
Parameters:
  actual -
Parameters:
  control -
Parameters:
  test -
Parameters:
  listener -
Parameters:
  differenceType -
throws:
  DifferenceFoundException -



compareAttribute
protected void compareAttribute(Attr control, Attr test, DifferenceListener listener) throws DifferenceFoundException(Code)
Compare two attributes
Parameters:
  control -
Parameters:
  test -
Parameters:
  listener -
throws:
  DifferenceFoundException -



compareCDataSection
protected void compareCDataSection(CDATASection control, CDATASection test, DifferenceListener listener) throws DifferenceFoundException(Code)
Compare two CDATA sections - unused, kept for backwards compatibility
Parameters:
  control -
Parameters:
  test -
Parameters:
  listener -
throws:
  DifferenceFoundException -



compareComment
protected void compareComment(Comment control, Comment test, DifferenceListener listener) throws DifferenceFoundException(Code)
Compare two comments
Parameters:
  control -
Parameters:
  test -
Parameters:
  listener -
throws:
  DifferenceFoundException -



compareDocument
protected void compareDocument(Document control, Document test, DifferenceListener listener, ElementQualifier elementQualifier) throws DifferenceFoundException(Code)
Compare two Documents for doctype and then element differences
Parameters:
  control -
Parameters:
  test -
Parameters:
  listener -
Parameters:
  elementQualifier -
throws:
  DifferenceFoundException -



compareDocumentType
protected void compareDocumentType(DocumentType control, DocumentType test, DifferenceListener listener) throws DifferenceFoundException(Code)
Compare two DocumentType nodes
Parameters:
  control -
Parameters:
  test -
Parameters:
  listener -
throws:
  DifferenceFoundException -



compareElement
protected void compareElement(Element control, Element test, DifferenceListener listener) throws DifferenceFoundException(Code)
Compare 2 elements and their attributes
Parameters:
  control -
Parameters:
  test -
Parameters:
  listener -
throws:
  DifferenceFoundException -



compareElementAttributes
void compareElementAttributes(Element control, Element test, NamedNodeMap controlAttr, NamedNodeMap testAttr, DifferenceListener listener) throws DifferenceFoundException(Code)



compareHasChildNodes
protected void compareHasChildNodes(Node control, Node test, DifferenceListener listener) throws DifferenceFoundException(Code)
Compare the number of children, and if the same, compare the actual children via their NodeLists.
Parameters:
  control -
Parameters:
  test -
Parameters:
  listener -
throws:
  DifferenceFoundException -



compareNode
protected void compareNode(Node control, Node test, DifferenceListener listener, ElementQualifier elementQualifier) throws DifferenceFoundException(Code)
First point of call: if nodes are comparable it compares node values then recurses to compare node children.
Parameters:
  control -
Parameters:
  test -
Parameters:
  listener -
Parameters:
  elementQualifier -
throws:
  DifferenceFoundException -



compareNodeBasics
protected boolean compareNodeBasics(Node control, Node test, DifferenceListener listener) throws DifferenceFoundException(Code)
Compares node type and node namespace characteristics: basically determines if nodes are comparable further
Parameters:
  control -
Parameters:
  test -
Parameters:
  listener - true if the nodes are comparable further, false otherwise
throws:
  DifferenceFoundException -



compareNodeChildren
protected void compareNodeChildren(Node control, Node test, DifferenceListener listener, ElementQualifier elementQualifier) throws DifferenceFoundException(Code)
Compare the number of children, and if the same, compare the actual children via their NodeLists.
Parameters:
  control -
Parameters:
  test -
Parameters:
  listener -
Parameters:
  elementQualifier -
throws:
  DifferenceFoundException -



compareNodeList
protected void compareNodeList(NodeList control, NodeList test, int numNodes, DifferenceListener listener, ElementQualifier elementQualifier) throws DifferenceFoundException(Code)
Compare the contents of two node list one by one, assuming that order of children is NOT important: matching begins at same position in test list as control list.
Parameters:
  control -
Parameters:
  test -
Parameters:
  numNodes - convenience parameter because the calling method shouldknow the value already
Parameters:
  listener -
Parameters:
  elementQualifier - used to determine which of the child elements inthe test NodeList should be compared to the current child element in thecontrol NodeList.
throws:
  DifferenceFoundException -



compareNodeList
protected void compareNodeList(List controlChildren, List testChildren, int numNodes, DifferenceListener listener, ElementQualifier elementQualifier) throws DifferenceFoundException(Code)
Compare the contents of two node list one by one, assuming that order of children is NOT important: matching begins at same position in test list as control list.
Parameters:
  control -
Parameters:
  test -
Parameters:
  numNodes - convenience parameter because the calling method shouldknow the value already
Parameters:
  listener -
Parameters:
  elementQualifier - used to determine which of the child elements inthe test NodeList should be compared to the current child element in thecontrol NodeList.
throws:
  DifferenceFoundException -



compareProcessingInstruction
protected void compareProcessingInstruction(ProcessingInstruction control, ProcessingInstruction test, DifferenceListener listener) throws DifferenceFoundException(Code)
Compare two processing instructions
Parameters:
  control -
Parameters:
  test -
Parameters:
  listener -
throws:
  DifferenceFoundException -



compareRecognizedXMLSchemaInstanceAttribute
protected void compareRecognizedXMLSchemaInstanceAttribute(Attr control, Attr test, DifferenceListener listener) throws DifferenceFoundException(Code)
Compare two attributes
Parameters:
  control -
Parameters:
  test -
Parameters:
  listener -
throws:
  DifferenceFoundException -



compareText
protected void compareText(Text control, Text test, DifferenceListener listener) throws DifferenceFoundException(Code)
Compare text - unused, kept for backwards compatibility
Parameters:
  control -
Parameters:
  test -
Parameters:
  listener -
throws:
  DifferenceFoundException -



compareText
protected void compareText(CharacterData control, CharacterData test, DifferenceListener listener) throws DifferenceFoundException(Code)
Compare text
Parameters:
  control -
Parameters:
  test -
Parameters:
  listener -
throws:
  DifferenceFoundException -



nodeList2List
static List nodeList2List(NodeList nl)(Code)
Returns the NodeList's Nodes as List, taking ignoreComments into account.



normalizeWhitespace
final static String normalizeWhitespace(String orig)(Code)
Replace all whitespace characters with SPACE and collapse consecutive whitespace chars to a single SPACE.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.