@Test
public void testWriteRead() {
//let's use TWO entities that share the same columnFamily AND use the same key in both to make sure
//the prefix stuff works just fine...
Activity act1 = new Activity("myid");
act1.setName("myname");
mgr.put(act1);
PartitionedSingleTrade trade = new PartitionedSingleTrade();
trade.setId("myid");
trade.setNumber(89);
mgr.put(trade);
//throw an a guy with Long key types as well...
TimeSeriesData d = new TimeSeriesData();
d.setKey(897L);
d.setSomeName("qwer");
mgr.put(d);
mgr.flush();
//unfortunately, the two rows are written as one (ie. MERGED) so
//to really TEST this out, we remove the trade row to make sure we still have the Activity
//row
mgr.remove(trade);
mgr.flush();
NoSqlEntityManager mgr2 = factory.createEntityManager();
PartitionedSingleTrade r = mgr2.find(PartitionedSingleTrade.class, trade.getId());
Assert.assertNull(r);
Activity act = mgr2.find(Activity.class, act1.getId());
Assert.assertNotNull(act);
Assert.assertEquals(act1.getName(), act.getName());
TimeSeriesData d2 = mgr2.find(TimeSeriesData.class, d.getKey());
Assert.assertEquals(d.getSomeName(), d2.getSomeName());
}