Search in sources :

Example 11 with JobEntryLogTable

use of org.pentaho.di.core.logging.JobEntryLogTable in project pentaho-kettle by pentaho.

the class SpoonExportXmlTest method initTables.

private void initTables(JobMeta jobMeta) {
    JobLogTable jobLogTable = JobLogTable.getDefault(mockedVariableSpace, mockedHasDbInterface);
    initTableWithSampleParams(jobLogTable);
    jobLogTable.setLogInterval(GLOBAL_PARAM);
    jobLogTable.setLogSizeLimit(GLOBAL_PARAM);
    jobMeta.setJobLogTable(jobLogTable);
    JobEntryLogTable jobEntryLogTable = JobEntryLogTable.getDefault(mockedVariableSpace, mockedHasDbInterface);
    initTableWithSampleParams(jobEntryLogTable);
    jobMeta.setJobEntryLogTable(jobEntryLogTable);
    ChannelLogTable channelLogTable = ChannelLogTable.getDefault(mockedVariableSpace, mockedHasDbInterface);
    initTableWithSampleParams(channelLogTable);
    jobMeta.setChannelLogTable(channelLogTable);
    jobMeta.setExtraLogTables(null);
}
Also used : JobLogTable(org.pentaho.di.core.logging.JobLogTable) ChannelLogTable(org.pentaho.di.core.logging.ChannelLogTable) JobEntryLogTable(org.pentaho.di.core.logging.JobEntryLogTable)

Example 12 with JobEntryLogTable

use of org.pentaho.di.core.logging.JobEntryLogTable in project pentaho-kettle by pentaho.

the class Spoon method saveJobAsXmlFile.

private boolean saveJobAsXmlFile(JobMeta jobMeta, boolean export) {
    JobLogTable origJobLogTable = jobMeta.getJobLogTable();
    JobEntryLogTable originEntryLogTable = jobMeta.getJobEntryLogTable();
    ChannelLogTable originChannelLogTable = jobMeta.getChannelLogTable();
    List<LogTableInterface> originExtraLogTables = jobMeta.getExtraLogTables();
    try {
        XmlExportHelper.swapTables(jobMeta);
        return saveXMLFile(jobMeta, export);
    } finally {
        jobMeta.setJobLogTable(origJobLogTable);
        jobMeta.setJobEntryLogTable(originEntryLogTable);
        jobMeta.setChannelLogTable(originChannelLogTable);
        jobMeta.setExtraLogTables(originExtraLogTables);
    }
}
Also used : LogTableInterface(org.pentaho.di.core.logging.LogTableInterface) JobLogTable(org.pentaho.di.core.logging.JobLogTable) ChannelLogTable(org.pentaho.di.core.logging.ChannelLogTable) JobEntryLogTable(org.pentaho.di.core.logging.JobEntryLogTable)

Example 13 with JobEntryLogTable

use of org.pentaho.di.core.logging.JobEntryLogTable in project pentaho-kettle by pentaho.

the class JobTest method recordsCleanUpMethodIsCalled_JobEntryLogTable.

@Test
public void recordsCleanUpMethodIsCalled_JobEntryLogTable() throws Exception {
    JobEntryLogTable jobEntryLogTable = JobEntryLogTable.getDefault(mockedVariableSpace, hasDatabasesInterface);
    setAllTableParamsDefault(jobEntryLogTable);
    JobMeta jobMeta = new JobMeta();
    jobMeta.setJobEntryLogTable(jobEntryLogTable);
    when(mockedJob.getJobMeta()).thenReturn(jobMeta);
    doCallRealMethod().when(mockedJob).writeJobEntryLogInformation();
    mockedJob.writeJobEntryLogInformation();
    verify(mockedDataBase).cleanupLogRecords(jobEntryLogTable);
}
Also used : JobEntryLogTable(org.pentaho.di.core.logging.JobEntryLogTable) Test(org.junit.Test)

Aggregations

JobEntryLogTable (org.pentaho.di.core.logging.JobEntryLogTable)13 ChannelLogTable (org.pentaho.di.core.logging.ChannelLogTable)8 JobLogTable (org.pentaho.di.core.logging.JobLogTable)8 LogTableInterface (org.pentaho.di.core.logging.LogTableInterface)6 Test (org.junit.Test)4 ArrayList (java.util.ArrayList)3 Database (org.pentaho.di.core.database.Database)3 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)3 KettleValueException (org.pentaho.di.core.exception.KettleValueException)3 JobEntryCopy (org.pentaho.di.job.entry.JobEntryCopy)3 Matchers.anyString (org.mockito.Matchers.anyString)2 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)2 KettleException (org.pentaho.di.core.exception.KettleException)2 KettleJobException (org.pentaho.di.core.exception.KettleJobException)2 StepLogTable (org.pentaho.di.core.logging.StepLogTable)2 DuplicateParamException (org.pentaho.di.core.parameters.DuplicateParamException)2 UnknownParamException (org.pentaho.di.core.parameters.UnknownParamException)2 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)2 JobMeta (org.pentaho.di.job.JobMeta)2 Date (java.util.Date)1