Exemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void fullPathFileNamesUsedForMonitoringBackup() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void FullPathFileNamesUsedForMonitoringBackup()
        {
            // given
            AtomicBoolean          wasActivated = new AtomicBoolean(false);
            StoreCopyClientMonitor monitor      = new StoreCopyClientMonitor_AdapterAnonymousInnerClass(this, wasActivated);

            // and
            ToFileStoreWriter writer     = new ToFileStoreWriter(_directory.absolutePath(), _fs, monitor);
            ByteBuffer        tempBuffer = ByteBuffer.allocate(128);

            // when
            writer.Write("expectedFileName", new DataProducer(16), tempBuffer, true, 16);

            // then
            assertTrue(wasActivated.get());
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldLetPageCacheHandleRecordStoresAndNativeLabelScanStoreFiles() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldLetPageCacheHandleRecordStoresAndNativeLabelScanStoreFiles()
        {
            // GIVEN
            ToFileStoreWriter writer     = new ToFileStoreWriter(_directory.databaseDir(), _fs, new StoreCopyClientMonitor_Adapter());
            ByteBuffer        tempBuffer = ByteBuffer.allocate(128);

            // WHEN
            foreach (StoreType type in StoreType.values())
            {
                if (type.RecordStore)
                {
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
                    File[] files = _directory.databaseLayout().file(type.DatabaseFile).toArray(File[] ::new);
                    foreach (File file in files)
                    {
                        WriteAndVerify(writer, tempBuffer, file);
                    }
                }
            }
            WriteAndVerify(writer, tempBuffer, _directory.databaseLayout().labelScanStore());
        }
Exemplo n.º 3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void writeAndVerify(ToFileStoreWriter writer, ByteBuffer tempBuffer, java.io.File file) throws java.io.IOException
        private void WriteAndVerify(ToFileStoreWriter writer, ByteBuffer tempBuffer, File file)
        {
            writer.Write(file.Name, new DataProducer(16), tempBuffer, true, 16);
            assertTrue("File created by writer should exist.", _fs.fileExists(file));
            assertEquals(16, _fs.getFileSize(file));
        }