use of org.pentaho.di.core.logging.LogChannelInterface in project pentaho-kettle by pentaho.
the class RepositoryImporterTest method createRepositoryImporter.
private static RepositoryImporter createRepositoryImporter(final JobEntryInterface jobEntryInterface, final StepMetaInterface stepMetaInterface, final boolean needToCheckPathForVariables) {
Repository repository = mock(Repository.class);
LogChannelInterface log = mock(LogChannelInterface.class);
RepositoryImporter importer = new RepositoryImporter(repository, log) {
@Override
JobMeta createJobMetaForNode(Node jobnode) throws KettleXMLException {
JobMeta meta = mock(JobMeta.class);
JobEntryCopy jec = mock(JobEntryCopy.class);
when(jec.isTransformation()).thenReturn(true);
when(jec.getEntry()).thenReturn(jobEntryInterface);
when(meta.getJobCopies()).thenReturn(Collections.singletonList(jec));
return meta;
}
@Override
TransMeta createTransMetaForNode(Node transnode) throws KettleMissingPluginsException, KettleXMLException {
TransMeta meta = mock(TransMeta.class);
StepMeta stepMeta = mock(StepMeta.class);
when(stepMeta.isMapping()).thenReturn(true);
when(stepMeta.getStepMetaInterface()).thenReturn(stepMetaInterface);
when(meta.getSteps()).thenReturn(Collections.singletonList(stepMeta));
return meta;
}
@Override
protected void replaceSharedObjects(JobMeta transMeta) throws KettleException {
}
@Override
protected void replaceSharedObjects(TransMeta transMeta) throws KettleException {
}
@Override
boolean needToCheckPathForVariables() {
return needToCheckPathForVariables;
}
};
return importer;
}
use of org.pentaho.di.core.logging.LogChannelInterface in project pentaho-kettle by pentaho.
the class TransSplitterTest method setUp.
@Before
public void setUp() throws Exception {
LogChannelInterfaceFactory logChannelInterfaceFactory = mock(LogChannelInterfaceFactory.class);
LogChannelInterface logChannelInterface = mock(LogChannelInterface.class);
oldLogChannelInterfaceFactory = KettleLogStore.getLogChannelInterfaceFactory();
KettleLogStore.setLogChannelInterfaceFactory(logChannelInterfaceFactory);
when(logChannelInterfaceFactory.create(any(), any(LoggingObjectInterface.class))).thenReturn(logChannelInterface);
}
use of org.pentaho.di.core.logging.LogChannelInterface in project pentaho-kettle by pentaho.
the class DimensionLookupMetaTest method setUp.
@Before
public void setUp() throws Exception {
LogChannelInterfaceFactory logChannelInterfaceFactory = mock(LogChannelInterfaceFactory.class);
LogChannelInterface logChannelInterface = mock(LogChannelInterface.class);
KettleLogStore.setLogChannelInterfaceFactory(logChannelInterfaceFactory);
when(logChannelInterfaceFactory.create(any(), any(LoggingObjectInterface.class))).thenReturn(logChannelInterface);
}
use of org.pentaho.di.core.logging.LogChannelInterface in project pentaho-kettle by pentaho.
the class PrepareExecutionTransServletTest method testPauseTransServletEscapesHtmlWhenTransFound.
@Test
@PrepareForTest({ Encode.class })
public void testPauseTransServletEscapesHtmlWhenTransFound() throws ServletException, IOException {
KettleLogStore.init();
HttpServletRequest mockHttpServletRequest = mock(HttpServletRequest.class);
HttpServletResponse mockHttpServletResponse = mock(HttpServletResponse.class);
Trans mockTrans = mock(Trans.class);
TransConfiguration mockTransConf = mock(TransConfiguration.class);
TransMeta mockTransMeta = mock(TransMeta.class);
TransExecutionConfiguration mockTransExecutionConf = mock(TransExecutionConfiguration.class);
LogChannelInterface mockChannelInterface = mock(LogChannelInterface.class);
StringWriter out = new StringWriter();
PrintWriter printWriter = new PrintWriter(out);
PowerMockito.spy(Encode.class);
when(mockHttpServletRequest.getContextPath()).thenReturn(PrepareExecutionTransServlet.CONTEXT_PATH);
when(mockHttpServletRequest.getParameter(anyString())).thenReturn(ServletTestUtils.BAD_STRING_TO_TEST);
when(mockHttpServletResponse.getWriter()).thenReturn(printWriter);
when(mockTransformationMap.getTransformation(any(CarteObjectEntry.class))).thenReturn(mockTrans);
when(mockTransformationMap.getConfiguration(any(CarteObjectEntry.class))).thenReturn(mockTransConf);
when(mockTransConf.getTransExecutionConfiguration()).thenReturn(mockTransExecutionConf);
when(mockTrans.getLogChannel()).thenReturn(mockChannelInterface);
when(mockTrans.getTransMeta()).thenReturn(mockTransMeta);
when(mockTransMeta.getMaximum()).thenReturn(new Point(10, 10));
prepareExecutionTransServlet.doGet(mockHttpServletRequest, mockHttpServletResponse);
assertFalse(ServletTestUtils.hasBadText(ServletTestUtils.getInsideOfTag("H1", out.toString())));
PowerMockito.verifyStatic(atLeastOnce());
Encode.forHtml(anyString());
}
use of org.pentaho.di.core.logging.LogChannelInterface in project pentaho-kettle by pentaho.
the class MailConnectionTest method beforeExec.
@Before
public void beforeExec() throws KettleException, MessagingException {
Object subj = new Object();
LogChannelInterface log = new LogChannel(subj);
conn = new Mconn(log);
}
Aggregations