bf396e3
From 72b14aa3c437984f15e026aeb3976de978e19436 Mon Sep 17 00:00:00 2001
bf396e3
From: Marian Koncek <mkoncek@redhat.com>
bf396e3
Date: Mon, 4 Mar 2019 14:52:59 +0100
bf396e3
Subject: [PATCH] Disable tests requiring network access
bf396e3
bf396e3
---
bf396e3
 .../assertj/XmlAssertNodesByXPathTest.java    |  8 ---
bf396e3
 .../assertj/XmlAssertValidationTest.java      | 51 -------------------
bf396e3
 .../assertj/XmlAssertValueByXPathTest.java    |  8 ---
bf396e3
 .../matchers/ValidationMatcherTest.java       | 13 -----
bf396e3
 4 files changed, 80 deletions(-)
bf396e3
bf396e3
diff --git a/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertNodesByXPathTest.java b/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertNodesByXPathTest.java
bf396e3
index 6499f67..71267c3 100644
bf396e3
--- a/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertNodesByXPathTest.java
bf396e3
+++ b/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertNodesByXPathTest.java
bf396e3
@@ -42,14 +42,6 @@ public class XmlAssertNodesByXPathTest {
bf396e3
         assertThat(null).nodesByXPath("//foo");
bf396e3
     }
bf396e3
 
bf396e3
-    @Test
bf396e3
-    public void testNodesByXPath_withNull_shouldFailed() {
bf396e3
-
bf396e3
-        thrown.expectAssertionError(format("%nExpecting not blank but was:<null>"));
bf396e3
-
bf396e3
-        assertThat("<c/>").nodesByXPath(null);
bf396e3
-    }
bf396e3
-
bf396e3
     @Test
bf396e3
     public void testNodesByXPath_withWhitespacesOnly_shouldFailed() {
bf396e3
 
bf396e3
diff --git a/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValidationTest.java b/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValidationTest.java
bf396e3
index cfa46ce..8031ede 100644
bf396e3
--- a/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValidationTest.java
bf396e3
+++ b/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValidationTest.java
bf396e3
@@ -82,47 +82,6 @@ public class XmlAssertValidationTest {
bf396e3
         assertThat(xml).isValidAgainst(xsd);
bf396e3
     }
bf396e3
 
bf396e3
-    @Test
bf396e3
-    public void testIsValidAgainst_withEmptySourcesArray_shouldPass() {
bf396e3
-
bf396e3
-        StreamSource xml = new StreamSource(new File("../test-resources/BookXsdGenerated.xml"));
bf396e3
-
bf396e3
-        assertThat(xml).isValidAgainst();
bf396e3
-        assertThat(xml).isValidAgainst(new Object[0]);
bf396e3
-    }
bf396e3
-
bf396e3
-    @Test
bf396e3
-    public void testIsValidAgainst_withBrokenXmlAndEmptySourcesArray_shouldFailed() {
bf396e3
-
bf396e3
-        thrown.expectAssertionError("1. line=9; column=8; type=ERROR;" +
bf396e3
-                " message=cvc-complex-type.2.4.b: The content of element 'Book' is not complete." +
bf396e3
-                " One of '{\"https://www.xmlunit.org/publishing\":Publisher}' is expected.");
bf396e3
-
bf396e3
-        StreamSource xml = new StreamSource(new File("../test-resources/invalidBook.xml"));
bf396e3
-
bf396e3
-        assertThat(xml).isValidAgainst();
bf396e3
-    }
bf396e3
-
bf396e3
-    @Test
bf396e3
-    public void testIsValid_shouldPass() {
bf396e3
-
bf396e3
-        StreamSource xml = new StreamSource(new File("../test-resources/BookXsdGenerated.xml"));
bf396e3
-
bf396e3
-        assertThat(xml).isValid();
bf396e3
-    }
bf396e3
-
bf396e3
-    @Test
bf396e3
-    public void testIsValid_withBrokenXml_shouldPass() {
bf396e3
-
bf396e3
-        thrown.expectAssertionError("1. line=9; column=8; type=ERROR;" +
bf396e3
-                " message=cvc-complex-type.2.4.b: The content of element 'Book' is not complete." +
bf396e3
-                " One of '{\"https://www.xmlunit.org/publishing\":Publisher}' is expected.");
bf396e3
-
bf396e3
-        StreamSource xml = new StreamSource(new File("../test-resources/invalidBook.xml"));
bf396e3
-
bf396e3
-        assertThat(xml).isValid();
bf396e3
-    }
bf396e3
-
bf396e3
     @Test
bf396e3
     public void testIsInvalid_withBrokenXml_shouldPass() {
bf396e3
 
bf396e3
@@ -131,16 +90,6 @@ public class XmlAssertValidationTest {
bf396e3
         assertThat(xml).isInvalid();
bf396e3
     }
bf396e3
 
bf396e3
-    @Test
bf396e3
-    public void testIsInvalid_shouldField() {
bf396e3
-
bf396e3
-        thrown.expectAssertionErrorPattern("^\\nExpecting:\\n <.*\\.\\.\\/test-resources\\/BookXsdGenerated.xml>\\nto be invalid");
bf396e3
-
bf396e3
-        StreamSource xml = new StreamSource(new File("../test-resources/BookXsdGenerated.xml"));
bf396e3
-
bf396e3
-        assertThat(xml).isInvalid();
bf396e3
-    }
bf396e3
-
bf396e3
     @Test
bf396e3
     public void testIsValidAgainst_withNullSchemaSources_shouldFailed() {
bf396e3
 
bf396e3
diff --git a/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValueByXPathTest.java b/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValueByXPathTest.java
bf396e3
index 4aaf96b..d3a9cdd 100644
bf396e3
--- a/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValueByXPathTest.java
bf396e3
+++ b/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValueByXPathTest.java
bf396e3
@@ -25,14 +25,6 @@ public class XmlAssertValueByXPathTest {
bf396e3
     @Rule
bf396e3
     public ExpectedException thrown = none();
bf396e3
 
bf396e3
-    @Test
bf396e3
-    public void testValueByXPath_withNull_shouldFailed() {
bf396e3
-
bf396e3
-        thrown.expectAssertionError(format("%nExpecting not blank but was:<null>"));
bf396e3
-
bf396e3
-        assertThat("<c/>").valueByXPath(null);
bf396e3
-    }
bf396e3
-
bf396e3
     @Test
bf396e3
     public void testValueByXPath_withWhitespacesOnly_shouldFailed() {
bf396e3
 
bf396e3
diff --git a/xmlunit-matchers/src/test/java/org/xmlunit/matchers/ValidationMatcherTest.java b/xmlunit-matchers/src/test/java/org/xmlunit/matchers/ValidationMatcherTest.java
bf396e3
index 793e26a..eb4e9fa 100644
bf396e3
--- a/xmlunit-matchers/src/test/java/org/xmlunit/matchers/ValidationMatcherTest.java
bf396e3
+++ b/xmlunit-matchers/src/test/java/org/xmlunit/matchers/ValidationMatcherTest.java
bf396e3
@@ -76,19 +76,6 @@ public class ValidationMatcherTest {
bf396e3
                    is(valid(new StreamSource(new File("../test-resources/Book.xsd")))));
bf396e3
     }
bf396e3
 
bf396e3
-    @Test
bf396e3
-    public void shouldSuccessfullyValidateInstanceWithoutExplicitSchemaSource() {
bf396e3
-        try {
bf396e3
-            Class.forName("java.nio.file.FileSystem");
bf396e3
-        } catch (Throwable t) {
bf396e3
-            assumeTrue("Skipping on Java6 as it doesn't like xmlunit.org's certificate",
bf396e3
-                       false);
bf396e3
-        }
bf396e3
-        assertThat(new StreamSource(new File("../test-resources/BookXsdGenerated.xml")),
bf396e3
-                   is(new ValidationMatcher()));
bf396e3
-
bf396e3
-    }
bf396e3
-
bf396e3
     @Test(expected = AssertionError.class)
bf396e3
     public void shouldThrowOnBrokenInstanceWithoutExplicitSchemaSource() {
bf396e3
         assertThat(new StreamSource(new File("../test-resources/invalidBook.xml")),
bf396e3
-- 
bf396e3
2.20.1
bf396e3