Examples of Revision


Examples of org.apache.jackrabbit.oak.plugins.document.Revision

*/
public class UtilsTest {

    @Test
    public void getPreviousIdFor() {
        Revision r = new Revision(System.currentTimeMillis(), 0, 0);
        assertEquals("2:p/" + r.toString() + "/0",
                Utils.getPreviousIdFor("/", r, 0));
        assertEquals("3:p/test/" + r.toString() + "/1",
                Utils.getPreviousIdFor("/test", r, 1));
        assertEquals("15:p/a/b/c/d/e/f/g/h/i/j/k/l/m/" + r.toString() + "/3",
                Utils.getPreviousIdFor("/a/b/c/d/e/f/g/h/i/j/k/l/m", r, 3));
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.document.Revision

    }

    @Ignore("Performance test")
    @Test
    public void performance_getPreviousIdFor() {
        Revision r = new Revision(System.currentTimeMillis(), 0, 0);
        String path = "/some/test/path/foo";
        // warm up
        for (int i = 0; i < 1 * 1000 * 1000; i++) {
            Utils.getPreviousIdFor(path, r, 0);
        }
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.document.Revision

    }

    @Ignore("Performance test")
    @Test
    public void performance_revisionToString() {
        Revision r = new Revision(System.currentTimeMillis(), 0, 0);
        // warm up
        for (int i = 0; i < 1 * 1000 * 1000; i++) {
            r.toString();
        }
        long time = System.currentTimeMillis();
        for (int i = 0; i < 30 * 1000 * 1000; i++) {
            r.toString();
        }
        time = System.currentTimeMillis() - time;
        System.out.println(time);
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.document.Revision

                    case INCREMENT: {
                        inserts[i].put(k.toString(), op.value);
                        break;
                    }
                    case SET_MAP_ENTRY: {
                        Revision r = k.getRevision();
                        if (r == null) {
                            throw new IllegalStateException(
                                    "SET_MAP_ENTRY must not have null revision");
                        }
                        DBObject value = new RevisionEntry(r, op.value);
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.mongomk.Revision

*/
public class UtilsTest {

    @Test
    public void getPreviousIdFor() {
        Revision r = new Revision(System.currentTimeMillis(), 0, 0);
        assertEquals("1:p/" + r.toString(), Utils.getPreviousIdFor("0:/", r));
        assertEquals("2:p/test/" + r.toString(), Utils.getPreviousIdFor("1:/test", r));
    }
View Full Code Here

Examples of org.apache.wicket.util.diff.Revision

    return "xmlLicense.txt";
  }

  public boolean checkLicenseHeader(final File file)
  {
    Revision revision = null;

    try
    {
      String header = extractLicenseHeader(file, 0, 17);

      if (header.startsWith("<?xml"))
      {
        header = header.substring(header.indexOf(LINE_ENDING) + LINE_ENDING.length());
      }
      else
      {
        // Then only take the first 16 lines
        String[] headers = header.split(LINE_ENDING);
        StringBuilder sb = new StringBuilder();
        for (int i = 0; (i < 16) && (i < headers.length); i++)
        {
          if (sb.length() > 0)
          {
            sb.append(LINE_ENDING);
          }
          sb.append(headers[i]);
        }
        header = sb.toString();
      }

      revision = Diff.diff(getLicenseHeader().split(LINE_ENDING), header.split(LINE_ENDING));
    }
    catch (Exception e)
    {
      e.printStackTrace();
      Assert.fail(e.getMessage());
    }

    return revision.size() == 0;
  }
View Full Code Here

Examples of org.apache.wicket.util.diff.Revision

    return "velocityLicense.txt";
  }

  public boolean checkLicenseHeader(final File file)
  {
    Revision revision = null;

    try
    {
      String header = extractLicenseHeader(file, 0, 16);

      revision = Diff.diff(getLicenseHeader().split(LINE_ENDING), header.split(LINE_ENDING));
    }
    catch (Exception e)
    {
      Assert.fail(e.getMessage());
    }

    return revision.size() == 0;
  }
View Full Code Here

Examples of org.apache.wicket.util.diff.Revision

    return "propertiesLicense.txt";
  }

  public boolean checkLicenseHeader(final File file)
  {
    Revision revision = null;

    try
    {
      String header = extractLicenseHeader(file, 0, 14);

      revision = Diff.diff(getLicenseHeader().split(LINE_ENDING), header.split(LINE_ENDING));
    }
    catch (Exception e)
    {
      Assert.fail(e.getMessage());
    }

    return revision.size() == 0;
  }
View Full Code Here

Examples of org.apache.wicket.util.diff.Revision

    return "cssLicense.txt";
  }

  public boolean checkLicenseHeader(final File file)
  {
    Revision revision = null;

    try
    {
      String header = extractLicenseHeader(file, 0, 16);

      revision = Diff.diff(getLicenseHeader().split(LINE_ENDING), header.split(LINE_ENDING));
    }
    catch (Exception e)
    {
      Assert.fail(e.getMessage());
    }

    return revision.size() == 0;
  }
View Full Code Here

Examples of org.apache.wicket.util.diff.Revision

      /* */

      String[] test1 = StringList.tokenize(reference, "\n").toArray();
      String[] test2 = StringList.tokenize(document, "\n").toArray();
      Diff df = new Diff(test1);
      Revision r;
      try
      {
        r = df.diff(test2);
      }
      catch (DifferentiationFailedException e)
      {
        throw new RuntimeException(e);
      }

      System.out.println(r.toString());

      if (failWithAssert)
      {
        Assert.assertEquals(filename, reference, document);
      }
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.