Package fitnesse.wiki

Examples of fitnesse.wiki.WikiImportProperty


    assertSubString("value=\"import\"", content);
  }

  @Test
  public void testWikiImportUpdate() throws Exception {
    WikiImportProperty property = new WikiImportProperty("http://my.host.com/PageRoot");
    property.setRoot(true);
    testWikiImportUpdateWith(property);
    assertSubString("imports its subpages from", content);
    assertSubString("value=\"Update Subpages\"", content);

    assertSubString("Automatically update imported content when executing tests", content);
View Full Code Here


    assertSubString("Automatically update imported content when executing tests", content);
  }

  @Test
  public void testWikiImportUpdateNonroot() throws Exception {
    testWikiImportUpdateWith(new WikiImportProperty("http://my.host.com/PageRoot"));
    assertSubString("imports its content and subpages from", content);
    assertSubString("value=\"Update Content and Subpages\"", content);

    assertSubString("Automatically update imported content when executing tests", content);
  }
View Full Code Here

  }

  @Test
  public void testImportingFromNonRootPageUpdatesPageContent() throws Exception {
    PageData data = testData.pageTwo.getData();
    WikiImportProperty importProperty = new WikiImportProperty(baseUrl + "PageOne");
    importProperty.addTo(data.getProperties());
    data.setContent("nonsense");
    testData.pageTwo.commit(data);

    Response response = makeSampleResponse("blah");
    MockResponseSender sender = new MockResponseSender();
View Full Code Here

  private void checkProperties(WikiPage page, String source, boolean isRoot, WikiPage remotePage) throws Exception {
    WikiPageProperties props = page.getData().getProperties();
    if (!isRoot)
      assertFalse("should not have Edit property", props.has("Edit"));

    WikiImportProperty importProperty = WikiImportProperty.createFrom(props);
    assertNotNull(importProperty);
    assertEquals(source, importProperty.getSourceUrl());
    assertEquals(isRoot, importProperty.isRoot());

    if (remotePage != null) {
      long remoteLastModificationTime = remotePage.getData().getProperties().getLastModificationTime().getTime();
      long importPropertyLastModificationTime = importProperty.getLastRemoteModificationTime().getTime();
      assertEquals(remoteLastModificationTime, importPropertyLastModificationTime);
    }
  }
View Full Code Here

  public void testImportedPageIndication() throws Exception {
    pageRenderingSetUp();

    page = WikiPageUtil.addPage(root, PathParser.parse("SamplePage"));
    PageData data = page.getData();
    WikiImportProperty importProperty = new WikiImportProperty("blah");
    importProperty.addTo(data.getProperties());
    page.commit(data);

    String content = getContentAfterSpecialImportHandling();

    assertSubString("<body class=\"imported\">", content);
View Full Code Here

    String content = getContentAfterSpecialImportHandling();

    assertNotSubString("Edit Locally", content);
    assertNotSubString("Edit Remotely", content);

    WikiImportProperty importProperty = new WikiImportProperty("blah");
    importProperty.addTo(data.getProperties());
    page.commit(data);
    content = getContentAfterSpecialImportHandling();

    assertTrue(WikiImportProperty.isImportedSubWiki(data));
    assertSubString("<a href=\"SamplePage?edit\" accesskey=\"e\">Edit Locally</a>", content);
View Full Code Here

  @Test
  public void testPageContentIsUpdated() throws Exception {
    PageData data = testData.pageTwo.getData();
    WikiPageProperties props = data.getProperties();

    WikiImportProperty importProps = new WikiImportProperty("http://localhost:" + FitNesseUtil.PORT + "/PageTwo");
    importProps.addTo(props);
    testData.pageTwo.commit(data);

    getResponse();

    data = testData.pageTwo.getData();
View Full Code Here

  @Test
  public void testImportedPageIndication() throws Exception {
    final WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("SamplePage"));
    final PageData data = page.getData();
    final WikiImportProperty importProperty = new WikiImportProperty("blah");
    importProperty.addTo(data.getProperties());
    page.commit(data);

    final String content = requestPage("SamplePage").getContent();

    assertSubString("<body class=\"imported\">", content);
View Full Code Here

  @Test
  public void testImportedPageIndicationNotOnRoot() throws Exception {
    final WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("SamplePage"));
    final PageData data = page.getData();
    final WikiImportProperty importProperty = new WikiImportProperty("blah");
    importProperty.setRoot(true);
    importProperty.addTo(data.getProperties());
    page.commit(data);

    final String content = requestPage("SamplePage").getContent();

    assertNotSubString("<body class=\"imported\">", content);
View Full Code Here

  }

  private void addImportPropertyToPage(WikiPage page, boolean isRoot, boolean autoUpdate) throws Exception {
    PageData data = page.getData();
    String sourceUrl = FitNesseUtil.URL + "PageOne";
    WikiImportProperty importProps = new WikiImportProperty(sourceUrl);
    importProps.setRoot(isRoot);
    importProps.setAutoUpdate(autoUpdate);
    importProps.addTo(data.getProperties());
    pageOne.commit(data);
  }
View Full Code Here

TOP

Related Classes of fitnesse.wiki.WikiImportProperty

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.