本文整理了Java中org.pentaho.di.core.Const.getHostnameReal()
方法的一些代码示例,展示了Const.getHostnameReal()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Const.getHostnameReal()
方法的具体详情如下:
包路径:org.pentaho.di.core.Const
类名称:Const
方法名:getHostnameReal
[英]Determine the hostname of the machine Kettle is running on
[中]确定正在运行的计算机的主机名
代码示例来源:origin: pentaho/pentaho-kettle
break;
case TYPE_SYSTEM_INFO_HOSTNAME_REAL:
row[index] = Const.getHostnameReal();
break;
case TYPE_SYSTEM_INFO_HOSTNAME:
代码示例来源:origin: pentaho/pentaho-kettle
@Test
public void testProcessRow() throws Exception {
SystemDataData systemDataData = new SystemDataData();
SystemDataMeta systemDataMeta = new SystemDataMeta();
systemDataMeta.allocate( 2 );
String[] names = systemDataMeta.getFieldName();
SystemDataTypes[] types = systemDataMeta.getFieldType();
names[0] = "hostname";
names[1] = "hostname_real";
types[0] = SystemDataTypes.getTypeFromString( SystemDataTypes.TYPE_SYSTEM_INFO_HOSTNAME.getDescription() );
types[1] = SystemDataTypes.getTypeFromString( SystemDataTypes.TYPE_SYSTEM_INFO_HOSTNAME_REAL.getDescription() );
SystemDataHandler systemData =
new SystemDataHandler( stepMockHelper.stepMeta, stepMockHelper.stepDataInterface, 0, stepMockHelper.transMeta,
stepMockHelper.trans );
Object[] expectedRow = new Object[] { Const.getHostname(), Const.getHostnameReal() };
RowMetaInterface inputRowMeta = mock( RowMetaInterface.class );
when( inputRowMeta.clone() ).thenReturn( inputRowMeta );
when( inputRowMeta.size() ).thenReturn( 2 );
systemDataData.outputRowMeta = inputRowMeta;
systemData.init( systemDataMeta, systemDataData );
assertFalse( systemData.processRow( systemDataMeta, systemDataData ) );
Object[] out = systemData.getOutputRow();
assertArrayEquals( expectedRow, out );
}
}
内容来源于网络,如有侵权,请联系作者删除!