use of org.pentaho.di.core.Result in project pentaho-kettle by pentaho.
the class JobEntryFTPTest method testVariableNonExistingTargetDir.
@Test
public void testVariableNonExistingTargetDir() throws Exception {
entry.setTargetDirectory("${Internal.Job.Filename.Directory}/Worg");
entry.setVariable("Internal.Job.Filename.Directory", existingDir + File.separator + "sub");
Result result = entry.execute(new Result(), 0);
assertFalse("For non existing folder should be false", result.getResult());
assertTrue("There should be errors", 0 != result.getNrErrors());
}
use of org.pentaho.di.core.Result in project pentaho-kettle by pentaho.
the class JobEntryFTPTest method testVariableExistingTargetDir.
@Test
public void testVariableExistingTargetDir() throws Exception {
entry.setTargetDirectory("${Internal.Job.Filename.Directory}");
entry.setVariable("Internal.Job.Filename.Directory", existingDir);
Result result = entry.execute(new Result(), 0);
assertTrue("For existing folder should be true", result.getResult());
assertEquals("There should be no errors", 0, result.getNrErrors());
}
use of org.pentaho.di.core.Result in project pentaho-kettle by pentaho.
the class JobEntryFTPTest method testPtotocolVariableNonExistingTargetDir.
@Test
public void testPtotocolVariableNonExistingTargetDir() throws Exception {
entry.setTargetDirectory("${Internal.Job.Filename.Directory}/Worg");
entry.setVariable("Internal.Job.Filename.Directory", "file://" + existingDir + File.separator + "sub");
Result result = entry.execute(new Result(), 0);
assertFalse("For non existing folder should be false", result.getResult());
assertTrue("There should be errors", 0 != result.getNrErrors());
}
use of org.pentaho.di.core.Result in project pentaho-kettle by pentaho.
the class JobEntryFTPTest method testProtocolVariableExistingTargetDir.
@Test
public void testProtocolVariableExistingTargetDir() throws Exception {
entry.setTargetDirectory("${Internal.Job.Filename.Directory}");
entry.setVariable("Internal.Job.Filename.Directory", "file://" + existingDir);
Result result = entry.execute(new Result(), 0);
assertTrue("For existing folder should be true", result.getResult());
assertEquals("There should be no errors", 0, result.getNrErrors());
}
use of org.pentaho.di.core.Result in project pentaho-kettle by pentaho.
the class MissingEntryTest method testExecute.
@Test
public void testExecute() throws KettleJobException {
MissingEntry entry = spy(new MissingEntry());
when(entry.getLogChannel()).thenReturn(mock(LogChannel.class));
entry.setName("MissingTest");
Result result = new Result();
result.setNrErrors(0);
result.setResult(true);
entry.execute(result, 0);
assertEquals(1, result.getNrErrors());
assertEquals(false, result.getResult());
}
Aggregations