forked from davidkiss/spring-boot-quartz-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix for issue davidkiss#4 - configured liquibase config file to be re…
…ad from classpath
- Loading branch information
Showing
4 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/test/java/com/kaviddiss/bootquartz/ApplicationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.kaviddiss.bootquartz; | ||
|
||
import com.kaviddiss.bootquartz.job.SampleJob; | ||
import org.quartz.*; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.SpringApplicationConfiguration; | ||
import org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests; | ||
import org.testng.annotations.Test; | ||
|
||
@SpringApplicationConfiguration(classes = Application.class) | ||
public class ApplicationTest extends AbstractTransactionalTestNGSpringContextTests { | ||
@Autowired | ||
private Scheduler scheduler; | ||
|
||
@Test | ||
public void test() throws Exception { | ||
|
||
JobDetail jobDetail = JobBuilder.newJob(SampleJob.class) | ||
.storeDurably(true) | ||
.build(); | ||
|
||
Trigger trigger = TriggerBuilder.newTrigger() | ||
.forJob(jobDetail) | ||
.startNow() | ||
.build(); | ||
|
||
scheduler.scheduleJob(jobDetail, trigger); | ||
|
||
Thread.sleep(5000); | ||
} | ||
} |