org.pentaho.di.job.Job.getVariable()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(170)

本文整理了Java中org.pentaho.di.job.Job.getVariable()方法的一些代码示例,展示了Job.getVariable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Job.getVariable()方法的具体详情如下:
包路径:org.pentaho.di.job.Job
类名称:Job
方法名:getVariable

Job.getVariable介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

private void setDefaultLogCommitSize() {
 String propLogCommitSize = this.getVariable( "pentaho.log.commit.size" );
 if ( propLogCommitSize != null ) {
  // override the logCommit variable
  try {
   logCommitSize = Integer.parseInt( propLogCommitSize );
  } catch ( Exception ignored ) {
   logCommitSize = 10; // ignore parsing error and default to 10
  }
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

job.setInternalKettleVariables( null );
Assert.assertEquals( repDirectory.getPath(), job.getVariable( Const.INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY ) );

代码示例来源:origin: pentaho/pentaho-kettle

Result result = entry.execute( new Result(), 0 );
assertTrue( "Result should be true", result.getResult() );
assertEquals( "a", parentJob.getVariable( "propertyFile" ) );
assertEquals( "a", parentJob.getVariable( "dynamicProperty" ) );
assertEquals( "parentValue", parentJob.getVariable( "parentParam" ) );
result = entry.execute( new Result(), 0 );
assertTrue( "Result should be true", result.getResult() );
assertEquals( "b", parentJob.getVariable( "propertyFile" ) );
assertEquals( "new", parentJob.getVariable( "newProperty" ) );
assertEquals( "haha", parentJob.getVariable( "parentParam" ) );
assertEquals( "static", parentJob.getVariable( "staticProperty" ) );
assertEquals( "", parentJob.getVariable( "dynamicProperty" ) );
assertEquals( "a", parentJob.getVariable( "propertyFile" ) );
assertEquals( "", parentJob.getVariable( "newProperty" ) );
assertEquals( "parentValue", parentJob.getVariable( "parentParam" ) );
assertEquals( "", parentJob.getVariable( "staticProperty" ) );
assertEquals( "a", parentJob.getVariable( "dynamicProperty" ) );
result = entry.execute( new Result(), 0 );
assertTrue( "Result should be true", result.getResult() );
assertEquals( "b", parentJob.getVariable( "propertyFile" ) );
assertEquals( "new", parentJob.getVariable( "newProperty" ) );
assertEquals( "haha", parentJob.getVariable( "parentParam" ) );
assertEquals( "static", parentJob.getVariable( "staticProperty" ) );
assertEquals( "", parentJob.getVariable( "dynamicProperty" ) );

代码示例来源:origin: pentaho/pentaho-kettle

@Test
public void testSetInternalEntryCurrentDirectoryWithFilename( ) {
 Job jobTest = new Job(  );
 boolean hasFilename = true;
 boolean hasRepoDir = false;
 jobTest.copyVariablesFrom( null );
 jobTest.setVariable( Const.INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY, "Original value defined at run execution" );
 jobTest.setVariable( Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, "file:///C:/SomeFilenameDirectory" );
 jobTest.setVariable( Const.INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY, "/SomeRepDirectory" );
 jobTest.setInternalEntryCurrentDirectory( hasFilename, hasRepoDir );
 assertEquals( "file:///C:/SomeFilenameDirectory", jobTest.getVariable( Const.INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY ) );
}

代码示例来源:origin: pentaho/pentaho-kettle

@Test
public void testSetInternalEntryCurrentDirectoryWithRepository( ) {
 Job jobTest = new Job(  );
 boolean hasFilename = false;
 boolean hasRepoDir = true;
 jobTest.copyVariablesFrom( null );
 jobTest.setVariable( Const.INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY, "Original value defined at run execution" );
 jobTest.setVariable( Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, "file:///C:/SomeFilenameDirectory" );
 jobTest.setVariable( Const.INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY, "/SomeRepDirectory" );
 jobTest.setInternalEntryCurrentDirectory( hasFilename, hasRepoDir );
 assertEquals( "/SomeRepDirectory", jobTest.getVariable( Const.INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY ) );
}

代码示例来源:origin: pentaho/pentaho-kettle

@Test
public void testSetInternalEntryCurrentDirectoryWithoutFilenameOrRepository( ) {
 Job jobTest = new Job(  );
 jobTest.copyVariablesFrom( null );
 boolean hasFilename = false;
 boolean hasRepoDir = false;
 jobTest.setVariable( Const.INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY, "Original value defined at run execution" );
 jobTest.setVariable( Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, "file:///C:/SomeFilenameDirectory" );
 jobTest.setVariable( Const.INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY, "/SomeRepDirectory" );
 jobTest.setInternalEntryCurrentDirectory( hasFilename, hasRepoDir );
 assertEquals( "Original value defined at run execution", jobTest.getVariable( Const.INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY )  );
}

相关文章