mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
More and better test cleanup
This commit is contained in:
@ -54,28 +54,7 @@ class QScheduleManagerTest extends BaseTest
|
|||||||
void afterEach()
|
void afterEach()
|
||||||
{
|
{
|
||||||
QLogger.deactivateCollectingLoggerForClass(QuartzScheduler.class);
|
QLogger.deactivateCollectingLoggerForClass(QuartzScheduler.class);
|
||||||
|
QuartzTestUtils.afterEach();
|
||||||
try
|
|
||||||
{
|
|
||||||
QScheduleManager.getInstance().unInit();
|
|
||||||
}
|
|
||||||
catch(IllegalStateException ise)
|
|
||||||
{
|
|
||||||
/////////////////////////////////////////////////////////////////
|
|
||||||
// ok, might just mean that this test didn't init the instance //
|
|
||||||
/////////////////////////////////////////////////////////////////
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
QuartzScheduler.getInstance().unInit();
|
|
||||||
}
|
|
||||||
catch(IllegalStateException ise)
|
|
||||||
{
|
|
||||||
/////////////////////////////////////////////////////////////////
|
|
||||||
// ok, might just mean that this test didn't init the instance //
|
|
||||||
/////////////////////////////////////////////////////////////////
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,10 +66,9 @@ class ScheduleAllNewJobsProcessTest extends BaseTest
|
|||||||
@AfterEach
|
@AfterEach
|
||||||
void afterEach()
|
void afterEach()
|
||||||
{
|
{
|
||||||
QLogger.deactivateCollectingLoggerForClass(QuartzScheduler.class);
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
QScheduleManager.getInstance().stop();
|
||||||
QScheduleManager.getInstance().unInit();
|
QScheduleManager.getInstance().unInit();
|
||||||
}
|
}
|
||||||
catch(IllegalStateException ise)
|
catch(IllegalStateException ise)
|
||||||
|
@ -28,7 +28,6 @@ import com.kingsrook.qqq.backend.core.BaseTest;
|
|||||||
import com.kingsrook.qqq.backend.core.actions.processes.RunProcessAction;
|
import com.kingsrook.qqq.backend.core.actions.processes.RunProcessAction;
|
||||||
import com.kingsrook.qqq.backend.core.context.QContext;
|
import com.kingsrook.qqq.backend.core.context.QContext;
|
||||||
import com.kingsrook.qqq.backend.core.exceptions.QException;
|
import com.kingsrook.qqq.backend.core.exceptions.QException;
|
||||||
import com.kingsrook.qqq.backend.core.logging.QLogger;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.actions.processes.RunProcessInput;
|
import com.kingsrook.qqq.backend.core.model.actions.processes.RunProcessInput;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.MetaDataProducerHelper;
|
import com.kingsrook.qqq.backend.core.model.metadata.MetaDataProducerHelper;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
||||||
@ -40,6 +39,7 @@ import com.kingsrook.qqq.backend.core.scheduler.quartz.QuartzScheduler;
|
|||||||
import com.kingsrook.qqq.backend.core.scheduler.quartz.QuartzTestUtils;
|
import com.kingsrook.qqq.backend.core.scheduler.quartz.QuartzTestUtils;
|
||||||
import com.kingsrook.qqq.backend.core.utils.TestUtils;
|
import com.kingsrook.qqq.backend.core.utils.TestUtils;
|
||||||
import org.junit.jupiter.api.AfterEach;
|
import org.junit.jupiter.api.AfterEach;
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.quartz.SchedulerException;
|
import org.quartz.SchedulerException;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
@ -52,35 +52,23 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
|||||||
class UnscheduleAllJobsProcessTest extends BaseTest
|
class UnscheduleAllJobsProcessTest extends BaseTest
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
@BeforeEach
|
||||||
|
void beforeEach()
|
||||||
|
{
|
||||||
|
QuartzTestUtils.afterEach();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
@AfterEach
|
@AfterEach
|
||||||
void afterEach()
|
void afterEach()
|
||||||
{
|
{
|
||||||
QLogger.deactivateCollectingLoggerForClass(QuartzScheduler.class);
|
QuartzTestUtils.afterEach();
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
QScheduleManager.getInstance().unInit();
|
|
||||||
}
|
|
||||||
catch(IllegalStateException ise)
|
|
||||||
{
|
|
||||||
/////////////////////////////////////////////////////////////////
|
|
||||||
// ok, might just mean that this test didn't init the instance //
|
|
||||||
/////////////////////////////////////////////////////////////////
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
QuartzScheduler.getInstance().unInit();
|
|
||||||
}
|
|
||||||
catch(IllegalStateException ise)
|
|
||||||
{
|
|
||||||
/////////////////////////////////////////////////////////////////
|
|
||||||
// ok, might just mean that this test didn't init the instance //
|
|
||||||
/////////////////////////////////////////////////////////////////
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -125,6 +125,7 @@ public class QuartzTestUtils
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
QuartzScheduler.getInstance().stop();
|
||||||
QuartzScheduler.getInstance().unInit();
|
QuartzScheduler.getInstance().unInit();
|
||||||
}
|
}
|
||||||
catch(IllegalStateException ise)
|
catch(IllegalStateException ise)
|
||||||
|
@ -53,6 +53,7 @@ class SimpleSchedulerTest extends BaseTest
|
|||||||
@AfterEach
|
@AfterEach
|
||||||
void afterEach()
|
void afterEach()
|
||||||
{
|
{
|
||||||
|
QScheduleManager.getInstance().stop();
|
||||||
QScheduleManager.getInstance().unInit();
|
QScheduleManager.getInstance().unInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user