@Test(expected = NoSuchRepositoryEntryException.class) public void testCreateLocalRepositoryFromNonexistentFileVersionId() throws Exception { long fileVersionId = RandomTestUtil.randomLong(); RepositoryLocalServiceUtil.getLocalRepositoryImpl(0, 0, fileVersionId); }
@Test(expected = NoSuchRepositoryEntryException.class) public void testCreateLocalRepositoryFromInvalidFolderId() throws Exception { long folderId = RandomTestUtil.randomLong(); RepositoryLocalServiceUtil.getLocalRepositoryImpl(folderId, 0, 0); }
@Test public void testCreateLocalRepositoryFromExistingRepositoryId() throws Exception { DLFolder dlFolder = DLTestUtil.addDLFolder(_group.getGroupId()); RepositoryLocalServiceUtil.getLocalRepositoryImpl(dlFolder.getRepositoryId()); }
@Test(expected = RepositoryException.class) public void testCreateRepositoryFromNonexistentRepositoryId() throws Exception { long repositoryId = RandomTestUtil.randomLong(); RepositoryLocalServiceUtil.getRepositoryImpl(repositoryId); }
@Test public void testCreateRepositoryFromExistingFileEntryId() throws Exception { DLFolder dlFolder = DLTestUtil.addDLFolder(_group.getGroupId()); DLFileEntry dlFileEntry = DLTestUtil.addDLFileEntry(dlFolder.getFolderId()); RepositoryLocalServiceUtil.getRepositoryImpl(0, dlFileEntry.getFileEntryId(), 0); }
@Test public void testCreateLocalRepositoryFromExistingFileVersionId() throws Exception { DLFolder dlFolder = DLTestUtil.addDLFolder(_group.getGroupId()); DLFileEntry dlFileEntry = DLTestUtil.addDLFileEntry(dlFolder.getFolderId()); DLFileVersion dlFileVersion = dlFileEntry.getLatestFileVersion(true); RepositoryLocalServiceUtil.getLocalRepositoryImpl(0, 0, dlFileVersion.getFileVersionId()); }