Search in sources :

Example 56 with Result

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());
}
Also used : Result(org.pentaho.di.core.Result) Test(org.junit.Test)

Example 57 with Result

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());
}
Also used : Result(org.pentaho.di.core.Result) Test(org.junit.Test)

Example 58 with Result

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());
}
Also used : Result(org.pentaho.di.core.Result) Test(org.junit.Test)

Example 59 with Result

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());
}
Also used : Result(org.pentaho.di.core.Result) Test(org.junit.Test)

Example 60 with Result

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());
}
Also used : LogChannel(org.pentaho.di.core.logging.LogChannel) Result(org.pentaho.di.core.Result) Test(org.junit.Test)

Aggregations

Result (org.pentaho.di.core.Result)192 Test (org.junit.Test)75 KettleException (org.pentaho.di.core.exception.KettleException)75 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)64 KettleXMLException (org.pentaho.di.core.exception.KettleXMLException)57 RowMetaAndData (org.pentaho.di.core.RowMetaAndData)40 FileObject (org.apache.commons.vfs2.FileObject)34 Job (org.pentaho.di.job.Job)32 IOException (java.io.IOException)24 ResultFile (org.pentaho.di.core.ResultFile)20 File (java.io.File)17 ArrayList (java.util.ArrayList)16 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)15 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)12 Pattern (java.util.regex.Pattern)10 KettleFileException (org.pentaho.di.core.exception.KettleFileException)10 Database (org.pentaho.di.core.database.Database)9 Date (java.util.Date)8 Trans (org.pentaho.di.trans.Trans)8 Matcher (java.util.regex.Matcher)7