@Test public void testGetRow() throws KettleFileException, FileSystemException { File tempDir = new File( new TemporaryFolder().toString() ); FileObject tempFile = KettleVFS.createTempFile( "prefix", "suffix", tempDir.toString() ); Date timeBeforeFile = Calendar.getInstance().getTime(); ResultFile resultFile = new ResultFile( ResultFile.FILE_TYPE_GENERAL, tempFile, "myOriginParent", "myOrigin" ); Date timeAfterFile = Calendar.getInstance().getTime(); assertNotNull( resultFile ); RowMetaInterface rm = resultFile.getRow().getRowMeta(); assertEquals( 7, rm.getValueMetaList().size() ); assertEquals( ValueMetaInterface.TYPE_STRING, rm.getValueMeta( 0 ).getType() ); assertEquals( ValueMetaInterface.TYPE_STRING, rm.getValueMeta( 1 ).getType() ); assertEquals( ValueMetaInterface.TYPE_STRING, rm.getValueMeta( 2 ).getType() ); assertEquals( ValueMetaInterface.TYPE_STRING, rm.getValueMeta( 3 ).getType() ); assertEquals( ValueMetaInterface.TYPE_STRING, rm.getValueMeta( 4 ).getType() ); assertEquals( ValueMetaInterface.TYPE_STRING, rm.getValueMeta( 5 ).getType() ); assertEquals( ValueMetaInterface.TYPE_DATE, rm.getValueMeta( 6 ).getType() ); assertEquals( ResultFile.FILE_TYPE_GENERAL, resultFile.getType() ); assertEquals( "myOrigin", resultFile.getOrigin() ); assertEquals( "myOriginParent", resultFile.getOriginParent() ); assertTrue( "ResultFile timestamp is created in the expected window", timeBeforeFile.compareTo( resultFile.getTimestamp() ) <= 0 && timeAfterFile.compareTo( resultFile.getTimestamp() ) >= 0 ); tempFile.delete(); tempDir.delete(); }
public RowMetaAndData getRow() { RowMetaAndData row = new RowMetaAndData(); row.addValue( new ValueMetaString( "type" ), getTypeDesc() ); row.addValue( new ValueMetaString( "filename" ), file.getName().getBaseName() ); row.addValue( new ValueMetaString( "path" ), file.getName().getURI() ); row.addValue( new ValueMetaString( "parentorigin" ), originParent ); row.addValue( new ValueMetaString( "origin" ), origin ); row.addValue( new ValueMetaString( "comment" ), comment ); row.addValue( new ValueMetaDate( "timestamp" ), timestamp ); return row; }
ResultFile implements Cloneable { public RowMetaAndData getRow() { RowMetaAndData row = new RowMetaAndData(); row.addValue( new ValueMetaString( "type" ), getTypeDesc() ); row.addValue( new ValueMetaString( "filename" ), file.getName().getBaseName() ); row.addValue( new ValueMetaString( "path" ), file.getName().getURI() ); row.addValue( new ValueMetaString( "parentorigin" ), originParent ); row.addValue( new ValueMetaString( "origin" ), origin ); row.addValue( new ValueMetaString( "comment" ), comment ); row.addValue( new ValueMetaDate( "timestamp" ), timestamp ); return row; } }
ResultFile implements Cloneable { public RowMetaAndData getRow() { RowMetaAndData row = new RowMetaAndData(); row.addValue( new ValueMetaString( "type" ), getTypeDesc() ); row.addValue( new ValueMetaString( "filename" ), file.getName().getBaseName() ); row.addValue( new ValueMetaString( "path" ), file.getName().getURI() ); row.addValue( new ValueMetaString( "parentorigin" ), originParent ); row.addValue( new ValueMetaString( "origin" ), origin ); row.addValue( new ValueMetaString( "comment" ), comment ); row.addValue( new ValueMetaDate( "timestamp" ), timestamp ); return row; } ResultFile( int type, FileObject file, String originParent, String origin );  ResultFile( Node node ); }
ResultFile implements Cloneable { public RowMetaAndData getRow() { RowMetaAndData row = new RowMetaAndData(); row.addValue( new ValueMetaString( "type" ), getTypeDesc() ); row.addValue( new ValueMetaString( "filename" ), file.getName().getBaseName() ); row.addValue( new ValueMetaString( "path" ), file.getName().getURI() ); row.addValue( new ValueMetaString( "parentorigin" ), originParent ); row.addValue( new ValueMetaString( "origin" ), origin ); row.addValue( new ValueMetaString( "comment" ), comment ); row.addValue( new ValueMetaDate( "timestamp" ), timestamp ); return row; } ResultFile( int type, FileObject file, String originParent, String origin );  ResultFile( Node node ); @Override String toString(); String getComment(); void setComment( String comment ); FileObject getFile(); void setFile( FileObject file ); String getOrigin(); void setOrigin( String origin ); String getOriginParent(); void setOriginParent( String originParent ); int getType(); void setType( int type ); String getTypeDesc(); String getTypeCode(); static final int getType( String typeString ); static final String getTypeCode( int fileType ); static final String getTypeDesc( int fileType ); static final String[] getAllTypeDesc(); Date getTimestamp(); void setTimestamp( Date timestamp ); RowMetaAndData getRow(); String getXML(); }
ResultFile implements Cloneable { public RowMetaAndData getRow() { RowMetaAndData row = new RowMetaAndData(); row.addValue( new ValueMetaString( "type" ), getTypeDesc() ); row.addValue( new ValueMetaString( "filename" ), file.getName().getBaseName() ); row.addValue( new ValueMetaString( "path" ), file.getName().getURI() ); row.addValue( new ValueMetaString( "parentorigin" ), originParent ); row.addValue( new ValueMetaString( "origin" ), origin ); row.addValue( new ValueMetaString( "comment" ), comment ); row.addValue( new ValueMetaDate( "timestamp" ), timestamp ); return row; } ResultFile( int type, FileObject file, String originParent, String origin );  ResultFile( Node node ); @Override String toString(); String getComment(); void setComment( String comment ); FileObject getFile(); void setFile( FileObject file ); String getOrigin(); void setOrigin( String origin ); String getOriginParent(); void setOriginParent( String originParent ); int getType(); void setType( int type ); String getTypeDesc(); String getTypeCode(); static final int getType( String typeString ); static final String getTypeCode( int fileType ); static final String getTypeDesc( int fileType ); static final String[] getAllTypeDesc(); Date getTimestamp(); void setTimestamp( Date timestamp ); RowMetaAndData getRow(); String getXML(); static final int FILE_TYPE_GENERAL; static final int FILE_TYPE_LOG; static final int FILE_TYPE_ERRORLINE; static final int FILE_TYPE_ERROR; static final int FILE_TYPE_WARNING; static final String[] fileTypeCode; static final String[] fileTypeDesc; }