Skip to content

Commit

Permalink
More verbose output for failing cases
Browse files Browse the repository at this point in the history
  • Loading branch information
klaren committed Feb 15, 2018
1 parent ba87879 commit 4eb0933
Showing 1 changed file with 14 additions and 8 deletions.
Expand Up @@ -20,7 +20,7 @@
package org.neo4j.backup;

import org.apache.commons.lang3.SystemUtils;
import org.junit.ClassRule;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.RuleChain;
Expand Down Expand Up @@ -56,16 +56,16 @@
@RunWith( Parameterized.class )
public class OnlineBackupCommandIT
{
@ClassRule
public static final TestDirectory testDirectory = TestDirectory.testDirectory();
@Rule
public final TestDirectory testDirectory = TestDirectory.testDirectory();

private final EmbeddedDatabaseRule db = new EmbeddedDatabaseRule( testDirectory.directory( "db" ) ).startLazily();
private final EmbeddedDatabaseRule db = new EmbeddedDatabaseRule().startLazily();

@Rule
public final RuleChain ruleChain = RuleChain.outerRule( SuppressOutput.suppressAll() ).around( db );

private static final String ip = "127.0.0.1";
private final File backupDir = testDirectory.directory( "backups" );
private File backupDir;

@Parameter
public String recordFormat;
Expand All @@ -76,6 +76,12 @@ public static List<String> recordFormats()
return Arrays.asList( Standard.LATEST_NAME, HighLimit.NAME );
}

@Before
public void setUp()
{
backupDir = testDirectory.directory( "backups" );
}

public static DbRepresentation createSomeData( GraphDatabaseService db )
{
try ( Transaction tx = db.beginTx() )
Expand Down Expand Up @@ -154,7 +160,7 @@ private void startDb( String backupPort )
createSomeData( db );
}

private static int runBackupToolFromOtherJvmToGetExitCode( String... args )
private int runBackupToolFromOtherJvmToGetExitCode( String... args )
throws Exception
{
return runBackupToolFromOtherJvmToGetExitCode( testDirectory.absolutePath(), args );
Expand All @@ -169,9 +175,9 @@ public static int runBackupToolFromOtherJvmToGetExitCode( File neo4jHome, String
allArgs.add( "backup" );
allArgs.addAll( Arrays.asList( args ) );

Process process = Runtime.getRuntime().exec( allArgs.toArray( new String[allArgs.size()] ),
Process process = Runtime.getRuntime().exec( allArgs.toArray( new String[0] ),
new String[] {"NEO4J_HOME=" + neo4jHome.getAbsolutePath()} );
return new ProcessStreamHandler( process, true ).waitForResult();
return new ProcessStreamHandler( process, false ).waitForResult();
}

private DbRepresentation getDbRepresentation()
Expand Down

0 comments on commit 4eb0933

Please sign in to comment.