コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnExpectedListOfFileNamesForEachType() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldReturnExpectedListOfFileNamesForEachType()
        {
            // given
            StoreFileMetadata[] expectedFiles = new StoreFileMetadata[]
            {
                new StoreFileMetadata(_databaseLayout.file("a"), 1),
                new StoreFileMetadata(_databaseLayout.file("b"), 2)
            };
            ExpectedFiles = expectedFiles;

            //when
            File[]          files = _prepareStoreCopyFiles.listReplayableFiles();
            StoreResource[] atomicFilesSnapshot = _prepareStoreCopyFiles.AtomicFilesSnapshot;

            //then
//JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter:
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
            File[] expectedFilesConverted = java.util.expectedFiles.Select(StoreFileMetadata::file).ToArray(File[] ::new);
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
            StoreResource[] exeptedAtomicFilesConverted = java.util.expectedFiles.Select(f => new StoreResource(f.file(), GetRelativePath(f), f.recordSize(), _fileSystemAbstraction)).ToArray(StoreResource[] ::new);
            assertArrayEquals(expectedFilesConverted, files);
            assertEquals(exeptedAtomicFilesConverted.Length, atomicFilesSnapshot.Length);
            for (int i = 0; i < exeptedAtomicFilesConverted.Length; i++)
            {
                StoreResource expected      = exeptedAtomicFilesConverted[i];
                StoreResource storeResource = atomicFilesSnapshot[i];
                assertEquals(expected.Path(), storeResource.Path());
                assertEquals(expected.RecordSize(), storeResource.RecordSize());
            }
        }
コード例 #2
0
 /// <summary>
 /// This sends operations on the outgoing pipeline or the file, including
 /// chunking <seealso cref="org.neo4j.causalclustering.catchup.storecopy.FileSender"/> handlers.
 /// <para>
 /// Note that we do not block here.
 /// </para>
 /// </summary>
 internal virtual void Stream(ChannelHandlerContext ctx, StoreResource resource)
 {
     ctx.write(ResponseMessageType.FILE);
     ctx.write(new FileHeader(resource.Path(), resource.RecordSize()));
     ctx.write(new FileSender(resource));
 }