Skip to content

Commit

Permalink
#107 qulice 0.22.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Aug 24, 2022
1 parent 8eddbd5 commit c8c5bc2
Show file tree
Hide file tree
Showing 23 changed files with 93 additions and 94 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -293,7 +293,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
<plugin>
<groupId>com.qulice</groupId>
<artifactId>qulice-maven-plugin</artifactId>
<version>0.21.1</version>
<version>0.22.0</version>
<configuration>
<excludes combine.children="append">
<exclude>findbugs:.*</exclude>
Expand Down
Expand Up @@ -41,10 +41,10 @@
* Test of XML features with Saxon.
* @since 0.17
*/
public final class SaxonSampleTest {
final class SaxonSampleTest {

@Test
public void buildsDocument() throws Exception {
void buildsDocument() throws Exception {
MatcherAssert.assertThat(
new Xembler(
new Directives().add("root")
Expand All @@ -56,7 +56,7 @@ public void buildsDocument() throws Exception {
}

@Test
public void appliesChangesToNode() throws Exception {
void appliesChangesToNode() throws Exception {
final Node node = new XMLDocument("<doc/>").node();
new Xembler(
new Directives().xpath("/doc")
Expand Down
Expand Up @@ -41,10 +41,10 @@
* Test of XML features with Xerces.
* @since 0.17
*/
public final class XercesSampleTest {
final class XercesSampleTest {

@Test
public void buildsDocument() throws Exception {
void buildsDocument() throws Exception {
MatcherAssert.assertThat(
new Xembler(
new Directives().add("root")
Expand All @@ -56,7 +56,7 @@ public void buildsDocument() throws Exception {
}

@Test
public void appliesChangesToNode() throws Exception {
void appliesChangesToNode() throws Exception {
final Node node = new XMLDocument("<doc/>").node();
new Xembler(
new Directives().xpath("/doc")
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/xembly/AddDirectiveTest.java
Expand Up @@ -40,10 +40,10 @@
*
* @since 0.1
*/
public final class AddDirectiveTest {
final class AddDirectiveTest {

@Test
public void addsNodesToCurrentNodes() throws Exception {
void addsNodesToCurrentNodes() throws Exception {
final Iterable<Directive> dirs = new Directives(
"ADD 'root'; ADD 'foo'; ADD 'x'; UP; UP; ADD 'bar'; UP; ADD 'bar';"
);
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/xembly/AddIfDirectiveTest.java
Expand Up @@ -42,10 +42,10 @@
*
* @since 0.1
*/
public final class AddIfDirectiveTest {
final class AddIfDirectiveTest {

@Test
public void addsNodesToCurrentNodes() throws Exception {
void addsNodesToCurrentNodes() throws Exception {
final Iterable<Directive> dirs = new Directives(
"ADD 'root'; ADD 'foo'; UP; ADDIF 'bar'; UP; ADDIF 'bar';"
);
Expand All @@ -62,7 +62,7 @@ public void addsNodesToCurrentNodes() throws Exception {
}

@Test
public void addsDomNodesDirectly() throws Exception {
void addsDomNodesDirectly() throws Exception {
final Document dom = DocumentBuilderFactory.newInstance()
.newDocumentBuilder().newDocument();
final Element root = dom.createElement("xxx");
Expand Down
9 changes: 4 additions & 5 deletions src/test/java/org/xembly/ArgTest.java
Expand Up @@ -39,11 +39,10 @@
*
* @since 0.1
*/
public final class ArgTest {
final class ArgTest {

@Test
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
public void escapesAndUnescaped() throws Exception {
void escapesAndUnescaped() throws Exception {
final String[] texts = {
"",
"123",
Expand All @@ -59,15 +58,15 @@ public void escapesAndUnescaped() throws Exception {
}

@Test
public void rejectsToEscapeInvalidXmlChars() {
void rejectsToEscapeInvalidXmlChars() {
Assertions.assertThrows(
XmlContentException.class,
() -> new Arg("\u001b\u0000").toString()
);
}

@Test
public void rejectsToUnEscapeInvalidXmlChars() {
void rejectsToUnEscapeInvalidXmlChars() {
Assertions.assertThrows(
XmlContentException.class,
() -> Arg.unescape("&#27;&#0000;")
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/org/xembly/AttrDirectiveTest.java
Expand Up @@ -43,10 +43,10 @@
*
* @since 0.1
*/
public final class AttrDirectiveTest {
final class AttrDirectiveTest {

@Test
public void addsAttributesToCurrentNodes() throws Exception {
void addsAttributesToCurrentNodes() throws Exception {
final Iterable<Directive> dirs = new Directives(
StringUtils.join(
new String[]{
Expand All @@ -68,7 +68,7 @@ public void addsAttributesToCurrentNodes() throws Exception {
}

@Test
public void addsDomAttributesDirectly() throws Exception {
void addsDomAttributesDirectly() throws Exception {
final Document dom = DocumentBuilderFactory.newInstance()
.newDocumentBuilder().newDocument();
final Element root = dom.createElement("xxx");
Expand All @@ -88,7 +88,7 @@ public void addsDomAttributesDirectly() throws Exception {
}

@Test
public void addsCaseSensitiveAttributesDirectly() throws Exception {
void addsCaseSensitiveAttributesDirectly() throws Exception {
final Document dom = DocumentBuilderFactory.newInstance()
.newDocumentBuilder().newDocument();
final Element root = dom.createElement("f");
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/xembly/CommentDirectiveTest.java
Expand Up @@ -40,10 +40,10 @@
*
* @since 0.1
*/
public final class CommentDirectiveTest {
final class CommentDirectiveTest {

@Test
public void addsComment() throws Exception {
void addsComment() throws Exception {
final Iterable<Directive> dirs = new Directives(
"ADD 'root'; ADD 'foo'; COMMENT 'How are you?';"
);
Expand Down
36 changes: 18 additions & 18 deletions src/test/java/org/xembly/DirectivesTest.java
Expand Up @@ -50,10 +50,10 @@
* @since 0.1
*/
@SuppressWarnings({"PMD.TooManyMethods", "PMD.AvoidDuplicateLiterals"})
public final class DirectivesTest {
final class DirectivesTest {

@Test
public void makesXmlDocument() throws Exception {
void makesXmlDocument() throws Exception {
MatcherAssert.assertThat(
XhtmlMatchers.xhtml(
new Xembler(
Expand All @@ -73,39 +73,39 @@ public void makesXmlDocument() throws Exception {
}

@Test
public void parsesIncomingGrammar() {
void parsesIncomingGrammar() {
final Iterable<Directive> dirs = new Directives(
"XPATH '//orders[@id=\"152\"]'; SET 'test';"
);
MatcherAssert.assertThat(dirs, Matchers.iterableWithSize(2));
}

@Test
public void throwsOnBrokenGrammar() {
void throwsOnBrokenGrammar() {
Assertions.assertThrows(
SyntaxException.class,
() -> new Directives("not a xembly at all")
);
}

@Test
public void throwsOnBrokenXmlContent() {
void throwsOnBrokenXmlContent() {
Assertions.assertThrows(
SyntaxException.class,
() -> new Directives("ADD '\u001b';")
);
}

@Test
public void throwsOnBrokenEscapedXmlContent() {
void throwsOnBrokenEscapedXmlContent() {
Assertions.assertThrows(
SyntaxException.class,
() -> new Directives("ADD '&#27;';")
);
}

@Test
public void addsMapOfValues() throws Exception {
void addsMapOfValues() throws Exception {
final Document dom = DocumentBuilderFactory.newInstance()
.newDocumentBuilder().newDocument();
dom.appendChild(dom.createElement("root"));
Expand All @@ -127,15 +127,15 @@ public void addsMapOfValues() throws Exception {
}

@Test
public void ingoresEmptyInput() {
void ingoresEmptyInput() {
MatcherAssert.assertThat(
new Directives("\n\t \r"),
Matchers.emptyIterable()
);
}

@Test
public void performsFullScaleModifications() throws Exception {
void performsFullScaleModifications() throws Exception {
final String script = new Directives()
.add("html").attr("xmlns", "http://www.w3.org/1999/xhtml")
.add("body")
Expand All @@ -155,7 +155,7 @@ public void performsFullScaleModifications() throws Exception {
}

@Test
public void copiesExistingNode() throws Exception {
void copiesExistingNode() throws Exception {
final Document dom = DocumentBuilderFactory.newInstance()
.newDocumentBuilder().newDocument();
final Iterable<Directive> copy = Directives.copyOf(
Expand All @@ -182,7 +182,7 @@ public void copiesExistingNode() throws Exception {
}

@Test
public void appendsExistingNode() throws Exception {
void appendsExistingNode() throws Exception {
final Document dom = DocumentBuilderFactory.newInstance()
.newDocumentBuilder().newDocument();
new Xembler(
Expand All @@ -207,7 +207,7 @@ public void appendsExistingNode() throws Exception {
}

@Test
public void addsElementsCaseSensitively() throws Exception {
void addsElementsCaseSensitively() throws Exception {
MatcherAssert.assertThat(
new Xembler(new Directives().add("XHtml").addIf("Body")).xml(),
XhtmlMatchers.hasXPaths(
Expand All @@ -218,7 +218,7 @@ public void addsElementsCaseSensitively() throws Exception {
}

@Test
public void convertsToString() {
void convertsToString() {
final Directives dirs = new Directives();
for (int idx = 0; idx < Tv.TEN; ++idx) {
dirs.add("HELLO");
Expand All @@ -234,7 +234,7 @@ public void convertsToString() {
}

@Test
public void pushesAndPopsCursor() throws Exception {
void pushesAndPopsCursor() throws Exception {
MatcherAssert.assertThat(
XhtmlMatchers.xhtml(
new Xembler(
Expand All @@ -255,7 +255,7 @@ public void pushesAndPopsCursor() throws Exception {
}

@Test
public void prefixesItemsWithNamespaces() throws Exception {
void prefixesItemsWithNamespaces() throws Exception {
MatcherAssert.assertThat(
new Xembler(
new Directives()
Expand All @@ -269,7 +269,7 @@ public void prefixesItemsWithNamespaces() throws Exception {

@Test
@Disabled
public void acceptsFromMultipleThreads() throws Exception {
void acceptsFromMultipleThreads() throws Exception {
final Directives dirs = new Directives().add("mt6");
new Callable<Void>() {
@Parallel(threads = Tv.FIFTY)
Expand All @@ -291,7 +291,7 @@ public Void call() {
}

@Test
public void addsComments() throws Exception {
void addsComments() throws Exception {
MatcherAssert.assertThat(
new Xembler(
new Directives()
Expand All @@ -303,7 +303,7 @@ public void addsComments() throws Exception {
}

@Test
public void appendsDirs() {
void appendsDirs() {
MatcherAssert.assertThat(
new Directives().add("0").append(
new Directives().add("1")
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/xembly/DomStackTest.java
Expand Up @@ -40,10 +40,10 @@
*
* @since 0.21
*/
public final class DomStackTest {
final class DomStackTest {

@Test
public void addsAndRetrieves() throws Exception {
void addsAndRetrieves() throws Exception {
final Directive.Stack stack = new DomStack();
final Directive.Cursor first = Mockito.mock(Directive.Cursor.class);
final Directive.Cursor second = Mockito.mock(Directive.Cursor.class);
Expand All @@ -60,7 +60,7 @@ public void addsAndRetrieves() throws Exception {
}

@Test
public void throwsExceptionOnEmpty() {
void throwsExceptionOnEmpty() {
Assertions.assertThrows(
ImpossibleModificationException.class,
() -> new DomStack().pop()
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/xembly/NsDirectiveTest.java
Expand Up @@ -42,9 +42,9 @@
* Validates NsDirective class.
* @since 0.19.3
*/
public final class NsDirectiveTest {
final class NsDirectiveTest {
@Test
public void setsNsAttr() throws Exception {
void setsNsAttr() throws Exception {
final Document dom = DocumentBuilderFactory.newInstance()
.newDocumentBuilder().newDocument();
final Element root = dom.createElement("f");
Expand Down
10 changes: 5 additions & 5 deletions src/test/java/org/xembly/PiDirectiveTest.java
Expand Up @@ -43,10 +43,10 @@
* Test case for {@link PiDirective}.
* @since 0.9
*/
public final class PiDirectiveTest {
final class PiDirectiveTest {

@Test
public void addsProcessingInstructionsToDom() throws Exception {
void addsProcessingInstructionsToDom() throws Exception {
final Iterable<Directive> dirs = new Directives(
StringUtils.join(
new String[] {
Expand All @@ -69,7 +69,7 @@ public void addsProcessingInstructionsToDom() throws Exception {
}

@Test
public void addsProcessingInstructionsDirectlyToDom() throws Exception {
void addsProcessingInstructionsDirectlyToDom() throws Exception {
final Document dom = DocumentBuilderFactory.newInstance()
.newDocumentBuilder().newDocument();
final Element root = dom.createElement("xxx");
Expand All @@ -85,7 +85,7 @@ public void addsProcessingInstructionsDirectlyToDom() throws Exception {
}

@Test
public void addsProcessingInstructionsToDomRoot() throws Exception {
void addsProcessingInstructionsToDomRoot() throws Exception {
final Iterable<Directive> dirs = new Directives(
"XPATH '/'; PI 'alpha' 'beta \u20ac'; ADD 'x4';"
);
Expand All @@ -101,7 +101,7 @@ public void addsProcessingInstructionsToDomRoot() throws Exception {
}

@Test
public void prependsProcessingInstructionsToDomRoot() throws Exception {
void prependsProcessingInstructionsToDomRoot() throws Exception {
MatcherAssert.assertThat(
new Xembler(new Directives("PI 'a' 'b'; ADD 'c';")).xml(),
Matchers.containsString("<?a b?><c/>")
Expand Down

0 comments on commit c8c5bc2

Please sign in to comment.