@Test
public void testRunInvalidQuery() throws Exception {

  commitDocuments(getDirectory(getIndexPath1AsFile()), new SingleFieldDocument("1", "Mahout is cool"));
  commitDocuments(getDirectory(getIndexPath1AsFile()), new SingleFieldDocument("2", "Mahout is cool"));
  String[] args = {
    "-i", getIndexPath1AsFile().toString(),
    "-o", seqFilesOutputPath.toString(),
    "-id", idField,
    "-f", StringUtils.join(fields, SequenceFilesFromLuceneStorageDriver.SEPARATOR_FIELDS),
    "-q", "invalid:query",
    "-xm", "sequential"
  };
  driver.setConf(conf);
  driver.run(args);
  assertTrue(FileSystem.get(conf).exists(seqFilesOutputPath));
  //shouldn't be any real files in the seq files out path
  SequenceFileDirIterator<Writable, Writable> iter =
      new SequenceFileDirIterator<Writable, Writable>(seqFilesOutputPath, PathType.LIST, PathFilters.logsCRCFilter(), null, false, conf);
  assertFalse(Iterators.size(iter) > 0);
}