Package com.gnizr.db.dao

Examples of com.gnizr.db.dao.Bookmark


    Date start = dformat.parse("2007-03-01");
    Date end = dformat.parse("2007-04-24");
   
    List<Bookmark> bmarks = bookmarkDao.getPopularCommunityBookmarks(start,end,2);
    assertEquals(2,bmarks.size());
    Bookmark bm1 = bmarks.get(0);
    assertEquals(3,bm1.getLink().getId());
    Bookmark bm2 = bmarks.get(1);
    assertEquals(5,bm2.getLink().getId());
  }
View Full Code Here


  protected IDataSet getDataSet() throws Exception {
    return new FlatXmlDataSet(TestUserDBDao1.class.getResourceAsStream("/dbunit/bmarkdbdao/TestBookmarkDBDao2-input.xml"));
  }

  public void testGetBookmark() throws Exception{
    Bookmark bm = bmDao.getBookmark(300);   
    String title = bm.getTitle();
    String expectedTitle = "Yahoo! Hong Kong - 雅虎香港";
    assertEquals(expectedTitle,title);
   
    bm = bmDao.getBookmark(301);
    title = bm.getTitle();
    expectedTitle = "زيباري يرفض تدويل الملف العراقي والهاشمي يصل دمشق";
    assertEquals(expectedTitle,title);
  }
View Full Code Here

    assertEquals(expectedTitle,title);
  }
 
  public void testCreateBookmark() throws Exception{
    Link link  = new Link(202);
    Bookmark bm = new Bookmark();
    bm.setUser(new User(1));
    bm.setLink(link);
    bm.setTitle("Yahoo! Hong Kong - 雅虎香港");
    bm.setCreatedOn(Calendar.getInstance().getTime());
    bm.setLastUpdated(Calendar.getInstance().getTime());
    int id = bmDao.createBookmark(bm);
    assertTrue((id > 0));
  }
View Full Code Here

    assertEquals(10,pm.getMarkerIconId());
    assertEquals("newnotes",pm.getNotes());
  }
 
  public void testAddRmvPointMarker() throws Exception{
    Bookmark bm = new Bookmark(299);
    assertTrue(geomMarkerDao.addPointMarker(bm,m1));
    assertTrue(geomMarkerDao.addPointMarker(bm,m1));
    assertTrue(geomMarkerDao.addPointMarker(bm,m2));
   
    assertTrue(geomMarkerDao.removePointMarker(bm,m1));
View Full Code Here

    assertTrue(geomMarkerDao.removePointMarker(bm,m1));
    assertTrue(geomMarkerDao.removePointMarker(bm,m2));
  }
 
  public void testListPointMarkers() throws Exception{
    Bookmark bm = new Bookmark(299);
    assertTrue(geomMarkerDao.addPointMarker(bm,m1));
    assertTrue(geomMarkerDao.addPointMarker(bm,m2));
   
    List<PointMarker> ptMrkrs = geomMarkerDao.listPointMarkers(bm);
    assertEquals(2,ptMrkrs.size());   
View Full Code Here

    assertEquals(0,ptMrkrs.size())
  }
 
 
  public void testDeleteBookmark() throws Exception{
    Bookmark bm = new Bookmark(299);
    assertTrue(geomMarkerDao.addPointMarker(bm,m1));
    assertTrue(geomMarkerDao.addPointMarker(bm,m1));
    assertTrue(geomMarkerDao.addPointMarker(bm,m2));
   
    assertNotNull(bookmarkDao.getBookmark(299));   
View Full Code Here

    assertNull(geomMarkerDao.getPointMarker(m1.getId()));
    assertNull(geomMarkerDao.getPointMarker(m2.getId()));     
  }
 
  public void testPageBookmarksInArchive() throws Exception{
    Bookmark bm299 = new Bookmark(299);
    Bookmark bm300 = new Bookmark(300);
    assertTrue(geomMarkerDao.addPointMarker(bm299,m1));
    assertTrue(geomMarkerDao.addPointMarker(bm300,m2));
   
    DaoResult<Bookmark> result = geomMarkerDao.pageBookmarksInArchive(new User(1), 0, 10);
    assertEquals(2,result.getSize());
    Bookmark bm = result.getResult().get(0);
    assertNotNull(bm.getUser().getUsername());
    assertNotNull(bm.getLink().getUrl());
  }
View Full Code Here

    assertNotNull(bm.getUser().getUsername());
    assertNotNull(bm.getLink().getUrl());
  }
 
  public void testPageBookmarksInFolder() throws Exception{
    Bookmark bm299 = new Bookmark(299);
    Bookmark bm300 = new Bookmark(300);
    assertTrue(geomMarkerDao.addPointMarker(bm299,m1));
    assertTrue(geomMarkerDao.addPointMarker(bm300,m2));
   
    DaoResult<Bookmark> result = geomMarkerDao.pageBookmarksInFolder(new Folder(1),0,0);
    assertEquals(1,result.getSize());
    assertEquals(0,result.getResult().size());
   
    result = geomMarkerDao.pageBookmarksInFolder(new Folder(1), 0, 10);
    assertEquals(1,result.getSize());
    assertEquals(1,result.getResult().size());
   
    Bookmark bm = result.getResult().get(0);
    assertEquals(300, bm.getId());
    assertNotNull(bm.getUser().getUsername());
    assertNotNull(bm.getLink().getUrl());
  }
View Full Code Here

    User user = userDao.getUser((1));
    assertNotNull(user);
   
    BookmarkDBDao bmDao = new BookmarkDBDao(getDataSource());
   
    Bookmark bookmark = bmDao.getBookmark(301);
    assertNotNull(bookmark);
   
    ForUser forUser = new ForUser (user, bookmark, "This is just a test", new Date());
   
    int fuid = fuDao.createForUser(forUser);
View Full Code Here

    assertNotNull (forUser.getForUser());
   
    User fuser = forUser.getForUser();
    assertEquals("jsmith",fuser.getUsername());
   
    Bookmark bm = forUser.getBookmark();
    assertEquals("cnn",bm.getTitle());
   
    User buser = forUser.getBookmark().getUser();
    assertEquals("jsmith",buser.getUsername());   
  }
View Full Code Here

TOP

Related Classes of com.gnizr.db.dao.Bookmark

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.