-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
Neo4jAdminUsageTest.java
82 lines (76 loc) · 3.54 KB
/
Neo4jAdminUsageTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
* Copyright (c) 2002-2017 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.commandline.admin;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class Neo4jAdminUsageTest
{
private Usage usageCmd;
@Before
public void setup()
{
usageCmd = new Usage( AdminTool.scriptName, CommandLocator.fromServiceLocator() );
}
@Test
public void verifyUsageMatchesExpectedCommands() throws Exception
{
final 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" +
"\n" +
"available commands:\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" +
" version\n" +
" Check the version of a Neo4j database store.\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" +
"Clustering\n" +
" unbind\n" +
" Removes cluster state data for the specified database.\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" +
"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() );
}
}