예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void transferOriginalDataToMigrationDirectory() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void TransferOriginalDataToMigrationDirectory()
        {
            ExplicitIndexProvider indexProviders = ExplicitIndexProvider;
            ExplicitIndexMigrator indexMigrator  = new TestExplicitIndexMigrator(this, _fs, indexProviders, _logProvider, true);

            indexMigrator.Migrate(_storeLayout, _migrationLayout, _progressMonitor, StandardV2_3.STORE_VERSION, StandardV3_0.STORE_VERSION);

            verify(_fs).copyRecursively(_originalIndexStore, _migratedIndexStore);
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void skipEmptyIndexStorageMigration() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void SkipEmptyIndexStorageMigration()
        {
            when(_fs.listFiles(_originalIndexStore)).thenReturn(null);

            ExplicitIndexProvider indexProviders = ExplicitIndexProvider;
            ExplicitIndexMigrator indexMigrator  = new TestExplicitIndexMigrator(this, _fs, indexProviders, _logProvider, true);

            indexMigrator.Migrate(_storeLayout, _migrationLayout, _progressMonitor, StandardV2_3.STORE_VERSION, StandardV3_0.STORE_VERSION);

            verify(_fs, never()).deleteRecursively(_originalIndexStore);
            verify(_fs, never()).moveToDirectory(_migratedIndexStore, _storeLayout.databaseDirectory());
        }
예제 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void cleanupMigrationDirectory() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void CleanupMigrationDirectory()
        {
            when(_fs.fileExists(_migratedIndexStore)).thenReturn(true);

            ExplicitIndexProvider indexProviders = ExplicitIndexProvider;
            ExplicitIndexMigrator indexMigrator  = new TestExplicitIndexMigrator(this, _fs, indexProviders, _logProvider, true);

            indexMigrator.Migrate(_storeLayout, _migrationLayout, _progressMonitor, StandardV2_3.STORE_VERSION, StandardV3_0.STORE_VERSION);
            indexMigrator.Cleanup(_migrationLayout);

            verify(_fs).deleteRecursively(_migratedIndexStore);
        }
예제 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void transferMigratedIndexesToStoreDirectory() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void TransferMigratedIndexesToStoreDirectory()
        {
            ExplicitIndexProvider indexProviders = ExplicitIndexProvider;
            ExplicitIndexMigrator indexMigrator  = new TestExplicitIndexMigrator(this, _fs, indexProviders, _logProvider, true);

            indexMigrator.Migrate(_storeLayout, _migrationLayout, _progressMonitor, StandardV2_3.STORE_VERSION, StandardV3_0.STORE_VERSION);
            reset(_fs);

            indexMigrator.MoveMigratedFiles(_migrationLayout, _storeLayout, "any", "any");

            verify(_fs).deleteRecursively(_originalIndexStore);
            verify(_fs).moveToDirectory(_migratedIndexStore, _storeLayout.databaseDirectory());
        }
예제 #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void logErrorWithIndexNameOnIndexMigrationException()
        public virtual void LogErrorWithIndexNameOnIndexMigrationException()
        {
            Log log = mock(typeof(Log));

            when(_logProvider.getLog(typeof(TestExplicitIndexMigrator))).thenReturn(log);

            ExplicitIndexProvider indexProviders = ExplicitIndexProvider;

            try
            {
                ExplicitIndexMigrator indexMigrator = new TestExplicitIndexMigrator(this, _fs, indexProviders, _logProvider, false);
                indexMigrator.Migrate(_storeLayout, _migrationLayout, _progressMonitor, StandardV2_3.STORE_VERSION, StandardV3_0.STORE_VERSION);

                fail("Index migration should fail");
            }
            catch (IOException)
            {
                // ignored
            }

            verify(log).error(eq("Migration of explicit indexes failed. Index: testIndex can't be migrated."), any(typeof(Exception)));
        }