예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void verifyUsageMatchesExpectedCommands()
        public virtual void VerifyUsageMatchesExpectedCommands()
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final StringBuilder sb = new StringBuilder();
            StringBuilder sb = new StringBuilder();

            _usageCmd.print(s => sb.Append(s).Append("\n"));

            assertEquals("usage: neo4j-admin <command>\n" + "\n" + "Manage your Neo4j instance.\n" + "\n" + "environment variables:\n" + "    NEO4J_CONF    Path to directory which contains neo4j.conf.\n" + "    NEO4J_DEBUG   Set to anything to enable debug output.\n" + "    NEO4J_HOME    Neo4j home directory.\n" + "    HEAP_SIZE     Set JVM maximum heap size during command execution.\n" + "                  Takes a number and a unit, for example 512m.\n" + "\n" + "available commands:\n" + "\n" + "General\n" + "    check-consistency\n" + "        Check the consistency of a database.\n" + "    import\n" + "        Import from a collection of CSV files or a pre-3.0 database.\n" + "    memrec\n" + "        Print Neo4j heap and pagecache memory settings recommendations.\n" + "    report\n" + "        Produces a zip/tar of the most common information needed for remote assessments.\n" + "    store-info\n" + "        Prints information about a Neo4j database store.\n" + "\n" + "Authentication\n" + "    set-default-admin\n" + "        Sets the default admin user when no roles are present.\n" + "    set-initial-password\n" + "        Sets the initial password of the initial admin user ('neo4j').\n" + "\n" + "Clustering\n" + "    unbind\n" + "        Removes cluster state data for the specified database.\n" + "\n" + "Offline backup\n" + "    dump\n" + "        Dump a database into a single-file archive.\n" + "    load\n" + "        Load a database from an archive created with the dump command.\n" + "\n" + "Online backup\n" + "    backup\n" + "        Perform an online backup from a running Neo4j enterprise server.\n" + "    restore\n" + "        Restore a backed up database.\n" + "\n" + "Use neo4j-admin help <command> for more details.\n", sb.ToString());
        }
예제 #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void execute(String... args) throws IncorrectUsage
        public override void Execute(params string[] args)
        {
            if (args.Length > 0)
            {
                try
                {
                    AdminCommand_Provider commandProvider = this._locator.findProvider(args[0]);
                    _usage.printUsageForCommand(commandProvider, _output);
                }
                catch (NoSuchElementException)
                {
                    StringBuilder validCommands = new StringBuilder();
                    _locator.AllProviders.forEach(commandProvider => validCommands.Append(commandProvider.name()).Append(" "));

                    throw new IncorrectUsage(format("Unknown command: %s. Available commands are: %s\n", args[0], validCommands));
                }
            }
            else
            {
                _usage.print(_output);
            }
        }
예제 #3
0
 private void BadUsage(string message)
 {
     _outsideWorld.stdErrLine(message);
     _usage.print(_outsideWorld.stdErrLine);
     Failure();
 }