public static bool CheckNeoStoreHasDefaultFormatVersion(StoreVersionCheck check, DatabaseLayout databaseLayout) { File metadataStore = databaseLayout.MetadataStore(); return(check.HasVersion(metadataStore, RecordFormatSelector.defaultFormat().storeVersion()).Outcome.Successful); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: UnusedLabelTokenStore() throws java.io.IOException internal UnusedLabelTokenStore(LabelTokenStoreTest outerInstance) : base(outerInstance.file, outerInstance.idFile, outerInstance.config, outerInstance.generatorFactory, outerInstance.cache, outerInstance.logProvider, outerInstance.dynamicStringStore, RecordFormatSelector.defaultFormat()) { this._outerInstance = outerInstance; pagedFile = mock(typeof(PagedFile)); when(pagedFile.io(any(typeof(Long)), any(typeof(Integer)))).thenReturn(outerInstance.pageCursor); when(pagedFile.pageSize()).thenReturn(1); when(outerInstance.pageCursor.Next()).thenReturn(true); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldWriteOutTheDynamicChainBeforeUpdatingThePropertyRecord() public virtual void ShouldWriteOutTheDynamicChainBeforeUpdatingThePropertyRecord() { // given PageCache pageCache = PageCacheRule.getPageCache(_fileSystemAbstraction); Config config = Config.defaults(GraphDatabaseSettings.rebuild_idgenerators_fast, "true"); DynamicStringStore stringPropertyStore = mock(typeof(DynamicStringStore)); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final PropertyStore store = new PropertyStore(storeFile, idFile, config, new org.neo4j.kernel.impl.core.JumpingIdGeneratorFactory(1), pageCache, org.neo4j.logging.NullLogProvider.getInstance(), stringPropertyStore, mock(PropertyKeyTokenStore.class), mock(DynamicArrayStore.class), org.neo4j.kernel.impl.store.format.RecordFormatSelector.defaultFormat()); PropertyStore store = new PropertyStore(_storeFile, _idFile, config, new JumpingIdGeneratorFactory(1), pageCache, NullLogProvider.Instance, stringPropertyStore, mock(typeof(PropertyKeyTokenStore)), mock(typeof(DynamicArrayStore)), RecordFormatSelector.defaultFormat()); store.Initialise(true); try { store.MakeStoreOk(); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final long propertyRecordId = store.nextId(); long propertyRecordId = store.NextId(); PropertyRecord record = new PropertyRecord(propertyRecordId); record.InUse = true; DynamicRecord dynamicRecord = dynamicRecord(); PropertyBlock propertyBlock = PropertyBlockWith(dynamicRecord); record.PropertyBlock = propertyBlock; doAnswer(invocation => { PropertyRecord recordBeforeWrite = store.GetRecord(propertyRecordId, store.NewRecord(), FORCE); assertFalse(recordBeforeWrite.inUse()); return(null); }).when(stringPropertyStore).updateRecord(dynamicRecord); // when store.UpdateRecord(record); // then verify that our mocked method above, with the assert, was actually called verify(stringPropertyStore).updateRecord(dynamicRecord); } finally { store.Close(); } }