Examples of UserTag


Examples of com.gnizr.db.dao.UserTag

  public void testFetchEditData2() throws Exception{
    action.setTag("semanticweb");
    action.setLoggedInUser(new User(1));
    assertEquals(ActionSupport.SUCCESS,action.fetchEditData());
   
    UserTag ut = action.getEditUserTag();
    assertTrue((ut.getId()>0));
   
    String related = action.getRelatedTags();
    assertTrue((related.length() == 0));
   
    String narrower = action.getNarrowerTags();
View Full Code Here

Examples of com.gnizr.db.dao.UserTag

    assertFalse(tags.isEmpty());
    assertEquals(2,tags.size());
 
    List<String> tagstr = new ArrayList<String>();
    for(Iterator<UserTag> it = tags.iterator();it.hasNext();){
      UserTag ut = it.next();
      tagstr.add(ut.getTag().getLabel());
    }
    assertTrue(tagstr.contains("webwork"));
    assertTrue(tagstr.contains("games"));
  }
View Full Code Here

Examples of com.gnizr.db.dao.UserTag

    assertNull(dao.getTagAssertion((1000000)));
  }
 
  public void testCreateTagAssertion() throws Exception{
    TagAssertion asrt = new TagAssertion();
    asrt.setSubject(new UserTag((104)));
    asrt.setProperty(new TagProperty((1)));
    asrt.setObject(new UserTag((103)));
    asrt.setUser(new User((1)));
    int id = dao.createTagAssertion(asrt);
    assertNotNull(id);
    assertTrue((id >0));
   
View Full Code Here

Examples of com.gnizr.db.dao.UserTag

    assertEquals("hchen1",ta1.getObject().getUser().getUsername());
  }
 
  public void testFindTagAssertionSubject() throws Exception{
    User hchen1 = new User((1));
    UserTag hchen1_news = new UserTag((101));
    List<TagAssertion> assertions = dao.findTagAssertion(hchen1,hchen1_news,null,null);
    assertEquals(1,assertions.size());
  }
View Full Code Here

Examples of com.gnizr.db.dao.UserTag

    assertEquals(1,assertions.size());
  }
 
  public void testFindTagAssertionObject() throws Exception{
    User hchen1 = new User((1));
    UserTag gnizr_brknews = new UserTag((103));
    List<TagAssertion> assertions = dao.findTagAssertion(hchen1,null,null,gnizr_brknews);
    assertEquals(1,assertions.size());
  }
View Full Code Here

Examples of com.gnizr.db.dao.UserTag

    assertEquals(1,assertions.size());
  }
 
  public void testFindTagAssertion() throws Exception{
    User user = new User((1));
    UserTag subjectTag = new UserTag((100));
    TagProperty tagPrpt = new TagProperty((1));
    UserTag objectTag = new UserTag((101));
    List<TagAssertion> assertions = dao.findTagAssertion(user, subjectTag, tagPrpt, objectTag);
    assertEquals(1,assertions.size());
  }
View Full Code Here

Examples of com.gnizr.db.dao.UserTag

    assertEquals(1,assertions.size());
  }
 
  public void testFindTagAssertionSubjectPrpt() throws Exception{
    User hchen1 = new User((1));
    UserTag cnn = new UserTag((100));
    TagProperty related = new TagProperty((1));
    List<TagAssertion> assertions = dao.findTagAssertion(hchen1,cnn,related,null);
    assertEquals(1,assertions.size());
  }
View Full Code Here

Examples of com.gnizr.db.dao.UserTag

      NoSuchTagException, NoSuchUserTagException,
      NoSuchTagPropertyException, NoSuchTagAssertionException,
      MissingIdException {
    if (hasMissingId(assertion)) {
      User user = assertion.getUser();
      UserTag subjTag = assertion.getSubject();
      TagProperty prpt = assertion.getProperty();
      UserTag objTag = assertion.getObject();
      fillId(userDao, user);
      fillId(tagDao, userDao, subjTag);
      fillId(tagPrptDao, prpt);
      fillId(tagDao, userDao, objTag);
      TagAssertion obj = getTagAssertion(tagAssertionDao, user, subjTag,
View Full Code Here

Examples of com.gnizr.db.dao.UserTag

  }

  public static UserTag getUserTag(TagDao tagDao, User user, Tag tag)
      throws MissingIdException {
    if (hasMissingId(user) == false && hasMissingId(tag) == false) {
      UserTag aTag = null;
      List<UserTag> aTags = tagDao.findUserTag(user, tag);
      if (aTags.isEmpty() == false) {
        aTag = aTags.get(0);
      }
      return aTag;
View Full Code Here

Examples of com.gnizr.db.dao.UserTag

      UserTag userTag) throws NoSuchUserException, NoSuchTagException,
      NoSuchUserTagException, MissingIdException {
    if (hasMissingId(userTag) == true) {
      fillId(tagDao, userDao, userTag);
    }
    UserTag ut = tagDao.getUserTag(userTag.getId());
    Tag t = ut.getTag();
    User u = ut.getUser();
    fillObject(tagDao, t);
    fillObject(userDao, u);
    userTag.setTag(t);
    userTag.setUser(u);
    userTag.setCount(ut.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.