Package com.gnizr.db.dao

Examples of com.gnizr.db.dao.Bookmark


    session.put(SessionConstants.PAGE_COUNT,1);
    assertEquals(ActionSupport.SUCCESS,listLinkAction.execute());
    List<Bookmark> results = listLinkAction.getBookmarks();
    assertEquals(1,results.size());
   
    Bookmark link1 = results.get(0);
    assertEquals("housingmaps",link1.getTitle())
  }
View Full Code Here


    session.put(SessionConstants.PAGE_COUNT,1);
    assertEquals(ActionSupport.SUCCESS,listLinkAction.execute());
    List<Bookmark> results = listLinkAction.getBookmarks();
    assertEquals(1,results.size());
   
    Bookmark link1 = results.get(0);
    assertEquals("morecols",link1.getTitle())
  }
View Full Code Here

    Link link1 = new Link(1);
    Link link2 = new Link(2);
    Link link3 = new Link(3);
    Link link205 = new Link(205);
   
    Bookmark bm1 = new Bookmark(user1,link1);
    bm1.setTags("tags1 tags2 tags3");
    bm1.setTitle("title foobar1");
   
    Bookmark bm2 = new Bookmark(user1,link2);
    bm2.setTags("tags4 tags5 tags6");
    bm2.setTitle("title foobar1");
   
    Bookmark bm3 = new Bookmark(user1,link3);
    bm3.setTags("tags1 tags");
    bm3.setTitle("title3 foobar2");
   
    Bookmark bm4 = new Bookmark(user1,link205);
    bm4.setTags("");
    bm4.setTitle("del.icio.us");
   
    assertTrue(bmManager.addBookmark(bm1)>0);
    assertTrue(bmManager.addBookmark(bm2)>0);
    assertTrue(bmManager.addBookmark(bm3)>0);
    assertTrue(bmManager.addBookmark(bm4)>0);
View Full Code Here

    String result = action.execute();
    assertEquals(ActionSupport.SUCCESS,result);

    int bmid = bookmarkManager.getBookmarkId(loggedInUser, "http://cnn.com");
    assertTrue(bmid > 0);
    Bookmark bm = bookmarkManager.getBookmark(bmid);
    assertEquals("CNN homepage",bm.getTitle());
    assertEquals("",bm.getNotes());
   
    action.setPointMarkers(new PointMarker[]{pm2});
    result = action.execute();   
   
    PointMarker[] resultPtMarkers = action.getPointMarkers();
View Full Code Here

  protected IDataSet getDataSet() throws Exception {
    return new FlatXmlDataSet(TestManageBookmarks.class.getResourceAsStream("/TestManageBookmarks-input.xml"));
  }
 
  public void testDoDeleteBookmarks() throws Exception{
    Bookmark b = bookmarkManager.getBookmark(301);
    assertNotNull(b);
    b = bookmarkManager.getBookmark(302);
    assertNotNull(b);
    b = bookmarkManager.getBookmark(303);
    assertNotNull(b);
View Full Code Here

    pm.setMarkerIconId(0);
    pm.setNotes("notes");
    pm.setPoint(10.0, 10.0);
   
    PointMarker[] markers = new PointMarker[]{pm};
    bookmarkManager.addPointMarkers(new Bookmark(307), Arrays.asList(markers));
   
    action.setUsername("gnizr");
    action.setFolder("my folder1");
    assertEquals(ActionSupport.SUCCESS,action.execute());
    List<Bookmark> bmarks = action.getBookmarks();
    assertEquals(1,bmarks.size());
    assertEquals(307,bmarks.get(0).getId());
   
    action.setFolder("my folder2");
    assertEquals(ActionSupport.SUCCESS,action.execute());
    bmarks = action.getBookmarks();
    assertEquals(1,bmarks.size());
    assertEquals(307,bmarks.get(0).getId());
   
    assertTrue(bookmarkManager.deleteBookmark(new Bookmark(307)));
  }
View Full Code Here

    pm.setMarkerIconId(0);
    pm.setNotes("notes");
    pm.setPoint(10.0, 10.0);
   
    PointMarker[] markers = new PointMarker[]{pm};
    bookmarkManager.addPointMarkers(new Bookmark(307), Arrays.asList(markers));
   
    action.setUsername("hchen1");
    assertEquals(ActionSupport.SUCCESS,action.execute());
    List<Bookmark> bmarks = action.getBookmarks();
    assertEquals(1,bmarks.size());
    assertEquals(307,bmarks.get(0).getId());
   
    assertTrue(bookmarkManager.deleteBookmark(new Bookmark(307)));
  }
View Full Code Here

  }
 
  private void initFolderData() throws Exception{
    folderManager.createFolder(new User("hchen1"), "folder1", "");
    List<Bookmark> bookmarks = new ArrayList<Bookmark>();
    bookmarks.add(new Bookmark(300));
    bookmarks.add(new Bookmark(301));
    bookmarks.add(new Bookmark(302));
    bookmarks.add(new Bookmark(303));
   
    folderManager.addBookmarks(new User("hchen1"), "folder1", bookmarks);
  }
View Full Code Here

    String r = action.execute();
    assertEquals(ActionSupport.SUCCESS,r);
   
    List<Bookmark> bmarks = action.getBookmarks();
    assertEquals(1,bmarks.size());
    Bookmark b = bmarks.get(0);
    assertEquals(302,b.getId());   
  }
View Full Code Here

    action.setTitle("CNN News Home Page");
    action.setLoggedInUser(loggedInUser);
    String result = action.doFetchBookmark();
    assertEquals(ActionSupport.SUCCESS,result);
   
    Bookmark bm = action.getEditBookmark();
    assertNotNull(bm);
   
    assertEquals("http://cnn.com",bm.getLink().getUrl());
    assertEquals("cnn news",bm.getTags());
    assertEquals("CNN News Home Page",bm.getTitle());
  }
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.