Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldPrintNiceHelp() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void ShouldPrintNiceHelp()
        {
            using (MemoryStream baos = new MemoryStream())
            {
                PrintStream ps = new PrintStream(baos);

                Usage usage = new Usage("neo4j-admin", mock(typeof(CommandLocator)));
                usage.PrintUsageForCommand(new CheckConsistencyCommandProvider(), ps.println);

                assertEquals(string.Format("usage: neo4j-admin check-consistency [--database=<name>]%n" + "                                     [--backup=</path/to/backup>]%n" + "                                     [--verbose[=<true|false>]]%n" + "                                     [--report-dir=<directory>]%n" + "                                     [--additional-config=<config-file-path>]%n" + "                                     [--check-graph[=<true|false>]]%n" + "                                     [--check-indexes[=<true|false>]]%n" + "                                     [--check-index-structure[=<true|false>]]%n" + "                                     [--check-label-scan-store[=<true|false>]]%n" + "                                     [--check-property-owners[=<true|false>]]%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" + "This command allows for checking the consistency of a database or a backup%n" + "thereof. It cannot be used with a database which is currently in use.%n" + "%n" + "All checks except 'check-graph' can be quite expensive so it may be useful to%n" + "turn them off for very large databases. Increasing the heap size can also be a%n" + "good idea. See 'neo4j-admin help' for details.%n" + "%n" + "options:%n" + "  --database=<name>                        Name of database. [default:" + GraphDatabaseSettings.DEFAULT_DATABASE_NAME + "]%n" + "  --backup=</path/to/backup>               Path to backup to check consistency%n" + "                                           of. Cannot be used together with%n" + "                                           --database. [default:]%n" + "  --verbose=<true|false>                   Enable verbose output.%n" + "                                           [default:false]%n" + "  --report-dir=<directory>                 Directory to write report file in.%n" + "                                           [default:.]%n" + "  --additional-config=<config-file-path>   Configuration file to supply%n" + "                                           additional configuration in. This%n" + "                                           argument is DEPRECATED. [default:]%n" + "  --check-graph=<true|false>               Perform checks between nodes,%n" + "                                           relationships, properties, types and%n" + "                                           tokens. [default:true]%n" + "  --check-indexes=<true|false>             Perform checks on indexes.%n" + "                                           [default:true]%n" + "  --check-index-structure=<true|false>     Perform structure checks on indexes.%n" + "                                           [default:false]%n" + "  --check-label-scan-store=<true|false>    Perform checks on the label scan%n" + "                                           store. [default:true]%n" + "  --check-property-owners=<true|false>     Perform additional checks on property%n" + "                                           ownership. This check is *very*%n" + "                                           expensive in time and memory.%n" + "                                           [default:false]%n"), baos.ToString());
            }
        }
Пример #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldPrintNiceHelp() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void ShouldPrintNiceHelp()
        {
            using (MemoryStream baos = new MemoryStream())
            {
                PrintStream ps = new PrintStream(baos);

                Usage usage = new Usage("neo4j-admin", mock(typeof(CommandLocator)));
                usage.PrintUsageForCommand(new ImportCommandProvider(), ps.println);

                assertEquals(string.Format("usage: neo4j-admin import [--mode=csv] [--database=<name>]%n" + "                          [--additional-config=<config-file-path>]%n" + "                          [--report-file=<filename>]%n" + "                          [--nodes[:Label1:Label2]=<\"file1,file2,...\">]%n" + "                          [--relationships[:RELATIONSHIP_TYPE]=<\"file1,file2,...\">]%n" + "                          [--id-type=<STRING|INTEGER|ACTUAL>]%n" + "                          [--input-encoding=<character-set>]%n" + "                          [--ignore-extra-columns[=<true|false>]]%n" + "                          [--ignore-duplicate-nodes[=<true|false>]]%n" + "                          [--ignore-missing-nodes[=<true|false>]]%n" + "                          [--multiline-fields[=<true|false>]]%n" + "                          [--delimiter=<delimiter-character>]%n" + "                          [--array-delimiter=<array-delimiter-character>]%n" + "                          [--quote=<quotation-character>]%n" + "                          [--max-memory=<max-memory-that-importer-can-use>]%n" + "                          [--f=<File containing all arguments to this import>]%n" + "                          [--high-io=<true/false>]%n" + "usage: neo4j-admin import --mode=database [--database=<name>]%n" + "                          [--additional-config=<config-file-path>]%n" + "                          [--from=<source-directory>]%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" + "Import a collection of CSV files with --mode=csv (default), or a database from a%n" + "pre-3.0 installation with --mode=database.%n" + "%n" + "options:%n" + "  --database=<name>%n" + "      Name of database. [default:" + GraphDatabaseSettings.DEFAULT_DATABASE_NAME + "]%n" + "  --additional-config=<config-file-path>%n" + "      Configuration file to supply additional configuration in. [default:]%n" + "  --mode=<database|csv>%n" + "      Import a collection of CSV files or a pre-3.0 installation. [default:csv]%n" + "  --from=<source-directory>%n" + "      The location of the pre-3.0 database (e.g. <neo4j-root>/data/graph.db).%n" + "      [default:]%n" + "  --report-file=<filename>%n" + "      File in which to store the report of the csv-import.%n" + "      [default:import.report]%n" + "  --nodes[:Label1:Label2]=<\"file1,file2,...\">%n" + "      Node CSV header and data. Multiple files will be logically seen as one big%n" + "      file from the perspective of the importer. The first line must contain the%n" + "      header. Multiple data sources like these can be specified in one import,%n" + "      where each data source has its own header. Note that file groups must be%n" + "      enclosed in quotation marks. [default:]%n" + "  --relationships[:RELATIONSHIP_TYPE]=<\"file1,file2,...\">%n" + "      Relationship CSV header and data. Multiple files will be logically seen as%n" + "      one big file from the perspective of the importer. The first line must%n" + "      contain the header. Multiple data sources like these can be specified in%n" + "      one import, where each data source has its own header. Note that file%n" + "      groups must be enclosed in quotation marks. [default:]%n" + "  --id-type=<STRING|INTEGER|ACTUAL>%n" + "      Each node must provide a unique id. This is used to find the correct nodes%n" + "      when creating relationships. Possible values are:%n" + "        STRING: arbitrary strings for identifying nodes,%n" + "        INTEGER: arbitrary integer values for identifying nodes,%n" + "        ACTUAL: (advanced) actual node ids.%n" + "      For more information on id handling, please see the Neo4j Manual:%n" + "      https://neo4j.com/docs/operations-manual/current/tools/import/%n" + "      [default:STRING]%n" + "  --input-encoding=<character-set>%n" + "      Character set that input data is encoded in. [default:UTF-8]%n" + "  --ignore-extra-columns=<true|false>%n" + "      If un-specified columns should be ignored during the import.%n" + "      [default:false]%n" + "  --ignore-duplicate-nodes=<true|false>%n" + "      If duplicate nodes should be ignored during the import. [default:false]%n" + "  --ignore-missing-nodes=<true|false>%n" + "      If relationships referring to missing nodes should be ignored during the%n" + "      import. [default:false]%n" + "  --multiline-fields=<true|false>%n" + "      Whether or not fields from input source can span multiple lines, i.e.%n" + "      contain newline characters. [default:false]%n" + "  --delimiter=<delimiter-character>%n" + "      Delimiter character between values in CSV data. [default:,]%n" + "  --array-delimiter=<array-delimiter-character>%n" + "      Delimiter character between array elements within a value in CSV data.%n" + "      [default:;]%n" + "  --quote=<quotation-character>%n" + "      Character to treat as quotation character for values in CSV data. Quotes%n" + "      can be escaped as per RFC 4180 by doubling them, for example \"\" would be%n" + "      interpreted as a literal \". You cannot escape using \\. [default:\"]%n" + "  --max-memory=<max-memory-that-importer-can-use>%n" + "      Maximum memory that neo4j-admin can use for various data structures and%n" + "      caching to improve performance. Values can be plain numbers, like 10000000%n" + "      or e.g. 20G for 20 gigabyte, or even e.g. 70%%. [default:90%%]%n" + "  --f=<File containing all arguments to this import>%n" + "      File containing all arguments, used as an alternative to supplying all%n" + "      arguments on the command line directly.Each argument can be on a separate%n" + "      line or multiple arguments per line separated by space.Arguments%n" + "      containing spaces needs to be quoted.Supplying other arguments in addition%n" + "      to this file argument is not supported. [default:]%n" + "  --high-io=<true/false>%n" + "      Ignore environment-based heuristics, and assume that the target storage%n" + "      subsystem can support parallel IO with high throughput. [default:null]%n"), baos.ToString());
            }
        }
Пример #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldPrintNiceHelp() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void ShouldPrintNiceHelp()
        {
            using (MemoryStream baos = new MemoryStream())
            {
                PrintStream ps = new PrintStream(baos);

                Usage usage = new Usage("neo4j-admin", mock(typeof(CommandLocator)));
                usage.PrintUsageForCommand(new LoadCommandProvider(), ps.println);

                assertEquals(string.Format("usage: neo4j-admin load --from=<archive-path> [--database=<name>]%n" + "                        [--force[=<true|false>]]%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" + "Load a database from an archive. <archive-path> must be an archive created with%n" + "the dump command. <database> is the name of the database to create. Existing%n" + "databases can be replaced by specifying --force. It is not possible to replace a%n" + "database that is mounted in a running Neo4j server.%n" + "%n" + "options:%n" + "  --from=<archive-path>   Path to archive created with the dump command.%n" + "  --database=<name>       Name of database. [default:" + GraphDatabaseSettings.DEFAULT_DATABASE_NAME + "]%n" + "  --force=<true|false>    If an existing database should be replaced.%n" + "                          [default:false]%n"), baos.ToString());
            }
        }
Пример #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldPrintUsage() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldPrintUsage()
        {
            using (MemoryStream baos = new MemoryStream())
            {
                PrintStream ps = new PrintStream(baos);

                Usage usage = new Usage("neo4j-admin", mock(typeof(CommandLocator)));
                usage.PrintUsageForCommand(new UnbindFromClusterCommandProvider(), ps.println);

                assertThat(baos.ToString(), containsString("usage"));
            }
        }