src/app/tests/mocks/jobs.ts
Properties |
|
Methods |
Accessors |
getJobExecution | ||||||||
getJobExecution(id: string)
|
||||||||
Defined in src/app/tests/mocks/jobs.ts:69
|
||||||||
Parameters :
Returns :
any
|
getJobExecutions |
getJobExecutions()
|
Defined in src/app/tests/mocks/jobs.ts:65
|
Returns :
any
|
getStepExecution |
getStepExecution(jobid: string, stepid: string)
|
Defined in src/app/tests/mocks/jobs.ts:82
|
Returns :
Observable<StepExecutionResource>
|
getStepExecutionProgress |
getStepExecutionProgress(jobid: string, stepid: string)
|
Defined in src/app/tests/mocks/jobs.ts:57
|
Returns :
Observable<StepExecutionProgress>
|
restartJob | ||||||||
restartJob(item: JobExecution)
|
||||||||
Defined in src/app/tests/mocks/jobs.ts:96
|
||||||||
Parameters :
Returns :
any
|
setJobExecutions | ||||||||
setJobExecutions(mock: )
|
||||||||
Defined in src/app/tests/mocks/jobs.ts:49
|
||||||||
Parameters :
Returns :
void
|
stopJob | ||||||||
stopJob(item: JobExecution)
|
||||||||
Defined in src/app/tests/mocks/jobs.ts:91
|
||||||||
Parameters :
Returns :
any
|
Private _testJobExecutions |
_testJobExecutions:
|
Type : JobExecution[]
|
Defined in src/app/tests/mocks/jobs.ts:19
|
Private _testStepExecutionProgress |
_testStepExecutionProgress:
|
Type : StepExecutionProgress
|
Defined in src/app/tests/mocks/jobs.ts:23
|
Private _testStepExecutionResource |
_testStepExecutionResource:
|
Type : StepExecutionResource
|
Defined in src/app/tests/mocks/jobs.ts:21
|
Public jobExecutionsPage |
jobExecutionsPage:
|
Type : Page<JobExecution>
|
Defined in src/app/tests/mocks/jobs.ts:17
|
jobsContext |
jobsContext:
|
Defined in src/app/tests/mocks/jobs.ts:9
|
testJobExecutions | ||||||||
gettestJobExecutions()
|
||||||||
Defined in src/app/tests/mocks/jobs.ts:25
|
||||||||
settestJobExecutions(params: any)
|
||||||||
Defined in src/app/tests/mocks/jobs.ts:29
|
||||||||
Parameters :
Returns :
void
|
testStepExecutionResource | ||||||||
gettestStepExecutionResource()
|
||||||||
Defined in src/app/tests/mocks/jobs.ts:33
|
||||||||
settestStepExecutionResource(params: any)
|
||||||||
Defined in src/app/tests/mocks/jobs.ts:37
|
||||||||
Parameters :
Returns :
void
|
testStepExecutionProgress | ||||||||
gettestStepExecutionProgress()
|
||||||||
Defined in src/app/tests/mocks/jobs.ts:41
|
||||||||
settestStepExecutionProgress(params: any)
|
||||||||
Defined in src/app/tests/mocks/jobs.ts:45
|
||||||||
Parameters :
Returns :
void
|
import { Observable, of } from 'rxjs';
import { Page } from '../../shared/model/page';
import { JobExecution } from '../../jobs/model/job-execution.model';
import { StepExecutionResource } from '../../jobs/model/step-execution-resource.model';
import { StepExecutionProgress } from '../../jobs/model/step-execution-progress.model';
export class MockJobsService {
jobsContext = {
sort: 'name',
order: 'ASC',
page: 0,
size: 30,
itemsSelected: []
};
public jobExecutionsPage: Page<JobExecution>;
private _testJobExecutions: JobExecution[];
private _testStepExecutionResource: StepExecutionResource;
private _testStepExecutionProgress: StepExecutionProgress;
get testJobExecutions() {
return this._testJobExecutions;
}
set testJobExecutions(params: any) {
this._testJobExecutions = params;
}
get testStepExecutionResource() {
return this._testStepExecutionResource;
}
set testStepExecutionResource(params: any) {
this._testStepExecutionResource = params;
}
get testStepExecutionProgress() {
return this._testStepExecutionProgress;
}
set testStepExecutionProgress(params: any) {
this._testStepExecutionProgress = params;
}
setJobExecutions(mock) {
let page = new Page<JobExecution>();
if (mock._embedded && mock._embedded.jobExecutionResourceList) {
page = JobExecution.pageFromJSON(mock);
}
this.jobExecutionsPage = page;
}
getStepExecutionProgress(jobid: string, stepid: string): Observable<StepExecutionProgress> {
let stepExecutionProgress: StepExecutionProgress = null;
if (this.testStepExecutionProgress) {
stepExecutionProgress = StepExecutionProgress.fromJSON(this.testStepExecutionProgress);
}
return of(stepExecutionProgress);
}
getJobExecutions() {
return of(this.jobExecutionsPage);
}
getJobExecution(id: string) {
let jobExecution = null;
if (this.testJobExecutions) {
const jsonItem = this.testJobExecutions
.find(je => je['executionId'] === +id);
if (!jsonItem) {
return of(jobExecution);
}
jobExecution = JobExecution.fromJSON(jsonItem);
}
return of(jobExecution);
}
getStepExecution(jobid: string, stepid: string): Observable<StepExecutionResource> {
let stepExecutionResource: StepExecutionResource = null;
if (this.testStepExecutionResource) {
stepExecutionResource = StepExecutionResource.fromJSON(this.testStepExecutionResource);
}
return of(stepExecutionResource);
}
stopJob(item: JobExecution) {
return of({});
}
restartJob(item: JobExecution) {
return of({});
}
}