Skip to content

Commit

Permalink
Fixing build
Browse files Browse the repository at this point in the history
  • Loading branch information
xpdota committed Nov 22, 2021
1 parent 9e66851 commit d4328d4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@
import gg.xp.reevent.events.DummyEventToForceAutoScan;
import gg.xp.reevent.events.Event;
import gg.xp.reevent.events.EventDistributor;
import gg.xp.reevent.events.EventMaster;
import gg.xp.reevent.events.TestEventCollector;
import gg.xp.xivdata.jobs.Job;
import gg.xp.xivsupport.events.actlines.events.AbilityUsedEvent;
import gg.xp.xivsupport.events.actlines.events.WipeEvent;
import gg.xp.xivsupport.events.actlines.events.ZoneChangeEvent;
import gg.xp.xivsupport.events.actlines.events.actorcontrol.DutyRecommenceEvent;
import gg.xp.xivsupport.events.state.XivState;
import gg.xp.xivsupport.events.triggers.jails.ClearAutoMarkRequest;
import gg.xp.xivsupport.events.triggers.marks.AutoMarkRequest;
import gg.xp.xivsupport.events.triggers.jails.FinalTitanJailsSolvedEvent;
import gg.xp.xivsupport.events.triggers.jails.JailSolver;
import gg.xp.xivsupport.events.triggers.jails.UnsortedTitanJailsSolvedEvent;
import gg.xp.xivsupport.models.XivEntity;
import gg.xp.xivsupport.events.state.XivState;
import gg.xp.xivsupport.events.triggers.marks.AutoMarkRequest;
import gg.xp.xivsupport.events.ws.ActWsRawMsg;
import gg.xp.xivsupport.models.XivEntity;
import gg.xp.xivsupport.models.XivZone;
import gg.xp.xivsupport.persistence.PersistenceProvider;
import gg.xp.xivsupport.speech.CalloutEvent;
Expand Down Expand Up @@ -66,8 +65,6 @@ public void jailTest() throws InterruptedException {
XivState state = container.getComponent(XivState.class);
// // TODO: still need better support for this...
// Thread.sleep(1000);
Assert.assertEquals(state.getPartyList().size(), 8);
Assert.assertEquals(state.getCombatantsListCopy().size(), 8);


// Send events
Expand Down Expand Up @@ -150,11 +147,6 @@ public void testWrongZone() {
TestEventCollector collector = new TestEventCollector();
dist.registerHandler(collector);

XivState state = container.getComponent(XivState.class);
// // TODO: still need better support for this...
// Thread.sleep(1000);
Assert.assertEquals(state.getPartyList().size(), 8);
Assert.assertEquals(state.getCombatantsListCopy().size(), 8);

dist.acceptEvent(new ZoneChangeEvent(new XivZone(0x123, "Stuff")));

Expand All @@ -177,12 +169,6 @@ public void testZoneLockOverride() {
JailSolver jails = container.getComponent(JailSolver.class);
jails.getOverrideZoneLock().set(true);

XivState state = container.getComponent(XivState.class);
// // TODO: still need better support for this...
// Thread.sleep(1000);
Assert.assertEquals(state.getPartyList().size(), 8);
Assert.assertEquals(state.getCombatantsListCopy().size(), 8);

dist.acceptEvent(new ZoneChangeEvent(new XivZone(0x123, "Stuff")));

// Send events
Expand All @@ -201,12 +187,6 @@ public void testResets() {
TestEventCollector collector = new TestEventCollector();
dist.registerHandler(collector);

XivState state = container.getComponent(XivState.class);
// // TODO: still need better support for this...
// Thread.sleep(1000);
Assert.assertEquals(state.getPartyList().size(), 8);
Assert.assertEquals(state.getCombatantsListCopy().size(), 8);


// Send events
dist.acceptEvent(new ACTLogLineEvent("21|2021-09-30T19:43:43.1650000-07:00|40016AA1|Titan|2B6C|Rock Throw|13|Random Person|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|42489|50128|9900|10000|0|1000|86.77625|95.90898|-4.091016E-13|1.591002|2477238|4476950|0|10000|0|1000|113.7886|86.21142|-1.378858E-12|-0.7854581|00009CA2|0|cd69a51d5f584b836fa20c4a5b356612"));
Expand Down Expand Up @@ -239,10 +219,6 @@ void testDisableTts() throws InterruptedException {
TestEventCollector collector = new TestEventCollector();
dist.registerHandler(collector);

XivState state = container.getComponent(XivState.class);
Assert.assertEquals(state.getPartyList().size(), 8);
Assert.assertEquals(state.getCombatantsListCopy().size(), 8);

JailSolver jail = container.getComponent(JailSolver.class);
jail.getEnableTts().set(false);

Expand Down Expand Up @@ -315,10 +291,6 @@ public void disableAmTest() throws InterruptedException {
TestEventCollector collector = new TestEventCollector();
dist.registerHandler(collector);

XivState state = container.getComponent(XivState.class);
Assert.assertEquals(state.getPartyList().size(), 8);
Assert.assertEquals(state.getCombatantsListCopy().size(), 8);

JailSolver jail = container.getComponent(JailSolver.class);
jail.getEnableAutomark().set(false);

Expand Down Expand Up @@ -398,12 +370,6 @@ public void resetOrderTest() throws InterruptedException {
TestEventCollector collector = new TestEventCollector();
dist.registerHandler(collector);

XivState state = container.getComponent(XivState.class);
// TODO: still need better support for this...
Thread.sleep(1000);
Assert.assertEquals(state.getPartyList().size(), 8);
Assert.assertEquals(state.getCombatantsListCopy().size(), 8);

JailSolver jail = container.getComponent(JailSolver.class);
List<Job> currentJailSort = new ArrayList<>(jail.getCurrentJailSort());
Collections.reverse(currentJailSort);
Expand Down Expand Up @@ -489,12 +455,6 @@ public void customOrderTest() throws InterruptedException {
TestEventCollector collector = new TestEventCollector();
dist.registerHandler(collector);

XivState state = container.getComponent(XivState.class);
// TODO: still need better support for this...
Thread.sleep(1000);
Assert.assertEquals(state.getPartyList().size(), 8);
Assert.assertEquals(state.getCombatantsListCopy().size(), 8);

JailSolver jail = container.getComponent(JailSolver.class);
List<Job> currentJailSort = new ArrayList<>(jail.getCurrentJailSort());
Collections.reverse(currentJailSort);
Expand Down Expand Up @@ -692,6 +652,23 @@ private static MutablePicoContainer setup() {
BasicEventQueue queue = container.getComponent(BasicEventQueue.class);
queue.waitDrain();
dist.acceptEvent(new DummyEventToForceAutoScan());
XivState state = container.getComponent(XivState.class);
// TODO: find actual solution to race conditions in tests
try {
Assert.assertEquals(state.getPartyList().size(), 8);
Assert.assertEquals(state.getCombatantsListCopy().size(), 8);
}
catch (Throwable e) {
try {
Thread.sleep(1000);
}
catch (InterruptedException ex) {
ex.printStackTrace();
}
Assert.assertEquals(state.getPartyList().size(), 8);
Assert.assertEquals(state.getCombatantsListCopy().size(), 8);
}

JailSolver jail = container.getComponent(JailSolver.class);
jail.getJailClearDelay().set(1000);

Expand Down
4 changes: 1 addition & 3 deletions xivsupport/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
<!-- <appender-ref ref="COLLECTOR"/>-->
</root>
<!-- TODO turn some log levels down, like actws null response -->
<logger name="gg.xp.reevent.scan.AutoHandlerScan.Topology" level="warn">
<appender-ref ref="COLLECTOR"/>
</logger>
<logger name="gg.xp.reevent.scan.AutoHandlerScan.Topology" level="warn"/>

</configuration>

0 comments on commit d4328d4

Please sign in to comment.