Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Jan 6, 2016
2 parents 1a9e29a + d12b26f commit c0b59ec
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
11 changes: 11 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,17 @@
<url>http://www.qulice.com</url>
</site>
</distributionManagement>
<dependencyManagement>
<dependencies>
<!-- Manual jcabi-xml version override until parent POM declares
version 0.17.1 or higher -->
<dependency>
<groupId>com.jcabi</groupId>
<artifactId>jcabi-xml</artifactId>
<version>0.17.1</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
Expand Down
3 changes: 1 addition & 2 deletions qulice-xml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,14 @@
<dependency>
<groupId>com.jcabi</groupId>
<artifactId>jcabi-xml</artifactId>
<version>0.15</version>
<!--
@todo #280 This version of jcabi-xml retries if the connection
to the host of the schema document is reset. However I don't know
how to trigger the "connection reset" condition for testing. We
should find a way to test whether it does retry if this happens.
See issues https://github.com/jcabi/jcabi-xml/issues/32 and
https://github.com/teamed/qulice/issues/280 for background
details.
details.
-->
</dependency>
<dependency>
Expand Down
16 changes: 16 additions & 0 deletions qulice-xml/src/test/java/com/qulice/xml/XmlValidatorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
* @author Yegor Bugayenko (yegor@tpc2.com)
* @version $Id$
*/
@SuppressWarnings("PMD.TooManyMethods")
public final class XmlValidatorTest {

/**
Expand Down Expand Up @@ -71,6 +72,21 @@ public void passesValidationOnCorrectFile() throws Exception {
validator.validate(env);
}

/**
* Should fail validation for XML without schema specified.
* @throws Exception If something wrong happens inside.
*/
@Test(expected = ValidationException.class)
public void failValidationWithoutSchema() throws Exception {
new XmlValidator(true).validate(new Environment.Mock()
.withFile(
"src/main/resources/noschema.xml",
// @checkstyle LineLength (1 line)
"<Configuration><Appenders><Console name=\"CONSOLE\" target=\"SYSTEM_OUT\"><PatternLayout pattern=\"[%p] %t %c: %m%n\"/></Console></Appenders></Configuration>"
)
);
}

/**
* XmlValidator can inform about missing end of line at the and of file.
* @throws Exception In case of error.
Expand Down

0 comments on commit c0b59ec

Please sign in to comment.