@Override public Neo4jRule copyFrom( File sourceDirectory ) { builder = builder.copyFrom( sourceDirectory ); return this; }
@Test public void shouldFailWhenProvidingANonDirectoryAsSource() throws IOException { File notADirectory = File.createTempFile( "prefix", "suffix" ); assertFalse( notADirectory.isDirectory() ); try ( ServerControls ignored = getTestServerBuilder( testDir.directory() ) .copyFrom( notADirectory ).newServer() ) { fail( "server should not start" ); } catch ( RuntimeException rte ) { Throwable cause = rte.getCause(); assertTrue( cause instanceof IOException ); assertTrue( cause.getMessage().contains( "exists but is not a directory" ) ); } }
try ( ServerControls server = getTestServerBuilder( testDir.databaseDir() ).copyFrom( existingStoreDir ) .newServer() )
@Override public Neo4jRule copyFrom( File sourceDirectory ) { builder = builder.copyFrom( sourceDirectory ); return this; }