use of alluxio.master.job.command.CommandManager in project alluxio by Alluxio.
the class PlanCoordinatorTest method before.
@Before
public void before() throws Exception {
mCommandManager = new CommandManager();
// Create mock JobServerContext
FileSystem fs = mock(FileSystem.class);
FileSystemContext fsCtx = PowerMockito.mock(FileSystemContext.class);
UfsManager ufsManager = Mockito.mock(UfsManager.class);
mJobServerContext = new JobServerContext(fs, fsCtx, ufsManager);
// Create mock job info.
mJobconfig = Mockito.mock(JobConfig.class, Mockito.withSettings().serializable());
Mockito.when(mJobconfig.getName()).thenReturn("mock");
mJobId = 1;
// Create mock job definition.
@SuppressWarnings("unchecked") PlanDefinition<JobConfig, Serializable, Serializable> mockPlanDefinition = Mockito.mock(PlanDefinition.class);
PlanDefinitionRegistry singleton = PowerMockito.mock(PlanDefinitionRegistry.class);
Whitebox.setInternalState(PlanDefinitionRegistry.class, "INSTANCE", singleton);
Mockito.when(singleton.getJobDefinition(mJobconfig)).thenReturn(mockPlanDefinition);
mPlanDefinition = mockPlanDefinition;
// Create test worker.
mWorkerInfo = new WorkerInfo();
mWorkerInfo.setId(0);
mWorkerInfoList = Lists.newArrayList(mWorkerInfo);
}
use of alluxio.master.job.command.CommandManager in project alluxio by Alluxio.
the class PlanTrackerTest method before.
@Before
public void before() {
mMockWorkflowTracker = mock(WorkflowTracker.class);
mTracker = new PlanTracker(CAPACITY, RETENTION_TIME, PURGE_CONUT, mMockWorkflowTracker);
mCommandManager = new CommandManager();
mMockJobServerContext = mock(JobServerContext.class);
mWorkers = Lists.newArrayList(new WorkerInfo());
mJobIdGenerator = new JobIdGenerator();
}
use of alluxio.master.job.command.CommandManager in project alluxio by Alluxio.
the class WorkflowTrackerTest method before.
@Before
public void before() throws Exception {
mMockJobMaster = mock(JobMaster.class);
mWorkflowTracker = new WorkflowTracker(mMockJobMaster);
mPlanTracker = new PlanTracker(CAPACITY, RETENTION_TIME, PURGE_CONUT, mWorkflowTracker);
mJobIdCounter = 100;
when(mMockJobMaster.getNewJobId()).thenAnswer(invocation -> mJobIdCounter++);
mWorkers = Lists.newArrayList(new WorkerInfo());
mCommandManager = new CommandManager();
mMockJobServerContext = mock(JobServerContext.class);
}
Aggregations