internal DiagnosticsReportCommand(Path homeDir, Path configDir, OutsideWorld outsideWorld) { this._homeDir = homeDir; this._configDir = configDir; this._fs = outsideWorld.FileSystem(); this.@out = outsideWorld.OutStream(); _err = outsideWorld.ErrorStream(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Before public void setup() public virtual void Setup() { _fileSystem = _fileSystemRule.get(); OutsideWorld mock = mock(typeof(OutsideWorld)); when(mock.FileSystem()).thenReturn(_fileSystem); _setPasswordCommand = new SetInitialPasswordCommand(_testDir.directory("home").toPath(), _testDir.directory("conf").toPath(), mock); _authInitFile = CommunitySecurityModule.getInitialUserRepositoryFile(_setPasswordCommand.loadNeo4jConfig()); CommunitySecurityModule.getUserRepositoryFile(_setPasswordCommand.loadNeo4jConfig()); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Before public void setup() throws java.io.IOException, org.neo4j.kernel.api.exceptions.InvalidArgumentsException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void Setup() { OutsideWorld mock = mock(typeof(OutsideWorld)); when(mock.FileSystem()).thenReturn(_fileSystem); _setDefaultAdmin = new SetDefaultAdminCommand(TestDir.directory("home").toPath(), TestDir.directory("conf").toPath(), mock); _config = _setDefaultAdmin.loadNeo4jConfig(); UserRepository users = CommunitySecurityModule.getUserRepository(_config, NullLogProvider.Instance, _fileSystem); users.create(new User.Builder("jake", LegacyCredential.forPassword("123")) .withRequiredPasswordChange(false).build()); _adminIniFile = new File(CommunitySecurityModule.getUserRepositoryFile(_config).ParentFile, "admin.ini"); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void listShouldDisplayAllClassifiers() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: internal virtual void ListShouldDisplayAllClassifiers() { using (MemoryStream baos = new MemoryStream()) { PrintStream ps = new PrintStream(baos); string[] args = new string[] { "--list" }; OutsideWorld outsideWorld = mock(typeof(OutsideWorld)); when(outsideWorld.FileSystem()).thenReturn(_fs); when(outsideWorld.OutStream()).thenReturn(ps); DiagnosticsReportCommand diagnosticsReportCommand = new DiagnosticsReportCommand(_homeDir, _configDir, outsideWorld); diagnosticsReportCommand.Execute(args); assertThat(baos.ToString(), @is(string.Format("Finding running instance of neo4j%n" + "No running instance of neo4j was found. Online reports will be omitted.%n" + "If neo4j is running but not detected, you can supply the process id of the running instance with --pid%n" + "All available classifiers:%n" + " config include configuration file%n" + " logs include log files%n" + " plugins include a view of the plugin directory%n" + " ps include a list of running processes%n" + " tree include a view of the tree structure of the data directory%n" + " tx include transaction logs%n"))); } }
private void ResetOutsideWorldMock() { reset(@out); when(@out.FileSystem()).thenReturn(_fileSystem); }