Last active
February 25, 2018 08:47
-
-
Save RayLuxembourg/17d25c0e64aad625aeed13371dfe7cc2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fitnesse.html; | |
import fitnesse.responders.run.SuiteResponder; | |
import fitnesse.wiki.*; | |
public class SetupTeardownIncluder { | |
private PageData pageData; | |
private boolean isSuite; | |
private WikiPage testPage; | |
private StringBuffer newPageContent; | |
private PageCrawler pageCrawler; | |
public static String render(PageData pageData) throws Exception { | |
return render(pageData, false); | |
} | |
public static String render(PageData pageData, boolean isSuite) | |
throws Exception { | |
return new SetupTeardownIncluder(pageData).render(isSuite); | |
} | |
private SetupTeardownIncluder(PageData pageData) { | |
this.pageData = pageData; | |
testPage = pageData.getWikiPage(); | |
pageCrawler = testPage.getPageCrawler(); | |
newPageContent = new StringBuffer(); | |
} | |
private String render(boolean isSuite) throws Exception { | |
this.isSuite = isSuite; | |
if (isTestPage()) | |
includeSetupAndTeardownPages(); | |
return pageData.getHtml(); | |
} | |
private boolean isTestPage() throws Exception { | |
return pageData.hasAttribute("Test"); | |
} | |
private void includeSetupAndTeardownPages() throws Exception { | |
includeSetupPages(); | |
includePageContent(); | |
includeTeardownPages(); | |
updatePageContent(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment