Package net.sf.collabreview.core.markup

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


    assertEquals(new InsertedByEditScriptMarkup(0, 5), result.get(0));
  }

  public void testSingleOrigin() throws Exception {
    List<MarkupElement> expected = new ArrayList<MarkupElement>(Arrays.asList(
        new OriginMarkup(0, 5, ai[0], 0, 5, 1)
    ));
    repository.setTrivialTokenFilter(new TrivialTokenFilter.NoneTrivialFilter());
    repository.addArtifact(ai[0], new Date(), artifactContent[0], artifactAuthor[0]);
    TokenOriginSearch tos = new TokenOriginSearch(repository);
    List<MarkupElement> result = tos.resolveGap(0, "Hello");
View Full Code Here


    assertEquals(expected, result);
  }

  public void testSingleMovedOrigin() throws Exception {
    List<MarkupElement> expected = new ArrayList<MarkupElement>(Arrays.asList(
        new OriginMarkup(0, 5, ai[1], 10, 15, 1)
    ));
    repository.setTrivialTokenFilter(new TrivialTokenFilter.NoneTrivialFilter());
    repository.addArtifact(ai[1], new Date(), artifactContent[1], artifactAuthor[1]);
    TokenOriginSearch tos = new TokenOriginSearch(repository);
    List<MarkupElement> result = tos.resolveGap(0, "World");
View Full Code Here

    assertEquals(expected, result);
  }

  public void testSingleOriginWithOffset() throws Exception {
    List<MarkupElement> expected = new ArrayList<MarkupElement>(Arrays.asList(
        new OriginMarkup(5, 10, ai[0], 0, 5, 1)
    ));
    repository.setTrivialTokenFilter(new TrivialTokenFilter.NoneTrivialFilter());
    repository.addArtifact(ai[0], new Date(), artifactContent[0], artifactAuthor[0]);
    TokenOriginSearch tos = new TokenOriginSearch(repository);
    List<MarkupElement> result = tos.resolveGap(5, "Hello");
View Full Code Here

    assertEquals(expected, result);
  }

  public void testChainOrigin() throws Exception {
    List<MarkupElement> expected = new ArrayList<MarkupElement>(Arrays.asList(
        new OriginMarkup(0, 4, ai[6], 17, 21, 1),
        new TrivialLineMarkup(4, 5),
        new OriginMarkup(5, 7, ai[6], 23, 25, 1),
        new TrivialLineMarkup(7, 8),
        new OriginMarkup(8, 9, ai[6], 27, 28, 1)
    ));
    repository.setTrivialTokenFilter(new TrivialTokenFilter.NoneTrivialFilter());
    repository.addArtifact(ai[6], new Date(), artifactContent[6], artifactAuthor[6]);
    TokenOriginSearch tos = new TokenOriginSearch(repository);
    List<MarkupElement> result = tos.resolveGap(0, "this\nis\na"); // 9 chars
View Full Code Here

   *
   * @throws Exception if there is a problem while accessing the repository
   */
  public void testChainOriginDeleteTrivial() throws Exception {
    List<MarkupElement> expected = new ArrayList<MarkupElement>(Arrays.asList(
        new OriginMarkup(0, 4, ai[7], 0, 4, 1), // Free
        new TrivialLineMarkup(4, 5),
        new OriginMarkup(5, 10, ai[6], 11, 16, 1), // World
        new TrivialLineMarkup(10, 11),
        new OriginMarkup(11, 15, ai[6], 17, 21, 1), // this
        new TrivialLineMarkup(15, 16),
        new TrivialLineMarkup(16, 26), // [trivial]
        new OriginMarkup(26, 28, ai[6], 23, 25, 1), // is
        new TrivialLineMarkup(28, 29),
        new OriginMarkup(29, 30, ai[6], 27, 28, 1), // a
        new TrivialLineMarkup(30, 31),
        new OriginMarkup(31, 35, ai[6], 29, 33, 1)// test
    ));
    repository.setTrivialTokenFilter(new TrivialTokenFilter() {
      public boolean isTrivialToken(Token token) {
        return "[trivial]".equals(token.getCore());
      }
View Full Code Here

   *
   * @throws Exception if there is a problem while accessing the repository
   */
  public void testAddTrivial() throws Exception {
    List<MarkupElement> expected = new ArrayList<MarkupElement>(Arrays.asList(
        new OriginMarkup(0, 4, ai[6], 17, 21, 1),
        new TrivialLineMarkup(4, 5),
        new OriginMarkup(5, 7, ai[6], 23, 25, 1),
        new TrivialLineMarkup(7, 8),
        new TrivialLineMarkup(8, 11),
        new TrivialLineMarkup(11, 14),
        new OriginMarkup(14, 15, ai[6], 27, 28, 1)
    ));
    repository.setTrivialTokenFilter(new TrivialTokenFilter() {
      public boolean isTrivialToken(Token token) {
        return token.getCore().charAt(0) == '_';
      }
View Full Code Here

   * @throws Exception if there is a problem while accessing the repository
   * @see TokenAlignerTest#testInsertTrivial()
   */
  public void testChainOriginAddTrivial() throws Exception {
    List<MarkupElement> expected = new ArrayList<MarkupElement>(Arrays.asList(
        new OriginMarkup(0, 4, ai[7], 0, 4, 1)// free
        new TrivialLineMarkup(4, 5),
        new OriginMarkup(5, 10, ai[6], 11, 16, 1), // world
        new TrivialLineMarkup(10, 11),
        new OriginMarkup(11, 15, ai[6], 17, 21, 1), // this
        new TrivialLineMarkup(15, 16),
        new OriginMarkup(16, 18, ai[6], 23, 25, 1), // is
        new TrivialLineMarkup(18, 19),
        new TrivialLineMarkup(19, 22), // _2
        new TrivialLineMarkup(22, 25), // _1
        new OriginMarkup(25, 26, ai[6], 27, 28, 1), // a
        new TrivialLineMarkup(26, 27),
        new OriginMarkup(27, 31, ai[6], 29, 33, 1) // test
    ));
    repository.setTrivialTokenFilter(new TrivialTokenFilter() {
      public boolean isTrivialToken(Token token) {
        return token.getCore().length() == 0 || token.getCore().charAt(0) == '_';
      }
View Full Code Here

   *
   * @throws Exception if there is a problem while accessing the repository
   */
  public void testIdentifyLongestForOverlay() throws Exception {
    List<MarkupElement> expected1 = new ArrayList<MarkupElement>(Arrays.asList(
        new OriginMarkup(0, 5, ai[1], 1, 6, 1),
        new TrivialLineMarkup(5, 6),
        new OriginMarkup(6, 11, ai[1], 10, 15, 1)
    ));
    List<MarkupElement> expected2 = new ArrayList<MarkupElement>(Arrays.asList(
        new OriginMarkup(0, 5, ai[6], 5, 10, 1),
        new TrivialLineMarkup(5, 6),
        new OriginMarkup(6, 11, ai[6], 11, 16, 1)
    ));
    repository.setTrivialTokenFilter(new TrivialTokenFilter.NoneTrivialFilter());
    addAllArtifacts();
    TokenOriginSearch tos = new TokenOriginSearch(repository);
    List<MarkupElement> result = tos.resolveGap(0, "Hello\nWorld");
View Full Code Here

   *
   * @throws Exception if there is a problem while accessing the repository
   */
  public void testWhitespaceInGapToResolve() throws Exception {
    List<MarkupElement> expected = new ArrayList<MarkupElement>(Arrays.asList(
        new OriginMarkup(0, 4, ai[6], 17, 21, 1),
        new TrivialLineMarkup(4, 8),
        new TrivialLineMarkup(8, 9),
        new OriginMarkup(9, 11, ai[6], 23, 25, 1),
        new TrivialLineMarkup(11, 12),
        new TrivialLineMarkup(12, 14),
        new OriginMarkup(14, 15, ai[6], 27, 28, 1)
    ));
    repository.setTrivialTokenFilter(new TrivialTokenFilter.NoneTrivialFilter());
    repository.addArtifact(ai[6], new Date(), artifactContent[6], artifactAuthor[6]);
    TokenOriginSearch tos = new TokenOriginSearch(repository);
    List<MarkupElement> result = tos.resolveGap(0, "this   \n is\n  a");
View Full Code Here

   *
   * @throws Exception if there is a problem while accessing the repository
   */
  public void _testChainOriginSubstituteTrivialWithNewTrivial() throws Exception {
    List<MarkupElement> expected = new ArrayList<MarkupElement>(Arrays.asList(
        new OriginMarkup(0, 4, ai[7], 0, 4, 1), // free
        new TrivialLineMarkup(4, 5),
        new OriginMarkup(5, 10, ai[7], 5, 10, 1), // world
        new TrivialLineMarkup(10, 11),
        new InsertedByEditScriptMarkup(11, 15), // xxx
        new TrivialLineMarkup(14, 15),
        new OriginMarkup(15, 17, ai[7], 16, 18, 1), // is
        new TrivialLineMarkup(17, 18),
        new OriginMarkup(18, 19, ai[6], 27, 28, 1)
    ));
    repository.setTrivialTokenFilter(new TrivialTokenFilter() {
      public boolean isTrivialToken(Token token) {
        return "this".equals(token.getCore()) || "xxx".equals(token.getCore());
      }
View Full Code Here

TOP

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

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.