Exemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Override @Nonnull public org.neo4j.commandline.admin.AdminCommand create(java.nio.file.Path homeDir, java.nio.file.Path configDir, org.neo4j.commandline.admin.OutsideWorld outsideWorld)
        public override AdminCommand Create(Path homeDir, Path configDir, OutsideWorld outsideWorld)
        {
            bool        debug       = System.getenv().get("NEO4J_DEBUG") != null;
            LogProvider logProvider = FormattedLogProvider.withDefaultLogLevel(debug ? Level.DEBUG : Level.NONE).toOutputStream(outsideWorld.OutStream());
            Monitors    monitors    = new Monitors();

            OnlineBackupContextFactory contextBuilder = new OnlineBackupContextFactory(homeDir, configDir);
            BackupModule backupModule = new BackupModule(outsideWorld, logProvider, monitors);

            BackupSupportingClassesFactoryProvider classesFactoryProvider   = ProvidersByPriority.findFirst().orElseThrow(NoProviderException());
            BackupSupportingClassesFactory         supportingClassesFactory = classesFactoryProvider.GetFactory(backupModule);
            BackupStrategyCoordinatorFactory       coordinatorFactory       = new BackupStrategyCoordinatorFactory(backupModule);

            return(new OnlineBackupCommand(outsideWorld, contextBuilder, supportingClassesFactory, coordinatorFactory));
        }
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 communityBackupSupportingFactory()
        public virtual void CommunityBackupSupportingFactory()
        {
            AssertableLogProvider logProvider = new AssertableLogProvider();

            //OutsideWorld outsideWorld = mock( OutsideWorld.class );

            RealOutsideWorld      outsideWorld   = new RealOutsideWorld();
            FileSystemAbstraction fileSystemMock = mock(typeof(FileSystemAbstraction));

            //outsideWorld.fileSystemAbstraction = fileSystemMock;
            Monitors monitors = mock(typeof(Monitors));

            BackupModule backupModule = new BackupModule(outsideWorld, logProvider, monitors);

            // when( backupModule.getOutsideWorld() ).thenReturn( outsideWorld );

            BackupSupportingClassesFactoryProvider provider = ProvidersByPriority.findFirst().get();

            BackupSupportingClassesFactory factory = provider.GetFactory(backupModule);

            /*
             * SecurePipelineWrapperFactory pipelineWrapperFactory = new SecurePipelineWrapperFactory();
             * SslPolicyLoader sslPolicyLoader;
             * // and
             * Config config = Config.defaults();
             * config.augment( CausalClusteringSettings.ssl_policy, "default" );
             *
             * // We want to create dependencies the same way factory.createPipelineWrapper does so.s
             * Dependencies dependencies = new Dependencies(  );
             * dependencies.satisfyDependencies(new Object[]{SslPolicyLoader.create(config, logProvider)});
             *
             * assertEquals( pipelineWrapperFactory.forClient(config, dependencies, logProvider, CausalClusteringSettings.ssl_policy),
             *      factory.createPipelineWrapper( Config.defaults() ) );
             */

            assertEquals(typeof(SecureClientPipelineWrapper), factory.CreatePipelineWrapper(Config.defaults()).GetType());
        }