Пример #1
0
 @Test
 public void testNoBufferTransportBlockingIfWritesAreWithinThreshold() {
   String loc = TestData.DATA_DIR + File.separator + Time.now();
   final Engine engine = new Engine(loc + File.separator + "buffer", loc + File.separator + "db");
   Variables.register("now", Time.now());
   engine.start();
   engine.add(TestData.getString(), TestData.getTObject(), TestData.getLong());
   engine.add(TestData.getString(), TestData.getTObject(), TestData.getLong());
   engine.stop();
   Assert.assertFalse(engine.bufferTransportThreadHasEverPaused.get());
   FileSystem.deleteDirectory(loc);
 }
Пример #2
0
 @Test
 public void testBrowseRecordIsSameAsFetchDescribe() {
   long record = Variables.register("record", TestData.getLong());
   List<String> keys = Variables.register("keys", Lists.<String>newArrayList());
   int count = TestData.getScaleCount();
   for (int i = 0; i < count; i++) {
     keys.add(TestData.getString());
   }
   count = TestData.getScaleCount();
   ListIterator<String> lit = keys.listIterator();
   for (int i = 0; i < count; i++) {
     if (!lit.hasNext()) {
       lit = keys.listIterator();
     }
     String key = lit.next();
     Object value = TestData.getObject();
     client.add(key, TestData.getObject(), record);
     Variables.register(key + "_" + i, value);
   }
   Assert.assertEquals(client.browse(record), client.fetch(client.describe(record), record));
 }