Skip to content

Enhancements of assertj module #126

Merged
bodewig merged 14 commits into
xmlunit:masterfrom
krystiankaluzny:master
Jun 29, 2018
Merged

Enhancements of assertj module #126
bodewig merged 14 commits into
xmlunit:masterfrom
krystiankaluzny:master

Conversation

@krystiankaluzny

Copy link
Copy Markdown
Member

Following features were add to assertj module:

  • check validation API, equivalent of ValidationMatcher
  • check value of XPath expresion API, equivalent of EvaluateXPathMatcher

@coveralls

coveralls commented Jun 28, 2018

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.2%) to 91.96% when pulling 6b77198 on krystiankaluzny:master into 23336de on xmlunit:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.02%) to 91.754% when pulling 372d0ca on krystiankaluzny:master into 23336de on xmlunit:master.

@krystiankaluzny

krystiankaluzny commented Jun 28, 2018

Copy link
Copy Markdown
Member Author

I also plan to add compare API (equivalent of CompareMatcher) and after that write something in the user guide.

BTW. Now, maven have problem with TLS in java6 build mode. Downloading artifacts failed with message: Received fatal alert: protocol_version.

Edit: Probably it's related to issue travis-ci/travis-ci#9713

@bodewig

bodewig commented Jun 28, 2018

Copy link
Copy Markdown
Member

I've seen the Java6 failures in other builds of mine before, the TLS stack in Java6 is pretty old and doesn't cope with longer keys or "more modern" ciphers (I think it doesn't even support Diffie-Hellman properly). Most likely Maven central has enabled a TLS feature that Java6 lacks. I'll look into it separately.

Many, many thanks!


Assertions.assertThat(schemaSources)
.isNotNull()
.isNotEmpty()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Hamcrest Matcher allows for an empty list of sources which in the end leads to JAXPValidator using https://docs.oracle.com/javase/7/docs/api/javax/xml/validation/SchemaFactory.html#newSchema() - i.e. schema sources are picked up from the document's xsi:schemaLocation and xsi:noSchemaLocation.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assumed that clients whould know if schemaSources is empty or not and use assertThat(xml).isValid() or assertThat(xml).isValidAgainst(schemaSources) respectively.
But you have right I shouldn't expect that clients would check length of schemaSources

*/
package org.xmlunit.assertj;

import org.assertj.core.api.*;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a nit, but if you happen to touch this class again, please expand the * import. This is nothing that would prevent me from merging the PR, though :-)

@bodewig bodewig mentioned this pull request Jun 28, 2018
@bodewig bodewig merged commit 7ef7815 into xmlunit:master Jun 29, 2018
@bodewig

bodewig commented Jun 29, 2018

Copy link
Copy Markdown
Member

Thanks a lot!

bodewig added a commit that referenced this pull request Jun 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants