Package com.gnizr.db.dao

Examples of com.gnizr.db.dao.Tag


    assertEquals("web",linkTag.getTag().getLabel());
    assertEquals((3),linkTag.getTag().getCount());
  }
 
  public void testFillObjectTag() throws Exception{
    Tag tag = new Tag("wii");
    GnizrDaoUtil.fillObject(tagDao, tag);
    assertEquals((2),tag.getId());
    assertEquals("wii",tag.getLabel());
   
    tag = new Tag((1));
    GnizrDaoUtil.fillObject(tagDao, tag);
    assertEquals("webwork",tag.getLabel());   
  }
View Full Code Here


    User user = userTag.getUser();
    assertEquals((1),user.getId());
    assertEquals("hchen1",user.getUsername());
    assertEquals("Harry Chen",user.getFullname());
   
    Tag tag = userTag.getTag();
    assertEquals((2),tag.getId());
    assertEquals("wii",tag.getLabel());
    assertEquals((1),tag.getCount());
  }
View Full Code Here

    String tag = "usa";
    List<Tag> tags = tagDao.findTag(tag);
    assertTrue(tags.isEmpty());

    int id = GnizrDaoUtil.createTagIfNotExist(tagDao,tag);
    Tag t = tagDao.getTag(id);
    assertEquals(tag,t.getLabel());
   
    int id2 = GnizrDaoUtil.createTagIfNotExist(tagDao, tag);
    t = tagDao.getTag(id2);
    assertNotNull(t);
    assertEquals(id,id2);
   
    tag = "foobar:usa";
    int id3 = GnizrDaoUtil.createTagIfNotExist(tagDao, tag);
    t = tagDao.getTag(id3);
    assertNotNull(t);
    assertEquals("foobar:usa",t.getLabel());
  }
View Full Code Here

      stmt.setInt(2,minFreq);
      stmt.setInt(3,sortBy);
      stmt.setInt(4,order);
      ResultSet rs = stmt.executeQuery();
      while(rs.next()){       
        Tag grpTag = TagDBDao.createNamedTagObject(GROUP_TAG_COL, rs, true);
        UserTag memUserTag = TagDBDao.createNamedUserTagObject(MEMBER_USER_TAG_IDX_COL,
            MEMBER_TAG_COL,UserSchema.TABLE_NAME, rs, true);
        List<UserTag> memTags = tagGroups.get(grpTag.getLabel());
        if(memTags == null){
          memTags = new ArrayList<UserTag>();
          tagGroups.put(grpTag.getLabel(),memTags);
        }
        memTags.add(memUserTag);
      }
    }catch(SQLException e){   
      logger.error(e);
View Full Code Here

    GnizrDaoUtil.fillId(userDao, user);
    if(folderName == null){
      throw new NullPointerException("folder name is NULL");
    }
    Folder folder = folderDao.getFolder(user, folderName);
    Tag tagObj = new Tag(tag);
    GnizrDaoUtil.fillId(tagDao, tagObj);
    if(folder != null){     
      result = folderDao.pageBookmarks(folder, tagObj, offset, count);
    }
    return result;   
View Full Code Here

      int[] maxMin = getMaxMin(tags);
      int max = maxMin[0];
      int min = maxMin[1];
      double[] threshold = compThreshold(max, min, NUM_OF_FONT_SIZE);
      for (Iterator<Tag> it = tags.iterator(); it.hasNext();) {
        Tag aTag = it.next();
        boolean fontSetFlag = false;
        for (int i = 0; i < NUM_OF_FONT_SIZE; i++) {
          if (fontSetFlag == false) {           
            if (aTag.getCount() <= threshold[i]) {
              cloud.put(aTag, i + 1);
              fontSetFlag = true;
            }
          } else {
            break;
View Full Code Here

    super.tearDown();
  }

  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

    assertEquals(id,id2);
  }
 
  public void testCreateTag() throws Exception{
    String t = "newtag";
    Tag tag1 = new Tag(t);   
    int t1Id = tagDao.createTag(tag1);
    assertNotNull(t1Id);
    assertTrue((t1Id > 0));
   
    int t1Id2 = tagDao.createTag(tag1);
View Full Code Here

 
  public void testCreateTag2() throws Exception{
    String t1 = "tt";
    String t2 = "TT";
   
    int t1Id = tagDao.createTag(new Tag(t1));
    int t2Id = tagDao.createTag(new Tag(t2));
    assertFalse((t1Id == t2Id));
  }
View Full Code Here

    assertFalse((t1Id == t2Id));
  }
 
  public void testCreateUserTag() throws Exception{
    User user = new User(1);
    Tag tag = new Tag("newtag");
    int tid = tagDao.createTag(tag);
    tag = tagDao.getTag(tid);
    UserTag userTag = new UserTag(user,tag);
    int id = tagDao.createUserTag(userTag);
    assertNotNull(id);
View Full Code Here

TOP

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

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.