Skip to content

Commit

Permalink
issue-252: Adopt tests for Windows OS
Browse files Browse the repository at this point in the history
  • Loading branch information
Boiarshinov committed Mar 10, 2022
1 parent 0a61c82 commit 50ff600
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public void testAreIdentical_withIgnoreWhitespaceAndTextValue_shouldPass() {
public void testAreIdentical_withIgnoreElementContentWhitespace_shouldFailed() {

thrown.expectAssertionError("Expecting:%n <control instance> and <test instance> to be identical");
thrown.expectAssertionError("Expected text value 'x' but was '%nx '");
thrown.expectAssertionError("Expected text value 'x' but was '\nx '");

String testXml = String.format("<a>%nx <b/>%n</a>");
String controlXml = "<a>x<b/></a>";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void testIsNotValidAgainst_withBrokenXml_andExternallyCreatedSchemaInstan
@Test
public void testIsValidAgainst_withBrokenXml_shouldFail() {

thrown.expectAssertionErrorPattern("^\\nExpecting:\\n <.*" + Pattern.quote(TestResources.TEST_RESOURCE_DIR) + "invalidBook.xml>\\nto be valid but found following problems:\\n.*");
thrown.expectAssertionErrorPattern("^(\\r\\n?|\\n)Expecting:(\\r\\n?|\\n) <.*" + Pattern.quote(TestResources.TEST_RESOURCE_DIR) + "invalidBook.xml>(\\r\\n?|\\n)to be valid but found following problems:(\\r\\n?|\\n).*");
thrown.expectAssertionError("1. line=9; column=8; type=ERROR;" +
" message=cvc-complex-type.2.4.b: The content of element 'Book' is not complete." +
" One of '{\"https://www.xmlunit.org/publishing\":Publisher}' is expected.");
Expand Down Expand Up @@ -167,8 +167,8 @@ public void testIsInvalid_withBrokenXml_shouldPass() {
@Test
public void testIsInvalid_shouldFail() {

thrown.expectAssertionErrorPattern("^\\nExpecting:\\n <.*"
+ Pattern.quote(TestResources.TEST_RESOURCE_DIR) + "BookXsdGenerated.xml>\\nto be invalid");
thrown.expectAssertionErrorPattern("^(\\r\\n?|\\n)Expecting:(\\r\\n?|\\n) <.*"
+ Pattern.quote(TestResources.TEST_RESOURCE_DIR) + "BookXsdGenerated.xml>(\\r\\n?|\\n)to be invalid");

StreamSource xml = new StreamSource(new File(TestResources.TEST_RESOURCE_DIR + "BookXsdGenerated.xml"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public void testAreIdentical_withIgnoreWhitespaceAndTextValue_shouldPass() {
public void testAreIdentical_withIgnoreElementContentWhitespace_shouldFailed() {

thrown.expectAssertionError("Expecting:%n <control instance> and <test instance> to be identical");
thrown.expectAssertionError("Expected text value 'x' but was '%nx '");
thrown.expectAssertionError("Expected text value 'x' but was '\nx '");

String testXml = String.format("<a>%nx <b/>%n</a>");
String controlXml = "<a>x<b/></a>";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void testIsNotValidAgainst_withBrokenXml_andExternallyCreatedSchemaInstan
@Test
public void testIsValidAgainst_withBrokenXml_shouldFail() {

thrown.expectAssertionErrorPattern("^\\nExpecting:\\n <.*" + Pattern.quote(TestResources.TEST_RESOURCE_DIR) + "invalidBook.xml>\\nto be valid but found following problems:\\n.*");
thrown.expectAssertionErrorPattern("^\\RExpecting:\\R <.*" + Pattern.quote(TestResources.TEST_RESOURCE_DIR) + "invalidBook.xml>\\Rto be valid but found following problems:\\R.*");
thrown.expectAssertionError("1. line=9; column=8; type=ERROR;" +
" message=cvc-complex-type.2.4.b: The content of element 'Book' is not complete." +
" One of '{\"https://www.xmlunit.org/publishing\":Publisher}' is expected.");
Expand Down Expand Up @@ -167,8 +167,8 @@ public void testIsInvalid_withBrokenXml_shouldPass() {
@Test
public void testIsInvalid_shouldFail() {

thrown.expectAssertionErrorPattern("^\\nExpecting:\\n <.*"
+ Pattern.quote(TestResources.TEST_RESOURCE_DIR) + "BookXsdGenerated.xml>\\nto be invalid");
thrown.expectAssertionErrorPattern("^\\RExpecting:\\R <.*"
+ Pattern.quote(TestResources.TEST_RESOURCE_DIR) + "BookXsdGenerated.xml>\\Rto be invalid");

StreamSource xml = new StreamSource(new File(TestResources.TEST_RESOURCE_DIR + "BookXsdGenerated.xml"));

Expand Down

0 comments on commit 50ff600

Please sign in to comment.