Skip to content

Commit

Permalink
MNK-???? - fix-up ExpressShutdownTest
Browse files Browse the repository at this point in the history
  • Loading branch information
cdennis committed Jun 14, 2013
1 parent e11a458 commit 3d35650
Showing 1 changed file with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
import org.junit.Assert;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SimpleTrigger;
import org.quartz.Trigger;
import org.quartz.TriggerBuilder;
import org.quartz.impl.JobDetailImpl;
import org.quartz.impl.calendar.BaseCalendar;
import org.quartz.impl.triggers.SimpleTriggerImpl;
import org.terracotta.quartz.AbstractTerracottaJobStore;
import org.terracotta.tests.base.AbstractClientBase;

Expand Down Expand Up @@ -186,11 +186,6 @@ private static void test(Scheduler scheduler) throws Throwable {
jobDetail.getJobDataMap().put("await-time", 150);
jobDetail.setDurability(true);

SimpleTriggerImpl trigger = new SimpleTriggerImpl("trigger1", "group");
trigger.setRepeatInterval(30000);
trigger.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY);
trigger.setJobName("testjob");
trigger.setCalendarName("mycal");

// This calendar doesn't do anything really, just testing that calendars work
if (!scheduler.getCalendarNames().contains("mycal")) {
Expand All @@ -199,14 +194,10 @@ private static void test(Scheduler scheduler) throws Throwable {
if (!scheduler.checkExists(jobDetail.getKey())) {
scheduler.addJob(jobDetail, false);
}
if (!scheduler.checkExists(trigger.getKey())) {
scheduler.scheduleJob(trigger);
}
}

private static void assertThreadShutdown(Set<SimpleThreadInfo> dump) throws Exception {
removeKnownThreads(dump);
if (dump.size() > 0) { throw new AssertionError("Threads still running: " + dump); }

Trigger trigger = TriggerBuilder.newTrigger().forJob("testjob").modifiedByCalendar("mycal").build();
scheduler.scheduleJob(trigger);
SimpleJob.localBarrier.await();
}

private static String getThreadDump() {
Expand Down

0 comments on commit 3d35650

Please sign in to comment.