Examples of LinkTag


Examples of com.gnizr.db.dao.LinkTag

    assertEquals("http://zirr.us/",link.getUrl());
    assertEquals(1,link.getCount());
  }
 
  public void testFillObjectLinkTag() throws Exception{
    LinkTag linkTag = new LinkTag(1);
    GnizrDaoUtil.fillObject(tagDao, linkDao, linkTag);
    assertEquals("web",linkTag.getTag().getLabel());
    assertEquals((3),linkTag.getTag().getCount());
  }
View Full Code Here

Examples of com.gnizr.db.dao.LinkTag

  public void testCreateLinkTag() throws Exception{
    Link link = new Link(1);
    Tag tag = new Tag("newtag");
    int tid = tagDao.createTag(tag);
    tag = new Tag(tid);
    int id = tagDao.createLinkTag(new LinkTag(link,tag));
    assertTrue((id >0));
   
    int id2 = tagDao.createLinkTag(new LinkTag(link,tag));
    assertEquals(id,id2);
  }
View Full Code Here

Examples of com.gnizr.db.dao.LinkTag

    Link link = new Link(1);
    Tag tag = new Tag(1);
    List<LinkTag> linkTags = tagDao.findLinkTag(link, tag);
    assertEquals(1,linkTags.size());
   
    LinkTag linkTag = linkTags.get(0);
    assertEquals((1),linkTag.getLink().getId());
    assertEquals((1),linkTag.getTag().getId());
 
    assertNotNull(linkTag.getTag().getLabel());
    assertNotNull(linkTag.getLink().getUrlHash());   
  }
View Full Code Here

Examples of com.gnizr.db.dao.LinkTag

    assertEquals(0,tags.size());
  }
 
  public void testGetLinkTag() throws Exception{
    int id = (1);
    LinkTag linkTag = tagDao.getLinkTag(id);
    assertNotNull(linkTag);
    assertEquals((105),linkTag.getCount());
    assertEquals((1),linkTag.getLink().getId());
    assertEquals((1),linkTag.getTag().getId());
  }
View Full Code Here

Examples of com.gnizr.db.dao.LinkTag

    assertEquals((1),userTag.getTag().getId());
  }
 
  public void testUpdateLinkTag() throws Exception{
    int id = (1);
    LinkTag tag = tagDao.getLinkTag(id);
    tag.setCount((938));   
    assertTrue(tagDao.updateLinkTag(tag));
    tag = tagDao.getLinkTag(id);
    assertEquals((938),tag.getCount());
  }
View Full Code Here

Examples of com.gnizr.db.dao.LinkTag

    assertEquals(0,tag4.getCount());
   
    UserTag uTag4 = tagDao.getUserTag(4000);
    assertEquals(0,uTag4.getCount());
   
    LinkTag lTag4 = tagDao.getLinkTag(400);
    assertEquals(0,lTag4.getCount());
   
    BookmarkTag bTag4 = tagDao.getBookmarkTag(40);
    assertEquals(0,bTag4.getCount());
       
    User user1 = new User(1);
    Link link1 = new Link(1);
    Bookmark bmark1 = new Bookmark(1);
       
    boolean[] opOkay = tagDao.addTagCountOne(new Tag[]{tag4}, user1, link1, bmark1);
    assertTrue(opOkay[0]);
   
    tag4 = tagDao.getTag(4);
    assertEquals(1,tag4.getCount());
   
    uTag4 = tagDao.getUserTag(4000);
    assertEquals(1,uTag4.getCount());
   
    lTag4 = tagDao.getLinkTag(400);
    assertEquals(1,lTag4.getCount());
   
    bTag4 = tagDao.getBookmarkTag(40);
    assertEquals(1,bTag4.getCount());
  }
View Full Code Here

Examples of com.gnizr.db.dao.LinkTag

  }
 
  public void testSubtractTagCountOne() throws Exception{
    Tag tag = tagDao.getTag(2);
    BookmarkTag btag = tagDao.getBookmarkTag(2);
    LinkTag ltag = tagDao.getLinkTag(2);
    UserTag utag = tagDao.getUserTag(2);
   
    assertEquals(100,tag.getCount());
    assertEquals(1,btag.getCount());
    assertEquals(1,ltag.getCount());
    assertEquals(1,utag.getCount());
   
    boolean[] opOkay = tagDao.subtractTagCountOne(new Tag[]{tag}, new User(1), new Link(1), new Bookmark(1));
    assertTrue(opOkay[0]);
   
    tag = tagDao.getTag(2);
    btag = tagDao.getBookmarkTag(2);
    ltag = tagDao.getLinkTag(2);
    utag = tagDao.getUserTag(2);
   
    assertEquals(99,tag.getCount());
    assertEquals(0,btag.getCount());
    assertEquals(0,ltag.getCount());
    assertEquals(0,utag.getCount());
  }
View Full Code Here

Examples of com.gnizr.db.dao.LinkTag

    if (hasMissingId(linkTag) == true) {
      Link link = linkTag.getLink();
      Tag tag = linkTag.getTag();
      fillId(linkDao, link);
      fillId(tagDao, tag);
      LinkTag obj = getLinkTag(tagDao, link, tag);
      if (obj == null) {
        throw new NoSuchLinkTagException("no such linkTag=" + linkTag);
      }
      linkTag.setId(obj.getId());
    }
  }
View Full Code Here

Examples of com.gnizr.db.dao.LinkTag

  }

  public static LinkTag getLinkTag(TagDao tagDao, Link link, Tag tag)
      throws MissingIdException {
    if (hasMissingId(link) == false && hasMissingId(tag) == false) {
      LinkTag aTag = null;
      List<LinkTag> aTags = tagDao.findLinkTag(link, tag);
      if (aTags.isEmpty() == false) {
        aTag = aTags.get(0);
      }
      return aTag;
View Full Code Here

Examples of com.gnizr.db.dao.LinkTag

      LinkTag linkTag) throws NoSuchLinkException, NoSuchTagException,
      MissingIdException, NoSuchLinkTagException, NoSuchUserException {
    if (hasMissingId(linkTag) == true) {
      fillId(tagDao, linkDao, linkTag);
    }
    LinkTag obj = tagDao.getLinkTag(linkTag.getId());
    Link l = obj.getLink();
    Tag t = obj.getTag();
    fillObject(linkDao, l);
    fillObject(tagDao, t);
    linkTag.setLink(l);
    linkTag.setTag(t);
    linkTag.setCount(obj.getCount());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.