use of com.palantir.atlasdb.api.TableCellVal in project atlasdb by palantir.
the class TransactionRemotingTest method testRaw2.
@Test
public void testRaw2() throws JsonProcessingException {
String tableName = "ns.my_table";
service.createTable(tableName);
TransactionToken txId = service.startTransaction();
Cell rawCell = Cell.create(new byte[] { 0, 1, 2 }, new byte[] { 3, 4, 5 });
TableCellVal putArg = new TableCellVal(tableName, ImmutableMap.of(rawCell, new byte[] { 40, 0 }));
service.put(txId, putArg);
TableCell tableCell = new TableCell(tableName, ImmutableList.of(rawCell));
service.getCells(txId, tableCell);
}
use of com.palantir.atlasdb.api.TableCellVal in project atlasdb by palantir.
the class AtlasConsoleServiceImpl method put.
@Override
public void put(TransactionToken token, String data) throws IOException {
TableCellVal cells = fromJson(data, TableCellVal.class);
service.put(token, cells);
}
use of com.palantir.atlasdb.api.TableCellVal in project atlasdb by palantir.
the class AtlasConsoleServiceTest method testPut.
@Test
public void testPut() throws IOException {
final TableCellVal input = context.mock(TableCellVal.class);
context.checking(fromJson(input, TableCellVal.class));
context.checking(new Expectations() {
{
oneOf(delegate).put(token, input);
}
});
service.put(token, QUERY);
context.assertIsSatisfied();
}
use of com.palantir.atlasdb.api.TableCellVal in project atlasdb by palantir.
the class TransactionRemotingTest method testGetCellsNone.
@Test
public void testGetCellsNone() {
setupFooStatus1("sweep.priority");
TransactionToken txId = service.startTransaction();
TableCellVal badCells = service.getCells(txId, new TableCell("sweep.priority", ImmutableList.of(Cell.create(new byte[1], SweepPriorityTable.SweepPriorityNamedColumn.CELLS_EXAMINED.getShortName()))));
Assert.assertTrue(badCells.getResults().isEmpty());
}
use of com.palantir.atlasdb.api.TableCellVal in project atlasdb by palantir.
the class TransactionRemotingTest method setupFooStatus1.
private void setupFooStatus1(String table) {
TransactionToken txId = service.startTransaction();
service.put(txId, new TableCellVal(table, getSweepPriorityTableContents("foo")));
service.commit(txId);
}
Aggregations