Package fitnesse.wiki

Examples of fitnesse.wiki.VersionInfo


    WikiPage root = InMemoryPage.makeRoot("RooT");
    page = WikiPageUtil.addPage(root, PathParser.parse("PageOne"), "original content");
    PageData data = page.getData();
    data.setContent("new stuff");
    data.setProperties(new WikiPageProperties());
    VersionInfo commitRecord = last(page.getVersions());
    page.commit(data);

    MockRequest request = new MockRequest();
    request.setResource("PageOne");
    request.addInput("version", commitRecord.getName());

    Responder responder = new RollbackResponder();
    response = responder.makeResponse(FitNesseUtil.makeTestContext(root), request);
  }
View Full Code Here


    PageData data = page.getData();
   
    WikiPageProperties properties = data.getProperties();
    properties.set(PageData.PropertySUITES, "New Page tags");
    data.setContent("new stuff");
    VersionInfo commitRecord = last(page.getVersions());
    oldVersion = commitRecord.getName();
    page.commit(data);
    MockRequest request = new MockRequest();
    request.setResource(pageName);
    request.addInput("version", oldVersion);
    request.addInput("requestParam", "requestValue");
View Full Code Here

    makeTestResponse("PageOne.PageTwo");
    assertSubString("PageOne.PageTwo?responder=", response.getContent());
  }

  static VersionInfo last(Collection<VersionInfo> versions) {
    VersionInfo last = null;
    for (VersionInfo i : versions) {
      last = i;
    }
    return last;
  }
View Full Code Here

  }

  @Test
  public void testGetVersionOfPageData() throws Exception {
    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("PageOne"), "some content");
    VersionInfo commitRecord = page.commit(page.getData());

    request.addInput("type", "meat");
    request.addInput("version", commitRecord.getName());
    request.setResource("PageOne");

    Object obj = getObject(root, request);
    assertEquals(PageData.class, obj.getClass());
    PageData data = (PageData) obj;
View Full Code Here

    assertEquals("01234567890123", match.group(2));
  }

  @Test
  public void testParts() {
    VersionInfo version = makeVersionInfo(new File("joe-20030101010101.zip"));
    assertEquals("joe", version.getAuthor());
    assertEquals("joe-20030101010101", version.getName());
  }
View Full Code Here

    assertEquals("joe-20030101010101", version.getName());
  }

  @Test
  public void testGetCreationTime() throws Exception {
    VersionInfo version = makeVersionInfo(new File("joe-20030101010101.zip"));
    Date date = version.getCreationTime();
    assertEquals("20030101010101", makeVersionTimeFormat().format(date));
  }
View Full Code Here

    checkAuthor("abc123efg-123-01234567890123", "abc123efg");
    checkAuthor("joe <joe@blo.com>-123-01234567890123", "joe <joe@blo.com>");
  }

  private void checkAuthor(String versionName, String author) throws Exception {
    VersionInfo version = makeVersionInfo(new File(versionName + ".zip"));
    assertEquals(author, version.getAuthor());
  }
View Full Code Here

  @Test
  public void originalContentCanBeRetrievedViaVersionInfo() throws Exception {
    PageData data = page.getData();
    data.setContent("new content");
    VersionInfo version = page.commit(data);

    PageData loadedData = page.getVersion(version.getName()).getData();
    assertEquals("original content", loadedData.getContent());
  }
View Full Code Here

  public void testSimpleVersionTasks() throws Exception {
    WikiPagePath path = PathParser.parse("MyPageOne");
    WikiPage page = WikiPageUtil.addPage(root, path, "old content");
    PageData data = page.getData();
    data.setContent("new content");
    VersionInfo previousVersion = page.commit(data);

    Collection<VersionInfo> versions = page.getVersions();
    assertEquals(1, versions.size());
    assertEquals(true, versions.contains(previousVersion));

    WikiPage loadedPage = page.getVersion(previousVersion.getName());
    assertEquals("old content", loadedPage.getData().getContent());
  }
View Full Code Here

    WikiPagePath testPagePath = PathParser.parse("TestPage");
    WikiPage testPage = WikiPageUtil.addPage(root, testPagePath, "version1");

    PageData data = testPage.getData();
    data.setAttribute(PageData.LAST_MODIFYING_USER, "Aladdin");
    VersionInfo record = testPage.commit(data);

    assertTrue(record.getName().startsWith("Aladdin"));
  }
View Full Code Here

TOP

Related Classes of fitnesse.wiki.VersionInfo

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.