Search in sources :

Example 1 with TodoResource

use of com.palantir.atlasdb.todo.TodoResource in project atlasdb by palantir.

the class MultiCassandraSingleNodeDownEteTest method shouldBeAbleToReadWithOneCassandraNodeDown.

@Test
public void shouldBeAbleToReadWithOneCassandraNodeDown() {
    TodoResource todos = EteSetup.createClientToSingleNode(TodoResource.class);
    Todo todo = getUniqueTodo();
    todos.addTodo(todo);
    assertThat(todos.getTodoList()).contains(todo);
}
Also used : ImmutableTodo(com.palantir.atlasdb.todo.ImmutableTodo) Todo(com.palantir.atlasdb.todo.Todo) TodoResource(com.palantir.atlasdb.todo.TodoResource) Test(org.junit.Test)

Example 2 with TodoResource

use of com.palantir.atlasdb.todo.TodoResource in project atlasdb by palantir.

the class MultiCassandraSingleNodeDownEteTest method shouldBeAbleToWriteWithOneCassandraNodeDown.

@Test
public void shouldBeAbleToWriteWithOneCassandraNodeDown() {
    TodoResource todos = EteSetup.createClientToSingleNode(TodoResource.class);
    Todo todo = getUniqueTodo();
    todos.addTodo(todo);
}
Also used : ImmutableTodo(com.palantir.atlasdb.todo.ImmutableTodo) Todo(com.palantir.atlasdb.todo.Todo) TodoResource(com.palantir.atlasdb.todo.TodoResource) Test(org.junit.Test)

Example 3 with TodoResource

use of com.palantir.atlasdb.todo.TodoResource in project atlasdb by palantir.

the class MultiCassandraDoubleNodeDownEteTest method shouldNotBeAbleToReadWithTwoCassandraNodesDown.

@Test(expected = RuntimeException.class)
public void shouldNotBeAbleToReadWithTwoCassandraNodesDown() {
    TodoResource todos = EteSetup.createClientToSingleNode(TodoResource.class);
    todos.getTodoList();
}
Also used : TodoResource(com.palantir.atlasdb.todo.TodoResource) Test(org.junit.Test)

Example 4 with TodoResource

use of com.palantir.atlasdb.todo.TodoResource in project atlasdb by palantir.

the class TimeLockMigrationEteTest method assertCanNeitherReadNorWrite.

private void assertCanNeitherReadNorWrite() {
    TodoResource todoClient = createEteClientFor(TodoResource.class);
    softAssertions.assertThat(catchThrowable(() -> todoClient.addTodo(TODO_3))).as("cannot write using embedded service after migration to TimeLock").hasMessageContaining("Connection refused");
    softAssertions.assertThat(catchThrowable(todoClient::getTodoList)).as("cannot read using embedded service after migration to TimeLock").hasMessageContaining("Connection refused");
}
Also used : TodoResource(com.palantir.atlasdb.todo.TodoResource)

Example 5 with TodoResource

use of com.palantir.atlasdb.todo.TodoResource in project atlasdb by palantir.

the class TimeLockMigrationEteTest method automaticallyMigratesTimestampsAndFailsOnRestart.

@Test
public void automaticallyMigratesTimestampsAndFailsOnRestart() throws Exception {
    TimestampService timestampClient = createEteClientFor(TimestampService.class);
    TodoResource todoClient = createEteClientFor(TodoResource.class);
    todoClient.addTodo(TODO);
    softAssertions.assertThat(todoClient.getTodoList()).as("contains one todo pre-migration").contains(TODO);
    long embeddedTimestamp = timestampClient.getFreshTimestamp();
    softAssertions.assertThat(embeddedTimestamp).as("can get a timestamp before migration").isNotNull();
    upgradeAtlasClientToTimelock();
    assertTimeLockGivesHigherTimestampThan(embeddedTimestamp);
    softAssertions.assertThat(todoClient.getTodoList()).as("can still read todo after migration to TimeLock").contains(TODO);
    todoClient.addTodo(TODO_2);
    softAssertions.assertThat(todoClient.getTodoList()).as("can add a new todo using TimeLock").contains(TODO, TODO_2);
    assertNoLongerExposesEmbeddedTimestampService();
    downgradeAtlasClientFromTimelockWithoutMigration();
    assertCanNeitherReadNorWrite();
}
Also used : TodoResource(com.palantir.atlasdb.todo.TodoResource) TimestampService(com.palantir.timestamp.TimestampService) Test(org.junit.Test)

Aggregations

TodoResource (com.palantir.atlasdb.todo.TodoResource)8 Test (org.junit.Test)6 ImmutableTodo (com.palantir.atlasdb.todo.ImmutableTodo)3 Todo (com.palantir.atlasdb.todo.Todo)3 TimestampService (com.palantir.timestamp.TimestampService)1