@Test void matchingGroupPathAreBlocked() { GroupedJobInitializer groupedJobInitializer = mock(GroupedJobInitializer.class); when(groupedJobInitializer.getPoolSize()).thenReturn(1); when(groupedJobInitializer.getDefaultPriority()).thenReturn(Thread.NORM_PRIORITY); when(this.groupedJobInitializerManager.getGroupedJobInitializer(any())).thenReturn(groupedJobInitializer); TestBasicGroupedJob jobA = groupedJob("A"); TestBasicGroupedJob jobAB = groupedJob("A", "B"); TestBasicGroupedJob job12 = groupedJob("1", "2"); TestBasicGroupedJob job1 = groupedJob("1"); jobA.lock(); jobAB.lock(); job12.lock(); job1.lock(); this.executor.execute(jobA); this.executor.execute(job12); waitJobWaiting(jobA); waitJobWaiting(job12); this.executor.execute(jobAB); this.executor.execute(job1); assertSame(State.WAITING, jobA.getStatus().getState()); assertNull(jobAB.getStatus().getState()); jobA.unlock(); waitJobWaiting(jobAB); assertSame(State.FINISHED, jobA.getStatus().getState()); assertSame(State.WAITING, jobAB.getStatus().getState()); jobAB.unlock(); waitJobFinished(jobAB); assertSame(State.FINISHED, jobA.getStatus().getState()); assertSame(State.FINISHED, jobAB.getStatus().getState()); assertSame(State.WAITING, job12.getStatus().getState()); assertNull(job1.getStatus().getState()); job12.unlock(); waitJobWaiting(job1); assertSame(State.FINISHED, job12.getStatus().getState()); assertSame(State.WAITING, job1.getStatus().getState()); job1.unlock(); waitJobFinished(job1); assertSame(State.FINISHED, job1.getStatus().getState()); assertSame(State.FINISHED, job1.getStatus().getState()); }
@Override public Job execute(String jobType, Request request) throws JobException { Job job = createJob(jobType, request); execute(job); return job; }
DefaultJobExecutor implements JobExecutor, Initializable, Disposable { @Override public Job execute(String jobType, Request request) throws JobException { Job job = createJob(jobType, request); execute(job); return job; } }
DefaultJobExecutor implements JobExecutor, Initializable, Disposable { @Override public Job execute(String jobType, Request request) throws JobException { Job job = createJob(jobType, request); execute(job); return job; }  }
DefaultJobExecutor implements JobExecutor, Initializable, Disposable { @Override public Job execute(String jobType, Request request) throws JobException { Job job = createJob(jobType, request); execute(job); return job; }  @Override void initialize(); @Override void dispose(); @Override Job getCurrentJob(JobGroupPath path); @Override Job getJob(List<String> id); @Override Job execute(String jobType, Request request); @Override void execute(Job job); }
DefaultJobExecutor implements JobExecutor, Initializable, Disposable { @Override public Job execute(String jobType, Request request) throws JobException { Job job = createJob(jobType, request); execute(job); return job; }  @Override void initialize(); @Override void dispose(); @Override Job getCurrentJob(JobGroupPath path); @Override Job getJob(List<String> id); @Override Job execute(String jobType, Request request); @Override void execute(Job job);  }