@Test
 public void testLoadRepresentationsAsyncWithIds() {
   List<String> dbIds = new ArrayList<String>();
   DbListener dbl;
   try {
     dbl = new DbListener();
     dbIds.add(mockRepresentationId);
     papi.loadRepresentationsAsync(dbIds, dbl);
     assertEquals(dbl.getResult(), 1);
   } catch (Exception e) {
     fail(e.getMessage());
   }
   try {
     // non-existent id
     dbl = new DbListener();
     dbIds.clear();
     dbIds.add(NonExistentClusterId);
     papi.loadRepresentationsAsync(dbIds, dbl);
     fail();
   } catch (IllegalArgumentException e) {
     assert (true);
   }
   try {
     // wrong input
     dbl = new DbListener();
     dbIds.add(AbcId);
     papi.loadRepresentationsAsync(dbIds, dbl);
     fail();
   } catch (IllegalArgumentException e) {
     assert (true);
   }
 }
  @Test
  public void testLoadAsyncWithSql() {
    String sql = "SELECT FROM " + DbConstants.CLS_MODEL;
    DbListener dbl;
    try {
      dbl = new DbListener();
      papi.loadAsync(sql, dbl);
      assertEquals(dbl.getResult(), 2);
    } catch (Exception e) {
      fail(e.getMessage());
    }
    // wrong input
    try {
      dbl = new DbListener();
      String nosql = "wrong";
      papi.loadAsync(nosql, dbl);
      fail();
    } catch (IllegalArgumentException e) {
      assert (true);
    }

    try {
      dbl = new DbListener();
      String nosql = "select from abc";
      dbl = new DbListener();
      papi.loadAsync(nosql, dbl);
      fail();
    } catch (IllegalArgumentException e) {
      assert (true);
    }
  }
 @Test
 public void testLoadPojosAsyncWithClass() {
   DbListener dbl;
   try {
     dbl = new DbListener();
     papi.loadPojosAsync(Revision.class, dbl);
     assertEquals(dbl.getResult(), 3);
   } catch (Exception e) {
     fail(e.getMessage());
   }
   // no wrong input
 }
 @Test
 public void testLoadRepresentationsAsyncWithConfig() {
   DbFilterConfig conf = new DbFilterConfig();
   conf.addNotation(Constants.NOTATION_BPMN2_0.toString());
   DbListener dbl = new DbListener();
   try {
     papi.loadRepresentationsAsync(conf, dbl);
     assertEquals(dbl.getResult(), 3);
   } catch (Exception e) {
     fail(e.getMessage());
   }
   // no wrong input
 }