//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: protected void after(boolean successful) throws Throwable protected internal override void After(bool successful) { IOUtils.closeAll(_neoStores, _rulePageCache, _jobScheduler); _neoStores = null; if (_ruleFs != null) { _ruleFs.Dispose(); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void releaseResourcesOnClose() throws java.io.IOException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: internal virtual void ReleaseResourcesOnClose() { using (EphemeralFileSystemAbstraction fileSystemAbstraction = new EphemeralFileSystemAbstraction()) { File testDir = new File("testDir"); File testFile = new File("testFile"); fileSystemAbstraction.Mkdir(testDir); fileSystemAbstraction.Create(testFile); assertTrue(fileSystemAbstraction.FileExists(testFile)); assertTrue(fileSystemAbstraction.FileExists(testFile)); fileSystemAbstraction.Dispose(); assertTrue(fileSystemAbstraction.Closed); assertFalse(fileSystemAbstraction.FileExists(testFile)); assertFalse(fileSystemAbstraction.FileExists(testFile)); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @AfterEach void tearDown() throws java.io.IOException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: internal virtual void TearDown() { _fs.Dispose(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void crashAndRebuildSlowWithDynamicStringDeletions() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void CrashAndRebuildSlowWithDynamicStringDeletions() { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.neo4j.kernel.internal.GraphDatabaseAPI db = (org.neo4j.kernel.internal.GraphDatabaseAPI) new org.neo4j.test.TestGraphDatabaseFactory().setFileSystem(fs.get()).newImpermanentDatabaseBuilder(testDir.databaseDir()).setConfig(org.neo4j.graphdb.factory.GraphDatabaseSettings.record_id_batch_size, "1").newGraphDatabase(); GraphDatabaseAPI db = ( GraphDatabaseAPI )(new TestGraphDatabaseFactory()).setFileSystem(Fs.get()).newImpermanentDatabaseBuilder(TestDir.databaseDir()).setConfig(GraphDatabaseSettings.record_id_batch_size, "1").newGraphDatabase(); IList <long> deletedNodeIds = ProduceNonCleanDefraggedStringStore(db); IDictionary <IdType, long> highIdsBeforeCrash = GetHighIds(db); // Make sure all of our changes are actually written to the files, since any background flushing could // mess up the check-sums in non-deterministic ways Db.DependencyResolver.resolveDependency(typeof(PageCache)).flushAndForce(); long checksumBefore = Fs.get().checksum(); long checksumBefore2 = Fs.get().checksum(); assertThat(checksumBefore, Matchers.equalTo(checksumBefore2)); EphemeralFileSystemAbstraction snapshot = Fs.snapshot(Db.shutdown); long snapshotChecksum = snapshot.Checksum(); if (snapshotChecksum != checksumBefore) { using (Stream @out = new FileStream(TestDir.file("snapshot.zip"), FileMode.Create, FileAccess.Write)) { snapshot.DumpZip(@out); } using (Stream @out = new FileStream(TestDir.file("fs.zip"), FileMode.Create, FileAccess.Write)) { Fs.get().dumpZip(@out); } } assertThat(snapshotChecksum, equalTo(checksumBefore)); // Recover with unsupported.dbms.id_generator_fast_rebuild_enabled=false AssertNumberOfFreeIdsEquals(TestDir.databaseDir(), snapshot, 0); GraphDatabaseAPI newDb = ( GraphDatabaseAPI )(new TestGraphDatabaseFactory()).setFileSystem(snapshot).newImpermanentDatabaseBuilder(TestDir.databaseDir()).setConfig(GraphDatabaseSettings.rebuild_idgenerators_fast, FALSE).newGraphDatabase(); IDictionary <IdType, long> highIdsAfterCrash = GetHighIds(newDb); assertEquals(highIdsBeforeCrash, highIdsAfterCrash); try { using (Transaction tx = newDb.BeginTx()) { // Verify that the data we didn't delete is still around int nameCount = 0; int relCount = 0; foreach (Node node in newDb.AllNodes) { nameCount++; assertThat(node, inTx(newDb, hasProperty("name"), true)); relCount += ( int )Iterables.count(node.GetRelationships(Direction.OUTGOING)); } assertEquals(16, nameCount); assertEquals(12, relCount); // Verify that the ids of the nodes we deleted are reused IList <long> newIds = new List <long>(); newIds.Add(newDb.CreateNode().Id); newIds.Add(newDb.CreateNode().Id); newIds.Add(newDb.CreateNode().Id); newIds.Add(newDb.CreateNode().Id); assertThat(newIds, @is(deletedNodeIds)); tx.Success(); } } finally { newDb.Shutdown(); snapshot.Dispose(); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @After public void cleanup() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void Cleanup() { Db.shutdown(); _fs.Dispose(); }