test(ft546): verify standard WCS end to end
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -107,6 +107,40 @@ class Ft546StandardRuntimeTest {
|
||||
assertEquals(1L, scheduler.getCompletedTickCount());
|
||||
}
|
||||
|
||||
@Test
|
||||
void wmsOutboxStillDispatchesWhenCoreTickFails() {
|
||||
AtomicInteger notificationDispatches = new AtomicInteger();
|
||||
Ft546WcsScheduler scheduler = new Ft546WcsScheduler(() -> {
|
||||
throw new IllegalStateException("core tick failed");
|
||||
}, notificationDispatches::incrementAndGet);
|
||||
|
||||
IllegalStateException failure = assertThrows(
|
||||
IllegalStateException.class, scheduler::runScheduledTick);
|
||||
|
||||
assertEquals("core tick failed", failure.getMessage());
|
||||
assertEquals(1, notificationDispatches.get());
|
||||
assertEquals(0L, scheduler.getCompletedTickCount());
|
||||
assertFalse(scheduler.isTickInProgress());
|
||||
}
|
||||
|
||||
@Test
|
||||
void coreTickFailureRemainsPrimaryWhenNotificationDispatchAlsoFails() {
|
||||
Ft546WcsScheduler scheduler = new Ft546WcsScheduler(() -> {
|
||||
throw new IllegalStateException("core tick failed");
|
||||
}, () -> {
|
||||
throw new IllegalArgumentException("notification dispatch failed");
|
||||
});
|
||||
|
||||
IllegalStateException failure = assertThrows(
|
||||
IllegalStateException.class, scheduler::runScheduledTick);
|
||||
|
||||
assertEquals("core tick failed", failure.getMessage());
|
||||
assertEquals(1, failure.getSuppressed().length);
|
||||
assertEquals("notification dispatch failed",
|
||||
failure.getSuppressed()[0].getMessage());
|
||||
assertFalse(scheduler.isTickInProgress());
|
||||
}
|
||||
|
||||
@Test
|
||||
void legacyModeDoesNotRequireStandardRuntimePorts() {
|
||||
new ApplicationContextRunner()
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.ruoyi.wcs.domain.shared.WcsClock;
|
||||
import com.ruoyi.wcs.infrastructure.persistence.task.MyBatisTransportOrderRepository;
|
||||
import com.ruoyi.wcs.port.in.TransportOrderUseCase;
|
||||
import com.ruoyi.wcs.port.out.TransportOrderRepository;
|
||||
import com.ruoyi.wcs.port.out.TransportOrderExecutionRepository;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
|
||||
@@ -28,6 +29,8 @@ class WcsCoreWiringTest {
|
||||
instanceof TransportOrderApplicationService);
|
||||
assertTrue(context.getBean(TransportOrderRepository.class)
|
||||
instanceof MyBatisTransportOrderRepository);
|
||||
assertTrue(context.getBean(TransportOrderExecutionRepository.class)
|
||||
instanceof MyBatisTransportOrderRepository);
|
||||
assertTrue(context.containsBeanDefinition("transportOrderMapper"));
|
||||
|
||||
WcsClock clock = context.getBean(WcsClock.class);
|
||||
|
||||
Reference in New Issue
Block a user