Skip to content

Commit 88abadf

Browse files
committed
[build] improve test setup
- add logback-test.xml to stop logcaptor to spam to terminal during test runs - remove maven-failsafe-plugin configuration as it is not used in this module - cleanup of RangeIndexConfigTest (try-with resources, no exceptions are thrown)
1 parent 3f6ac49 commit 88abadf

File tree

3 files changed

+35
-17
lines changed

3 files changed

+35
-17
lines changed

extensions/indexes/range/pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,6 @@
145145
</classpathDependencyExcludes>
146146
</configuration>
147147
</plugin>
148-
<plugin>
149-
<groupId>org.apache.maven.plugins</groupId>
150-
<artifactId>maven-failsafe-plugin</artifactId>
151-
<configuration>
152-
<classpathDependencyExcludes>
153-
<classpathDependencyExclude>org.apache.logging.log4j:log4j-slf4j-impl</classpathDependencyExclude>
154-
<classpathDependencyExclude>org.apache.logging.log4j:log4j-slf4j2-impl</classpathDependencyExclude>
155-
</classpathDependencyExcludes>
156-
</configuration>
157-
</plugin>
158148
<plugin>
159149
<groupId>org.apache.maven.plugins</groupId>
160150
<artifactId>maven-dependency-plugin</artifactId>

extensions/indexes/range/src/test/java/org/exist/indexing/range/RangeIndexConfigTest.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class RangeIndexConfigTest {
4545
* {@see https://github.com/eXist-db/exist/issues/1339}
4646
*/
4747
@Test
48-
public void errorsHaveSourceContext() throws NoSuchFieldException, IllegalAccessException {
48+
public void errorsHaveSourceContext() {
4949
final String badCreateQName = "tei:persName "; // Note the trailing
5050
final String mockCollectionXConfUri = "/db/system/conf/db/mock/" + DEFAULT_COLLECTION_CONFIG_FILE;
5151

@@ -89,15 +89,16 @@ public void errorsHaveSourceContext() throws NoSuchFieldException, IllegalAccess
8989
final Map<String, String> namespaces = new HashMap<>();
9090
namespaces.put("tei", "http://www.tei-c.org/ns/1.0");
9191

92-
LogCaptor logCaptor = LogCaptor.forClass(RangeIndexConfig.class);
92+
try (LogCaptor logCaptor = LogCaptor.forClass(RangeIndexConfig.class)) {
9393

94-
final RangeIndexConfig config = new RangeIndexConfig(mockConfigNodes, namespaces);
94+
final RangeIndexConfig config = new RangeIndexConfig(mockConfigNodes, namespaces);
9595

96-
assertTrue(logCaptor.getLogs().getFirst()
97-
.contains("Illegal QName: '" + badCreateQName + "'.. QName is invalid: INVALID_LOCAL_PART"));
96+
assertTrue(logCaptor.getLogs().getFirst()
97+
.contains("Illegal QName: '" + badCreateQName + "'.. QName is invalid: INVALID_LOCAL_PART"));
9898

99-
assertTrue(logCaptor.getLogs().getFirst()
100-
.contains("(" + mockCollectionXConfUri + ")"));
99+
assertTrue(logCaptor.getLogs().getFirst()
100+
.contains("(" + mockCollectionXConfUri + ")"));
101+
}
101102

102103
verify(mockConfigNodes, mockConfigNode, mockCreates, mockCreateDocument, mockCreate, mockEmptyNodeList);
103104
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
eXist-db Open Source Native XML Database
5+
Copyright (C) 2001 The eXist-db Authors
6+
7+
8+
http://www.exist-db.org
9+
10+
This library is free software; you can redistribute it and/or
11+
modify it under the terms of the GNU Lesser General Public
12+
License as published by the Free Software Foundation; either
13+
version 2.1 of the License, or (at your option) any later version.
14+
15+
This library is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18+
Lesser General Public License for more details.
19+
20+
You should have received a copy of the GNU Lesser General Public
21+
License along with this library; if not, write to the Free Software
22+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23+
24+
-->
25+
<configuration>
26+
<statusListener class="ch.qos.logback.core.status.NopStatusListener" />
27+
</configuration>

0 commit comments

Comments
 (0)