@Test public void recordsCleanUpMethodIsCalled_JobLogTable() throws Exception { JobLogTable jobLogTable = JobLogTable.getDefault( mockedVariableSpace, hasDatabasesInterface ); setAllTableParamsDefault( jobLogTable ); doCallRealMethod().when( mockedJob ).writeLogTableInformation( jobLogTable, LogStatus.END ); mockedJob.writeLogTableInformation( jobLogTable, LogStatus.END ); verify( mockedDataBase ).cleanupLogRecords( jobLogTable ); }
protected void writeLogTableInformation( JobLogTable jobLogTable, LogStatus status ) throws KettleJobException, KettleDatabaseException { boolean cleanLogRecords = status.equals( LogStatus.END ); String tableName = jobLogTable.getActualTableName(); DatabaseMeta logcon = jobLogTable.getDatabaseMeta(); Database ldb = createDataBase( logcon ); ldb.shareVariablesWith( this ); try { ldb.connect(); ldb.setCommit( logCommitSize ); ldb.writeLogRecord( jobLogTable, status, this, null ); if ( cleanLogRecords ) { ldb.cleanupLogRecords( jobLogTable ); } } catch ( KettleDatabaseException dbe ) { addErrors( 1 ); throw new KettleJobException( "Unable to end processing by writing log record to table " + tableName, dbe ); } finally { if ( !ldb.isAutoCommit() ) { ldb.commitLog( true, jobLogTable ); } ldb.disconnect(); } }
Job extends Thread implements VariableSpace, NamedParams, HasLogChannelInterface, LoggingObjectInterface,
    ExecutorInterface, ExtensionDataInterface { protected void writeLogTableInformation( JobLogTable jobLogTable, LogStatus status ) throws KettleJobException, KettleDatabaseException { boolean cleanLogRecords = status.equals( LogStatus.END ); String tableName = jobLogTable.getActualTableName(); DatabaseMeta logcon = jobLogTable.getDatabaseMeta(); Database ldb = createDataBase( logcon ); ldb.shareVariablesWith( this ); try { ldb.connect(); ldb.setCommit( logCommitSize ); ldb.writeLogRecord( jobLogTable, status, this, null ); if ( cleanLogRecords ) { ldb.cleanupLogRecords( jobLogTable ); } } catch ( KettleDatabaseException dbe ) { addErrors( 1 ); throw new KettleJobException( "Unable to end processing by writing log record to table " + tableName, dbe ); } finally { if ( !ldb.isAutoCommit() ) { ldb.commitLog( true, jobLogTable ); } ldb.disconnect(); } } }
Job extends Thread implements VariableSpace, NamedParams, HasLogChannelInterface, LoggingObjectInterface,
    ExecutorInterface, ExtensionDataInterface { protected void writeLogTableInformation( JobLogTable jobLogTable, LogStatus status ) throws KettleJobException, KettleDatabaseException { boolean cleanLogRecords = status.equals( LogStatus.END ); String tableName = jobLogTable.getActualTableName(); DatabaseMeta logcon = jobLogTable.getDatabaseMeta(); Database ldb = createDataBase( logcon ); ldb.shareVariablesWith( this ); try { ldb.connect(); ldb.setCommit( logCommitSize ); ldb.writeLogRecord( jobLogTable, status, this, null ); if ( cleanLogRecords ) { ldb.cleanupLogRecords( jobLogTable ); } } catch ( KettleDatabaseException dbe ) { addErrors( 1 ); throw new KettleJobException( "Unable to end processing by writing log record to table " + tableName, dbe ); } finally { if ( !ldb.isAutoCommit() ) { ldb.commitLog( true, jobLogTable ); } ldb.disconnect(); } } Job( String name, String file, String[] args );  Job( Repository repository, JobMeta jobMeta );  Job( Repository repository, JobMeta jobMeta, LoggingObjectInterface parentLogging );  Job(); }
Job extends Thread implements VariableSpace, NamedParams, HasLogChannelInterface, LoggingObjectInterface,
    ExecutorInterface, ExtensionDataInterface { protected void writeLogTableInformation( JobLogTable jobLogTable, LogStatus status ) throws KettleJobException, KettleDatabaseException { boolean cleanLogRecords = status.equals( LogStatus.END ); String tableName = jobLogTable.getActualTableName(); DatabaseMeta logcon = jobLogTable.getDatabaseMeta(); Database ldb = createDataBase( logcon ); ldb.shareVariablesWith( this ); try { ldb.connect(); ldb.setCommit( logCommitSize ); ldb.writeLogRecord( jobLogTable, status, this, null ); if ( cleanLogRecords ) { ldb.cleanupLogRecords( jobLogTable ); } } catch ( KettleDatabaseException dbe ) { addErrors( 1 ); throw new KettleJobException( "Unable to end processing by writing log record to table " + tableName, dbe ); } finally { if ( !ldb.isAutoCommit() ) { ldb.commitLog( true, jobLogTable ); } ldb.disconnect(); } } Job( String name, String file, String[] args );  Job( Repository repository, JobMeta jobMeta );  Job( Repository repository, JobMeta jobMeta, LoggingObjectInterface parentLogging );  Job(); void init(); @Override String toString(); static final Job createJobWithNewClassLoader(); String getJobname(); void setRepository( Repository rep ); void run(); Result execute( int nr, Result result ); void fireJobFinishListeners(); void fireJobStartListeners(); void waitUntilFinished(); void waitUntilFinished( long maxMiliseconds ); int getErrors(); void resetErrors(); void addErrors( int nrToAdd ); boolean beginProcessing(); boolean isActive(); void stopAll(); void setStopped( boolean stopped ); boolean isStopped(); Date getStartDate(); Date getEndDate(); Date getCurrentDate(); Date getDepDate(); Date getLogDate(); JobMeta getJobMeta(); Repository getRep(); Thread getThread(); JobTracker getJobTracker(); void setJobTracker( JobTracker jobTracker ); void setSourceRows( List<RowMetaAndData> sourceRows ); List<RowMetaAndData> getSourceRows(); Job getParentJob(); void setParentJob( Job parentJob ); Result getResult(); void setResult( Result result ); boolean isInitialized(); long getBatchId(); void setBatchId( long batchId ); long getPassedBatchId(); void setPassedBatchId( long jobBatchId ); void setInternalKettleVariables( VariableSpace var ); void copyVariablesFrom( VariableSpace space ); String environmentSubstitute( String aString ); String[] environmentSubstitute( String[] aString ); String fieldSubstitute( String aString, RowMetaInterface rowMeta, Object[] rowData ); VariableSpace getParentVariableSpace(); void setParentVariableSpace( VariableSpace parent ); String getVariable( String variableName, String defaultValue ); String getVariable( String variableName ); boolean getBooleanValueOfVariable( String variableName, boolean defaultValue ); void initializeVariablesFrom( VariableSpace parent ); String[] listVariables(); void setVariable( String variableName, String variableValue ); void shareVariablesWith( VariableSpace space ); void injectVariables( Map<String, String> prop ); String getStatus(); static String sendToSlaveServer( JobMeta jobMeta, JobExecutionConfiguration executionConfiguration,
      Repository repository, IMetaStore metaStore ); void addJobListener( JobListener jobListener ); void addJobEntryListener( JobEntryListener jobEntryListener ); void removeJobListener( JobListener jobListener ); void removeJobEntryListener( JobEntryListener jobEntryListener ); List<JobEntryListener> getJobEntryListeners(); List<JobListener> getJobListeners(); boolean isFinished(); void setFinished( boolean finished ); void addParameterDefinition( String key, String defValue, String description ); String getParameterDescription( String key ); String getParameterDefault( String key ); String getParameterValue( String key ); String[] listParameters(); void setParameterValue( String key, String value ); void eraseParameters(); void clearParameters(); void activateParameters(); void copyParametersFrom( NamedParams params ); void setSocketRepository( SocketRepository socketRepository ); SocketRepository getSocketRepository(); LogChannelInterface getLogChannel(); String getObjectName(); String getObjectCopy(); String getFilename(); String getLogChannelId(); ObjectId getObjectId(); ObjectRevision getObjectRevision(); LoggingObjectType getObjectType(); LoggingObjectInterface getParent(); RepositoryDirectoryInterface getRepositoryDirectory(); LogLevel getLogLevel(); void setLogLevel( LogLevel logLevel ); List<LoggingHierarchy> getLoggingHierarchy(); boolean isInteractive(); void setInteractive( boolean interactive ); Map<JobEntryCopy, JobEntryTrans> getActiveJobEntryTransformations(); Map<JobEntryCopy, JobEntryJob> getActiveJobEntryJobs(); List<JobEntryResult> getJobEntryResults(); String getContainerObjectId(); void setContainerObjectId( String containerObjectId ); LoggingObjectInterface getParentLoggingObject(); Date getRegistrationDate(); JobEntryCopy getStartJobEntryCopy(); void setStartJobEntryCopy( JobEntryCopy startJobEntryCopy ); String getExecutingServer(); void setExecutingServer( String executingServer ); String getExecutingUser(); void setExecutingUser( String executingUser ); @Override boolean isGatheringMetrics(); @Override void setGatheringMetrics( boolean gatheringMetrics ); @Override boolean isForcingSeparateLogging(); @Override void setForcingSeparateLogging( boolean forcingSeparateLogging ); String getTransactionId(); void setTransactionId( String transactionId ); List<DelegationListener> getDelegationListeners(); void setDelegationListeners( List<DelegationListener> delegationListeners ); void addDelegationListener( DelegationListener delegationListener ); String[] getArguments(); void setArguments( String[] arguments ); Trans getParentTrans(); void setParentTrans( Trans parentTrans ); Map<String, Object> getExtensionDataMap(); Result getStartJobEntryResult(); void setStartJobEntryResult( Result startJobEntryResult ); }
Job extends Thread implements VariableSpace, NamedParams, HasLogChannelInterface, LoggingObjectInterface,
    ExecutorInterface, ExtensionDataInterface { protected void writeLogTableInformation( JobLogTable jobLogTable, LogStatus status ) throws KettleJobException, KettleDatabaseException { boolean cleanLogRecords = status.equals( LogStatus.END ); String tableName = jobLogTable.getActualTableName(); DatabaseMeta logcon = jobLogTable.getDatabaseMeta(); Database ldb = createDataBase( logcon ); ldb.shareVariablesWith( this ); try { ldb.connect(); ldb.setCommit( logCommitSize ); ldb.writeLogRecord( jobLogTable, status, this, null ); if ( cleanLogRecords ) { ldb.cleanupLogRecords( jobLogTable ); } } catch ( KettleDatabaseException dbe ) { addErrors( 1 ); throw new KettleJobException( "Unable to end processing by writing log record to table " + tableName, dbe ); } finally { if ( !ldb.isAutoCommit() ) { ldb.commitLog( true, jobLogTable ); } ldb.disconnect(); } } Job( String name, String file, String[] args );  Job( Repository repository, JobMeta jobMeta );  Job( Repository repository, JobMeta jobMeta, LoggingObjectInterface parentLogging );  Job(); void init(); @Override String toString(); static final Job createJobWithNewClassLoader(); String getJobname(); void setRepository( Repository rep ); void run(); Result execute( int nr, Result result ); void fireJobFinishListeners(); void fireJobStartListeners(); void waitUntilFinished(); void waitUntilFinished( long maxMiliseconds ); int getErrors(); void resetErrors(); void addErrors( int nrToAdd ); boolean beginProcessing(); boolean isActive(); void stopAll(); void setStopped( boolean stopped ); boolean isStopped(); Date getStartDate(); Date getEndDate(); Date getCurrentDate(); Date getDepDate(); Date getLogDate(); JobMeta getJobMeta(); Repository getRep(); Thread getThread(); JobTracker getJobTracker(); void setJobTracker( JobTracker jobTracker ); void setSourceRows( List<RowMetaAndData> sourceRows ); List<RowMetaAndData> getSourceRows(); Job getParentJob(); void setParentJob( Job parentJob ); Result getResult(); void setResult( Result result ); boolean isInitialized(); long getBatchId(); void setBatchId( long batchId ); long getPassedBatchId(); void setPassedBatchId( long jobBatchId ); void setInternalKettleVariables( VariableSpace var ); void copyVariablesFrom( VariableSpace space ); String environmentSubstitute( String aString ); String[] environmentSubstitute( String[] aString ); String fieldSubstitute( String aString, RowMetaInterface rowMeta, Object[] rowData ); VariableSpace getParentVariableSpace(); void setParentVariableSpace( VariableSpace parent ); String getVariable( String variableName, String defaultValue ); String getVariable( String variableName ); boolean getBooleanValueOfVariable( String variableName, boolean defaultValue ); void initializeVariablesFrom( VariableSpace parent ); String[] listVariables(); void setVariable( String variableName, String variableValue ); void shareVariablesWith( VariableSpace space ); void injectVariables( Map<String, String> prop ); String getStatus(); static String sendToSlaveServer( JobMeta jobMeta, JobExecutionConfiguration executionConfiguration,
      Repository repository, IMetaStore metaStore ); void addJobListener( JobListener jobListener ); void addJobEntryListener( JobEntryListener jobEntryListener ); void removeJobListener( JobListener jobListener ); void removeJobEntryListener( JobEntryListener jobEntryListener ); List<JobEntryListener> getJobEntryListeners(); List<JobListener> getJobListeners(); boolean isFinished(); void setFinished( boolean finished ); void addParameterDefinition( String key, String defValue, String description ); String getParameterDescription( String key ); String getParameterDefault( String key ); String getParameterValue( String key ); String[] listParameters(); void setParameterValue( String key, String value ); void eraseParameters(); void clearParameters(); void activateParameters(); void copyParametersFrom( NamedParams params ); void setSocketRepository( SocketRepository socketRepository ); SocketRepository getSocketRepository(); LogChannelInterface getLogChannel(); String getObjectName(); String getObjectCopy(); String getFilename(); String getLogChannelId(); ObjectId getObjectId(); ObjectRevision getObjectRevision(); LoggingObjectType getObjectType(); LoggingObjectInterface getParent(); RepositoryDirectoryInterface getRepositoryDirectory(); LogLevel getLogLevel(); void setLogLevel( LogLevel logLevel ); List<LoggingHierarchy> getLoggingHierarchy(); boolean isInteractive(); void setInteractive( boolean interactive ); Map<JobEntryCopy, JobEntryTrans> getActiveJobEntryTransformations(); Map<JobEntryCopy, JobEntryJob> getActiveJobEntryJobs(); List<JobEntryResult> getJobEntryResults(); String getContainerObjectId(); void setContainerObjectId( String containerObjectId ); LoggingObjectInterface getParentLoggingObject(); Date getRegistrationDate(); JobEntryCopy getStartJobEntryCopy(); void setStartJobEntryCopy( JobEntryCopy startJobEntryCopy ); String getExecutingServer(); void setExecutingServer( String executingServer ); String getExecutingUser(); void setExecutingUser( String executingUser ); @Override boolean isGatheringMetrics(); @Override void setGatheringMetrics( boolean gatheringMetrics ); @Override boolean isForcingSeparateLogging(); @Override void setForcingSeparateLogging( boolean forcingSeparateLogging ); String getTransactionId(); void setTransactionId( String transactionId ); List<DelegationListener> getDelegationListeners(); void setDelegationListeners( List<DelegationListener> delegationListeners ); void addDelegationListener( DelegationListener delegationListener ); String[] getArguments(); void setArguments( String[] arguments ); Trans getParentTrans(); void setParentTrans( Trans parentTrans ); Map<String, Object> getExtensionDataMap(); Result getStartJobEntryResult(); void setStartJobEntryResult( Result startJobEntryResult ); static final String CONFIGURATION_IN_EXPORT_FILENAME; }