Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void unregisterIndexProvider()
        internal virtual void UnregisterIndexProvider()
        {
            IndexImplementation index = mock(typeof(IndexImplementation));
            string testProviderName   = "b";

            _provider.registerIndexProvider(testProviderName, index);
            assertTrue(_provider.unregisterIndexProvider(testProviderName));
        }
Пример #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void registerAndAccessIndexProvider()
        internal virtual void RegisterAndAccessIndexProvider()
        {
            IndexImplementation index = mock(typeof(IndexImplementation));
            string testProviderName   = "a";

            _provider.registerIndexProvider(testProviderName, index);
            assertSame(index, _provider.getProviderByName(testProviderName));
        }
Пример #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void throwOnAttemptToRegisterProviderWithSameName()
        internal virtual void ThrowOnAttemptToRegisterProviderWithSameName()
        {
            IndexImplementation index = mock(typeof(IndexImplementation));
            string testProviderName   = "a";

            _provider.registerIndexProvider(testProviderName, index);
            assertThrows(typeof(System.ArgumentException), () => _provider.registerIndexProvider(testProviderName, index));
        }
Пример #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void accessAllRegisteredIndexProviders()
        internal virtual void AccessAllRegisteredIndexProviders()
        {
            IndexImplementation index1 = mock(typeof(IndexImplementation));
            IndexImplementation index2 = mock(typeof(IndexImplementation));
            string testProviderName1   = "e";
            string testProviderName2   = "f";

            _provider.registerIndexProvider(testProviderName1, index1);
            _provider.registerIndexProvider(testProviderName2, index2);

            assertThat(_provider.allIndexProviders(), contains(index1, index2));
        }
Пример #5
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void migrate(org.neo4j.io.layout.DatabaseLayout directoryLayout, org.neo4j.io.layout.DatabaseLayout migrationLayout, org.neo4j.kernel.impl.util.monitoring.ProgressReporter progressMonitor, String versionToMigrateFrom, String versionToMigrateTo) throws java.io.IOException
        public override void Migrate(DatabaseLayout directoryLayout, DatabaseLayout migrationLayout, ProgressReporter progressMonitor, string versionToMigrateFrom, string versionToMigrateTo)
        {
            IndexImplementation indexImplementation = _explicitIndexProvider.getProviderByName(LUCENE_EXPLICIT_INDEX_PROVIDER_NAME);

            if (indexImplementation != null)
            {
                RecordFormats from = RecordFormatSelector.selectForVersion(versionToMigrateFrom);
                RecordFormats to   = RecordFormatSelector.selectForVersion(versionToMigrateTo);
                if (!from.HasCompatibleCapabilities(to, CapabilityType.INDEX))
                {
                    _originalExplicitIndexesRoot  = indexImplementation.GetIndexImplementationDirectory(directoryLayout);
                    _migrationExplicitIndexesRoot = indexImplementation.GetIndexImplementationDirectory(migrationLayout);
                    if (IsNotEmptyDirectory(_originalExplicitIndexesRoot))
                    {
                        MigrateExplicitIndexes(progressMonitor);
                        _explicitIndexMigrated = true;
                    }
                }
            }
            else
            {
                _log.debug("Lucene index provider not found, nothing to migrate.");
            }
        }