Search in sources :

Example 1 with ManagedConcourseServer

use of com.cinchapi.concourse.server.ManagedConcourseServer in project concourse by cinchapi.

the class GH426 method testReproGH426.

@Test
public void testReproGH426() {
    ConcourseCodebase codebase = ConcourseCodebase.cloneFromGithub();
    String installer = codebase.buildInstaller();
    ManagedConcourseServer server = ManagedConcourseServer.manageNewServer(new File(installer));
    server.start();
    Concourse client = server.connect();
    long record = client.add("name", "jeff");
    Assert.assertEquals("jeff", client.get("name", record));
}
Also used : ConcourseCodebase(com.cinchapi.concourse.util.ConcourseCodebase) Concourse(com.cinchapi.concourse.Concourse) ManagedConcourseServer(com.cinchapi.concourse.server.ManagedConcourseServer) File(java.io.File) Test(org.junit.Test)

Example 2 with ManagedConcourseServer

use of com.cinchapi.concourse.server.ManagedConcourseServer in project concourse by cinchapi.

the class GH426 method testFreshInstallExistingData.

@Test
public void testFreshInstallExistingData() throws IOException {
    // Ensure that commit 237556de81031c919fc8add3b773618ef750ca48 still
    // works as expected
    ManagedConcourseServer server = ManagedConcourseServer.manageNewServer("0.10.5");
    server.start();
    Concourse client = server.connect();
    long record = client.add("name", "jeff");
    server.stop();
    String directory = server.getInstallDirectory();
    ConcourseCodebase codebase = ConcourseCodebase.cloneFromGithub();
    String installer = codebase.buildInstaller();
    File src = new File(installer);
    File dest = new File(server.getInstallDirectory() + "/concourse-server.bin");
    Files.copy(src, dest);
    // Run the upgrade from the installer
    System.out.println("Upgrading Concourse Server...");
    Process proc = new ProcessBuilder("sh", dest.getAbsolutePath(), "--", "skip-integration").directory(new File(server.getInstallDirectory())).start();
    Processes.waitForSuccessfulCompletion(proc);
    for (String line : Processes.getStdOut(proc)) {
        System.out.println(line);
    }
    server = ManagedConcourseServer.manageExistingServer(directory);
    server.start();
    client = server.connect();
    Assert.assertEquals("jeff", client.get("name", record));
}
Also used : ConcourseCodebase(com.cinchapi.concourse.util.ConcourseCodebase) Concourse(com.cinchapi.concourse.Concourse) ManagedConcourseServer(com.cinchapi.concourse.server.ManagedConcourseServer) File(java.io.File) Test(org.junit.Test)

Aggregations

Concourse (com.cinchapi.concourse.Concourse)2 ManagedConcourseServer (com.cinchapi.concourse.server.ManagedConcourseServer)2 ConcourseCodebase (com.cinchapi.concourse.util.ConcourseCodebase)2 File (java.io.File)2 Test (org.junit.Test)2