Package org.ngrinder.model

Examples of org.ngrinder.model.Tag


  public void testPerfTestTag() {
    PerfTest entity = new PerfTest();
    entity.setTestName("test1");
    entity.setTags(new TreeSet<Tag>() {
      {
        add(new Tag("hello"));
        add(new Tag("world"));
      }
    });
    entity = perfTestRepository.save(entity);
    PerfTest findOne = perfTestRepository.findOne(entity.getId());
    SortedSet<Tag> tags = findOne.getTags();
    assertThat(tags.first(), is(new Tag("hello")));
    assertThat(tags.last(), is(new Tag("world")));
  }
View Full Code Here


  }

  @SuppressWarnings("serial")
  @Test
  public void testPerfTestTag2() {
    final Tag hello = tagRepository.save(new Tag("hello"));
    final Tag world = tagRepository.save(new Tag("world"));
    final Tag world2 = tagRepository.save(new Tag("world2"));

    PerfTest entity = new PerfTest();
    entity.setTestName("test1");
    entity.setTags(new TreeSet<Tag>() {
      {
View Full Code Here

    tagRepository.deleteAll();
  }

  @Test
  public void testTagService() {
    Tag entity = new Tag("HELLO");
    entity.setLastModifiedUser(getTestUser());
    entity.setCreatedUser(getTestUser());
    tagRepository.save(entity);
    Set<Tag> addTags = tagService.addTags(getTestUser(), new String[]{"HELLO", "WORLD"});
    assertThat(addTags.size(), is(2));
    assertThat(tagRepository.findAll().size(), is(2));
View Full Code Here

    Specifications<Tag> spec = Specifications.where(lastModifiedOrCreatedBy(user)).and(valueIn(tags));
    List<Tag> foundTags = tagRepository.findAll(spec);
    SortedSet<Tag> allTags = new TreeSet<Tag>(foundTags);
    for (String each : tags) {
      Tag newTag = new Tag(StringUtils.trimToEmpty(StringUtils.replace(each, ",", "")));
      if (allTags.contains(newTag)) {
        continue;
      }
      if (!foundTags.contains(newTag) && !allTags.contains(newTag)) {
        allTags.add(saveTag(user, newTag));
View Full Code Here

TOP

Related Classes of org.ngrinder.model.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.