Search in sources :

Example 1 with RecentFile

use of org.pentaho.di.plugins.fileopensave.providers.recents.model.RecentFile in project pentaho-kettle by pentaho.

the class RecentUtilsTest method setPathsRepositoryTest.

@Test
public void setPathsRepositoryTest() {
    LastUsedFile lastUsedFile = new LastUsedFile(LastUsedFile.FILE_TYPE_TRANSFORMATION, "file", "/home/admin", true, "repo", "admin", true, 1, new Date(), "");
    RecentFile recentFile = new RecentFile();
    RecentUtils.setPaths(lastUsedFile, recentFile);
    Assert.assertEquals("file", recentFile.getName());
    Assert.assertEquals("/home/admin", recentFile.getParent());
    Assert.assertEquals("/home/admin/file", recentFile.getPath());
    Assert.assertEquals("repo", recentFile.getRepository());
    Assert.assertEquals("admin", recentFile.getUsername());
}
Also used : LastUsedFile(org.pentaho.di.core.LastUsedFile) Date(java.util.Date) RecentFile(org.pentaho.di.plugins.fileopensave.providers.recents.model.RecentFile) Test(org.junit.Test)

Example 2 with RecentFile

use of org.pentaho.di.plugins.fileopensave.providers.recents.model.RecentFile in project pentaho-kettle by pentaho.

the class RecentUtilsTest method setPathsVFSTest.

@Test
public void setPathsVFSTest() {
    LastUsedFile lastUsedFile = new LastUsedFile(LastUsedFile.FILE_TYPE_TRANSFORMATION, PVFS_PATH, null, false, null, null, false, 1, new Date(), NAMED_CONNECTION);
    RecentFile recentFile = new RecentFile();
    RecentUtils.setPaths(lastUsedFile, recentFile);
    Assert.assertEquals(PVFS_FILENAME, recentFile.getName());
    Assert.assertEquals(PVFS_PARENT, recentFile.getParent());
    Assert.assertEquals(PVFS_PATH, recentFile.getPath());
}
Also used : LastUsedFile(org.pentaho.di.core.LastUsedFile) Date(java.util.Date) RecentFile(org.pentaho.di.plugins.fileopensave.providers.recents.model.RecentFile) Test(org.junit.Test)

Example 3 with RecentFile

use of org.pentaho.di.plugins.fileopensave.providers.recents.model.RecentFile in project pentaho-kettle by pentaho.

the class RecentUtilsTest method setPathsUnixTest.

@Test
public void setPathsUnixTest() {
    LastUsedFile lastUsedFile = new LastUsedFile(LastUsedFile.FILE_TYPE_TRANSFORMATION, UNIX_PATH, null, false, null, null, false, 1, new Date(), null);
    RecentFile recentFile = new RecentFile();
    RecentUtils.setPaths(lastUsedFile, recentFile);
    Assert.assertEquals(UNIX_FILENAME, recentFile.getName());
    Assert.assertEquals(UNIX_PARENT, recentFile.getParent());
    Assert.assertEquals(UNIX_PATH, recentFile.getPath());
}
Also used : LastUsedFile(org.pentaho.di.core.LastUsedFile) Date(java.util.Date) RecentFile(org.pentaho.di.plugins.fileopensave.providers.recents.model.RecentFile) Test(org.junit.Test)

Example 4 with RecentFile

use of org.pentaho.di.plugins.fileopensave.providers.recents.model.RecentFile in project pentaho-kettle by pentaho.

the class RecentUtilsTest method setPathsWindowsTest.

@Test
public void setPathsWindowsTest() {
    LastUsedFile lastUsedFile = new LastUsedFile(LastUsedFile.FILE_TYPE_TRANSFORMATION, WINDOWS_PATH, null, false, null, null, false, 1, new Date(), null);
    RecentFile recentFile = new RecentFile();
    RecentUtils.setPaths(lastUsedFile, recentFile);
    Assert.assertEquals(WINDOWS_FILENAME, recentFile.getName());
    Assert.assertEquals(WINDOWS_PARENT, recentFile.getParent());
    Assert.assertEquals(WINDOWS_PATH, recentFile.getPath());
}
Also used : LastUsedFile(org.pentaho.di.core.LastUsedFile) Date(java.util.Date) RecentFile(org.pentaho.di.plugins.fileopensave.providers.recents.model.RecentFile) Test(org.junit.Test)

Aggregations

Date (java.util.Date)4 Test (org.junit.Test)4 LastUsedFile (org.pentaho.di.core.LastUsedFile)4 RecentFile (org.pentaho.di.plugins.fileopensave.providers.recents.model.RecentFile)4