Search in sources :

Example 16 with LoggingObjectInterface

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

the class KettleReportBuilderTest method createReport.

@Test
public void createReport() throws Exception {
    LoggingObjectInterface log = mock(LoggingObjectInterface.class);
    AutoDocOptionsInterface options = mock(AutoDocOptionsInterface.class);
    when(options.isIncludingImage()).thenReturn(Boolean.TRUE);
    KettleReportBuilder builder = new KettleReportBuilder(log, Collections.<ReportSubjectLocation>emptyList(), "", options);
    builder.createReport();
    assertNotNull(builder.getReport());
    assertNotNull(builder.getReport().getDataFactory());
    assertNotNull(builder.getReport().getReportHeader());
    assertNotNull(builder.getReport().getReportFooter());
    assertNotNull(builder.getReport().getRootGroup());
    assertNotNull(builder.getReport().getPageDefinition());
    assertTrue(builder.getReport().getExpressions().size() > 0);
}
Also used : LoggingObjectInterface(org.pentaho.di.core.logging.LoggingObjectInterface) Test(org.junit.Test)

Example 17 with LoggingObjectInterface

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

the class JobTrackerExecution method setUpBeforeClass.

@Before
public void setUpBeforeClass() throws Exception {
    KettleEnvironment.init();
    LoggingObjectInterface log = new SimpleLoggingObject("junit", LoggingObjectType.GENERAL, null);
    File file = File.createTempFile(JobTrackerExecution.class.getSimpleName(), "");
    file.deleteOnExit();
    DatabaseMeta databaseMeta = new DatabaseMeta(NAME, "Hypersonic", "JDBC", null, "mem:HSQLDB-JUNIT-LOGJOB", null, null, null);
    Database logDataBase = new Database(log, databaseMeta);
    logDataBase.connect();
    // run sql create for database
    InputStream input = JobTrackerExecution.class.getClassLoader().getResourceAsStream(PKG + CREATE);
    String sql = getStringFromInput(input);
    logDataBase.execStatements(sql);
    logDataBase.commit(true);
    logDataBase.disconnect();
}
Also used : InputStream(java.io.InputStream) Database(org.pentaho.di.core.database.Database) LoggingObjectInterface(org.pentaho.di.core.logging.LoggingObjectInterface) SimpleLoggingObject(org.pentaho.di.core.logging.SimpleLoggingObject) File(java.io.File) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) Before(org.junit.Before)

Aggregations

LoggingObjectInterface (org.pentaho.di.core.logging.LoggingObjectInterface)17 SimpleLoggingObject (org.pentaho.di.core.logging.SimpleLoggingObject)5 ArrayList (java.util.ArrayList)4 Test (org.junit.Test)4 RowMetaAndData (org.pentaho.di.core.RowMetaAndData)3 Database (org.pentaho.di.core.database.Database)3 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)3 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)3 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)3 Timer (java.util.Timer)2 TimerTask (java.util.TimerTask)2 ControlAdapter (org.eclipse.swt.events.ControlAdapter)2 ControlEvent (org.eclipse.swt.events.ControlEvent)2 DisposeEvent (org.eclipse.swt.events.DisposeEvent)2 DisposeListener (org.eclipse.swt.events.DisposeListener)2 MouseAdapter (org.eclipse.swt.events.MouseAdapter)2 MouseEvent (org.eclipse.swt.events.MouseEvent)2 PaintEvent (org.eclipse.swt.events.PaintEvent)2 PaintListener (org.eclipse.swt.events.PaintListener)2 Rectangle (org.eclipse.swt.graphics.Rectangle)2