Search in sources :

Example 1 with ROOT

use of org.dcache.auth.Subjects.ROOT in project dcache by dCache.

the class RemoteNameSpaceProviderTests method shouldSucceedForPathToPnfsidWithKnownPathAndResolvingSymlinks.

@Test
public void shouldSucceedForPathToPnfsidWithKnownPathAndResolvingSymlinks() throws Exception {
    givenSuccessfulResponse((Modifier<PnfsGetFileAttributes>) (m) -> m.setFileAttributes(FileAttributes.ofPnfsId(A_PNFSID)));
    PnfsId id = _namespace.pathToPnfsid(ROOT, "/path/to/entry", true);
    PnfsGetFileAttributes sent = getSingleSendAndWaitMessage(PnfsGetFileAttributes.class);
    assertThat(sent.getReplyRequired(), is(true));
    assertThat(sent.getSubject(), is(ROOT));
    assertThat(sent.getPnfsPath(), is("/path/to/entry"));
    assertThat(sent.getPnfsId(), nullValue());
    assertThat(sent.isFollowSymlink(), is(true));
    assertThat(id, is(A_PNFSID));
}
Also used : FILE_NOT_FOUND(diskCacheV111.util.CacheException.FILE_NOT_FOUND) ListDirectoryHandler(org.dcache.util.list.ListDirectoryHandler) Link(diskCacheV111.namespace.NameSpaceProvider.Link) CellMessage(dmg.cells.nucleus.CellMessage) ChecksumType(org.dcache.util.ChecksumType) FILE_EXISTS(diskCacheV111.util.CacheException.FILE_EXISTS) PnfsHandler(diskCacheV111.util.PnfsHandler) BDDMockito.verify(org.mockito.BDDMockito.verify) FlagOperation(diskCacheV111.vehicles.PnfsFlagMessage.FlagOperation) Matchers.nullValue(org.hamcrest.Matchers.nullValue) Map(java.util.Map) SIZE(org.dcache.namespace.FileAttribute.SIZE) EnumSet(java.util.EnumSet) FileAttributes(org.dcache.vehicles.FileAttributes) FileAttributesBuilder.fileAttributes(org.dcache.util.FileAttributesBuilder.fileAttributes) PnfsGetParentMessage(diskCacheV111.vehicles.PnfsGetParentMessage) BDDMockito.never(org.mockito.BDDMockito.never) Collection(java.util.Collection) Range(com.google.common.collect.Range) FileExistsCacheException(diskCacheV111.util.FileExistsCacheException) PnfsGetCacheLocationsMessage(diskCacheV111.vehicles.PnfsGetCacheLocationsMessage) Preconditions.checkState(com.google.common.base.Preconditions.checkState) PnfsFlagMessage(diskCacheV111.vehicles.PnfsFlagMessage) SerializationHandler(dmg.cells.nucleus.SerializationHandler) List(java.util.List) DirectoryEntry(org.dcache.util.list.DirectoryEntry) CellMessageAnswerable(dmg.cells.nucleus.CellMessageAnswerable) Matchers.is(org.hamcrest.Matchers.is) PnfsCreateEntryMessage(diskCacheV111.vehicles.PnfsCreateEntryMessage) CellPath(dmg.cells.nucleus.CellPath) PnfsClearCacheLocationMessage(diskCacheV111.vehicles.PnfsClearCacheLocationMessage) PnfsDeleteEntryMessage(diskCacheV111.vehicles.PnfsDeleteEntryMessage) PnfsMessage(diskCacheV111.vehicles.PnfsMessage) PnfsSetFileAttributes(org.dcache.vehicles.PnfsSetFileAttributes) NOT_FILE(diskCacheV111.util.CacheException.NOT_FILE) HashMap(java.util.HashMap) CellEndpoint(dmg.cells.nucleus.CellEndpoint) SerializationException(dmg.cells.nucleus.SerializationException) Answer(org.mockito.stubbing.Answer) BDDMockito.any(org.mockito.BDDMockito.any) BDDMockito.anyLong(org.mockito.BDDMockito.anyLong) Lists(com.google.common.collect.Lists) CacheException(diskCacheV111.util.CacheException) CellStub(org.dcache.cells.CellStub) ArgumentCaptor(org.mockito.ArgumentCaptor) TYPE(org.dcache.namespace.FileAttribute.TYPE) PnfsListDirectoryMessage(org.dcache.vehicles.PnfsListDirectoryMessage) ListHandler(org.dcache.namespace.ListHandler) Matchers.hasSize(org.hamcrest.Matchers.hasSize) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) FileNotFoundCacheException(diskCacheV111.util.FileNotFoundCacheException) FileType(org.dcache.namespace.FileType) Before(org.junit.Before) PnfsId(diskCacheV111.util.PnfsId) ROOT(org.dcache.auth.Subjects.ROOT) BDDMockito.doAnswer(org.mockito.BDDMockito.doAnswer) Executor(java.util.concurrent.Executor) REGULAR(org.dcache.namespace.FileType.REGULAR) PnfsGetFileAttributes(org.dcache.vehicles.PnfsGetFileAttributes) Test(org.junit.Test) NotFileCacheException(diskCacheV111.util.NotFileCacheException) BDDMockito.willAnswer(org.mockito.BDDMockito.willAnswer) PnfsRemoveChecksumMessage(org.dcache.vehicles.PnfsRemoveChecksumMessage) Matchers.hasItem(org.hamcrest.Matchers.hasItem) PnfsAddCacheLocationMessage(diskCacheV111.vehicles.PnfsAddCacheLocationMessage) FileAttribute(org.dcache.namespace.FileAttribute) BDDMockito.mock(org.mockito.BDDMockito.mock) Collections(java.util.Collections) PnfsMapPathMessage(diskCacheV111.vehicles.PnfsMapPathMessage) PnfsId(diskCacheV111.util.PnfsId) PnfsGetFileAttributes(org.dcache.vehicles.PnfsGetFileAttributes) Test(org.junit.Test)

Example 2 with ROOT

use of org.dcache.auth.Subjects.ROOT in project dcache by dCache.

the class RemoteNameSpaceProviderTests method shouldSucceedWhenGetCacheLocationForFileWithTwoLocations.

@Test
public void shouldSucceedWhenGetCacheLocationForFileWithTwoLocations() throws Exception {
    givenSuccessfulResponse((Modifier<PnfsGetCacheLocationsMessage>) (r) -> r.setCacheLocations(Lists.newArrayList("pool-1", "pool-2")));
    List<String> locations = _namespace.getCacheLocation(ROOT, A_PNFSID);
    PnfsGetCacheLocationsMessage sent = getSingleSendAndWaitMessage(PnfsGetCacheLocationsMessage.class);
    assertThat(sent.getReplyRequired(), is(true));
    assertThat(sent.getSubject(), is(ROOT));
    assertThat(sent.getPnfsId(), is(A_PNFSID));
    assertThat(locations, hasSize(2));
    assertThat(locations, hasItem("pool-1"));
    assertThat(locations, hasItem("pool-2"));
}
Also used : FILE_NOT_FOUND(diskCacheV111.util.CacheException.FILE_NOT_FOUND) ListDirectoryHandler(org.dcache.util.list.ListDirectoryHandler) Link(diskCacheV111.namespace.NameSpaceProvider.Link) CellMessage(dmg.cells.nucleus.CellMessage) ChecksumType(org.dcache.util.ChecksumType) FILE_EXISTS(diskCacheV111.util.CacheException.FILE_EXISTS) PnfsHandler(diskCacheV111.util.PnfsHandler) BDDMockito.verify(org.mockito.BDDMockito.verify) FlagOperation(diskCacheV111.vehicles.PnfsFlagMessage.FlagOperation) Matchers.nullValue(org.hamcrest.Matchers.nullValue) Map(java.util.Map) SIZE(org.dcache.namespace.FileAttribute.SIZE) EnumSet(java.util.EnumSet) FileAttributes(org.dcache.vehicles.FileAttributes) FileAttributesBuilder.fileAttributes(org.dcache.util.FileAttributesBuilder.fileAttributes) PnfsGetParentMessage(diskCacheV111.vehicles.PnfsGetParentMessage) BDDMockito.never(org.mockito.BDDMockito.never) Collection(java.util.Collection) Range(com.google.common.collect.Range) FileExistsCacheException(diskCacheV111.util.FileExistsCacheException) PnfsGetCacheLocationsMessage(diskCacheV111.vehicles.PnfsGetCacheLocationsMessage) Preconditions.checkState(com.google.common.base.Preconditions.checkState) PnfsFlagMessage(diskCacheV111.vehicles.PnfsFlagMessage) SerializationHandler(dmg.cells.nucleus.SerializationHandler) List(java.util.List) DirectoryEntry(org.dcache.util.list.DirectoryEntry) CellMessageAnswerable(dmg.cells.nucleus.CellMessageAnswerable) Matchers.is(org.hamcrest.Matchers.is) PnfsCreateEntryMessage(diskCacheV111.vehicles.PnfsCreateEntryMessage) CellPath(dmg.cells.nucleus.CellPath) PnfsClearCacheLocationMessage(diskCacheV111.vehicles.PnfsClearCacheLocationMessage) PnfsDeleteEntryMessage(diskCacheV111.vehicles.PnfsDeleteEntryMessage) PnfsMessage(diskCacheV111.vehicles.PnfsMessage) PnfsSetFileAttributes(org.dcache.vehicles.PnfsSetFileAttributes) NOT_FILE(diskCacheV111.util.CacheException.NOT_FILE) HashMap(java.util.HashMap) CellEndpoint(dmg.cells.nucleus.CellEndpoint) SerializationException(dmg.cells.nucleus.SerializationException) Answer(org.mockito.stubbing.Answer) BDDMockito.any(org.mockito.BDDMockito.any) BDDMockito.anyLong(org.mockito.BDDMockito.anyLong) Lists(com.google.common.collect.Lists) CacheException(diskCacheV111.util.CacheException) CellStub(org.dcache.cells.CellStub) ArgumentCaptor(org.mockito.ArgumentCaptor) TYPE(org.dcache.namespace.FileAttribute.TYPE) PnfsListDirectoryMessage(org.dcache.vehicles.PnfsListDirectoryMessage) ListHandler(org.dcache.namespace.ListHandler) Matchers.hasSize(org.hamcrest.Matchers.hasSize) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) FileNotFoundCacheException(diskCacheV111.util.FileNotFoundCacheException) FileType(org.dcache.namespace.FileType) Before(org.junit.Before) PnfsId(diskCacheV111.util.PnfsId) ROOT(org.dcache.auth.Subjects.ROOT) BDDMockito.doAnswer(org.mockito.BDDMockito.doAnswer) Executor(java.util.concurrent.Executor) REGULAR(org.dcache.namespace.FileType.REGULAR) PnfsGetFileAttributes(org.dcache.vehicles.PnfsGetFileAttributes) Test(org.junit.Test) NotFileCacheException(diskCacheV111.util.NotFileCacheException) BDDMockito.willAnswer(org.mockito.BDDMockito.willAnswer) PnfsRemoveChecksumMessage(org.dcache.vehicles.PnfsRemoveChecksumMessage) Matchers.hasItem(org.hamcrest.Matchers.hasItem) PnfsAddCacheLocationMessage(diskCacheV111.vehicles.PnfsAddCacheLocationMessage) FileAttribute(org.dcache.namespace.FileAttribute) BDDMockito.mock(org.mockito.BDDMockito.mock) Collections(java.util.Collections) PnfsMapPathMessage(diskCacheV111.vehicles.PnfsMapPathMessage) PnfsGetCacheLocationsMessage(diskCacheV111.vehicles.PnfsGetCacheLocationsMessage) Test(org.junit.Test)

Example 3 with ROOT

use of org.dcache.auth.Subjects.ROOT in project dcache by dCache.

the class RemoteNameSpaceProviderTests method shouldSucceedForPathToPnfsidWithKnownPathAndNotResolvingSymlinks.

@Test
public void shouldSucceedForPathToPnfsidWithKnownPathAndNotResolvingSymlinks() throws Exception {
    givenSuccessfulResponse((Modifier<PnfsGetFileAttributes>) (m) -> m.setFileAttributes(FileAttributes.ofPnfsId(A_PNFSID)));
    PnfsId id = _namespace.pathToPnfsid(ROOT, "/path/to/entry", false);
    PnfsGetFileAttributes sent = getSingleSendAndWaitMessage(PnfsGetFileAttributes.class);
    assertThat(sent.getReplyRequired(), is(true));
    assertThat(sent.getSubject(), is(ROOT));
    assertThat(sent.getPnfsPath(), is("/path/to/entry"));
    assertThat(sent.getPnfsId(), nullValue());
    assertThat(sent.isFollowSymlink(), is(false));
    assertThat(id, is(A_PNFSID));
}
Also used : FILE_NOT_FOUND(diskCacheV111.util.CacheException.FILE_NOT_FOUND) ListDirectoryHandler(org.dcache.util.list.ListDirectoryHandler) Link(diskCacheV111.namespace.NameSpaceProvider.Link) CellMessage(dmg.cells.nucleus.CellMessage) ChecksumType(org.dcache.util.ChecksumType) FILE_EXISTS(diskCacheV111.util.CacheException.FILE_EXISTS) PnfsHandler(diskCacheV111.util.PnfsHandler) BDDMockito.verify(org.mockito.BDDMockito.verify) FlagOperation(diskCacheV111.vehicles.PnfsFlagMessage.FlagOperation) Matchers.nullValue(org.hamcrest.Matchers.nullValue) Map(java.util.Map) SIZE(org.dcache.namespace.FileAttribute.SIZE) EnumSet(java.util.EnumSet) FileAttributes(org.dcache.vehicles.FileAttributes) FileAttributesBuilder.fileAttributes(org.dcache.util.FileAttributesBuilder.fileAttributes) PnfsGetParentMessage(diskCacheV111.vehicles.PnfsGetParentMessage) BDDMockito.never(org.mockito.BDDMockito.never) Collection(java.util.Collection) Range(com.google.common.collect.Range) FileExistsCacheException(diskCacheV111.util.FileExistsCacheException) PnfsGetCacheLocationsMessage(diskCacheV111.vehicles.PnfsGetCacheLocationsMessage) Preconditions.checkState(com.google.common.base.Preconditions.checkState) PnfsFlagMessage(diskCacheV111.vehicles.PnfsFlagMessage) SerializationHandler(dmg.cells.nucleus.SerializationHandler) List(java.util.List) DirectoryEntry(org.dcache.util.list.DirectoryEntry) CellMessageAnswerable(dmg.cells.nucleus.CellMessageAnswerable) Matchers.is(org.hamcrest.Matchers.is) PnfsCreateEntryMessage(diskCacheV111.vehicles.PnfsCreateEntryMessage) CellPath(dmg.cells.nucleus.CellPath) PnfsClearCacheLocationMessage(diskCacheV111.vehicles.PnfsClearCacheLocationMessage) PnfsDeleteEntryMessage(diskCacheV111.vehicles.PnfsDeleteEntryMessage) PnfsMessage(diskCacheV111.vehicles.PnfsMessage) PnfsSetFileAttributes(org.dcache.vehicles.PnfsSetFileAttributes) NOT_FILE(diskCacheV111.util.CacheException.NOT_FILE) HashMap(java.util.HashMap) CellEndpoint(dmg.cells.nucleus.CellEndpoint) SerializationException(dmg.cells.nucleus.SerializationException) Answer(org.mockito.stubbing.Answer) BDDMockito.any(org.mockito.BDDMockito.any) BDDMockito.anyLong(org.mockito.BDDMockito.anyLong) Lists(com.google.common.collect.Lists) CacheException(diskCacheV111.util.CacheException) CellStub(org.dcache.cells.CellStub) ArgumentCaptor(org.mockito.ArgumentCaptor) TYPE(org.dcache.namespace.FileAttribute.TYPE) PnfsListDirectoryMessage(org.dcache.vehicles.PnfsListDirectoryMessage) ListHandler(org.dcache.namespace.ListHandler) Matchers.hasSize(org.hamcrest.Matchers.hasSize) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) FileNotFoundCacheException(diskCacheV111.util.FileNotFoundCacheException) FileType(org.dcache.namespace.FileType) Before(org.junit.Before) PnfsId(diskCacheV111.util.PnfsId) ROOT(org.dcache.auth.Subjects.ROOT) BDDMockito.doAnswer(org.mockito.BDDMockito.doAnswer) Executor(java.util.concurrent.Executor) REGULAR(org.dcache.namespace.FileType.REGULAR) PnfsGetFileAttributes(org.dcache.vehicles.PnfsGetFileAttributes) Test(org.junit.Test) NotFileCacheException(diskCacheV111.util.NotFileCacheException) BDDMockito.willAnswer(org.mockito.BDDMockito.willAnswer) PnfsRemoveChecksumMessage(org.dcache.vehicles.PnfsRemoveChecksumMessage) Matchers.hasItem(org.hamcrest.Matchers.hasItem) PnfsAddCacheLocationMessage(diskCacheV111.vehicles.PnfsAddCacheLocationMessage) FileAttribute(org.dcache.namespace.FileAttribute) BDDMockito.mock(org.mockito.BDDMockito.mock) Collections(java.util.Collections) PnfsMapPathMessage(diskCacheV111.vehicles.PnfsMapPathMessage) PnfsId(diskCacheV111.util.PnfsId) PnfsGetFileAttributes(org.dcache.vehicles.PnfsGetFileAttributes) Test(org.junit.Test)

Example 4 with ROOT

use of org.dcache.auth.Subjects.ROOT in project dcache by dCache.

the class RemoteNameSpaceProviderTests method shouldSucceedForFindExistingEntry.

@Test
public void shouldSucceedForFindExistingEntry() throws Exception {
    givenSuccessfulResponse((Modifier<PnfsGetParentMessage>) (r) -> r.addLocation(ANOTHER_PNFSID, "file"));
    Collection<Link> locations = _namespace.find(ROOT, A_PNFSID);
    PnfsGetParentMessage sent = getSingleSendAndWaitMessage(PnfsGetParentMessage.class);
    assertThat(sent.getReplyRequired(), is(true));
    assertThat(sent.getSubject(), is(ROOT));
    assertThat(sent.getPnfsId(), is(A_PNFSID));
    assertThat(locations.size(), is(1));
    Link location = locations.iterator().next();
    assertThat(location.getParent(), is(ANOTHER_PNFSID));
    assertThat(location.getName(), is("file"));
}
Also used : FILE_NOT_FOUND(diskCacheV111.util.CacheException.FILE_NOT_FOUND) ListDirectoryHandler(org.dcache.util.list.ListDirectoryHandler) Link(diskCacheV111.namespace.NameSpaceProvider.Link) CellMessage(dmg.cells.nucleus.CellMessage) ChecksumType(org.dcache.util.ChecksumType) FILE_EXISTS(diskCacheV111.util.CacheException.FILE_EXISTS) PnfsHandler(diskCacheV111.util.PnfsHandler) BDDMockito.verify(org.mockito.BDDMockito.verify) FlagOperation(diskCacheV111.vehicles.PnfsFlagMessage.FlagOperation) Matchers.nullValue(org.hamcrest.Matchers.nullValue) Map(java.util.Map) SIZE(org.dcache.namespace.FileAttribute.SIZE) EnumSet(java.util.EnumSet) FileAttributes(org.dcache.vehicles.FileAttributes) FileAttributesBuilder.fileAttributes(org.dcache.util.FileAttributesBuilder.fileAttributes) PnfsGetParentMessage(diskCacheV111.vehicles.PnfsGetParentMessage) BDDMockito.never(org.mockito.BDDMockito.never) Collection(java.util.Collection) Range(com.google.common.collect.Range) FileExistsCacheException(diskCacheV111.util.FileExistsCacheException) PnfsGetCacheLocationsMessage(diskCacheV111.vehicles.PnfsGetCacheLocationsMessage) Preconditions.checkState(com.google.common.base.Preconditions.checkState) PnfsFlagMessage(diskCacheV111.vehicles.PnfsFlagMessage) SerializationHandler(dmg.cells.nucleus.SerializationHandler) List(java.util.List) DirectoryEntry(org.dcache.util.list.DirectoryEntry) CellMessageAnswerable(dmg.cells.nucleus.CellMessageAnswerable) Matchers.is(org.hamcrest.Matchers.is) PnfsCreateEntryMessage(diskCacheV111.vehicles.PnfsCreateEntryMessage) CellPath(dmg.cells.nucleus.CellPath) PnfsClearCacheLocationMessage(diskCacheV111.vehicles.PnfsClearCacheLocationMessage) PnfsDeleteEntryMessage(diskCacheV111.vehicles.PnfsDeleteEntryMessage) PnfsMessage(diskCacheV111.vehicles.PnfsMessage) PnfsSetFileAttributes(org.dcache.vehicles.PnfsSetFileAttributes) NOT_FILE(diskCacheV111.util.CacheException.NOT_FILE) HashMap(java.util.HashMap) CellEndpoint(dmg.cells.nucleus.CellEndpoint) SerializationException(dmg.cells.nucleus.SerializationException) Answer(org.mockito.stubbing.Answer) BDDMockito.any(org.mockito.BDDMockito.any) BDDMockito.anyLong(org.mockito.BDDMockito.anyLong) Lists(com.google.common.collect.Lists) CacheException(diskCacheV111.util.CacheException) CellStub(org.dcache.cells.CellStub) ArgumentCaptor(org.mockito.ArgumentCaptor) TYPE(org.dcache.namespace.FileAttribute.TYPE) PnfsListDirectoryMessage(org.dcache.vehicles.PnfsListDirectoryMessage) ListHandler(org.dcache.namespace.ListHandler) Matchers.hasSize(org.hamcrest.Matchers.hasSize) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) FileNotFoundCacheException(diskCacheV111.util.FileNotFoundCacheException) FileType(org.dcache.namespace.FileType) Before(org.junit.Before) PnfsId(diskCacheV111.util.PnfsId) ROOT(org.dcache.auth.Subjects.ROOT) BDDMockito.doAnswer(org.mockito.BDDMockito.doAnswer) Executor(java.util.concurrent.Executor) REGULAR(org.dcache.namespace.FileType.REGULAR) PnfsGetFileAttributes(org.dcache.vehicles.PnfsGetFileAttributes) Test(org.junit.Test) NotFileCacheException(diskCacheV111.util.NotFileCacheException) BDDMockito.willAnswer(org.mockito.BDDMockito.willAnswer) PnfsRemoveChecksumMessage(org.dcache.vehicles.PnfsRemoveChecksumMessage) Matchers.hasItem(org.hamcrest.Matchers.hasItem) PnfsAddCacheLocationMessage(diskCacheV111.vehicles.PnfsAddCacheLocationMessage) FileAttribute(org.dcache.namespace.FileAttribute) BDDMockito.mock(org.mockito.BDDMockito.mock) Collections(java.util.Collections) PnfsMapPathMessage(diskCacheV111.vehicles.PnfsMapPathMessage) PnfsGetParentMessage(diskCacheV111.vehicles.PnfsGetParentMessage) Link(diskCacheV111.namespace.NameSpaceProvider.Link) Test(org.junit.Test)

Example 5 with ROOT

use of org.dcache.auth.Subjects.ROOT in project dcache by dCache.

the class RemoteNameSpaceProviderTests method shouldSucceedWhenGetCacheLocationForFileWithOneLocation.

@Test
public void shouldSucceedWhenGetCacheLocationForFileWithOneLocation() throws Exception {
    givenSuccessfulResponse((Modifier<PnfsGetCacheLocationsMessage>) (r) -> r.setCacheLocations(Collections.singletonList("pool-1")));
    List<String> locations = _namespace.getCacheLocation(ROOT, A_PNFSID);
    PnfsGetCacheLocationsMessage sent = getSingleSendAndWaitMessage(PnfsGetCacheLocationsMessage.class);
    assertThat(sent.getReplyRequired(), is(true));
    assertThat(sent.getSubject(), is(ROOT));
    assertThat(sent.getPnfsId(), is(A_PNFSID));
    assertThat(locations, hasSize(1));
    assertThat(locations, hasItem("pool-1"));
}
Also used : FILE_NOT_FOUND(diskCacheV111.util.CacheException.FILE_NOT_FOUND) ListDirectoryHandler(org.dcache.util.list.ListDirectoryHandler) Link(diskCacheV111.namespace.NameSpaceProvider.Link) CellMessage(dmg.cells.nucleus.CellMessage) ChecksumType(org.dcache.util.ChecksumType) FILE_EXISTS(diskCacheV111.util.CacheException.FILE_EXISTS) PnfsHandler(diskCacheV111.util.PnfsHandler) BDDMockito.verify(org.mockito.BDDMockito.verify) FlagOperation(diskCacheV111.vehicles.PnfsFlagMessage.FlagOperation) Matchers.nullValue(org.hamcrest.Matchers.nullValue) Map(java.util.Map) SIZE(org.dcache.namespace.FileAttribute.SIZE) EnumSet(java.util.EnumSet) FileAttributes(org.dcache.vehicles.FileAttributes) FileAttributesBuilder.fileAttributes(org.dcache.util.FileAttributesBuilder.fileAttributes) PnfsGetParentMessage(diskCacheV111.vehicles.PnfsGetParentMessage) BDDMockito.never(org.mockito.BDDMockito.never) Collection(java.util.Collection) Range(com.google.common.collect.Range) FileExistsCacheException(diskCacheV111.util.FileExistsCacheException) PnfsGetCacheLocationsMessage(diskCacheV111.vehicles.PnfsGetCacheLocationsMessage) Preconditions.checkState(com.google.common.base.Preconditions.checkState) PnfsFlagMessage(diskCacheV111.vehicles.PnfsFlagMessage) SerializationHandler(dmg.cells.nucleus.SerializationHandler) List(java.util.List) DirectoryEntry(org.dcache.util.list.DirectoryEntry) CellMessageAnswerable(dmg.cells.nucleus.CellMessageAnswerable) Matchers.is(org.hamcrest.Matchers.is) PnfsCreateEntryMessage(diskCacheV111.vehicles.PnfsCreateEntryMessage) CellPath(dmg.cells.nucleus.CellPath) PnfsClearCacheLocationMessage(diskCacheV111.vehicles.PnfsClearCacheLocationMessage) PnfsDeleteEntryMessage(diskCacheV111.vehicles.PnfsDeleteEntryMessage) PnfsMessage(diskCacheV111.vehicles.PnfsMessage) PnfsSetFileAttributes(org.dcache.vehicles.PnfsSetFileAttributes) NOT_FILE(diskCacheV111.util.CacheException.NOT_FILE) HashMap(java.util.HashMap) CellEndpoint(dmg.cells.nucleus.CellEndpoint) SerializationException(dmg.cells.nucleus.SerializationException) Answer(org.mockito.stubbing.Answer) BDDMockito.any(org.mockito.BDDMockito.any) BDDMockito.anyLong(org.mockito.BDDMockito.anyLong) Lists(com.google.common.collect.Lists) CacheException(diskCacheV111.util.CacheException) CellStub(org.dcache.cells.CellStub) ArgumentCaptor(org.mockito.ArgumentCaptor) TYPE(org.dcache.namespace.FileAttribute.TYPE) PnfsListDirectoryMessage(org.dcache.vehicles.PnfsListDirectoryMessage) ListHandler(org.dcache.namespace.ListHandler) Matchers.hasSize(org.hamcrest.Matchers.hasSize) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) FileNotFoundCacheException(diskCacheV111.util.FileNotFoundCacheException) FileType(org.dcache.namespace.FileType) Before(org.junit.Before) PnfsId(diskCacheV111.util.PnfsId) ROOT(org.dcache.auth.Subjects.ROOT) BDDMockito.doAnswer(org.mockito.BDDMockito.doAnswer) Executor(java.util.concurrent.Executor) REGULAR(org.dcache.namespace.FileType.REGULAR) PnfsGetFileAttributes(org.dcache.vehicles.PnfsGetFileAttributes) Test(org.junit.Test) NotFileCacheException(diskCacheV111.util.NotFileCacheException) BDDMockito.willAnswer(org.mockito.BDDMockito.willAnswer) PnfsRemoveChecksumMessage(org.dcache.vehicles.PnfsRemoveChecksumMessage) Matchers.hasItem(org.hamcrest.Matchers.hasItem) PnfsAddCacheLocationMessage(diskCacheV111.vehicles.PnfsAddCacheLocationMessage) FileAttribute(org.dcache.namespace.FileAttribute) BDDMockito.mock(org.mockito.BDDMockito.mock) Collections(java.util.Collections) PnfsMapPathMessage(diskCacheV111.vehicles.PnfsMapPathMessage) PnfsGetCacheLocationsMessage(diskCacheV111.vehicles.PnfsGetCacheLocationsMessage) Test(org.junit.Test)

Aggregations

Preconditions.checkState (com.google.common.base.Preconditions.checkState)7 Lists (com.google.common.collect.Lists)7 Range (com.google.common.collect.Range)7 Link (diskCacheV111.namespace.NameSpaceProvider.Link)7 CacheException (diskCacheV111.util.CacheException)7 FILE_EXISTS (diskCacheV111.util.CacheException.FILE_EXISTS)7 FILE_NOT_FOUND (diskCacheV111.util.CacheException.FILE_NOT_FOUND)7 NOT_FILE (diskCacheV111.util.CacheException.NOT_FILE)7 FileExistsCacheException (diskCacheV111.util.FileExistsCacheException)7 FileNotFoundCacheException (diskCacheV111.util.FileNotFoundCacheException)7 NotFileCacheException (diskCacheV111.util.NotFileCacheException)7 PnfsHandler (diskCacheV111.util.PnfsHandler)7 PnfsId (diskCacheV111.util.PnfsId)7 PnfsAddCacheLocationMessage (diskCacheV111.vehicles.PnfsAddCacheLocationMessage)7 PnfsClearCacheLocationMessage (diskCacheV111.vehicles.PnfsClearCacheLocationMessage)7 PnfsCreateEntryMessage (diskCacheV111.vehicles.PnfsCreateEntryMessage)7 PnfsDeleteEntryMessage (diskCacheV111.vehicles.PnfsDeleteEntryMessage)7 PnfsFlagMessage (diskCacheV111.vehicles.PnfsFlagMessage)7 FlagOperation (diskCacheV111.vehicles.PnfsFlagMessage.FlagOperation)7 PnfsGetCacheLocationsMessage (diskCacheV111.vehicles.PnfsGetCacheLocationsMessage)7