Search in sources :

Example 1 with ConcourseCodebase

use of com.cinchapi.concourse.util.ConcourseCodebase 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 ConcourseCodebase

use of com.cinchapi.concourse.util.ConcourseCodebase 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)

Example 3 with ConcourseCodebase

use of com.cinchapi.concourse.util.ConcourseCodebase in project concourse by cinchapi.

the class UpgradeTest method beforeEachTest.

@Override
protected final void beforeEachTest() {
    super.beforeEachTest();
    try {
        log.info("Running pre upgrade actions...");
        preUpgradeActions();
        server.stop();
        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
        log.info("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)) {
            log.info(line);
        }
        server.start();
        client = server.connect();
    } catch (IOException e) {
        throw CheckedExceptions.wrapAsRuntimeException(e);
    }
}
Also used : ConcourseCodebase(com.cinchapi.concourse.util.ConcourseCodebase) IOException(java.io.IOException) File(java.io.File)

Aggregations

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