/** * package-local visibility for testing purposes */ TransMeta loadTransformationMeta() throws KettleException { return MetaInjectMeta.loadTransformationMeta( meta, getTrans().getRepository(), getTrans().getMetaStore(), this ); }
@Test public void testCreateInternalTransSetsRepository() throws KettleException { Trans transParentMock = mock( Trans.class ); Repository repositoryMock = mock( Repository.class ); TransExecutorData transExecutorDataMock = mock( TransExecutorData.class ); TransMeta transMetaMock = mock( TransMeta.class ); executor.init( meta, data ); when( transParentMock.getRepository() ).thenReturn( repositoryMock ); when( transParentMock.getLogLevel() ).thenReturn( LogLevel.DEBUG ); doNothing().when( transParentMock ).initializeVariablesFrom( any( VariableSpace.class ) ); when( executor.getLogLevel() ).thenReturn( LogLevel.DEBUG ); when( executor.createInternalTrans() ).thenCallRealMethod(); when( executor.getTrans() ).thenReturn( transParentMock ); when( executor.getData() ).thenReturn( transExecutorDataMock ); when( transMetaMock.listVariables() ).thenReturn( new String[0] ); when( transMetaMock.listParameters() ).thenReturn( new String[0] ); when( transExecutorDataMock.getExecutorTransMeta() ).thenReturn( transMetaMock ); Trans internalTrans = executor.createInternalTrans(); assertNotNull( internalTrans ); Trans parentTrans = internalTrans.getParentTrans(); assertEquals( parentTrans, transParentMock ); assertEquals( parentTrans.getRepository(), repositoryMock ); assertEquals( internalTrans.getRepository(), repositoryMock ); }
@VisibleForTesting Trans createInternalTrans() throws KettleException { Trans executorTrans = new Trans( getData().getExecutorTransMeta(), this ); executorTrans.setParentTrans( getTrans() ); executorTrans.setRepository( getTrans().getRepository() ); executorTrans.setLogLevel( getLogLevel() ); executorTrans.setArguments( getTrans().getArguments() ); executorTrans.setInternalKettleVariables( this ); executorTrans.setPreview( getTrans().isPreview() ); TransStepUtil.initServletConfig( getTrans(), executorTrans ); return executorTrans; }
private Trans createSubtrans() { Trans subTrans = new Trans( this.subtransMeta, this.parentTrans ); subTrans.setParentTrans( this.parentTrans ); subTrans.setRepository( this.parentTrans.getRepository() ); subTrans.setLogLevel( this.parentTrans.getLogLevel() ); subTrans.setArguments( this.parentTrans.getArguments() ); if ( this.shareVariables ) { subTrans.shareVariablesWith( this.parentTrans ); } subTrans.setInternalKettleVariables( this.parentTrans ); subTrans.copyParametersFrom( this.subtransMeta ); subTrans.setPreview( this.parentTrans.isPreview() ); TransStepUtil.initServletConfig( this.parentTrans, subTrans ); return subTrans; }
data.repository = getTrans().getRepository(); if ( data.repository != null ) { data.tree = data.repository.loadRepositoryDirectoryTree(); TransformationInformation.init( getTrans().getRepository() ); JobInformation.init( getTrans().getRepository() ); if ( getTrans().getRepository() == null ) { switch ( objectType ) { case TRANSFORMATION:
meta.getFields( data.outputRowMeta, getStepname(), null, null, this, getTrans().getRepository(), getTrans() .getMetaStore() );