Skip to content

Commit 393a55f

Browse files
committed
[bugfix] Enable some tests that were previously not running under Surefire
Closes eXist-db/exist#5903
1 parent a33e34e commit 393a55f

File tree

82 files changed

+2523
-1354
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2523
-1354
lines changed

.circleci/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,12 +527,13 @@ jobs:
527527
else
528528
export JAVA_TOOL_OPTIONS="<< pipeline.parameters.java_tool_options >>"
529529
fi
530-
$MAVEN_BIN test -Dappbundler.skip=true -Ddocker=false -P !mac-dmg-on-mac,!codesign-mac-app,!codesign-mac-dmg,!mac-dmg-on-unix,!installer,!concurrency-stress-tests,!micro-benchmarks,skip-build-dist-archives
530+
$MAVEN_BIN test integration-test -Dappbundler.skip=true -Ddocker=false -P !mac-dmg-on-mac,!codesign-mac-app,!codesign-mac-dmg,!mac-dmg-on-unix,!installer,!concurrency-stress-tests,!micro-benchmarks,skip-build-dist-archives
531531
- run:
532532
name: Save test results
533533
command: |
534534
mkdir -p ~/test-results/junit/
535535
/usr/bin/find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \;
536+
/usr/bin/find . -type f -regex ".*/target/failsafe-reports/.*xml" -exec cp {} ~/test-results/junit/ \;
536537
when: always
537538
- store_test_results:
538539
path: ~/test-results

build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ if "%TARGET%"=="quick" (
9595
) else if "%TARGET%"=="test" (
9696
set "CMD=%BASE_CMD% clean test -Ddependency-check.skip=true"
9797
) else if "%TARGET%"=="site" (
98-
set "CMD=%BASE_CMD% clean test -Ddependency-check.skip=true"
98+
set "CMD=%BASE_CMD% clean verify site -Ddependency-check.skip=true"
9999
) else if "%TARGET%"=="license-check" (
100100
set "CMD=%BASE_CMD% license:check"
101101
) else if "%TARGET%"=="license-format" (

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ if [ "${TARGET}" == "test" ]; then
141141
fi
142142

143143
if [ "${TARGET}" == "site" ]; then
144-
CMD="${BASE_CMD} clean site -Ddependency-check.skip=true"
144+
CMD="${BASE_CMD} clean verify site -Ddependency-check.skip=true"
145145
$CMD
146146
exit 0;
147147
fi
@@ -171,4 +171,4 @@ if [ "${TARGET}" == "dependency-security-check" ]; then
171171
fi
172172

173173
print-useage
174-
exit 0;
174+
exit 0;

elemental-parent/pom.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,10 @@
420420
<java.locale.providers>JRE,CLDR,SPI</java.locale.providers>
421421
<log4j.configurationFile>${project.build.testOutputDirectory}/log4j2.xml</log4j.configurationFile>
422422
</systemPropertyVariables>
423+
<includes>
424+
<include>**/*Test.java</include>
425+
<include>**/*Tests.java</include>
426+
</includes>
423427
</configuration>
424428
</plugin>
425429
<plugin>
@@ -431,6 +435,11 @@
431435
<groupId>org.apache.maven.plugins</groupId>
432436
<artifactId>maven-failsafe-plugin</artifactId>
433437
<version>3.5.3</version>
438+
<configuration>
439+
<includes>
440+
<include>**/*IT.java</include>
441+
</includes>
442+
</configuration>
434443
</plugin>
435444
<plugin>
436445
<groupId>com.github.hazendaz.maven</groupId>
@@ -541,6 +550,26 @@
541550
<groupId>org.apache.maven.plugins</groupId>
542551
<artifactId>maven-surefire-plugin</artifactId>
543552
</plugin>
553+
<plugin>
554+
<groupId>org.apache.maven.plugins</groupId>
555+
<artifactId>maven-failsafe-plugin</artifactId>
556+
<executions>
557+
<execution>
558+
<id>integration-test</id>
559+
<phase>integration-test</phase>
560+
<goals>
561+
<goal>integration-test</goal>
562+
</goals>
563+
</execution>
564+
<execution>
565+
<id>verify</id>
566+
<phase>verify</phase>
567+
<goals>
568+
<goal>verify</goal>
569+
</goals>
570+
</execution>
571+
</executions>
572+
</plugin>
544573
<plugin>
545574
<groupId>org.apache.maven.plugins</groupId>
546575
<artifactId>maven-release-plugin</artifactId>

exist-core/pom.xml

Lines changed: 85 additions & 19 deletions
Large diffs are not rendered by default.

exist-core/src/main/java/org/exist/storage/recovery/RecoveryManager.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,10 @@ private void doRecovery(final int txnCount, final Path last, final JournalReader
325325
} catch (final Exception e) {
326326
LOG.error("Exception caught while redoing transactions. Aborting recovery to avoid possible damage. " +
327327
"Before starting again, make sure to run a check via the emergency export tool.", e);
328-
if (next != null)
329-
{
330-
LOG.info("Log entry that caused the exception: {}", next.dump());}
331-
throw new LogException("Recovery aborted. ");
328+
if (next != null) {
329+
LOG.info("Log entry that caused the exception: {}", next.dump());
330+
}
331+
throw new LogException("Recovery aborted: " + e.getMessage(), e);
332332
} finally {
333333
LOG.info("Redo processed {} out of {} transactions.", redoCnt, txnCount);
334334
}
@@ -375,10 +375,10 @@ private void doRecovery(final int txnCount, final Path last, final JournalReader
375375
}
376376
} catch (final Exception e) {
377377
LOG.warn("Exception caught while undoing dirty transactions. Remaining transactions to be undone: {}. Aborting recovery to avoid possible damage. Before starting again, make sure to run a check via the emergency export tool.", runningTxns.size(), e);
378-
if (next != null)
379-
{
380-
LOG.warn("Log entry that caused the exception: {}", next.dump());}
381-
throw new LogException("Recovery aborted", e);
378+
if (next != null) {
379+
LOG.warn("Log entry that caused the exception: {}", next.dump());
380+
}
381+
throw new LogException("Recovery aborted: " + e.getMessage(), e);
382382
}
383383
}
384384
} finally {

exist-core/src/test/java/org/exist/IndexerTest2.java renamed to exist-core/src/test/java/org/exist/Indexer2Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
*
8585
* @author ljo
8686
*/
87-
public class IndexerTest2 {
87+
public class Indexer2Test {
8888

8989
private final static String XML =
9090
"<?xml version=\"1.0\"?>\n" +

exist-core/src/test/java/org/exist/IndexerTest3.java renamed to exist-core/src/test/java/org/exist/Indexer3Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
*
8181
* @author ljo
8282
*/
83-
public class IndexerTest3 {
83+
public class Indexer3Test {
8484

8585
@ClassRule
8686
public static final ExistEmbeddedServer existEmbeddedServer = new ExistEmbeddedServer(true, true);

exist-core/src/test/java/org/exist/collections/triggers/TestTrigger.java renamed to exist-core/src/test/java/org/exist/collections/triggers/MessagesTrigger.java

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
11
/*
2+
* Elemental
3+
* Copyright (C) 2024, Evolved Binary Ltd
4+
*
5+
6+
* https://www.evolvedbinary.com | https://www.elemental.xyz
7+
*
8+
* This library is free software; you can redistribute it and/or
9+
* modify it under the terms of the GNU Lesser General Public
10+
* License as published by the Free Software Foundation; version 2.1.
11+
*
12+
* This library is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
* Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public
18+
* License along with this library; if not, write to the Free Software
19+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20+
*
21+
* NOTE: Parts of this file contain code from 'The eXist-db Authors'.
22+
* The original license header is included below.
23+
*
24+
* =====================================================================
25+
*
226
* eXist-db Open Source Native XML Database
327
* Copyright (C) 2001 The eXist-db Authors
428
*
@@ -42,7 +66,7 @@
4266
/**
4367
* Test trigger to check if trigger configuration is working properly.
4468
*/
45-
public class TestTrigger extends SAXTrigger implements DocumentTrigger {
69+
public class MessagesTrigger extends SAXTrigger implements DocumentTrigger {
4670

4771
protected Logger LOG = LogManager.getLogger(getClass());
4872

0 commit comments

Comments
 (0)