Search in sources :

Example 1 with Concourse

use of com.cinchapi.concourse.Concourse in project concourse by cinchapi.

the class CON171 method repro3.

@Test(expected = TransactionException.class)
public void repro3() {
    Concourse client2 = Concourse.connect(SERVER_HOST, SERVER_PORT, "admin", "admin");
    client.stage();
    client2.add("foo", "bar", 1);
    client.find("foo", Operator.EQUALS, "bar");
    client2.remove("foo", "bar", 1);
    Assert.assertFalse(client.find("foo", Operator.EQUALS, "bar").isEmpty());
}
Also used : Concourse(com.cinchapi.concourse.Concourse) ConcourseIntegrationTest(com.cinchapi.concourse.test.ConcourseIntegrationTest) Test(org.junit.Test)

Example 2 with Concourse

use of com.cinchapi.concourse.Concourse in project concourse by cinchapi.

the class CON171 method repro1.

@Test(expected = TransactionException.class)
public void repro1() {
    Concourse client2 = Concourse.connect(SERVER_HOST, SERVER_PORT, "admin", "admin");
    client.stage();
    client.find("foo", Operator.EQUALS, "bar");
    client2.set("foo", "bar", 1);
    Assert.assertTrue(client.find("foo", Operator.EQUALS, "bar").isEmpty());
}
Also used : Concourse(com.cinchapi.concourse.Concourse) ConcourseIntegrationTest(com.cinchapi.concourse.test.ConcourseIntegrationTest) Test(org.junit.Test)

Example 3 with Concourse

use of com.cinchapi.concourse.Concourse in project concourse by cinchapi.

the class ManagedConcourseServerTest method testClientFindWithTime.

@Test
public void testClientFindWithTime() {
    server.start();
    Concourse concourse = server.connect();
    concourse.add("foo", 1, 1);
    Timestamp timestamp = Timestamp.now();
    concourse.add("foo", 1, 2);
    Assert.assertFalse(concourse.find("foo", Operator.EQUALS, 1, timestamp).contains(2L));
}
Also used : Concourse(com.cinchapi.concourse.Concourse) Timestamp(com.cinchapi.concourse.Timestamp) Test(org.junit.Test)

Example 4 with Concourse

use of com.cinchapi.concourse.Concourse in project concourse by cinchapi.

the class ManagedConcourseServerTest method testCalculator.

@Test(expected = UnsupportedOperationException.class)
public void testCalculator() {
    server.start();
    Concourse concourse = server.connect();
    concourse.add("age", 20);
    concourse.add("age", 40);
    Assert.assertEquals(60, concourse.calculate().sum("age"));
}
Also used : Concourse(com.cinchapi.concourse.Concourse) Test(org.junit.Test)

Example 5 with Concourse

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

Aggregations

Concourse (com.cinchapi.concourse.Concourse)28 Test (org.junit.Test)23 ConcourseIntegrationTest (com.cinchapi.concourse.test.ConcourseIntegrationTest)10 PermissionException (com.cinchapi.concourse.PermissionException)2 Timestamp (com.cinchapi.concourse.Timestamp)2 ManagedConcourseServer (com.cinchapi.concourse.server.ManagedConcourseServer)2 ClientServerTest (com.cinchapi.concourse.test.ClientServerTest)2 ConcourseCodebase (com.cinchapi.concourse.util.ConcourseCodebase)2 File (java.io.File)2 IOException (java.io.IOException)2 Path (java.nio.file.Path)2 Map (java.util.Map)2 Set (java.util.Set)2 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)2 ConnectionPool (com.cinchapi.concourse.ConnectionPool)1 Link (com.cinchapi.concourse.Link)1 TransactionException (com.cinchapi.concourse.TransactionException)1 ConcourseBaseTest (com.cinchapi.concourse.test.ConcourseBaseTest)1 PluginTest (com.cinchapi.concourse.test.PluginTest)1 AccessToken (com.cinchapi.concourse.thrift.AccessToken)1