Search in sources :

Example 1 with MonitorExecutionChangedJobListener

use of com.dangdang.ddframe.job.lite.internal.execution.ExecutionListenerManager.MonitorExecutionChangedJobListener in project elastic-job by dangdangdotcom.

the class ExecutionListenerManagerTest method assertMonitorExecutionChangedJobListenerWhenIsMonitorExecutionPathAndUpdateButEnable.

@Test
public void assertMonitorExecutionChangedJobListenerWhenIsMonitorExecutionPathAndUpdateButEnable() {
    executionListenerManager.new MonitorExecutionChangedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_UPDATED, new ChildData("/test_job/config", null, LiteJsonConstants.getJobJson().getBytes())), "/test_job/config");
    verify(executionService, times(0)).removeExecutionInfo();
}
Also used : ChildData(org.apache.curator.framework.recipes.cache.ChildData) TreeCacheEvent(org.apache.curator.framework.recipes.cache.TreeCacheEvent) MonitorExecutionChangedJobListener(com.dangdang.ddframe.job.lite.internal.execution.ExecutionListenerManager.MonitorExecutionChangedJobListener) Test(org.junit.Test)

Example 2 with MonitorExecutionChangedJobListener

use of com.dangdang.ddframe.job.lite.internal.execution.ExecutionListenerManager.MonitorExecutionChangedJobListener in project elastic-job by dangdangdotcom.

the class ExecutionListenerManagerTest method assertMonitorExecutionChangedJobListenerWhenIsMonitorExecutionPathAndUpdateButDisable.

@Test
public void assertMonitorExecutionChangedJobListenerWhenIsMonitorExecutionPathAndUpdateButDisable() {
    executionListenerManager.new MonitorExecutionChangedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_UPDATED, new ChildData("/test_job/config", null, LiteJsonConstants.getJobJson(false).getBytes())), "/test_job/config");
    verify(executionService).removeExecutionInfo();
}
Also used : ChildData(org.apache.curator.framework.recipes.cache.ChildData) TreeCacheEvent(org.apache.curator.framework.recipes.cache.TreeCacheEvent) MonitorExecutionChangedJobListener(com.dangdang.ddframe.job.lite.internal.execution.ExecutionListenerManager.MonitorExecutionChangedJobListener) Test(org.junit.Test)

Example 3 with MonitorExecutionChangedJobListener

use of com.dangdang.ddframe.job.lite.internal.execution.ExecutionListenerManager.MonitorExecutionChangedJobListener in project elastic-job by dangdangdotcom.

the class ExecutionListenerManagerTest method assertMonitorExecutionChangedJobListenerWhenIsNotMonitorExecutionPath.

@Test
public void assertMonitorExecutionChangedJobListenerWhenIsNotMonitorExecutionPath() {
    executionListenerManager.new MonitorExecutionChangedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/test_job/config/other", null, LiteJsonConstants.getJobJson().getBytes())), "/test_job/config/other");
    verify(executionService, times(0)).removeExecutionInfo();
}
Also used : ChildData(org.apache.curator.framework.recipes.cache.ChildData) TreeCacheEvent(org.apache.curator.framework.recipes.cache.TreeCacheEvent) MonitorExecutionChangedJobListener(com.dangdang.ddframe.job.lite.internal.execution.ExecutionListenerManager.MonitorExecutionChangedJobListener) Test(org.junit.Test)

Example 4 with MonitorExecutionChangedJobListener

use of com.dangdang.ddframe.job.lite.internal.execution.ExecutionListenerManager.MonitorExecutionChangedJobListener in project elastic-job by dangdangdotcom.

the class ExecutionListenerManagerTest method assertMonitorExecutionChangedJobListenerWhenIsMonitorExecutionPathButNotUpdate.

@Test
public void assertMonitorExecutionChangedJobListenerWhenIsMonitorExecutionPathButNotUpdate() {
    executionListenerManager.new MonitorExecutionChangedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/test_job/config", null, LiteJsonConstants.getJobJson().getBytes())), "/test_job/config");
    verify(executionService, times(0)).removeExecutionInfo();
}
Also used : ChildData(org.apache.curator.framework.recipes.cache.ChildData) TreeCacheEvent(org.apache.curator.framework.recipes.cache.TreeCacheEvent) MonitorExecutionChangedJobListener(com.dangdang.ddframe.job.lite.internal.execution.ExecutionListenerManager.MonitorExecutionChangedJobListener) Test(org.junit.Test)

Aggregations

MonitorExecutionChangedJobListener (com.dangdang.ddframe.job.lite.internal.execution.ExecutionListenerManager.MonitorExecutionChangedJobListener)4 ChildData (org.apache.curator.framework.recipes.cache.ChildData)4 TreeCacheEvent (org.apache.curator.framework.recipes.cache.TreeCacheEvent)4 Test (org.junit.Test)4