Package net.sf.collabreview.core.markup

Examples of net.sf.collabreview.core.markup.Markup


  public Artifact(ArtifactIdentifier id, Author author, Date date, String content) {
    // copying the identifier (instead of assigning it) is a fix for a problem with Hibernate, because the
    this.id = id;
    this.content = content;
    this.markup = new Markup();
    this.date = date == null ? new Date() : date;
    if (author != null) {
      this.creatorName = author.getName();
    }
  }
View Full Code Here


   * @param a      artifact to copy
   */
  protected Artifact(ArtifactIdentifier id, Author author, Date date, Artifact a) {
    this.id = id;
    this.content = a.content;
    this.markup = new Markup(a.markup);
    this.date = date == null ? new Date(a.date.getTime()) : date;
    if (author != null) {
      this.creatorName = author.getName();
    } else {
      this.creatorName = a.creatorName;
View Full Code Here

      this.creatorName = a.creatorName;
    }
  }

  public void copyMarkupFrom(Artifact original) {
    this.markup = new Markup(original.markup);
  }
View Full Code Here

    int maxIndex = 5;
    for (int i = 0; i < maxIndex; i++) {
      repository.addArtifact(identifier[i], null, content[i], authors[i]);
    }
    Artifact artifact = repository.getArtifact(identifier[4]);
    Markup result = artifact.getMarkup();
    System.out.println(artifact.printContentWithMarkups());
    assertTrue(result.listAt(0).size() == 1 && ((AuthorMarkup) result.listAt(0).get(0)).getAuthorName().equals(authors[0].getName()));
    assertTrue(result.listAt(12).size() == 1 && ((AuthorMarkup) result.listAt(12).get(0)).getAuthorName().equals(authors[0].getName()));
    assertTrue(result.listAt(13).size() == 1 && ((AuthorMarkup) result.listAt(13).get(0)).getAuthorName().equals(authors[1].getName()));
    assertTrue(result.listAt(32).size() == 1 && ((AuthorMarkup) result.listAt(32).get(0)).getAuthorName().equals(authors[1].getName()));
    assertEquals(1, result.listAt(33).size());
    assertEquals(authors[2].getName(), ((AuthorMarkup) result.listAt(33).get(0)).getAuthorName());
    assertTrue(result.listAt(47).size() == 1 && ((AuthorMarkup) result.listAt(47).get(0)).getAuthorName().equals(authors[2].getName()));
    assertTrue(result.listAt(48).size() == 1);
    assertEquals(authors[1].getName(), ((AuthorMarkup) result.listAt(49).get(0)).getAuthorName());
    assertTrue(result.listAt(51).size() == 1 && ((AuthorMarkup) result.listAt(51).get(0)).getAuthorName().equals(authors[1].getName()));
  }
View Full Code Here

TOP

Related Classes of net.sf.collabreview.core.markup.Markup

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.