Package fitnesse.wiki

Examples of fitnesse.wiki.WikiImportProperty.addTo()


  @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


    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

    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

  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

  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

    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);
  }

  private String sentMessages = "";
View Full Code Here

    WikiPagePath pagePath = page.getPageCrawler().getFullPath();
    WikiImportProperty importProps = new WikiImportProperty("http://localhost:" + FitNesseUtil.PORT + "/" + PathParser.render(pagePath));
    if (isRoot)
      importProps.setRoot(true);
    importProps.addTo(data.getProperties());
    page.commit(data);

    return page;
  }
View Full Code Here

      WikiImportProperty importProperty = new WikiImportProperty(remoteUrl());
      Date lastModificationTime = remoteProps.getLastModificationTime();
      importProperty.setLastRemoteModificationTime(lastModificationTime);
      importProperty.setAutoUpdate(autoUpdateSetting);
      importProperty.addTo(remoteProps);

      localPage.commit(remoteData);

      importerClient.pageImported(localPage);
    }
View Full Code Here

      if (!isUpdate) {
        WikiImportProperty importProperty = new WikiImportProperty(importer.remoteUrl());
        importProperty.setRoot(true);
        importProperty.setAutoUpdate(importer.getAutoUpdateSetting());
        importProperty.addTo(data.getProperties());
        page.commit(data);
      }
    } catch (WikiImporter.WikiImporterException e) {
      traversalListener.process(new ImportError("ERROR", "The remote resource, " + importer.remoteUrl() + ", was not found."));
    } catch (WikiImporter.AuthenticationRequiredException e) {
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.