本文整理了Java中org.pentaho.di.job.Job.getVariable()
方法的一些代码示例,展示了Job.getVariable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Job.getVariable()
方法的具体详情如下:
包路径:org.pentaho.di.job.Job
类名称: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 ) );
}
内容来源于网络,如有侵权,请联系作者删除!