Tag cnn = tagDao.findTag("cnn").get(0);
assertEquals(0,cnn.getCount());
}
public void testAddPointMarkers() throws Exception{
PointMarker pm1 = new PointMarker();
pm1.setMarkerIconId(5);
pm1.setNotes("marker1");
pm1.setPoint(10,11);
int id = geomMarkerDao.createPointMarker(pm1);
assertTrue(id > 0);
pm1.setId(id);
PointMarker pm2 = new PointMarker();
pm2.setMarkerIconId(2);
pm2.setNotes("marker2");
pm2.setPoint(20.03,21.11);
List<PointMarker> ptMarkers = new ArrayList<PointMarker>();
ptMarkers.add(pm1);
ptMarkers.add(pm2);
Bookmark bm300 = manager.getBookmark(300);
List<PointMarker> addedPtMarkers = manager.addPointMarkers(bm300, ptMarkers);
assertEquals(2,addedPtMarkers.size());
assertEquals(id,addedPtMarkers.get(0).getId());
assertTrue(addedPtMarkers.get(1).getId() > 0);
ptMarkers = geomMarkerDao.listPointMarkers(bm300);
assertEquals(2,ptMarkers.size());
for(PointMarker pm : ptMarkers){
if(pm.getId() == pm1.getId()){
assertEquals(5,pm.getMarkerIconId());
assertEquals("marker1",pm.getNotes());
assertEquals(10.0,pm.getPoint().getX());
assertEquals(11.0,pm.getPoint().getY());
}else if(pm.getId() == pm2.getId()){
assertEquals(2,pm2.getMarkerIconId());
assertEquals("marker2",pm2.getNotes());
assertEquals(20.03,pm2.getPoint().getX());
assertEquals(21.11,pm2.getPoint().getY());
}else{
assertFalse(true);
}
}
pm1 = ptMarkers.get(0);
pm2 = ptMarkers.get(1);
assertTrue(geomMarkerDao.deletePointMarker(pm1.getId()));
assertTrue(geomMarkerDao.deletePointMarker(pm2.getId()));
}