for ( StepMeta stepMeta : injectTransMeta.getUsedSteps() ) { StepMetaInterface meta = stepMeta.getStepMetaInterface(); if ( meta.getStepMetaInjectionInterface() != null || BeanInjectionInfo .isInjectionSupported( meta.getClass() ) ) { injectSteps.add( stepMeta ); processNewMDIDescription( stepMeta, stepItem, metaInterface ); } else { processOldMDIDescription( stepMeta, stepItem, metaInterface.getStepMetaInjectionInterface() );
@Test public void testTopLevelMetadataEntries() { try { List<StepInjectionMetaEntry> entries = loader.getStepMeta().getStepMetaInterface().getStepMetaInjectionInterface().getStepInjectionMetadataEntries(); String masterKeys = "SCHEMA TABLE LOADACTION STOPONERROR DELIMITER ENCLOSURE DBNAMEOVERRIDE MAPPINGS "; for ( StepInjectionMetaEntry entry : entries ) { String key = entry.getKey(); assertTrue( masterKeys.contains( key ) ); masterKeys = masterKeys.replace( key, "" ); } assertTrue( masterKeys.trim().length() == 0 ); } catch ( KettleException e ) { fail( e.getMessage() ); } }
@Test public void testTopLevelMetadataEntries() { try { List<StepInjectionMetaEntry> entries = loader.getStepMeta().getStepMetaInterface().getStepMetaInjectionInterface().getStepInjectionMetadataEntries(); String masterKeys = "SCHEMA TABLE LOGFILE FIELD_SEPARATOR FIELD_ENCLOSURE NULL_REPRESENTATION ENCODING TRUNCATE " + "FULLY_QUOTE_SQL BUFFER_SIZE MAPPINGS "; for ( StepInjectionMetaEntry entry : entries ) { String key = entry.getKey(); assertTrue( masterKeys.contains( key ) ); masterKeys = masterKeys.replace( key, "" ); } assertTrue( masterKeys.trim().length() == 0 ); } catch ( KettleException e ) { fail( e.getMessage() ); } }
for ( StepMeta stepMeta : data.transMeta.getUsedSteps() ) { StepMetaInjectionInterface injectionInterface = stepMeta.getStepMetaInterface().getStepMetaInjectionInterface(); if ( injectionInterface != null ) { data.stepInjectionMap.put( stepMeta.getName(), injectionInterface );
@Test public void testChildLevelMetadataEntries() { try { List<StepInjectionMetaEntry> entries = loader.getStepMeta().getStepMetaInterface().getStepMetaInjectionInterface().getStepInjectionMetadataEntries(); String childKeys = "STREAMNAME FIELDNAME DATEMASK "; StepInjectionMetaEntry mappingEntry = null; for ( StepInjectionMetaEntry entry : entries ) { String key = entry.getKey(); if ( key.equals( "MAPPINGS" ) ) { mappingEntry = entry; break; } } assertNotNull( mappingEntry ); List<StepInjectionMetaEntry> fieldAttributes = mappingEntry.getDetails().get( 0 ).getDetails(); for ( StepInjectionMetaEntry attribute : fieldAttributes ) { String key = attribute.getKey(); assertTrue( childKeys.contains( key ) ); childKeys = childKeys.replace( key, "" ); } assertTrue( childKeys.trim().length() == 0 ); } catch ( KettleException e ) { fail( e.getMessage() ); } }
@Test public void testChildLevelMetadataEntries() { try { List<StepInjectionMetaEntry> entries = loader.getStepMeta().getStepMetaInterface().getStepMetaInjectionInterface().getStepInjectionMetadataEntries(); String childKeys = "STREAMNAME FIELDNAME FIELD_FORMAT_OK "; StepInjectionMetaEntry mappingEntry = null; for ( StepInjectionMetaEntry entry : entries ) { String key = entry.getKey(); if ( key.equals( "MAPPINGS" ) ) { mappingEntry = entry; break; } } assertNotNull( mappingEntry ); List<StepInjectionMetaEntry> fieldAttributes = mappingEntry.getDetails().get( 0 ).getDetails(); for ( StepInjectionMetaEntry attribute : fieldAttributes ) { String key = attribute.getKey(); assertTrue( childKeys.contains( key ) ); childKeys = childKeys.replace( key, "" ); } assertTrue( childKeys.trim().length() == 0 ); } catch ( KettleException e ) { fail( e.getMessage() ); } }
stepMetaInterface.getStepMetaInjectionInterface() != null || BeanInjectionInfo.isInjectionSupported( stepMetaInterface.getClass() );
loader.getStepMeta().getStepMetaInterface().getStepMetaInjectionInterface().getStepInjectionMetadataEntries(); loader.getStepMeta().getStepMetaInterface().getStepMetaInjectionInterface().injectStepMetadataEntries( entries );
loader.getStepMeta().getStepMetaInterface().getStepMetaInjectionInterface().getStepInjectionMetadataEntries(); loader.getStepMeta().getStepMetaInterface().getStepMetaInjectionInterface().injectStepMetadataEntries( entries );