Search in sources :

Example 1 with FolderContentType

use of org.talend.dataprep.api.folder.FolderContentType in project data-prep by Talend.

the class FileSystemUtilsTest method matches_entryDoesNotMatch.

@Test
public void matches_entryDoesNotMatch() throws Exception {
    Path testEntry = testFolder.resolve("testEntry");
    String contentId = "contentId";
    String folderId = "folderId";
    FolderContentType contentType = FolderContentType.PREPARATION;
    createEntry(testEntry, contentId, folderId, contentType);
    // test read
    assertFalse(FileSystemUtils.matches(testEntry, "other id", contentType));
}
Also used : Path(java.nio.file.Path) FolderContentType(org.talend.dataprep.api.folder.FolderContentType) Test(org.junit.Test)

Example 2 with FolderContentType

use of org.talend.dataprep.api.folder.FolderContentType in project data-prep by Talend.

the class FileSystemUtilsTest method toFolderEntry.

@Test
public void toFolderEntry() throws Exception {
    Path testEntry = testFolder.resolve("testEntry");
    String contentId = "contentId";
    String folderId = "folderId";
    FolderContentType contentType = FolderContentType.PREPARATION;
    createEntry(testEntry, contentId, folderId, contentType);
    FolderEntry folderEntry = FileSystemUtils.toFolderEntry(testEntry);
    assertNotNull(folderEntry);
    assertEquals(contentId, folderEntry.getContentId());
    assertEquals(folderId, folderEntry.getFolderId());
    assertEquals(contentType, folderEntry.getContentType());
}
Also used : Path(java.nio.file.Path) FolderEntry(org.talend.dataprep.api.folder.FolderEntry) FolderContentType(org.talend.dataprep.api.folder.FolderContentType) Test(org.junit.Test)

Example 3 with FolderContentType

use of org.talend.dataprep.api.folder.FolderContentType in project data-prep by Talend.

the class FileSystemUtilsTest method matches_entryMatches.

@Test
public void matches_entryMatches() throws Exception {
    Path testEntry = testFolder.resolve("testEntry");
    String contentId = "contentId";
    String folderId = "folderId";
    FolderContentType contentType = FolderContentType.PREPARATION;
    createEntry(testEntry, contentId, folderId, contentType);
    // test read
    assertTrue(FileSystemUtils.matches(testEntry, contentId, contentType));
}
Also used : Path(java.nio.file.Path) FolderContentType(org.talend.dataprep.api.folder.FolderContentType) Test(org.junit.Test)

Aggregations

Path (java.nio.file.Path)3 Test (org.junit.Test)3 FolderContentType (org.talend.dataprep.api.folder.FolderContentType)3 FolderEntry (org.talend.dataprep.api.folder.FolderEntry)1