CE-936 Quartz test updates

This commit is contained in:
2024-03-19 20:05:00 -05:00
parent c9f921c148
commit 02d068dad7
3 changed files with 34 additions and 43 deletions

View File

@ -62,27 +62,7 @@ class QuartzSchedulerTest extends BaseTest
@AfterEach @AfterEach
void afterEach() void afterEach()
{ {
try QuartzTestUtils.afterEach();
{
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 //
/////////////////////////////////////////////////////////////////
}
} }

View File

@ -27,6 +27,7 @@ import java.util.Properties;
import com.kingsrook.qqq.backend.core.context.QContext; import com.kingsrook.qqq.backend.core.context.QContext;
import com.kingsrook.qqq.backend.core.model.metadata.QInstance; import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
import com.kingsrook.qqq.backend.core.model.metadata.scheduleing.quartz.QuartzSchedulerMetaData; import com.kingsrook.qqq.backend.core.model.metadata.scheduleing.quartz.QuartzSchedulerMetaData;
import com.kingsrook.qqq.backend.core.scheduler.QScheduleManager;
import org.quartz.SchedulerException; import org.quartz.SchedulerException;
@ -102,4 +103,35 @@ public class QuartzTestUtils
{ {
return QuartzScheduler.getInstance().queryQuartz(); return QuartzScheduler.getInstance().queryQuartz();
} }
/*******************************************************************************
**
*******************************************************************************/
public static void afterEach()
{
try
{
QScheduleManager.getInstance().stop();
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 //
/////////////////////////////////////////////////////////////////
}
}
} }

View File

@ -92,28 +92,7 @@ class QuartzJobsProcessTest extends BaseTest
@AfterEach @AfterEach
void afterEach() void afterEach()
{ {
try QuartzTestUtils.afterEach();
{
QScheduleManager.getInstance().stop();
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 //
/////////////////////////////////////////////////////////////////
}
} }