ProxyDao extends AbstractXpipeConsoleDAO { public List<ProxyTbl> getAllProxyTbls() { return queryHandler.handleQuery(new DalQuery<List<ProxyTbl>>() { @Override public List<ProxyTbl> doQuery() throws DalException { return dao.findAll(ProxyTblEntity.READSET_ID_DC_URI); } }); }  List<ProxyTbl> getActiveProxyTbls(); List<ProxyTbl> getMonitorActiveProxyTbls(); void insert(ProxyTbl proto); void delete(long id); void update(ProxyTbl proto); List<ProxyTbl> getAllProxyTbls();  }
@Test public void testGetAllProxyTbls() { List<ProxyTbl> proxies = proxyDao.getActiveProxyTbls(); Assert.assertEquals(1, proxies.size()); ProxyTbl target = proxies.get(0); Assert.assertEquals(proto1.getDcId(), target.getDcId()); Assert.assertEquals(proto1.getUri(), target.getUri()); }
@Test public void testGetAllProxies() { List<ProxyTbl> proxies = proxyDao.getAllProxyTbls(); Collections.sort(proxies, new Comparator<ProxyTbl>() { @Override public int compare(ProxyTbl o1, ProxyTbl o2) { return (int) (o1.getId() - o2.getId()); } }); Assert.assertEquals(2, proxies.size()); }