public void test_journal_oneIndexRandomData() throws IOException, InterruptedException, ExecutionException {
  final File out=File.createTempFile(getName(),Options.JNL);
  try {
    final Journal src=getStore(getProperties());
    try {
      final String NAME="testIndex";
      src.registerIndex(new IndexMetadata(NAME,UUID.randomUUID()));
{
        BTree ndx=src.getIndex(NAME);
        KV[] a=AbstractBTreeTestCase.getRandomKeyValues(1000);
        for (        KV kv : a) {
          ndx.insert(kv.key,kv.val);
        }
      }
      src.commit();
      Future<Journal> f=src.compact(out);
      Journal newJournal=f.get();
      try {
        assertNotNull(newJournal.getIndex(NAME));
        AbstractBTreeTestCase.assertSameBTree(src.getIndex(NAME),newJournal.getIndex(NAME));
      }
  finally {
        newJournal.destroy();
      }
    }
  finally {
      src.destroy();
    }
  }
  finally {
    out.delete();
  }
}

public void test_journal_oneIndexRandomData ( ) throws IOException , InterruptedException , ExecutionException { final File out = File . createTempFile ( getName ( ) , Options . JNL ) ; try { final Journal src = getStore ( getProperties ( ) ) ; try { final String NAME = "testIndex" ; src . registerIndex ( new IndexMetadata ( NAME , UUID . randomUUID ( ) ) ) ; { BTree ndx = src . getIndex ( NAME ) ; KV [ ] a = AbstractBTreeTestCase . getRandomKeyValues ( 1000 ) ; for ( KV kv : a ) { ndx . insert ( kv . key , kv . val ) ; } } src . commit ( ) ; Future < Journal > f = src . compact ( out ) ; Journal newJournal = f . get ( ) ; try { assertNotNull ( newJournal . getIndex ( NAME ) ) ; AbstractBTreeTestCase . assertSameBTree ( src . getIndex ( NAME ) , newJournal . getIndex ( NAME ) ) ; } finally { newJournal . destroy ( ) ; } } finally { src . destroy ( ) ; } } finally { out . delete ( ) ; } }
test with a journal on which a single index has been registered with random data on the index .
