From d3b58ae85bfb1c79c5c60f519836fc4cd9264183 Mon Sep 17 00:00:00 2001 From: XP Date: Sat, 28 Dec 2024 19:46:24 -0800 Subject: [PATCH] Test improvements --- .../AllTimelinesLoadedSuccessfullyTest.java | 51 ++++++++++--------- triggers/titan-jails/pom.xml | 27 +++++----- 2 files changed, 41 insertions(+), 37 deletions(-) diff --git a/timelines/src/test/java/gg/xp/xivsupport/timelines/AllTimelinesLoadedSuccessfullyTest.java b/timelines/src/test/java/gg/xp/xivsupport/timelines/AllTimelinesLoadedSuccessfullyTest.java index 11cd2b783ee9..4b4fd2769773 100644 --- a/timelines/src/test/java/gg/xp/xivsupport/timelines/AllTimelinesLoadedSuccessfullyTest.java +++ b/timelines/src/test/java/gg/xp/xivsupport/timelines/AllTimelinesLoadedSuccessfullyTest.java @@ -2,13 +2,15 @@ import gg.xp.reevent.events.EventDistributor; import gg.xp.reevent.events.InitEvent; -import gg.xp.xivdata.data.GameLanguage; +import gg.xp.xivdata.data.*; import gg.xp.xivsupport.lang.GameLanguageInfoEvent; import gg.xp.xivsupport.sys.XivMain; import org.picocontainer.MutablePicoContainer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Parameters; import org.testng.annotations.Test; import java.util.Set; @@ -17,29 +19,32 @@ public class AllTimelinesLoadedSuccessfullyTest { private static final Logger log = LoggerFactory.getLogger(AllTimelinesLoadedSuccessfullyTest.class); - @Test - void didAllTimelinesLoad() { - for (GameLanguage value : GameLanguage.values()) { + @DataProvider(parallel = true) + public static Object[] testCases() { + return GameLanguage.class.getEnumConstants(); + } - MutablePicoContainer pico = XivMain.testingMasterInit(); - EventDistributor dist = pico.getComponent(EventDistributor.class); - dist.acceptEvent(new InitEvent()); - dist.acceptEvent(new GameLanguageInfoEvent(value)); - TimelineManager manager = pico.getComponent(TimelineManager.class); - Set timelineZoneIds = TimelineManager.getTimelines().keySet(); - int size = timelineZoneIds.size(); - log.info("Number of timelines: {}", size); - if (size < 100) { - Assert.fail("Expected at least 100 timelines, got " + size); - } - for (Long timelineZoneId : timelineZoneIds) { - TimelineProcessor proc = manager.getTimeline(timelineZoneId); - Assert.assertNotNull(proc, "Timeline Processor was null for zone " + timelineZoneId); - Assert.assertFalse(proc.getRawEntries().isEmpty(), "Timeline Processor was empty for zone " + timelineZoneId); - } - TimelineInfo firstEntry = TimelineCsvReader.readCsv().get(0); - Assert.assertEquals(firstEntry.zoneId(), 134L); - Assert.assertEquals(firstEntry.filename(), "test.txt"); + @Test(dataProvider = "testCases") + @Parameters + void didAllTimelinesLoad(GameLanguage value) { + MutablePicoContainer pico = XivMain.testingMasterInit(); + EventDistributor dist = pico.getComponent(EventDistributor.class); + dist.acceptEvent(new InitEvent()); + dist.acceptEvent(new GameLanguageInfoEvent(value)); + TimelineManager manager = pico.getComponent(TimelineManager.class); + Set timelineZoneIds = TimelineManager.getTimelines().keySet(); + int size = timelineZoneIds.size(); + log.info("Number of timelines: {}", size); + if (size < 100) { + Assert.fail("Expected at least 100 timelines, got " + size); + } + for (Long timelineZoneId : timelineZoneIds) { + TimelineProcessor proc = manager.getTimeline(timelineZoneId); + Assert.assertNotNull(proc, "Timeline Processor was null for zone " + timelineZoneId); + Assert.assertFalse(proc.getRawEntries().isEmpty(), "Timeline Processor was empty for zone " + timelineZoneId); } + TimelineInfo firstEntry = TimelineCsvReader.readCsv().get(0); + Assert.assertEquals(firstEntry.zoneId(), 134L); + Assert.assertEquals(firstEntry.filename(), "test.txt"); } } diff --git a/triggers/titan-jails/pom.xml b/triggers/titan-jails/pom.xml index bd94f5306ab5..2499e617a4af 100644 --- a/triggers/titan-jails/pom.xml +++ b/triggers/titan-jails/pom.xml @@ -11,26 +11,25 @@ titan-jails + + + + org.apache.maven.plugins + maven-surefire-plugin + + + 8 + + + + + - - - - - - - - - org.hamcrest hamcrest-all test - - - - - \ No newline at end of file