public long getErrors() { return trans.getErrors(); }
/** * @deprecated Deprecated as of 8.0. Seems unused; will be to remove in 8.1 (ccaspanello) */ @Deprecated public void checkErrors() { if ( trans != null ) { if ( !trans.isFinished() ) { if ( trans.getErrors() != 0 ) { trans.killAll(); } } } }
private void checkErrorVisuals() { if ( trans.getErrors() > 0 ) {
@Override public void transFinished( Trans trans ) throws KettleException { // Copy over the data from the previewDelegate... // if ( trans.getErrors() != 0 ) { // capture logging and store it... // for ( StepMetaDataCombi combi : trans.getSteps() ) { if ( combi.copy == 0 ) { StringBuffer logBuffer = KettleLogStore.getAppender().getBuffer( combi.step.getLogChannel().getLogChannelId(), false ); previewLogMap.put( combi.stepMeta, logBuffer ); } } } } } );
@Test public void testStepShouldProcessError_WhenMappingTransHasError() throws KettleException { // Set Up TransMock to return the error int errorCount = 1; when( stepMockHelper.trans.getErrors() ).thenReturn( errorCount ); // The step has been already finished when( stepMockHelper.trans.isFinished() ).thenReturn( Boolean.TRUE ); // The step was started simpleMpData.wasStarted = true; smp = new SimpleMapping( stepMockHelper.stepMeta, stepMockHelper.stepDataInterface, 0, stepMockHelper.transMeta, stepMockHelper.trans ); smp.init( stepMockHelper.initStepMetaInterface, simpleMpData ); smp.dispose( stepMockHelper.processRowsStepMetaInterface, simpleMpData ); verify( stepMockHelper.trans, times( 1 ) ).isFinished(); verify( stepMockHelper.trans, never() ).waitUntilFinished(); verify( stepMockHelper.trans, never() ).addActiveSubTransformation( anyString(), any( Trans.class ) ); verify( stepMockHelper.trans, times( 1 ) ).removeActiveSubTransformation( anyString() ); verify( stepMockHelper.trans, never() ).getActiveSubTransformation( anyString() ); verify( stepMockHelper.trans, times( 1 ) ).getErrors(); assertTrue( "The step contains the errors", smp.getErrors() == errorCount ); }
@Test public void testDispose() throws KettleException { // Set Up TransMock to return the error when( stepMockHelper.trans.getErrors() ).thenReturn( 0 ); // The step has been already finished when( stepMockHelper.trans.isFinished() ).thenReturn( Boolean.FALSE ); // The step was started simpleMpData.wasStarted = true; smp = new SimpleMapping( stepMockHelper.stepMeta, stepMockHelper.stepDataInterface, 0, stepMockHelper.transMeta, stepMockHelper.trans ); smp.init( stepMockHelper.initStepMetaInterface, simpleMpData ); smp.dispose( stepMockHelper.processRowsStepMetaInterface, simpleMpData ); verify( stepMockHelper.trans, times( 1 ) ).isFinished(); verify( stepMockHelper.trans, times( 1 ) ).waitUntilFinished(); verify( stepMockHelper.trans, times( 1 ) ).removeActiveSubTransformation( anyString() ); }
trans.startThreads(); trans.waitUntilFinished(); if ( trans.getErrors() > 0 ) { StringBuffer log = KettleLogStore.getAppender().getBuffer( trans.getLogChannelId(), false ); buffer.append( log );
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { // Close the running transformation if ( getData().wasStarted ) { if ( !getData().mappingTrans.isFinished() ) { // Wait until the child transformation has finished. getData().mappingTrans.waitUntilFinished(); } // Remove it from the list of active sub-transformations... // getTrans().removeActiveSubTransformation( getStepname() ); // See if there was an error in the sub-transformation, in that case, flag error etc. if ( getData().mappingTrans.getErrors() > 0 ) { logError( BaseMessages.getString( PKG, "SimpleMapping.Log.ErrorOccurredInSubTransformation" ) ); setErrors( 1 ); } } super.dispose( smi, sdi ); }
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { // Close the running transformation if ( getData().wasStarted ) { if ( !getData().mappingTrans.isFinished() ) { // Wait until the child transformation has finished. getData().getMappingTrans().waitUntilFinished(); } // Remove it from the list of active sub-transformations... // getTrans().removeActiveSubTransformation( getStepname() ); // See if there was an error in the sub-transformation, in that case, flag error etc. if ( getData().getMappingTrans().getErrors() > 0 ) { logError( BaseMessages.getString( PKG, "Mapping.Log.ErrorOccurredInSubTransformation" ) ); setErrors( 1 ); } } super.dispose( smi, sdi ); }
if ( trans.getErrors() > 0 ) { setDebugStatus( "Errors detected for mapper transformation" ); List<KettleLoggingEvent> logList = KettleLogStore