From 0ab1ccc20a609014bddaf1fe6a3e78c4d069f8e4 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Sat, 11 Jan 2025 10:26:07 +0000 Subject: [PATCH] Ensure that test which changes static value does not run at the same time as other tests Otherwise we get strange test-failures in other places. git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1923066 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/poi/hssf/record/TestRecordFactory.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/poi/src/test/java/org/apache/poi/hssf/record/TestRecordFactory.java b/poi/src/test/java/org/apache/poi/hssf/record/TestRecordFactory.java index 56ad4027764..a44cce0e42c 100644 --- a/poi/src/test/java/org/apache/poi/hssf/record/TestRecordFactory.java +++ b/poi/src/test/java/org/apache/poi/hssf/record/TestRecordFactory.java @@ -33,10 +33,12 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.poi.util.HexRead; import org.apache.poi.util.RecordFormatException; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.Isolated; /** * Tests the record factory */ +@Isolated // changes static values, so other tests should not run at the same time final class TestRecordFactory { @@ -245,6 +247,7 @@ void testMaxNumberOfRecords() { assertEquals(0, RecordFactory.getMaxNumberOfRecords()); // check exception when exceeding the limit + //noinspection resource assertThrows(RecordFormatException.class, () -> HSSFTestDataSamples.openSampleWorkbook("SampleSS.xls")); } finally {