本文整理了Java中org.pentaho.di.job.Job.getParentJob()
方法的一些代码示例,展示了Job.getParentJob()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Job.getParentJob()
方法的具体详情如下:
包路径:org.pentaho.di.job.Job
类名称:Job
方法名:getParentJob
[英]Gets the parent job.
[中]获取父作业。
代码示例来源:origin: pentaho/pentaho-kettle
@Test
public void testRunSetsResult() throws Exception {
when( mockJob.isStopped() ).thenReturn( false );
when( mockJob.getParentJob() ).thenReturn( parentJob );
when( parentJob.isStopped() ).thenReturn( false );
when( mockJob.execute( Mockito.anyInt(), Mockito.any( Result.class ) ) ).thenReturn( mockResult );
jobRunner.run();
verify( mockJob, times( 1 ) ).setResult( Mockito.any( Result.class ) );
}
代码示例来源:origin: pentaho/pentaho-kettle
@Test
public void testRunWithExceptionOnExecuteSetsResult() throws Exception {
when( mockJob.isStopped() ).thenReturn( false );
when( mockJob.getParentJob() ).thenReturn( parentJob );
when( parentJob.isStopped() ).thenReturn( false );
doThrow( KettleException.class ).when( mockJob ).execute( anyInt(), any( Result.class ) );
jobRunner.run();
verify( mockJob, times( 1 ) ).setResult( Mockito.any( Result.class ) );
}
代码示例来源:origin: pentaho/pentaho-kettle
@Test
public void testWaitUntilFinished() throws Exception {
when( mockJob.isStopped() ).thenReturn( true );
when( mockJob.getParentJob() ).thenReturn( parentJob );
when( parentJob.isStopped() ).thenReturn( false );
when( mockJob.execute( Mockito.anyInt(), Mockito.any( Result.class ) ) ).thenReturn( mockResult );
jobRunner.waitUntilFinished();
}
}
代码示例来源:origin: pentaho/pentaho-kettle
@Test
public void testRunWithExceptionOnExecuteAndFireJobSetsResult() throws KettleException {
when( mockJob.isStopped() ).thenReturn( false );
when( mockJob.getParentJob() ).thenReturn( parentJob );
when( parentJob.isStopped() ).thenReturn( false );
when( mockJob.execute( Mockito.anyInt(), Mockito.any( Result.class ) ) ).thenReturn( mockResult );
doThrow( KettleException.class ).when( mockJob ).execute( anyInt(), any( Result.class ) );
doThrow( Exception.class ).when( mockJob ).fireJobFinishListeners();
jobRunner.run();
verify( mockJob, times( 1 ) ).setResult( Mockito.any( Result.class ) );
assertTrue( jobRunner.isFinished() );
}
代码示例来源:origin: pentaho/pentaho-kettle
@Test
public void testRunWithException() throws Exception {
when( mockJob.isStopped() ).thenReturn( false );
when( mockJob.getParentJob() ).thenReturn( parentJob );
when( mockJob.getJobMeta() ).thenReturn( mockJobMeta );
when( parentJob.isStopped() ).thenReturn( false );
doThrow( KettleException.class ).when( mockJob ).execute( anyInt(), any( Result.class ) );
jobRunner.run();
verify( mockResult, times( 1 ) ).setNrErrors( Mockito.anyInt() );
//[PDI-14981] catch more general exception to prevent thread hanging
doThrow( Exception.class ).when( mockJob ).fireJobFinishListeners();
jobRunner.run();
}
代码示例来源:origin: pentaho/pentaho-kettle
@Test
public void testRunWithExceptionOnFireJobSetsResult() throws KettleException {
when( mockJob.isStopped() ).thenReturn( false );
when( mockJob.getParentJob() ).thenReturn( parentJob );
when( parentJob.isStopped() ).thenReturn( false );
when( mockJob.execute( Mockito.anyInt(), Mockito.any( Result.class ) ) ).thenReturn( mockResult );
doThrow( Exception.class ).when( mockJob ).fireJobFinishListeners();
jobRunner.run();
verify( mockJob, times( 1 ) ).setResult( Mockito.any( Result.class ) );
assertTrue( jobRunner.isFinished() );
}
代码示例来源:origin: pentaho/pentaho-kettle
@Test
public void testRun() throws Exception {
// Call all the NO-OP paths
when( mockJob.isStopped() ).thenReturn( true );
jobRunner.run();
when( mockJob.isStopped() ).thenReturn( false );
when( mockJob.getParentJob() ).thenReturn( null );
when( mockJob.getJobMeta() ).thenReturn( mockJobMeta );
jobRunner.run();
when( parentJob.isStopped() ).thenReturn( true );
when( mockJob.getParentJob() ).thenReturn( parentJob );
jobRunner.run();
when( parentJob.isStopped() ).thenReturn( false );
when( mockJob.execute( Mockito.anyInt(), Mockito.any( Result.class ) ) ).thenReturn( mockResult );
jobRunner.run();
}
代码示例来源:origin: pentaho/pentaho-kettle
@Test
public void testIsFinished() throws Exception {
assertFalse( jobRunner.isFinished() );
when( mockJob.isStopped() ).thenReturn( false );
when( mockJob.getParentJob() ).thenReturn( parentJob );
when( parentJob.isStopped() ).thenReturn( false );
when( mockJob.execute( Mockito.anyInt(), Mockito.any( Result.class ) ) ).thenReturn( mockResult );
jobRunner.run();
assertTrue( jobRunner.isFinished() );
}
代码示例来源:origin: pentaho/pentaho-kettle
while ( parentJobTraverse != null ) {
parentJobTraverse.setVariable( varname, value );
parentJobTraverse = parentJobTraverse.getParentJob();
while ( rootJob != null ) {
rootJob.setVariable( varname, value );
rootJob = rootJob.getParentJob();
Job gpJob = parentJob.getParentJob();
if ( gpJob != null ) {
gpJob.setVariable( varname, value );
代码示例来源:origin: pentaho/pentaho-kettle
public void run() {
try {
if ( job.isStopped() || ( job.getParentJob() != null && job.getParentJob().isStopped() ) ) {
return;
代码示例来源:origin: pentaho/pentaho-kettle
verifyRecursiveExecution( parentJob.getParentJob(), jobMeta );
代码示例来源:origin: pentaho/pentaho-kettle
while ( parentJob != null ) {
parentJob.setVariable( varname, value );
parentJob = parentJob.getParentJob();
parentJob.setVariable( varname, value );
parentJob = parentJob.getParentJob();
VariableSpace gpJob = trans.getParentJob().getParentJob();
if ( gpJob != null ) {
gpJob.setVariable( varname, value );
代码示例来源:origin: pentaho/pentaho-kettle
Job j = getParentJob();
代码示例来源:origin: pentaho/pentaho-kettle
while ( rootJob.getParentJob() != null ) {
rootJob = rootJob.getParentJob();
内容来源于网络,如有侵权,请联系作者删除!