Skip to content

Commit

Permalink
Make AdminTool read the NEO4J_ environment variables through mutable …
Browse files Browse the repository at this point in the history
…static fields, so tests could potentially modify them in-process.
  • Loading branch information
chrisvest committed Dec 8, 2017
1 parent b9d9c01 commit 4b9becb
Showing 1 changed file with 8 additions and 5 deletions.
Expand Up @@ -33,15 +33,18 @@

public class AdminTool
{

static final int STATUS_SUCCESS = 0;
public static final int STATUS_SUCCESS = 0;
public static final int STATUS_ERROR = 1;
// These fields are mutable for in-process AdminTool testing purposes.
public static String NEO4J_HOME = System.getenv().getOrDefault( "NEO4J_HOME", "" );
public static String NEO4J_CONF = System.getenv().getOrDefault( "NEO4J_CONF", "" );
public static String NEO4J_DEBUG = System.getenv().getOrDefault( "NEO4J_DEBUG", "" );

public static void main( String[] args ) throws IOException
{
Path homeDir = Paths.get( System.getenv().getOrDefault( "NEO4J_HOME", "" ) );
Path configDir = Paths.get( System.getenv().getOrDefault( "NEO4J_CONF", "" ) );
boolean debug = System.getenv( "NEO4J_DEBUG" ) != null;
Path homeDir = Paths.get( NEO4J_HOME );
Path configDir = Paths.get( NEO4J_CONF );
boolean debug = NEO4J_DEBUG != null;

try ( RealOutsideWorld outsideWorld = new RealOutsideWorld() )
{
Expand Down

0 comments on commit 4b9becb

Please sign in to comment.