@Test public void testSynchronizeDifferentFieldsArraysLengths() throws Exception { ReplaceStringData data = new ReplaceStringData(); ReplaceString replaceString = new ReplaceString( stepMockHelper.stepMeta, data, 0, stepMockHelper.transMeta, stepMockHelper.trans ); ReplaceStringMeta meta = new ReplaceStringMeta(); replaceString.init( meta, data ); meta.setFieldInStream( new String[] { "input1", "input2" } ); meta.setFieldOutStream( new String[] { "out" } ); meta.setUseRegEx( new int[] { 1 } ); meta.setCaseSensitive( new int[] { 0 } ); meta.setWholeWord( new int[] { 1 } ); meta.setReplaceString( new String[] { "string" } ); meta.setReplaceByString( new String[] { "string" } ); meta.setEmptyString( new boolean[] { true } ); meta.setFieldReplaceByString( new String[] { "string" } ); meta.afterInjectionSynchronization(); Assert.assertEquals( meta.getFieldInStream().length, meta.getFieldOutStream().length ); Assert.assertEquals( StringUtils.EMPTY, meta.getFieldOutStream()[ 1 ] ); Assert.assertEquals( meta.getFieldInStream().length, meta.getUseRegEx().length ); Assert.assertEquals( 0, meta.getUseRegEx()[ 1 ] ); Assert.assertEquals( meta.getFieldInStream().length, meta.getCaseSensitive().length ); Assert.assertEquals( 0, meta.getCaseSensitive()[ 1 ] ); Assert.assertEquals( meta.getFieldInStream().length, meta.getWholeWord().length ); Assert.assertEquals( 0, meta.getWholeWord()[ 1 ] ); Assert.assertEquals( meta.getFieldInStream().length, meta.getReplaceString().length ); Assert.assertEquals( StringUtils.EMPTY, meta.getReplaceString()[ 1 ] ); Assert.assertEquals( meta.getFieldInStream().length, meta.getReplaceByString().length ); Assert.assertEquals( StringUtils.EMPTY, meta.getReplaceByString()[ 1 ] ); Assert.assertEquals( meta.getFieldInStream().length, meta.isSetEmptyString().length ); Assert.assertEquals( false, meta.isSetEmptyString()[ 1 ] ); Assert.assertEquals( meta.getFieldInStream().length, meta.getFieldReplaceByString().length ); Assert.assertEquals( StringUtils.EMPTY, meta.getFieldReplaceByString()[ 1 ] ); }
public boolean init( StepMetaInterface smi, StepDataInterface sdi ) { meta = (ReplaceStringMeta) smi; data = (ReplaceStringData) sdi; if ( super.init( smi, sdi ) ) { return true; } return false; }
ReplaceString extends BaseStep implements StepInterface { public boolean init( StepMetaInterface smi, StepDataInterface sdi ) { meta = (ReplaceStringMeta) smi; data = (ReplaceStringData) sdi; if ( super.init( smi, sdi ) ) { return true; } return false; } }
ReplaceString extends BaseStep implements StepInterface { public boolean init( StepMetaInterface smi, StepDataInterface sdi ) { meta = (ReplaceStringMeta) smi; data = (ReplaceStringData) sdi; if ( super.init( smi, sdi ) ) { return true; } return false; } ReplaceString( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta,
    Trans trans ); }
ReplaceString extends BaseStep implements StepInterface { public boolean init( StepMetaInterface smi, StepDataInterface sdi ) { meta = (ReplaceStringMeta) smi; data = (ReplaceStringData) sdi; if ( super.init( smi, sdi ) ) { return true; } return false; } ReplaceString( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta,
    Trans trans ); static String replaceString( String originalString, Pattern pattern, String replaceByString ); boolean processRow( StepMetaInterface smi, StepDataInterface sdi ); boolean init( StepMetaInterface smi, StepDataInterface sdi ); void dispose( StepMetaInterface smi, StepDataInterface sdi ); }
ReplaceString extends BaseStep implements StepInterface { public boolean init( StepMetaInterface smi, StepDataInterface sdi ) { meta = (ReplaceStringMeta) smi; data = (ReplaceStringData) sdi; if ( super.init( smi, sdi ) ) { return true; } return false; } ReplaceString( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta,
    Trans trans ); static String replaceString( String originalString, Pattern pattern, String replaceByString ); boolean processRow( StepMetaInterface smi, StepDataInterface sdi ); boolean init( StepMetaInterface smi, StepDataInterface sdi ); void dispose( StepMetaInterface smi, StepDataInterface sdi );  }