use of com.cinchapi.concourse.Concourse 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));
}
use of com.cinchapi.concourse.Concourse in project concourse by cinchapi.
the class ConcourseAccount method getOwners.
@Override
public Customer[] getOwners() {
Concourse concourse = Constants.CONCOURSE_CONNECTIONS.request();
try {
Set<Link> customerLinks = concourse.select("owners", id);
Customer[] owners = new Customer[customerLinks.size()];
int index = 0;
for (Link link : customerLinks) {
owners[index] = new ConcourseCustomer(link.longValue());
++index;
}
return owners;
} finally {
Constants.CONCOURSE_CONNECTIONS.release(concourse);
}
}
use of com.cinchapi.concourse.Concourse in project concourse by cinchapi.
the class AuthenticationTest method testDisabledUserSessionsEndedImmediately.
@Test
public void testDisabledUserSessionsEndedImmediately() {
String username = TestData.getSimpleString();
createUser(username, username, "admin");
Concourse con = Concourse.connect(SERVER_HOST, SERVER_PORT, username, username);
con.getServerEnvironment();
disableUser(username);
try {
con.getServerEnvironment();
Assert.fail();
} catch (Exception e) {
Assert.assertTrue(true);
}
}
use of com.cinchapi.concourse.Concourse in project concourse by cinchapi.
the class PermissionTest method testPermissionChangeTakesImmediateEffect.
@Test
public void testPermissionChangeTakesImmediateEffect() {
createUser("jeff", "jeff", "user");
grant("jeff", "write", "production");
Concourse client2 = Concourse.connect(SERVER_HOST, SERVER_PORT, "jeff", "jeff", "production");
long record = client2.add("name", "jeff");
grant("jeff", "read", "production");
try {
client2.add("name", "jeff");
Assert.fail();
} catch (PermissionException e) {
Assert.assertEquals(ImmutableSet.of(record), client2.inventory());
}
}
use of com.cinchapi.concourse.Concourse in project concourse by cinchapi.
the class PermissionTest method testPermissionsAreEnforced.
@Test(expected = PermissionException.class)
public void testPermissionsAreEnforced() {
createUser("jeff", "jeff", "user");
Concourse concourse = Concourse.connect(SERVER_HOST, SERVER_PORT, "jeff", "jeff");
concourse.getServerEnvironment();
}
Aggregations