> }
> private void includePageContent() throws Exception {
> newPageContent.append(pageData.getContent());
> }
> private void includeTeardownPages() throws Exception {
> includeTeardownPage();
> if (isSuite)
> includeSuiteTeardownPage();
> }
> private void includeTeardownPage() throws Exception {
> include("TearDown", "-teardown");
> }
> private void includeSuiteTeardownPage() throws Exception {
> include(SuiteResponder.SUITE_TEARDOWN_NAME, "-teardown");
> }
> private void updatePageContent() throws Exception {
> pageData.setContent(newPageContent.toString());
> }
> private void include(String pageName, String arg) throws Exception {
> WikiPage inheritedPage = findInheritedPage(pageName);
> if (inheritedPage != null) {
> String pagePathName = getPathNameForPage(inheritedPage);
> buildIncludeDirective(pagePathName, arg);
> }
> }
> private WikiPage findInheritedPage(String pageName) throws Exception {
> return PageCrawlerImpl.getInheritedPage(pageName, testPage);
> }
> private String getPathNameForPage(WikiPage page) throws Exception {
> WikiPagePath pagePath = pageCrawler.getFullPath(page);
> return PathParser.render(pagePath);
> }
> private void buildIncludeDirective(String pagePathName, String arg) {
> newPageContent
> .append("\n!include ")
> .append(arg)
> .append(" .")
Листинг 3.7 (продолжение)
> .append(pagePathName)
> .append("\n");
> }
>}
[KP78]: Kernighan and Plaugher, The Elements of Programming Style, 2d. ed., McGraw-Hill, 1978.
[PPP02]: Robert C. Martin, Agile Software Development: Principles, Patterns, and Practices, Prentice Hall, 2002.
[GOF]: Design Patterns: Elements of Reusable Object Oriented Software, Gamma et al., Addison-Wesley, 1996.
[PRAG]: The Pragmatic Programmer, Andrew Hunt, Dave Thomas, Addison-Wesley, 2000.
[SP72]: Structured Programming, O.-J. Dahl, E. W. Dijkstra, C. A. R. Hoare, Academic Press, London, 1972.