This is an automated email from the ASF dual-hosted git repository. slachiewicz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-site-plugin.git
commit c503b669fc0985dfdb229ed7239707f8957e5019 Author: Sylwester Lachiewicz <[email protected]> AuthorDate: Wed Nov 25 19:53:05 2026 +0000 Format Groovy IT scripts Formatting only: the CONVERSION-phase AST of every file is unchanged. See https://github.com/apache/maven-invoker-plugin/issues/811. --- src/it/projects/MSITE-159/verify.groovy | 2 +- src/it/projects/MSITE-265/verify.groovy | 2 +- src/it/projects/MSITE-354/verify.groovy | 2 +- src/it/projects/MSITE-456/verify.groovy | 2 +- src/it/projects/MSITE-458/verify.groovy | 2 +- src/it/projects/MSITE-507/verify.groovy | 4 +- src/it/projects/MSITE-512/verify.groovy | 12 +- src/it/projects/MSITE-548/verify.groovy | 2 +- src/it/projects/MSITE-566/verify.groovy | 2 +- src/it/projects/MSITE-582/verify.groovy | 8 +- src/it/projects/MSITE-604/verify.groovy | 22 ++-- src/it/projects/MSITE-609/verify.groovy | 2 +- src/it/projects/MSITE-627/verify.groovy | 2 +- src/it/projects/MSITE-658/verify.groovy | 2 +- src/it/projects/MSITE-705-debug/verify.groovy | 4 +- src/it/projects/MSITE-705-no-debug/verify.groovy | 4 +- src/it/projects/MSITE-723/verify.groovy | 6 +- src/it/projects/MSITE-842/verify.groovy | 16 +-- src/it/projects/MSITE-856/verify.groovy | 2 +- src/it/projects/auto-refresh/verify.groovy | 12 +- .../default-reports-excluded/verify.groovy | 6 +- src/it/projects/default-reports/verify.groovy | 14 +-- src/it/projects/doxia-formats/verify.groovy | 55 +++++---- .../editable-pages-alt-source/verify.groovy | 2 +- src/it/projects/editable-pages/verify.groovy | 2 +- src/it/projects/effective-site/verify.groovy | 4 +- src/it/projects/empty-report-set/verify.groovy | 11 +- .../projects/filtered-site-sources/verify.groovy | 2 +- src/it/projects/full-reporting/verify.groovy | 129 +++++++++++---------- src/it/projects/gh-1286-missing-skin/verify.groovy | 6 +- .../inheritance-interpolation/verify.groovy | 40 +++---- src/it/projects/inheritedMenus/verify.groovy | 2 +- src/it/projects/inheritedReports/verify.groovy | 4 +- src/it/projects/new-configuration/verify.groovy | 34 +++--- src/it/projects/no-version/verify.groovy | 16 +-- src/it/projects/publishDate/verify.groovy | 8 +- .../report-changes-generation/verify.groovy | 2 +- src/it/projects/reportConfig/verify.groovy | 10 +- src/it/projects/resources/verify.groovy | 14 +-- .../projects/site-attach-descriptor/verify.groovy | 14 +-- src/it/projects/site-deploy/verify.groovy | 2 +- src/it/projects/site-inheritance/verify.groovy | 2 +- src/it/projects/site-jar/verify.groovy | 20 ++-- src/it/projects/site-sd-2/verify.groovy | 38 +++--- src/it/projects/site-sd-lang/verify.groovy | 2 +- .../site-sd-parent-no-append-path/verify.groovy | 22 ++-- .../projects/site-sd-stagingSiteURL/verify.groovy | 12 +- src/it/projects/site-sd-submodule/verify.groovy | 12 +- .../verify.groovy | 24 ++-- .../site-sd-top-parent-no-site/verify.groovy | 24 ++-- .../site-sd-top-parent-same-site/verify.groovy | 24 ++-- src/it/projects/site-sd/verify.groovy | 22 ++-- src/it/projects/site-skip/verify.groovy | 8 +- src/it/projects/surefire-report/verify.groovy | 16 +-- src/it/projects/template-skin/verify.groovy | 4 +- src/it/projects/validate/verify.groovy | 2 +- src/it/projects/velocity-tools/verify.groovy | 4 +- 57 files changed, 361 insertions(+), 362 deletions(-) diff --git a/src/it/projects/MSITE-159/verify.groovy b/src/it/projects/MSITE-159/verify.groovy index 8273435f..c7c9306a 100644 --- a/src/it/projects/MSITE-159/verify.groovy +++ b/src/it/projects/MSITE-159/verify.groovy @@ -18,7 +18,7 @@ * under the License. */ -final File siteDirectory = new File( basedir, "target/site" ) +final File siteDirectory = new File(basedir, "target/site") assert siteDirectory.exists() && siteDirectory.isDirectory() : "site is missing or not a directory." File index = new File( siteDirectory, "index.html" ) diff --git a/src/it/projects/MSITE-265/verify.groovy b/src/it/projects/MSITE-265/verify.groovy index 36d7f3c0..7840784c 100644 --- a/src/it/projects/MSITE-265/verify.groovy +++ b/src/it/projects/MSITE-265/verify.groovy @@ -18,7 +18,7 @@ * under the License. */ -File target = new File( basedir, "target" ) +File target = new File(basedir, "target") assert target.exists() && target.isDirectory() : "target file is missing or not a directory." File siteDirectory = new File( target, "site" ) diff --git a/src/it/projects/MSITE-354/verify.groovy b/src/it/projects/MSITE-354/verify.groovy index 917be147..812431c2 100644 --- a/src/it/projects/MSITE-354/verify.groovy +++ b/src/it/projects/MSITE-354/verify.groovy @@ -18,7 +18,7 @@ * under the License. */ -File target = new File( basedir, "target" ) +File target = new File(basedir, "target") assert target.exists() && target.isDirectory() : "target directory is missing or not a directory." File site = new File( target, "site" ) diff --git a/src/it/projects/MSITE-456/verify.groovy b/src/it/projects/MSITE-456/verify.groovy index 3d10f222..cd16f9e6 100644 --- a/src/it/projects/MSITE-456/verify.groovy +++ b/src/it/projects/MSITE-456/verify.groovy @@ -18,7 +18,7 @@ * under the License. */ -File parentSiteDirectory = new File( basedir, "target/site" ) +File parentSiteDirectory = new File(basedir, "target/site") assert parentSiteDirectory.exists() && parentSiteDirectory.isDirectory() : "parent site is missing or not a directory." File parentIndex = new File( parentSiteDirectory, "index.html" ) diff --git a/src/it/projects/MSITE-458/verify.groovy b/src/it/projects/MSITE-458/verify.groovy index 22dd9d7b..a5065b6c 100644 --- a/src/it/projects/MSITE-458/verify.groovy +++ b/src/it/projects/MSITE-458/verify.groovy @@ -18,7 +18,7 @@ * under the License. */ -final File siteDirectory = new File( basedir, "target/site" ) +final File siteDirectory = new File(basedir, "target/site") assert siteDirectory.exists() && siteDirectory.isDirectory() : "site is missing or not a directory." File index = new File( siteDirectory, "index.html" ) diff --git a/src/it/projects/MSITE-507/verify.groovy b/src/it/projects/MSITE-507/verify.groovy index 29360f08..f96165ca 100644 --- a/src/it/projects/MSITE-507/verify.groovy +++ b/src/it/projects/MSITE-507/verify.groovy @@ -18,5 +18,5 @@ * under the License. */ -buildLog = new File( basedir, 'build.log' ).text -assert buildLog.contains( 'BUILD SUCCESS' ) +buildLog = new File(basedir, 'build.log').text +assert buildLog.contains('BUILD SUCCESS') diff --git a/src/it/projects/MSITE-512/verify.groovy b/src/it/projects/MSITE-512/verify.groovy index 82f12a34..4c723280 100644 --- a/src/it/projects/MSITE-512/verify.groovy +++ b/src/it/projects/MSITE-512/verify.groovy @@ -18,11 +18,11 @@ * under the License. */ -assert new File( basedir, 'parent-usage-test/target/site/xref/index.html' ).exists(); -assert new File( basedir, 'parent-usage-test/target/site/xref-test/index.html' ).exists(); -assert new File( basedir, 'parent-usage-test/target/site/apidocs' ).exists(); +assert new File(basedir, 'parent-usage-test/target/site/xref/index.html').exists() +assert new File(basedir, 'parent-usage-test/target/site/xref-test/index.html').exists() +assert new File(basedir, 'parent-usage-test/target/site/apidocs').exists() -assert new File( basedir, 'parent-usage-test/target/site/apidocs' ).exists(); -assert !new File( basedir, 'parent-usage-test/target/site/apidocs/org/apache/maven/titi/AppFoo.html' ).exists(); +assert new File(basedir, 'parent-usage-test/target/site/apidocs').exists() +assert !new File(basedir, 'parent-usage-test/target/site/apidocs/org/apache/maven/titi/AppFoo.html').exists() -return true; \ No newline at end of file +return true \ No newline at end of file diff --git a/src/it/projects/MSITE-548/verify.groovy b/src/it/projects/MSITE-548/verify.groovy index feef1865..cbd808a6 100644 --- a/src/it/projects/MSITE-548/verify.groovy +++ b/src/it/projects/MSITE-548/verify.groovy @@ -18,7 +18,7 @@ * under the License. */ -File deployDirectory = new File( basedir, "deploy" ) +File deployDirectory = new File(basedir, "deploy") assert deployDirectory.exists() && deployDirectory.isDirectory() : "deploy directory is missing or not a directory:" + deployDirectory.getAbsolutePath() File rootDirectory = new File( deployDirectory, "MSITE-548" ) diff --git a/src/it/projects/MSITE-566/verify.groovy b/src/it/projects/MSITE-566/verify.groovy index 44fdcce0..d1639ba5 100644 --- a/src/it/projects/MSITE-566/verify.groovy +++ b/src/it/projects/MSITE-566/verify.groovy @@ -18,7 +18,7 @@ * under the License. */ -File target = new File( basedir, "target" ) +File target = new File(basedir, "target") assert target.exists() && target.isDirectory() : "target file is missing or not a directory." File siteDescriptor = new File( target, "test-1.0-SNAPSHOT-site.xml" ) diff --git a/src/it/projects/MSITE-582/verify.groovy b/src/it/projects/MSITE-582/verify.groovy index d9c526aa..080510cc 100644 --- a/src/it/projects/MSITE-582/verify.groovy +++ b/src/it/projects/MSITE-582/verify.groovy @@ -18,9 +18,9 @@ * under the License. */ -content = new File( basedir, 'child/target/site/index.html' ).text; +content = new File(basedir, 'child/target/site/index.html').text -assert !content.contains( '<a href="A/B/C/D">D</a>' ); -assert content.contains( '<a href="A/B/C/M">M</a>' ); +assert !content.contains('<a href="A/B/C/D">D</a>') +assert content.contains('<a href="A/B/C/M">M</a>') -return true; \ No newline at end of file +return true \ No newline at end of file diff --git a/src/it/projects/MSITE-604/verify.groovy b/src/it/projects/MSITE-604/verify.groovy index 7c7040c2..2804ca87 100644 --- a/src/it/projects/MSITE-604/verify.groovy +++ b/src/it/projects/MSITE-604/verify.groovy @@ -17,23 +17,23 @@ * under the License. */ -target = new File( basedir, 'target' ); -assert target.isDirectory(); +target = new File(basedir, 'target') +assert target.isDirectory() // msite604.siteURL property value from settings.xml -rootDirectory = new File( target, 'root' ); -assert rootDirectory.isDirectory(); +rootDirectory = new File(target, 'root') +assert rootDirectory.isDirectory() // msite604.siteBase property value from pom.xml -baseDirectory = new File( rootDirectory, 'defaultBase' ); -assert !baseDirectory.isDirectory(); +baseDirectory = new File(rootDirectory, 'defaultBase') +assert !baseDirectory.isDirectory() // msite604.siteBase property value from settings.xml -baseDirectory = new File( rootDirectory, 'settingsBase' ); -assert baseDirectory.isDirectory(); +baseDirectory = new File(rootDirectory, 'settingsBase') +assert baseDirectory.isDirectory() // msite604.sitePath property value from pom.xml -defaultDirectory = new File( baseDirectory, 'defaultPath' ); -assert defaultDirectory.exists(); +defaultDirectory = new File(baseDirectory, 'defaultPath') +assert defaultDirectory.exists() -return true; +return true diff --git a/src/it/projects/MSITE-609/verify.groovy b/src/it/projects/MSITE-609/verify.groovy index 8dda80dd..07e72d94 100644 --- a/src/it/projects/MSITE-609/verify.groovy +++ b/src/it/projects/MSITE-609/verify.groovy @@ -20,7 +20,7 @@ import groovy.xml.XmlSlurper -File target = new File( basedir, "target" ) +File target = new File(basedir, "target") assert target.exists() && target.isDirectory() : "target file is missing or not a directory." File siteDirectory = new File( target, "site-deployed" ) diff --git a/src/it/projects/MSITE-627/verify.groovy b/src/it/projects/MSITE-627/verify.groovy index 431a000f..8a327946 100644 --- a/src/it/projects/MSITE-627/verify.groovy +++ b/src/it/projects/MSITE-627/verify.groovy @@ -18,7 +18,7 @@ * under the License. */ -final File siteDirectory = new File( basedir, "target/site" ) +final File siteDirectory = new File(basedir, "target/site") assert siteDirectory.exists() && siteDirectory.isDirectory() : "site is missing or not a directory." File report = new File( siteDirectory, "MSITE-627.html" ) diff --git a/src/it/projects/MSITE-658/verify.groovy b/src/it/projects/MSITE-658/verify.groovy index 6f5b19bd..4391645e 100644 --- a/src/it/projects/MSITE-658/verify.groovy +++ b/src/it/projects/MSITE-658/verify.groovy @@ -18,7 +18,7 @@ * under the License. */ -final File siteDirectory = new File( basedir, "target/site" ) +final File siteDirectory = new File(basedir, "target/site") assert siteDirectory.isDirectory() : "site is missing or not a directory." File licenses = new File( siteDirectory, "licenses.html" ) diff --git a/src/it/projects/MSITE-705-debug/verify.groovy b/src/it/projects/MSITE-705-debug/verify.groovy index 97da882c..6cef2e85 100644 --- a/src/it/projects/MSITE-705-debug/verify.groovy +++ b/src/it/projects/MSITE-705-debug/verify.groovy @@ -18,5 +18,5 @@ * under the License. */ -content = new File( basedir, 'build.log' ).text -return content.contains( 'Session: Disconnected' ) +content = new File(basedir, 'build.log').text +return content.contains('Session: Disconnected') diff --git a/src/it/projects/MSITE-705-no-debug/verify.groovy b/src/it/projects/MSITE-705-no-debug/verify.groovy index 97276684..4f90013b 100644 --- a/src/it/projects/MSITE-705-no-debug/verify.groovy +++ b/src/it/projects/MSITE-705-no-debug/verify.groovy @@ -18,5 +18,5 @@ * under the License. */ -content = new File( basedir, 'build.log' ).text -return !content.contains( 'Session: Disconnected' ) +content = new File(basedir, 'build.log').text +return !content.contains('Session: Disconnected') diff --git a/src/it/projects/MSITE-723/verify.groovy b/src/it/projects/MSITE-723/verify.groovy index 2ffd4a2b..86bd416a 100644 --- a/src/it/projects/MSITE-723/verify.groovy +++ b/src/it/projects/MSITE-723/verify.groovy @@ -18,8 +18,8 @@ * under the License. */ -content = new File( basedir, 'target/site/index.html' ).text; +content = new File(basedir, 'target/site/index.html').text -assert content.contains( 'Correct!' ); +assert content.contains('Correct!') -return true; \ No newline at end of file +return true \ No newline at end of file diff --git a/src/it/projects/MSITE-842/verify.groovy b/src/it/projects/MSITE-842/verify.groovy index 2bc801d6..f5b46f78 100644 --- a/src/it/projects/MSITE-842/verify.groovy +++ b/src/it/projects/MSITE-842/verify.groovy @@ -18,26 +18,26 @@ * under the License. */ -File resultFile; -File expectedFile; +File resultFile +File expectedFile // Check MSITE-842.html (must exist and be exactly like the model -resultFile = new File(basedir, "project/target/site/MSITE-842.html"); -expectedFile = new File(basedir, "project/src/it/MSITE-842.html"); +resultFile = new File(basedir, "project/target/site/MSITE-842.html") +expectedFile = new File(basedir, "project/src/it/MSITE-842.html") assert resultFile.exists() && resultFile.isFile() assert resultFile.text.normalize().equals(expectedFile.text.normalize()) // Check another-page.html (must exist and be exactly like the model -resultFile = new File(basedir, "project/target/site/another-page.html"); -expectedFile = new File(basedir, "project/src/it/another-page.html"); +resultFile = new File(basedir, "project/target/site/another-page.html") +expectedFile = new File(basedir, "project/src/it/another-page.html") assert resultFile.exists() && resultFile.isFile() assert resultFile.text.normalize().equals(expectedFile.text.normalize()) // Check sub/sub.html (must exist and be exactly like the model -resultFile = new File(basedir, "project/target/site/sub/sub.html"); -expectedFile = new File(basedir, "project/src/it/sub/sub.html"); +resultFile = new File(basedir, "project/target/site/sub/sub.html") +expectedFile = new File(basedir, "project/src/it/sub/sub.html") assert resultFile.exists() && resultFile.isFile() assert resultFile.text.normalize().equals(expectedFile.text.normalize()) diff --git a/src/it/projects/MSITE-856/verify.groovy b/src/it/projects/MSITE-856/verify.groovy index de46d5b3..b7ebd90f 100644 --- a/src/it/projects/MSITE-856/verify.groovy +++ b/src/it/projects/MSITE-856/verify.groovy @@ -17,7 +17,7 @@ * under the License. */ -final File siteDirectory = new File( basedir, "target/site" ) +final File siteDirectory = new File(basedir, "target/site") assert siteDirectory.isDirectory() : "site is missing or not a directory." File sitemapHtmlFile = new File( siteDirectory, "sitemap.html" ) diff --git a/src/it/projects/auto-refresh/verify.groovy b/src/it/projects/auto-refresh/verify.groovy index a2e6251e..2bea7a12 100644 --- a/src/it/projects/auto-refresh/verify.groovy +++ b/src/it/projects/auto-refresh/verify.groovy @@ -18,13 +18,13 @@ */ // Check that the site output directory exists -File target = new File( basedir, 'target/site' ); -assert target.isDirectory() : "target/site directory should exist"; +File target = new File(basedir, 'target/site') +assert target.isDirectory() : "target/site directory should exist" // Check that the rendered markdown page exists -File testPage = new File( target, 'test.html' ); -assert testPage.isFile() : "test.html should have been rendered from test.md"; +File testPage = new File( target, 'test.html' ) +assert testPage.isFile() : "test.html should have been rendered from test.md" // Check that the rendered page contains expected content -String content = testPage.text; -assert content.contains( 'Hot Reload Test' ) : "test.html should contain 'Hot Reload Test'"; +String content = testPage.text +assert content.contains( 'Hot Reload Test' ) : "test.html should contain 'Hot Reload Test'" diff --git a/src/it/projects/default-reports-excluded/verify.groovy b/src/it/projects/default-reports-excluded/verify.groovy index ecf93c32..5d44f75d 100644 --- a/src/it/projects/default-reports-excluded/verify.groovy +++ b/src/it/projects/default-reports-excluded/verify.groovy @@ -18,7 +18,7 @@ * under the License. */ -sitedir = new File( basedir, 'target/site' ); +sitedir = new File(basedir, 'target/site') -assert new File( sitedir, 'css' ).exists(); -assert !new File( sitedir, 'index.html' ).exists(); +assert new File(sitedir, 'css').exists() +assert !new File(sitedir, 'index.html').exists() diff --git a/src/it/projects/default-reports/verify.groovy b/src/it/projects/default-reports/verify.groovy index 6a3ccacc..7e034364 100644 --- a/src/it/projects/default-reports/verify.groovy +++ b/src/it/projects/default-reports/verify.groovy @@ -18,11 +18,11 @@ * under the License. */ -sitedir = new File( basedir, 'target/site' ); +sitedir = new File(basedir, 'target/site') -assert new File( sitedir, 'dependency-info.html' ).exists(); -assert new File( sitedir, 'index.html' ).exists(); -assert new File( sitedir, 'plugin-management.html' ).exists(); -assert new File( sitedir, 'plugins.html' ).exists(); -assert new File( sitedir, 'project-info.html' ).exists(); -assert new File( sitedir, 'summary.html' ).exists(); +assert new File(sitedir, 'dependency-info.html').exists() +assert new File(sitedir, 'index.html').exists() +assert new File(sitedir, 'plugin-management.html').exists() +assert new File(sitedir, 'plugins.html').exists() +assert new File(sitedir, 'project-info.html').exists() +assert new File(sitedir, 'summary.html').exists() diff --git a/src/it/projects/doxia-formats/verify.groovy b/src/it/projects/doxia-formats/verify.groovy index bd56ecfc..69dc0c98 100644 --- a/src/it/projects/doxia-formats/verify.groovy +++ b/src/it/projects/doxia-formats/verify.groovy @@ -20,43 +20,42 @@ // These files must have been generated [ - 'apt-macro.html', - 'index.html', - 'velocity-context.html', - 'velocity-include-parse.html', - 'faq-macro.html', - 'faq.html', - 'markdown-macro.html', - 'markdown.html', - 'markdown2.html', - 'xdoc.html', - 'xdoc-macro.html', - 'xhtml.html', - 'xhtml-macro.html' + 'apt-macro.html', + 'index.html', + 'velocity-context.html', + 'velocity-include-parse.html', + 'faq-macro.html', + 'faq.html', + 'markdown-macro.html', + 'markdown.html', + 'markdown2.html', + 'xdoc.html', + 'xdoc-macro.html', + 'xhtml.html', + 'xhtml-macro.html' ].each { - // File exists - def verifiedFile = new File( basedir, "target/site/$it" ) - assert verifiedFile.exists() : "$it must have been generated" + // File exists + def verifiedFile = new File(basedir, "target/site/$it") + assert verifiedFile.exists() : "$it must have been generated" - // File contains the content marker 'Content for verify.groovy' - def verifiedContent = verifiedFile.text - assert verifiedContent.contains( 'Content for verify.groovy' ) : + // File contains the content marker 'Content for verify.groovy' + def verifiedContent = verifiedFile.text + assert verifiedContent.contains('Content for verify.groovy') : "$it must have content from the source ('Content for verify.groovy')" - // File does NOT contain the path to the source file referenced by the SNIPPET macro. - // This means that the SNIPPET macro has been properly processed. - // This test can be run in all files produced, even those with no macros. - assert !verifiedContent.contains( 'src/main/java/org/apache/maven/plugins/site/it/CustomVelocityTool.java' ) : + // File does NOT contain the path to the source file referenced by the SNIPPET macro. + // This means that the SNIPPET macro has been properly processed. + // This test can be run in all files produced, even those with no macros. + assert !verifiedContent.contains('src/main/java/org/apache/maven/plugins/site/it/CustomVelocityTool.java') : "Macros must have been processed in $it and SNIPPET source file path removed" - } // ignore.txt must NOT have been generated -assert !( new File( basedir, 'target/site/ignore.txt' ).exists() ) : - "ignore.txt does not end up in the generated content" +assert !(new File(basedir, 'target/site/ignore.txt').exists()) : +"ignore.txt does not end up in the generated content" assert !( new File( basedir, 'target/site/ignore.html' ).exists() ) : - "ignore.txt does not produce ignore.html" +"ignore.txt does not produce ignore.html" // .vm files must have been processed with Velocity def velocity = new File( basedir, 'target/generated-site/processed/velocity-context.apt' ) @@ -66,7 +65,7 @@ def content = velocity.text assert content.contains( '= <<<val1>>>' ) : "Velocity-processed content must conform to MSITE-550" assert !( content.replace('<<<$value', '').contains( '<<<$' ) ) : - 'Velocity-processed content must not contain any veloci-macro reference' +'Velocity-processed content must not contain any veloci-macro reference' assert content.contains( "Content for verify.groovy" ) : "Velocity-processed content must contain English text for default locale" diff --git a/src/it/projects/editable-pages-alt-source/verify.groovy b/src/it/projects/editable-pages-alt-source/verify.groovy index ff41fb15..655a477e 100644 --- a/src/it/projects/editable-pages-alt-source/verify.groovy +++ b/src/it/projects/editable-pages-alt-source/verify.groovy @@ -18,7 +18,7 @@ * under the License. */ -def page = new File( basedir, 'target/site/markdown.html' ) +def page = new File(basedir, 'target/site/markdown.html') assert page.exists() : "$page must have been generated" def content = page.text diff --git a/src/it/projects/editable-pages/verify.groovy b/src/it/projects/editable-pages/verify.groovy index bc6bb995..f7a2b567 100644 --- a/src/it/projects/editable-pages/verify.groovy +++ b/src/it/projects/editable-pages/verify.groovy @@ -18,7 +18,7 @@ * under the License. */ -def page = new File( basedir, 'target/site/markdown.html' ) +def page = new File(basedir, 'target/site/markdown.html') assert page.exists() : "$page must have been generated" def content = page.text diff --git a/src/it/projects/effective-site/verify.groovy b/src/it/projects/effective-site/verify.groovy index 078e5623..00ba326a 100644 --- a/src/it/projects/effective-site/verify.groovy +++ b/src/it/projects/effective-site/verify.groovy @@ -17,6 +17,6 @@ * specific language governing permissions and limitations * under the License. */ -assert new File( basedir, 'effective-site.xml' ).exists(); +assert new File(basedir, 'effective-site.xml').exists() -return true; \ No newline at end of file +return true \ No newline at end of file diff --git a/src/it/projects/empty-report-set/verify.groovy b/src/it/projects/empty-report-set/verify.groovy index 61a75aa6..f50d8040 100644 --- a/src/it/projects/empty-report-set/verify.groovy +++ b/src/it/projects/empty-report-set/verify.groovy @@ -17,13 +17,12 @@ * under the License. */ -import java.io.*; +import java.io.* -File indexHtml = new File( basedir, "target/site/index.html" ); +File indexHtml = new File(basedir, "target/site/index.html") -if ( indexHtml.exists() ) -{ - throw new Exception( "Detected unwanted file " + indexHtml ); +if (indexHtml.exists()) { + throw new Exception("Detected unwanted file " + indexHtml) } -return true; +return true diff --git a/src/it/projects/filtered-site-sources/verify.groovy b/src/it/projects/filtered-site-sources/verify.groovy index ab997d9b..ceb92592 100644 --- a/src/it/projects/filtered-site-sources/verify.groovy +++ b/src/it/projects/filtered-site-sources/verify.groovy @@ -18,7 +18,7 @@ * under the License. */ -def page = new File( basedir, 'target/generated-site/markdown/filtered.md' ) +def page = new File(basedir, 'target/generated-site/markdown/filtered.md') assert page.exists() : "$page must have been filtered into the generated site directory" page = new File( basedir, 'target/site/filtered.html' ) diff --git a/src/it/projects/full-reporting/verify.groovy b/src/it/projects/full-reporting/verify.groovy index ba6dda49..6cf1c480 100644 --- a/src/it/projects/full-reporting/verify.groovy +++ b/src/it/projects/full-reporting/verify.groovy @@ -17,79 +17,86 @@ * specific language governing permissions and limitations * under the License. */ -assert new File( basedir, 'target/surefire-reports' ).exists(); -assert new File( basedir, 'target/surefire-reports/org.apache.maven.plugins.site.its.AppTest.txt' ).exists(); -content = new File( basedir, 'target/surefire-reports/org.apache.maven.plugins.site.its.AppTest.txt' ).text; +assert new File(basedir, 'target/surefire-reports').exists() +assert new File(basedir, 'target/surefire-reports/org.apache.maven.plugins.site.its.AppTest.txt').exists() +content = new File(basedir, 'target/surefire-reports/org.apache.maven.plugins.site.its.AppTest.txt').text -assert content.contains( 'Test set: org.apache.maven.plugins.site.its.AppTest' ); +assert content.contains('Test set: org.apache.maven.plugins.site.its.AppTest') -assert content.contains( 'Tests run: 1, Failures: 0, Errors: 0, Skipped: 0' ); +assert content.contains('Tests run: 1, Failures: 0, Errors: 0, Skipped: 0') -sitedir = new File( basedir, 'target/site' ); +sitedir = new File(basedir, 'target/site') -assert new File( sitedir, 'surefire.html' ).exists(); -assert new File( sitedir, 'index.html' ).exists(); -assert new File( sitedir, 'checkstyle.html' ).exists(); -assert new File( sitedir, 'cpd.html' ).exists(); -assert new File( sitedir, 'apidocs/index.html' ).exists(); -assert new File( sitedir, 'apidocs/org/apache/maven/plugins/site/its/App.html' ).exists(); +assert new File(sitedir, 'surefire.html').exists() +assert new File(sitedir, 'index.html').exists() +assert new File(sitedir, 'checkstyle.html').exists() +assert new File(sitedir, 'cpd.html').exists() +assert new File(sitedir, 'apidocs/index.html').exists() +assert new File(sitedir, 'apidocs/org/apache/maven/plugins/site/its/App.html').exists() //assert new File( sitedir, 'cobertura/index.html' ).exists(); -assert new File( sitedir, 'xref/index.html' ).exists(); -assert new File( sitedir, 'xref-test/index.html' ).exists(); +assert new File(sitedir, 'xref/index.html').exists() +assert new File(sitedir, 'xref-test/index.html').exists() -assert new File( sitedir, 'taglist.html' ).exists(); -assert new File( sitedir, 'team.html' ).exists(); +assert new File(sitedir, 'taglist.html').exists() +assert new File(sitedir, 'team.html').exists() -assert new File( sitedir, 'dependencies.html' ).exists(); -content = new File( sitedir, 'dependencies.html' ).text; -assert content.contains( 'org.junit.jupiter:junit-jupiter-api:jar:' ); +assert new File(sitedir, 'dependencies.html').exists() +content = new File(sitedir, 'dependencies.html').text +assert content.contains('org.junit.jupiter:junit-jupiter-api:jar:') // check reports order -String[] reports = [ 'index', // <report>index</report> - 'summary', // <report>summary</report> - 'licenses', // <report>licenses</report> - 'team', // <report>team</report> - 'scm', // <report>scm</report> - 'issue-management', // <report>issue-management</report> - 'mailing-lists', // <report>mailing-lists</report> - 'dependencies', // <report>dependencies</report> - 'ci-management', // <report>ci-management</report> - 'plugin-management', // <report>plugin-management</report> - 'plugins' // <report>plugins</report> - ]; -String info = new File( sitedir, 'project-info.html' ).text; -int index1 = 10; -int index2 = 10; -String previousReportLink; -for ( String report : reports ) -{ - File reportFile = new File( sitedir, report + ".html" ); - if ( !reportFile.isFile() ) - { - println "Report file not existent: $reportFile"; - return false; +String[] reports = [ + 'index', + // <report>index</report> + 'summary', + // <report>summary</report> + 'licenses', + // <report>licenses</report> + 'team', + // <report>team</report> + 'scm', + // <report>scm</report> + 'issue-management', + // <report>issue-management</report> + 'mailing-lists', + // <report>mailing-lists</report> + 'dependencies', + // <report>dependencies</report> + 'ci-management', + // <report>ci-management</report> + 'plugin-management', + // <report>plugin-management</report> + 'plugins' // <report>plugins</report> +] +String info = new File(sitedir, 'project-info.html').text +int index1 = 10 +int index2 = 10 +String previousReportLink +for (String report : reports) { + File reportFile = new File(sitedir, report + ".html") + if (!reportFile.isFile()) { + println "Report file not existent: $reportFile" + return false } - String link = "<a href=\"" + reportFile.getName() + "\""; - int i1 = info.indexOf( link ); - int i2 = info.indexOf( link, i1 + 1 ); - if ( i1 < index1 ) - { - println "Wrong order for first report link: expected $previousReportLink -> $link, but found $i1 < $index1"; - println " previous report link: " + info.substring( index1 - 10, index1 + 70 ); - println " actual report link: " + info.substring( i1 - 10, i1 + 70 ); - return false; + String link = "<a href=\"" + reportFile.getName() + "\"" + int i1 = info.indexOf(link) + int i2 = info.indexOf(link, i1 + 1) + if (i1 <index1) { + println "Wrong order for first report link: expected $previousReportLink -> $link, but found $i1 < $index1" + println " previous report link: " + info.substring(index1 - 10, index1 + 70) + println " actual report link: " + info.substring(i1 - 10, i1 + 70) + return false } - if ( i2 < index2 ) - { - println "Wrong order for second report link: expected $previousReportLink -> $link, but found $i2 < $index2"; - println " previous report link: " + info.substring( index2 - 10, index2 + 70 ); - println " actual report link: " + info.substring( i2 - 10, i2 + 70 ); - return false; + if (i2 <index2) { + println "Wrong order for second report link: expected $previousReportLink -> $link, but found $i2 < $index2" + println " previous report link: " + info.substring(index2 - 10, index2 + 70) + println " actual report link: " + info.substring(i2 - 10, i2 + 70) + return false } - index1 = i1; - index2 = i2; - previousReportLink = link; + index1 = i1 + index2 = i2 + previousReportLink = link } -return true; +return true diff --git a/src/it/projects/gh-1286-missing-skin/verify.groovy b/src/it/projects/gh-1286-missing-skin/verify.groovy index f2f22ea1..2874b9d3 100644 --- a/src/it/projects/gh-1286-missing-skin/verify.groovy +++ b/src/it/projects/gh-1286-missing-skin/verify.groovy @@ -17,15 +17,15 @@ * under the License. */ -File buildLog = new File( basedir, 'build.log' ) +File buildLog = new File(basedir, 'build.log') assert buildLog.exists() String log = buildLog.text // The build must fail with a clear, actionable message ... -assert log.contains( 'No skin is declared in the site descriptor' ) +assert log.contains('No skin is declared in the site descriptor') // ... and NOT with the previous cryptic NullPointerException from doxia-sitetools. -assert !log.contains( 'skin cannot be null' ) +assert !log.contains('skin cannot be null') return true diff --git a/src/it/projects/inheritance-interpolation/verify.groovy b/src/it/projects/inheritance-interpolation/verify.groovy index 42627f07..c63f92c0 100644 --- a/src/it/projects/inheritance-interpolation/verify.groovy +++ b/src/it/projects/inheritance-interpolation/verify.groovy @@ -19,36 +19,36 @@ */ // POM inheritance+interpolation -content = new File( basedir, 'child/target/generated-site/processed/pom.apt' ).text; +content = new File(basedir, 'child/target/generated-site/processed/pom.apt').text // normal field check -assert content.contains( "<<<project.artifactId = 'repo-parent'>>>" ); -assert content.contains( "<<<project.artifactId = 'relative-parent'>>>" ); -assert content.contains( "<<<project.artifactId = 'reactor-parent'>>>" ); -assert content.contains( "<<<project.artifactId = 'child'>>>" ); +assert content.contains("<<<project.artifactId = 'repo-parent'>>>") +assert content.contains("<<<project.artifactId = 'relative-parent'>>>") +assert content.contains("<<<project.artifactId = 'reactor-parent'>>>") +assert content.contains("<<<project.artifactId = 'child'>>>") // url check (with its inheritance) -assert content.contains( '<<<http://maven.apache.org/$\\{property}>>>' ); // repo-parent -assert content.contains( '<<<http://maven.apache.org/$\\{property}/relative-parent>>>' ); // relative-parent -assert content.contains( '<<<http://maven.apache.org/prop-value-from-reactor-parent/relative-parent/reactor-parent>>>' ); // reactor-parent -assert content.contains( '<<<http://maven.apache.org/prop-value-from-child/relative-parent/reactor-parent/child>>>' ); // child +assert content.contains('<<<http://maven.apache.org/$\\{property}>>>') // repo-parent +assert content.contains('<<<http://maven.apache.org/$\\{property}/relative-parent>>>') // relative-parent +assert content.contains('<<<http://maven.apache.org/prop-value-from-reactor-parent/relative-parent/reactor-parent>>>') // reactor-parent +assert content.contains('<<<http://maven.apache.org/prop-value-from-child/relative-parent/reactor-parent/child>>>') // child // site.xml Site Model inheritance+interpolation -effectiveSiteContent = new File( basedir, 'child/target/effective-site.xml' ).text; -childContent = new File( basedir, 'child/target/site/index.html' ).text; +effectiveSiteContent = new File(basedir, 'child/target/effective-site.xml').text +childContent = new File(basedir, 'child/target/site/index.html').text // bannerLeft name -assert effectiveSiteContent.contains( '<bannerLeft name="bannerLeft project.artifactId = child" />' ); -assert childContent.contains( 'bannerLeft project.artifactId = child' ); +assert effectiveSiteContent.contains('<bannerLeft name="bannerLeft project.artifactId = child" />') +assert childContent.contains('bannerLeft project.artifactId = child') // breadcrumbs -assert childContent.contains( '<a href="../../index.html"' ); -assert childContent.contains( '<a href="../index.html"' ); -assert childContent.contains( '<a href="index.html"' ); +assert childContent.contains('<a href="../../index.html"') +assert childContent.contains('<a href="../index.html"') +assert childContent.contains('<a href="index.html"') -reactorEffectiveSiteContent = new File( basedir, 'reactor-parent/target/effective-site.xml' ).text; -reactorContent = new File( basedir, 'reactor-parent/target/site/index.html' ).text; +reactorEffectiveSiteContent = new File(basedir, 'reactor-parent/target/effective-site.xml').text +reactorContent = new File(basedir, 'reactor-parent/target/site/index.html').text // bannerLeft name -assert reactorEffectiveSiteContent.contains( '<bannerLeft name="bannerLeft project.artifactId = reactor-parent" />' ); -assert reactorContent.contains( 'bannerLeft project.artifactId = reactor-parent' ); +assert reactorEffectiveSiteContent.contains('<bannerLeft name="bannerLeft project.artifactId = reactor-parent" />') +assert reactorContent.contains('bannerLeft project.artifactId = reactor-parent') diff --git a/src/it/projects/inheritedMenus/verify.groovy b/src/it/projects/inheritedMenus/verify.groovy index 120b3ed5..73dc7632 100644 --- a/src/it/projects/inheritedMenus/verify.groovy +++ b/src/it/projects/inheritedMenus/verify.groovy @@ -18,7 +18,7 @@ * under the License. */ -File parentDirectory = new File( basedir, "parentNotAsRef" ) +File parentDirectory = new File(basedir, "parentNotAsRef") assert parentDirectory.exists() && parentDirectory.isDirectory() : "parent is missing or not a directory." File parentSiteDirectory = new File( parentDirectory, "target/site" ) diff --git a/src/it/projects/inheritedReports/verify.groovy b/src/it/projects/inheritedReports/verify.groovy index a2023691..56b3e461 100644 --- a/src/it/projects/inheritedReports/verify.groovy +++ b/src/it/projects/inheritedReports/verify.groovy @@ -18,8 +18,8 @@ * under the License. */ -File parentSiteDirectory = new File( basedir, "target/site" ) -File parentIndex = new File( parentSiteDirectory, "index.html" ) +File parentSiteDirectory = new File(basedir, "target/site") +File parentIndex = new File(parentSiteDirectory, "index.html") assert parentIndex.exists() && !parentIndex.isDirectory() : "no index file in parent or is a directory." // CHILD diff --git a/src/it/projects/new-configuration/verify.groovy b/src/it/projects/new-configuration/verify.groovy index bd82ce2a..4f0ea89f 100644 --- a/src/it/projects/new-configuration/verify.groovy +++ b/src/it/projects/new-configuration/verify.groovy @@ -17,26 +17,26 @@ * specific language governing permissions and limitations * under the License. */ - + // since maven-site-plugin 3.7, this IT is not expected to be successful any more: back to reporting section -return true; +return true -assert !new File( basedir, 'target/surefire-reports' ).exists(); -assert !new File( basedir, 'target/surefire-reports/org.apache.maven.plugins.site.its.AppTest.txt' ).exists(); +assert !new File(basedir, 'target/surefire-reports').exists() +assert !new File(basedir, 'target/surefire-reports/org.apache.maven.plugins.site.its.AppTest.txt').exists() -assert !new File( basedir, 'target/site/surefire.html' ).exists(); -assert new File( basedir, 'target/site/index.html' ).exists(); -assert !new File( basedir, 'target/site/checkstyle.html' ).exists(); -assert !new File( basedir, 'target/site/cpd.html' ).exists(); -assert new File( basedir, 'target/site/apidocs/index.html' ).exists(); -assert !new File( basedir, 'target/site/apidocs/org/apache/maven/plugins/site/its/App.html' ).exists(); -assert !new File( basedir, 'target/site/cobertura/index.html' ).exists(); -assert !new File( basedir, 'target/site/xref/index.html' ).exists(); -assert !new File( basedir, 'target/site/xref-test/index.html' ).exists(); +assert !new File(basedir, 'target/site/surefire.html').exists() +assert new File(basedir, 'target/site/index.html').exists() +assert !new File(basedir, 'target/site/checkstyle.html').exists() +assert !new File(basedir, 'target/site/cpd.html').exists() +assert new File(basedir, 'target/site/apidocs/index.html').exists() +assert !new File(basedir, 'target/site/apidocs/org/apache/maven/plugins/site/its/App.html').exists() +assert !new File(basedir, 'target/site/cobertura/index.html').exists() +assert !new File(basedir, 'target/site/xref/index.html').exists() +assert !new File(basedir, 'target/site/xref-test/index.html').exists() -assert !new File( basedir, 'target/site/taglist.html' ).exists(); -assert !new File( basedir, 'target/site/team-list.html' ).exists(); +assert !new File(basedir, 'target/site/taglist.html').exists() +assert !new File(basedir, 'target/site/team-list.html').exists() -assert !new File( basedir, 'target/site/dependencies.html' ).exists(); +assert !new File(basedir, 'target/site/dependencies.html').exists() -return true; +return true diff --git a/src/it/projects/no-version/verify.groovy b/src/it/projects/no-version/verify.groovy index 65a8033f..e614baac 100644 --- a/src/it/projects/no-version/verify.groovy +++ b/src/it/projects/no-version/verify.groovy @@ -17,15 +17,15 @@ * specific language governing permissions and limitations * under the License. */ -assert new File( basedir, 'target/surefire-reports' ).exists(); -assert new File( basedir, 'target/surefire-reports/org.apache.maven.plugins.site.its.AppTest.txt' ).exists(); -content = new File( basedir, 'target/surefire-reports/org.apache.maven.plugins.site.its.AppTest.txt' ).text; +assert new File(basedir, 'target/surefire-reports').exists() +assert new File(basedir, 'target/surefire-reports/org.apache.maven.plugins.site.its.AppTest.txt').exists() +content = new File(basedir, 'target/surefire-reports/org.apache.maven.plugins.site.its.AppTest.txt').text -assert content.contains( 'Test set: org.apache.maven.plugins.site.its.AppTest' ); +assert content.contains('Test set: org.apache.maven.plugins.site.its.AppTest') -assert content.contains( 'Tests run: 1, Failures: 0, Errors: 0, Skipped: 0' ); +assert content.contains('Tests run: 1, Failures: 0, Errors: 0, Skipped: 0') -assert new File( basedir, 'target/site/surefire.html' ).exists(); -assert !new File( basedir, 'target/site/index.html' ).exists(); +assert new File(basedir, 'target/site/surefire.html').exists() +assert !new File(basedir, 'target/site/index.html').exists() -return true; +return true diff --git a/src/it/projects/publishDate/verify.groovy b/src/it/projects/publishDate/verify.groovy index af6a09b0..ad608177 100644 --- a/src/it/projects/publishDate/verify.groovy +++ b/src/it/projects/publishDate/verify.groovy @@ -18,7 +18,7 @@ * under the License. */ -sitedir = new File( basedir, 'target/site' ); -index = new File( sitedir, 'index.html' ); -assert index.exists(); -assert index.getText().contains( '<li id="publishDate">Last Published: 2000-01-01' ); +sitedir = new File(basedir, 'target/site') +index = new File(sitedir, 'index.html') +assert index.exists() +assert index.getText().contains('<li id="publishDate">Last Published: 2000-01-01') diff --git a/src/it/projects/report-changes-generation/verify.groovy b/src/it/projects/report-changes-generation/verify.groovy index 1a0a7b97..de4e3dc3 100644 --- a/src/it/projects/report-changes-generation/verify.groovy +++ b/src/it/projects/report-changes-generation/verify.groovy @@ -20,7 +20,7 @@ import java.util.jar.* -File report = new File( basedir, "target/site/changes.html" ) +File report = new File(basedir, "target/site/changes.html") assert report.exists() && !report.isDirectory() : "report file is missing or a directory." String reportContent = report.getText('UTF-8') diff --git a/src/it/projects/reportConfig/verify.groovy b/src/it/projects/reportConfig/verify.groovy index 195a2e0d..d4dead3b 100644 --- a/src/it/projects/reportConfig/verify.groovy +++ b/src/it/projects/reportConfig/verify.groovy @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -File f = new File( basedir, 'target/site/licenses.html' ) -assert f.exists(); +File f = new File(basedir, 'target/site/licenses.html') +assert f.exists() -content = f.text; +content = f.text // linkOnly parameter merged from pluginManagement -assert content.contains( ' href="http://www.apache.org/licenses/LICENSE-2.0.txt"' ); +assert content.contains(' href="http://www.apache.org/licenses/LICENSE-2.0.txt"') -return true; \ No newline at end of file +return true \ No newline at end of file diff --git a/src/it/projects/resources/verify.groovy b/src/it/projects/resources/verify.groovy index b44ee4d5..f19d729c 100644 --- a/src/it/projects/resources/verify.groovy +++ b/src/it/projects/resources/verify.groovy @@ -16,17 +16,17 @@ * specific language governing permissions and limitations * under the License. */ -File site = new File( basedir, 'target/site' ) -assert site.exists(); +File site = new File(basedir, 'target/site') +assert site.exists() // file from src/site/resources -assert new File( site, 'src-site-resources.txt' ).exists(); +assert new File(site, 'src-site-resources.txt').exists() // MSITE-744 file from target/generated-site/resources -assert new File( site, 'generated-site-resources.txt' ).exists(); +assert new File(site, 'generated-site-resources.txt').exists() // file from maven-default-skin:jar:1.0 -assert new File( site, 'images/logos/maven-feather.png' ).exists(); +assert new File(site, 'images/logos/maven-feather.png').exists() // MSITE-702 overriding skin content with src/site/resources -assert new File( site, 'css/maven-base.css' ).text.contains( 'overriding Skin content...' ); +assert new File(site, 'css/maven-base.css').text.contains('overriding Skin content...') -return true; \ No newline at end of file +return true \ No newline at end of file diff --git a/src/it/projects/site-attach-descriptor/verify.groovy b/src/it/projects/site-attach-descriptor/verify.groovy index b0a655c9..f8939199 100644 --- a/src/it/projects/site-attach-descriptor/verify.groovy +++ b/src/it/projects/site-attach-descriptor/verify.groovy @@ -18,7 +18,7 @@ * under the License. */ -File target = new File( basedir, "target" ) +File target = new File(basedir, "target") assert target.exists() && target.isDirectory() : "target file is missing or not a directory." File siteDescriptor = new File( target, "site-attach-descriptor-1.0-SNAPSHOT-site.xml" ) @@ -30,12 +30,10 @@ assert siteDescriptorSwedish.exists() && !siteDescriptorSwedish.isDirectory() : File artifactsDirectory = new File( target, "snapshot-repo/org/apache/maven/plugins/site/its/site-attach-descriptor/1.0-SNAPSHOT" ) boolean pomSiteDescriptor = false File[] files = artifactsDirectory.listFiles() -for ( int i = 0; i < files.length; i++ ) -{ +for ( int i = 0; i < files.length; i++ ) { String name = files[i].getName() // site-attach-descriptor-1.0-20090823.204852-1-site.xml - if ( name.endsWith( "-site.xml" ) ) - { + if ( name.endsWith( "-site.xml" ) ) { pomSiteDescriptor = pomSiteDescriptor || name.startsWith( "site-attach-descriptor-1.0" ) } } @@ -44,12 +42,10 @@ assert pomSiteDescriptor : "site descriptor not deployed for pom packaging." artifactsDirectory = new File( target, "snapshot-repo/org/apache/maven/plugins/site/its/jar-site-attach-descriptor/1.0-SNAPSHOT" ) boolean jarSiteDescriptor = false files = artifactsDirectory.listFiles() -for ( int i = 0; i < files.length; i++ ) -{ +for ( int i = 0; i < files.length; i++ ) { String name = files[i].getName() // jar-site-attach-descriptor-1.0-20090823.204852-1-site.xml - if ( name.endsWith( "-site.xml" ) ) - { + if ( name.endsWith( "-site.xml" ) ) { jarSiteDescriptor = jarSiteDescriptor || name.startsWith( "jar-site-attach-descriptor-1.0" ) } } diff --git a/src/it/projects/site-deploy/verify.groovy b/src/it/projects/site-deploy/verify.groovy index 8dda80dd..07e72d94 100644 --- a/src/it/projects/site-deploy/verify.groovy +++ b/src/it/projects/site-deploy/verify.groovy @@ -20,7 +20,7 @@ import groovy.xml.XmlSlurper -File target = new File( basedir, "target" ) +File target = new File(basedir, "target") assert target.exists() && target.isDirectory() : "target file is missing or not a directory." File siteDirectory = new File( target, "site-deployed" ) diff --git a/src/it/projects/site-inheritance/verify.groovy b/src/it/projects/site-inheritance/verify.groovy index 81727856..c9acf6fb 100644 --- a/src/it/projects/site-inheritance/verify.groovy +++ b/src/it/projects/site-inheritance/verify.groovy @@ -18,7 +18,7 @@ * under the License. */ -final File siteDirectory = new File( basedir, "webhost.company.com" ) +final File siteDirectory = new File(basedir, "webhost.company.com") assert siteDirectory.exists() && siteDirectory.isDirectory() : "site is missing or not a directory." // DEPLOY diff --git a/src/it/projects/site-jar/verify.groovy b/src/it/projects/site-jar/verify.groovy index a07cd9f8..65bbbaaa 100644 --- a/src/it/projects/site-jar/verify.groovy +++ b/src/it/projects/site-jar/verify.groovy @@ -20,36 +20,34 @@ import java.util.jar.* -File target = new File( basedir, "target" ) +File target = new File(basedir, "target") assert target.exists() && target.isDirectory() : "target file is missing or not a directory." File siteJar = new File( target, "site-jar-1.0-SNAPSHOT-site.jar" ) assert siteJar.exists() && !siteJar.isDirectory() : "siteJar file is missing or a directory." -String[] fileNames = new String[] { "download.html", "index.html", "releases/release1.6.html" } +String[] fileNames = new String[] { + "download.html", "index.html", "releases/release1.6.html" + } Set contents = new HashSet() JarFile jar = new JarFile( siteJar ) Enumeration jarEntries = jar.entries() long timestamp = -1 -while ( jarEntries.hasMoreElements() ) -{ +while ( jarEntries.hasMoreElements() ) { JarEntry entry = (JarEntry) jarEntries.nextElement() - if ( timestamp == -1 ) - { - timestamp = entry.getTime(); // reproducible timestamp in jar file cause local timestamp depending on timezone + if ( timestamp == -1 ) { + timestamp = entry.getTime() // reproducible timestamp in jar file cause local timestamp depending on timezone } assert entry.getTime() == timestamp : "wrong entry time for " + entry.getName() + ": " + entry.getTime() + " instead of " + timestamp - if ( !entry.isDirectory() ) - { + if ( !entry.isDirectory() ) { // Only compare files contents.add( entry.getName() ) } } -for ( int i = 0; i < fileNames.length; i++ ) -{ +for ( int i = 0; i < fileNames.length; i++ ) { String fileName = fileNames[i] assert contents.contains( fileName ) : "File[" + fileName + "] not found in jar archive" } diff --git a/src/it/projects/site-sd-2/verify.groovy b/src/it/projects/site-sd-2/verify.groovy index 954c4117..2c624052 100644 --- a/src/it/projects/site-sd-2/verify.groovy +++ b/src/it/projects/site-sd-2/verify.groovy @@ -17,33 +17,33 @@ * under the License. */ -target = new File( basedir, 'target' ); -assert target.isDirectory(); +target = new File(basedir, 'target') +assert target.isDirectory() // deploy: reference layout // deploy/ // |- aggregator/ // `- plugins/ // `- maven-rocks-plugin/ -deployDirectory = new File( basedir, 'deploy' ); -assert deployDirectory.isDirectory(); -assert new File( deployDirectory, 'aggregator' ).isDirectory(); -pluginsDirectory = new File( deployDirectory, 'plugins' ); -assert pluginsDirectory.isDirectory(); -assert new File( pluginsDirectory, 'maven-rocks-plugin' ).isDirectory(); +deployDirectory = new File(basedir, 'deploy') +assert deployDirectory.isDirectory() +assert new File(deployDirectory, 'aggregator').isDirectory() +pluginsDirectory = new File(deployDirectory, 'plugins') +assert pluginsDirectory.isDirectory() +assert new File(pluginsDirectory, 'maven-rocks-plugin').isDirectory() // stage -stageDirectory = new File( target, 'staging' ); -assert stageDirectory.isDirectory(); -pluginsDirectory = new File( stageDirectory, 'plugins' ); -assert pluginsDirectory.isDirectory(); -assert new File( pluginsDirectory, 'maven-rocks-plugin' ).isDirectory(); +stageDirectory = new File(target, 'staging') +assert stageDirectory.isDirectory() +pluginsDirectory = new File(stageDirectory, 'plugins') +assert pluginsDirectory.isDirectory() +assert new File(pluginsDirectory, 'maven-rocks-plugin').isDirectory() // stage deploy -stageDeployDirectory = new File( deployDirectory, 'staging' ); -assert stageDeployDirectory.isDirectory(); -pluginsDirectory = new File( stageDeployDirectory, 'plugins' ); -assert pluginsDirectory.isDirectory(); -assert new File( pluginsDirectory, 'maven-rocks-plugin' ).isDirectory(); +stageDeployDirectory = new File(deployDirectory, 'staging') +assert stageDeployDirectory.isDirectory() +pluginsDirectory = new File(stageDeployDirectory, 'plugins') +assert pluginsDirectory.isDirectory() +assert new File(pluginsDirectory, 'maven-rocks-plugin').isDirectory() -return true; \ No newline at end of file +return true \ No newline at end of file diff --git a/src/it/projects/site-sd-lang/verify.groovy b/src/it/projects/site-sd-lang/verify.groovy index db28c92e..227bd0bb 100644 --- a/src/it/projects/site-sd-lang/verify.groovy +++ b/src/it/projects/site-sd-lang/verify.groovy @@ -22,7 +22,7 @@ // SITE -File topLevelDirectory = new File( basedir, "target/site" ) +File topLevelDirectory = new File(basedir, "target/site") assert topLevelDirectory.exists() && topLevelDirectory.isDirectory() : "Site directory '" + topLevelDirectory + "' is missing or not a directory." File moduleDirectory = new File( basedir, "mymodule/target/site" ) diff --git a/src/it/projects/site-sd-parent-no-append-path/verify.groovy b/src/it/projects/site-sd-parent-no-append-path/verify.groovy index c12f14bd..6003f226 100644 --- a/src/it/projects/site-sd-parent-no-append-path/verify.groovy +++ b/src/it/projects/site-sd-parent-no-append-path/verify.groovy @@ -18,21 +18,21 @@ */ // deploy -deployDirectory = new File( basedir, 'deploy' ); -assert deployDirectory.isDirectory(); -assert new File( deployDirectory, 'index.html' ).isFile(); +deployDirectory = new File(basedir, 'deploy') +assert deployDirectory.isDirectory() +assert new File(deployDirectory, 'index.html').isFile() // stage: directly in target/staging, not in a parent-relative directory -stageDirectory = new File( basedir, 'target/staging' ); -assert stageDirectory.isDirectory(); -assert new File( stageDirectory, 'index.html' ).isFile(); -assert !new File( basedir, 'target/unrelated-child' ).exists(); +stageDirectory = new File(basedir, 'target/staging') +assert stageDirectory.isDirectory() +assert new File(stageDirectory, 'index.html').isFile() +assert !new File(basedir, 'target/unrelated-child').exists() // stage deploy -stageDeployDirectory = new File( deployDirectory, 'staging' ); -assert new File( stageDeployDirectory, 'index.html' ).isFile(); +stageDeployDirectory = new File(deployDirectory, 'staging') +assert new File(stageDeployDirectory, 'index.html').isFile() // nothing may land next to the unrelated parent site -assert !new File( basedir, 'target/parent-deploy' ).exists(); +assert !new File(basedir, 'target/parent-deploy').exists() -return true; +return true diff --git a/src/it/projects/site-sd-stagingSiteURL/verify.groovy b/src/it/projects/site-sd-stagingSiteURL/verify.groovy index 48c4ac83..b6a75566 100644 --- a/src/it/projects/site-sd-stagingSiteURL/verify.groovy +++ b/src/it/projects/site-sd-stagingSiteURL/verify.groovy @@ -17,12 +17,12 @@ * under the License. */ -target = new File( basedir, 'target' ); -assert target.isDirectory(); +target = new File(basedir, 'target') +assert target.isDirectory() -stageDeploy = new File( target, 'MSITE-649-1.0-SNAPSHOT' ); -assert stageDeploy.isDirectory(); +stageDeploy = new File(target, 'MSITE-649-1.0-SNAPSHOT') +assert stageDeploy.isDirectory() -assert !new File( stageDeploy, 'MSITE-649' ).exists(); // a MSITE-649 subdirectory has been created inside the staging directory +assert !new File(stageDeploy, 'MSITE-649').exists() // a MSITE-649 subdirectory has been created inside the staging directory -return true; \ No newline at end of file +return true \ No newline at end of file diff --git a/src/it/projects/site-sd-submodule/verify.groovy b/src/it/projects/site-sd-submodule/verify.groovy index 2e2fe27c..78f25681 100644 --- a/src/it/projects/site-sd-submodule/verify.groovy +++ b/src/it/projects/site-sd-submodule/verify.groovy @@ -17,11 +17,11 @@ * under the License. */ -target = new File( basedir, 'target' ); -assert target.isDirectory(); +target = new File(basedir, 'target') +assert target.isDirectory() -stageDeploy = new File( target, 'site-deployed/staging' ); -assert stageDeploy.isDirectory(); -assert new File( stageDeploy, 'module' ).exists(); +stageDeploy = new File(target, 'site-deployed/staging') +assert stageDeploy.isDirectory() +assert new File(stageDeploy, 'module').exists() -return true; \ No newline at end of file +return true \ No newline at end of file diff --git a/src/it/projects/site-sd-top-parent-different-site/verify.groovy b/src/it/projects/site-sd-top-parent-different-site/verify.groovy index 3abb9bdf..eeed3608 100644 --- a/src/it/projects/site-sd-top-parent-different-site/verify.groovy +++ b/src/it/projects/site-sd-top-parent-different-site/verify.groovy @@ -17,22 +17,22 @@ * under the License. */ -target = new File( basedir, 'target' ); -assert target.isDirectory(); +target = new File(basedir, 'target') +assert target.isDirectory() // deploy -deployDirectory = new File( basedir, 'deploy' ); -assert deployDirectory.isDirectory(); -assert new File( deployDirectory, 'module1' ).isDirectory(); +deployDirectory = new File(basedir, 'deploy') +assert deployDirectory.isDirectory() +assert new File(deployDirectory, 'module1').isDirectory() // stage -stageDirectory = new File( target, 'staging' ); -assert stageDirectory.isDirectory(); -assert new File( stageDirectory, 'module1' ).isDirectory(); +stageDirectory = new File(target, 'staging') +assert stageDirectory.isDirectory() +assert new File(stageDirectory, 'module1').isDirectory() // stage deploy -stageDeployDirectory = new File( deployDirectory, 'staging' ); -assert stageDeployDirectory.isDirectory(); -assert new File( stageDeployDirectory, 'module1' ).isDirectory(); +stageDeployDirectory = new File(deployDirectory, 'staging') +assert stageDeployDirectory.isDirectory() +assert new File(stageDeployDirectory, 'module1').isDirectory() -return true; \ No newline at end of file +return true \ No newline at end of file diff --git a/src/it/projects/site-sd-top-parent-no-site/verify.groovy b/src/it/projects/site-sd-top-parent-no-site/verify.groovy index 3abb9bdf..eeed3608 100644 --- a/src/it/projects/site-sd-top-parent-no-site/verify.groovy +++ b/src/it/projects/site-sd-top-parent-no-site/verify.groovy @@ -17,22 +17,22 @@ * under the License. */ -target = new File( basedir, 'target' ); -assert target.isDirectory(); +target = new File(basedir, 'target') +assert target.isDirectory() // deploy -deployDirectory = new File( basedir, 'deploy' ); -assert deployDirectory.isDirectory(); -assert new File( deployDirectory, 'module1' ).isDirectory(); +deployDirectory = new File(basedir, 'deploy') +assert deployDirectory.isDirectory() +assert new File(deployDirectory, 'module1').isDirectory() // stage -stageDirectory = new File( target, 'staging' ); -assert stageDirectory.isDirectory(); -assert new File( stageDirectory, 'module1' ).isDirectory(); +stageDirectory = new File(target, 'staging') +assert stageDirectory.isDirectory() +assert new File(stageDirectory, 'module1').isDirectory() // stage deploy -stageDeployDirectory = new File( deployDirectory, 'staging' ); -assert stageDeployDirectory.isDirectory(); -assert new File( stageDeployDirectory, 'module1' ).isDirectory(); +stageDeployDirectory = new File(deployDirectory, 'staging') +assert stageDeployDirectory.isDirectory() +assert new File(stageDeployDirectory, 'module1').isDirectory() -return true; \ No newline at end of file +return true \ No newline at end of file diff --git a/src/it/projects/site-sd-top-parent-same-site/verify.groovy b/src/it/projects/site-sd-top-parent-same-site/verify.groovy index 3abb9bdf..eeed3608 100644 --- a/src/it/projects/site-sd-top-parent-same-site/verify.groovy +++ b/src/it/projects/site-sd-top-parent-same-site/verify.groovy @@ -17,22 +17,22 @@ * under the License. */ -target = new File( basedir, 'target' ); -assert target.isDirectory(); +target = new File(basedir, 'target') +assert target.isDirectory() // deploy -deployDirectory = new File( basedir, 'deploy' ); -assert deployDirectory.isDirectory(); -assert new File( deployDirectory, 'module1' ).isDirectory(); +deployDirectory = new File(basedir, 'deploy') +assert deployDirectory.isDirectory() +assert new File(deployDirectory, 'module1').isDirectory() // stage -stageDirectory = new File( target, 'staging' ); -assert stageDirectory.isDirectory(); -assert new File( stageDirectory, 'module1' ).isDirectory(); +stageDirectory = new File(target, 'staging') +assert stageDirectory.isDirectory() +assert new File(stageDirectory, 'module1').isDirectory() // stage deploy -stageDeployDirectory = new File( deployDirectory, 'staging' ); -assert stageDeployDirectory.isDirectory(); -assert new File( stageDeployDirectory, 'module1' ).isDirectory(); +stageDeployDirectory = new File(deployDirectory, 'staging') +assert stageDeployDirectory.isDirectory() +assert new File(stageDeployDirectory, 'module1').isDirectory() -return true; \ No newline at end of file +return true \ No newline at end of file diff --git a/src/it/projects/site-sd/verify.groovy b/src/it/projects/site-sd/verify.groovy index 6a67bf01..4dd46a28 100644 --- a/src/it/projects/site-sd/verify.groovy +++ b/src/it/projects/site-sd/verify.groovy @@ -17,19 +17,19 @@ * under the License. */ -target = new File( basedir, 'target' ); -assert target.isDirectory(); +target = new File(basedir, 'target') +assert target.isDirectory() // stage -stagingDirectory = new File( target, 'staging' ); -assert stagingDirectory.isDirectory(); -assert new File( stagingDirectory, 'MSITE-304-child' ).isDirectory(); // notice: artifactId, not module name +stagingDirectory = new File(target, 'staging') +assert stagingDirectory.isDirectory() +assert new File(stagingDirectory, 'MSITE-304-child').isDirectory() // notice: artifactId, not module name // stage-deploy -deployDirectory = new File( target, 'www.example.com/parent' ); -stageDeployDirectory = new File( deployDirectory, 'staging' ); -assert stageDeployDirectory.isDirectory(); -assert new File( stageDeployDirectory, 'MSITE-304-child' ).isDirectory(); -assert !new File( deployDirectory, 'MSITE-304-child/staging' ).exists(); +deployDirectory = new File(target, 'www.example.com/parent') +stageDeployDirectory = new File(deployDirectory, 'staging') +assert stageDeployDirectory.isDirectory() +assert new File(stageDeployDirectory, 'MSITE-304-child').isDirectory() +assert !new File(deployDirectory, 'MSITE-304-child/staging').exists() -return true; \ No newline at end of file +return true \ No newline at end of file diff --git a/src/it/projects/site-skip/verify.groovy b/src/it/projects/site-skip/verify.groovy index 7aa4d097..21c7e979 100644 --- a/src/it/projects/site-skip/verify.groovy +++ b/src/it/projects/site-skip/verify.groovy @@ -18,13 +18,13 @@ * under the License. */ -final File deployDirectory = new File( basedir, "deployed" ) -final File stageDirectory = new File( basedir, "target/staging" ) -final File stageDeployDirectory = new File( deployDirectory, "staging" ) +final File deployDirectory = new File(basedir, "deployed") +final File stageDirectory = new File(basedir, "target/staging") +final File stageDeployDirectory = new File(deployDirectory, "staging") // top -File siteDir = new File( basedir, "target/site" ) +File siteDir = new File(basedir, "target/site") assert siteDir.exists() && siteDir.isDirectory() : "top site is missing or not a directory." File stageDir = new File( stageDirectory, "." ) diff --git a/src/it/projects/surefire-report/verify.groovy b/src/it/projects/surefire-report/verify.groovy index 65a8033f..e614baac 100644 --- a/src/it/projects/surefire-report/verify.groovy +++ b/src/it/projects/surefire-report/verify.groovy @@ -17,15 +17,15 @@ * specific language governing permissions and limitations * under the License. */ -assert new File( basedir, 'target/surefire-reports' ).exists(); -assert new File( basedir, 'target/surefire-reports/org.apache.maven.plugins.site.its.AppTest.txt' ).exists(); -content = new File( basedir, 'target/surefire-reports/org.apache.maven.plugins.site.its.AppTest.txt' ).text; +assert new File(basedir, 'target/surefire-reports').exists() +assert new File(basedir, 'target/surefire-reports/org.apache.maven.plugins.site.its.AppTest.txt').exists() +content = new File(basedir, 'target/surefire-reports/org.apache.maven.plugins.site.its.AppTest.txt').text -assert content.contains( 'Test set: org.apache.maven.plugins.site.its.AppTest' ); +assert content.contains('Test set: org.apache.maven.plugins.site.its.AppTest') -assert content.contains( 'Tests run: 1, Failures: 0, Errors: 0, Skipped: 0' ); +assert content.contains('Tests run: 1, Failures: 0, Errors: 0, Skipped: 0') -assert new File( basedir, 'target/site/surefire.html' ).exists(); -assert !new File( basedir, 'target/site/index.html' ).exists(); +assert new File(basedir, 'target/site/surefire.html').exists() +assert !new File(basedir, 'target/site/index.html').exists() -return true; +return true diff --git a/src/it/projects/template-skin/verify.groovy b/src/it/projects/template-skin/verify.groovy index 3320c4b6..7428a43b 100644 --- a/src/it/projects/template-skin/verify.groovy +++ b/src/it/projects/template-skin/verify.groovy @@ -18,11 +18,11 @@ * under the License. */ -File index = new File( basedir, "target/site/index.html" ) +File index = new File(basedir, "target/site/index.html") assert index.exists() && !index.isDirectory() : "no index file or is a directory." String content = index.getText('UTF-8') int index1 = content.indexOf( "dummy=value" ) -int index2 = content.indexOf( "att1=val1" ); // MSITE-550 +int index2 = content.indexOf( "att1=val1" ) // MSITE-550 assert index1 >= 0 && index2 >= 0 : "index.html not resolved!" diff --git a/src/it/projects/validate/verify.groovy b/src/it/projects/validate/verify.groovy index 87087b6b..6f3e8eec 100644 --- a/src/it/projects/validate/verify.groovy +++ b/src/it/projects/validate/verify.groovy @@ -17,6 +17,6 @@ * under the License. */ -buildlog = new File( basedir, 'build.log' ) +buildlog = new File(basedir, 'build.log') assert buildlog.text.contains('BUILD SUCCESS') \ No newline at end of file diff --git a/src/it/projects/velocity-tools/verify.groovy b/src/it/projects/velocity-tools/verify.groovy index 2da8a4d9..8238b16f 100644 --- a/src/it/projects/velocity-tools/verify.groovy +++ b/src/it/projects/velocity-tools/verify.groovy @@ -18,9 +18,9 @@ * under the License. */ -def content = new File( basedir, 'target/generated-site/processed/tools.apt' ).text +def content = new File(basedir, 'target/generated-site/processed/tools.apt').text -assert content.contains( 'configured=Hello tools.html' ) : 'custom SafeConfig tool must get its property and the context' +assert content.contains('configured=Hello tools.html') : 'custom SafeConfig tool must get its property and the context' assert content.contains( 'setter=5' ) : 'custom tool must be configured through its setter' assert content.contains( 'date=26/10/2026' ) : 'site-tools.xml must override the format of the date tool' assert content.contains( 'render=<b>' ) : 'render.eval must see the other tools'
