joel-costigliola/assertj-core — pull request #172 by mpi (2014-02-09 22:42:51+00:00)
Title: #111: support for xml and xpath assertions

This Pull Request contains following new assertions and methods:
```java
CharSequence.asXml(),
XmlNodeSetAssert.extractingXPath(String),
XmlNodeSetAssert.isEmpty(),
XmlNodeSetAssert.hasSize(int),
XmlNodeSetAssert.contains(String...),
XmlNodeSetAssert.containsOnly(String...),
XmlNodeSetAssert.containsExactly(String...),
XmlNodeAssert.isElement(),
XmlNodeAssert.isAttribute(),
XmlNodeAssert.isComment(),
XmlNodeAssert.isTextNode(),
XmlNodeAssert.isEqualTo(String).
```
Although there is still a hundred of new xml assertions that can be added to this list, I believe this PR is a good starting point.

@joel-costigliola:
While reviewing please look into the following more carefully:
* Instead of implementing ```findingNodeByXPath(String xpath)``` suggested in #111, I have introduced ```extractingXPath(String xpath)``` that return ```XmlNodeSetAssert```. It works in a similar way to ```IterableAssert``` and ```extracting```. I haven't introduced ```findingNodeByXPath(String xpath)``` in the first place, because I believe that extracting multiple elements is a more commonly used scenario. A method ```findingNodeByXPath(String xpath)``` can be introduced later by delegating to ```extractingXPath(String xpath)``` and asserting that the size is equal to 1.
* I have introduced simple DSL for defining expected xml node, eg. attribute node can be created by ```"@attribute='value'"```. For more details please have a look on javadoc of ```XmlNodeSetAssert.isEqualTo(String)```,
* I have introduced an interface ```XmlNodeAssert``` with the following implementations: ```XmlElementAssert```, ```XmlAttributeAssert```, ```XmlTextNodeAssert```, ... . My intention was to create seeds for further more fine-grained assertions on individual node types.

What can be done next:
* ```asXml()``` to ```InputStreamAssert``` and ```FileAssert```,
* methods for finding single xml node: ```findingNodeByXPath(String xpath)```,
* methods for finding single xml node of particular type, eg. ```findingElementByXPath(String xpath)```, ```findingAttributeByXPath(String xpath)```, ...
* assertions valid only for particular types of nodes, eg. ```XmlAttributeAssert.hasValue(String)```, ```XmlElementAssert.hasChildren()```, ...