@Test public void testGetXml() { String[] inputSteps = new String[] { "Step1", "Step2" }; multiMergeMeta.setInputSteps( inputSteps ); multiMergeMeta.setKeyFields( new String[] {"Key1", "Key2"} ); String xml = multiMergeMeta.getXML(); Assert.assertTrue( xml.contains( "step0" ) ); Assert.assertTrue( xml.contains( "step1" ) ); }
@Override public String getXML() { StringBuilder retval = new StringBuilder(); String[] inputStepsNames = inputSteps != null ? inputSteps : ArrayUtils.EMPTY_STRING_ARRAY; retval.append( " " ).append( XMLHandler.addTagValue( "join_type", getJoinType() ) ); for ( int i = 0; i < inputStepsNames.length; i++ ) { retval.append( " " ).append( XMLHandler.addTagValue( "step" + i, inputStepsNames[ i ] ) ); } retval.append( " " ).append( XMLHandler.addTagValue( "number_input", inputStepsNames.length ) ); retval.append( " " ).append( XMLHandler.openTag( "keys" ) ).append( Const.CR ); for ( int i = 0; i < keyFields.length; i++ ) { retval.append( " " ).append( XMLHandler.addTagValue( "key", keyFields[i] ) ); } retval.append( " " ).append( XMLHandler.closeTag( "keys" ) ).append( Const.CR ); return retval.toString(); }
MultiMergeJoinMeta extends BaseStepMeta implements StepMetaInterface { @Override public String getXML() { StringBuilder retval = new StringBuilder(); String[] inputStepsNames = inputSteps != null ? inputSteps : ArrayUtils.EMPTY_STRING_ARRAY; retval.append( " " ).append( XMLHandler.addTagValue( "join_type", getJoinType() ) ); for ( int i = 0; i < inputStepsNames.length; i++ ) { retval.append( " " ).append( XMLHandler.addTagValue( "step" + i, inputStepsNames[ i ] ) ); } retval.append( " " ).append( XMLHandler.addTagValue( "number_input", inputStepsNames.length ) ); retval.append( " " ).append( XMLHandler.openTag( "keys" ) ).append( Const.CR ); for ( int i = 0; i < keyFields.length; i++ ) { retval.append( " " ).append( XMLHandler.addTagValue( "key", keyFields[i] ) ); } retval.append( " " ).append( XMLHandler.closeTag( "keys" ) ).append( Const.CR ); return retval.toString(); } }
MultiMergeJoinMeta extends BaseStepMeta implements StepMetaInterface { @Override public String getXML() { StringBuilder retval = new StringBuilder(); String[] inputStepsNames = inputSteps != null ? inputSteps : ArrayUtils.EMPTY_STRING_ARRAY; retval.append( " " ).append( XMLHandler.addTagValue( "join_type", getJoinType() ) ); for ( int i = 0; i < inputStepsNames.length; i++ ) { retval.append( " " ).append( XMLHandler.addTagValue( "step" + i, inputStepsNames[ i ] ) ); } retval.append( " " ).append( XMLHandler.addTagValue( "number_input", inputStepsNames.length ) ); retval.append( " " ).append( XMLHandler.openTag( "keys" ) ).append( Const.CR ); for ( int i = 0; i < keyFields.length; i++ ) { retval.append( " " ).append( XMLHandler.addTagValue( "key", keyFields[i] ) ); } retval.append( " " ).append( XMLHandler.closeTag( "keys" ) ).append( Const.CR ); return retval.toString(); } MultiMergeJoinMeta(); }
MultiMergeJoinMeta extends BaseStepMeta implements StepMetaInterface { @Override public String getXML() { StringBuilder retval = new StringBuilder(); String[] inputStepsNames = inputSteps != null ? inputSteps : ArrayUtils.EMPTY_STRING_ARRAY; retval.append( " " ).append( XMLHandler.addTagValue( "join_type", getJoinType() ) ); for ( int i = 0; i < inputStepsNames.length; i++ ) { retval.append( " " ).append( XMLHandler.addTagValue( "step" + i, inputStepsNames[ i ] ) ); } retval.append( " " ).append( XMLHandler.addTagValue( "number_input", inputStepsNames.length ) ); retval.append( " " ).append( XMLHandler.openTag( "keys" ) ).append( Const.CR ); for ( int i = 0; i < keyFields.length; i++ ) { retval.append( " " ).append( XMLHandler.addTagValue( "key", keyFields[i] ) ); } retval.append( " " ).append( XMLHandler.closeTag( "keys" ) ).append( Const.CR ); return retval.toString(); } MultiMergeJoinMeta(); String getJoinType(); void setJoinType( String joinType ); String[] getKeyFields(); void setKeyFields( String[] keyFields ); @Override boolean excludeFromRowLayoutVerification(); @Override void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); void allocateKeys( int nrKeys ); @Override Object clone(); @Override String getXML(); @Override void setDefault(); @Override void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); @Override void searchInfoAndTargetSteps( List<StepMeta> steps ); @Override void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); @Override void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev,
      String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository,
      IMetaStore metaStore ); @Override void getFields( RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep,
      VariableSpace space, Repository repository, IMetaStore metaStore ); @Override StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta tr,
      Trans trans ); @Override StepDataInterface getStepData(); @Override void resetStepIoMeta(); void setInputSteps( String[] inputSteps ); String[] getInputSteps(); void allocateInputSteps( int count ); }
MultiMergeJoinMeta extends BaseStepMeta implements StepMetaInterface { @Override public String getXML() { StringBuilder retval = new StringBuilder(); String[] inputStepsNames = inputSteps != null ? inputSteps : ArrayUtils.EMPTY_STRING_ARRAY; retval.append( " " ).append( XMLHandler.addTagValue( "join_type", getJoinType() ) ); for ( int i = 0; i < inputStepsNames.length; i++ ) { retval.append( " " ).append( XMLHandler.addTagValue( "step" + i, inputStepsNames[ i ] ) ); } retval.append( " " ).append( XMLHandler.addTagValue( "number_input", inputStepsNames.length ) ); retval.append( " " ).append( XMLHandler.openTag( "keys" ) ).append( Const.CR ); for ( int i = 0; i < keyFields.length; i++ ) { retval.append( " " ).append( XMLHandler.addTagValue( "key", keyFields[i] ) ); } retval.append( " " ).append( XMLHandler.closeTag( "keys" ) ).append( Const.CR ); return retval.toString(); } MultiMergeJoinMeta(); String getJoinType(); void setJoinType( String joinType ); String[] getKeyFields(); void setKeyFields( String[] keyFields ); @Override boolean excludeFromRowLayoutVerification(); @Override void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); void allocateKeys( int nrKeys ); @Override Object clone(); @Override String getXML(); @Override void setDefault(); @Override void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); @Override void searchInfoAndTargetSteps( List<StepMeta> steps ); @Override void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); @Override void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev,
      String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository,
      IMetaStore metaStore ); @Override void getFields( RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep,
      VariableSpace space, Repository repository, IMetaStore metaStore ); @Override StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta tr,
      Trans trans ); @Override StepDataInterface getStepData(); @Override void resetStepIoMeta(); void setInputSteps( String[] inputSteps ); String[] getInputSteps(); void allocateInputSteps( int count ); static final String[] join_types; static final boolean[] optionals; }