command.executeToStream();
}
@Test
public void testServerRefCount() throws IOException {
BaseRepository repo = getTestRepository();
BaseRepository repo2 = getTestRepository2();
writeFile("a");
commit();
Bundle bundle = IncomingCommand.on(repo2).execute(repo);
Repository repo3 = bundle.getOverlayRepository();
Assert.assertSame(repo2.getServerPool(), repo3.getServerPool());
ServerPool pool = repo2.getServerPool();
Assert.assertEquals(1, pool.getServers().size());
Assert.assertNotNull(pool.getServers().get(0).getProcess());
repo2.close();
Assert.assertNotNull(pool.getServers().get(0).getProcess());
Server server = pool.getServers().get(0);
bundle.close();
Assert.assertNull(server.getProcess());
Assert.assertTrue(pool.getServers().isEmpty());