This is an automated email from the ASF dual-hosted git repository. michaelo pushed a commit to branch use-groovy-features in repository https://gitbox.apache.org/repos/asf/maven-fluido-skin.git
commit 24e184897c23fcb475a5d31cd141ff03a73dcda5 Author: Michael Osipov <micha...@apache.org> AuthorDate: Sat Jan 28 23:58:12 2023 +0100 Simplify IT verification with more Groovy features --- src/it/mskins-10/verify.groovy | 2 +- src/it/mskins-107/verify.groovy | 2 +- src/it/mskins-13/verify.groovy | 2 +- src/it/mskins-143_default/verify.groovy | 8 ++++---- src/it/mskins-143_false/verify.groovy | 8 ++++---- src/it/mskins-143_true/verify.groovy | 8 ++++---- src/it/mskins-17/verify.groovy | 2 +- src/it/mskins-174/verify.groovy | 2 +- src/it/mskins-177-apache-analytics/verify.groovy | 14 +++++++------- src/it/mskins-177-matomo-no-options/verify.groovy | 14 +++++++------- src/it/mskins-47/verify.groovy | 2 +- src/it/mskins-72/verify.groovy | 2 +- src/it/mskins-76/verify.groovy | 10 +++++----- src/it/mskins-76_topbar/verify.groovy | 10 +++++----- src/it/sidebar/verify.groovy | 2 +- src/it/topbar/verify.groovy | 2 +- 16 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/it/mskins-10/verify.groovy b/src/it/mskins-10/verify.groovy index dc3549c..613fed9 100644 --- a/src/it/mskins-10/verify.groovy +++ b/src/it/mskins-10/verify.groovy @@ -19,4 +19,4 @@ File index = new File( basedir, "target/site/index.html" ) assert index.exists() -assert 1 == index.getText().count( 'Generated by Apache Maven Doxia ' ) \ No newline at end of file +assert index.text.contains( 'Generated by Apache Maven Doxia ' ) \ No newline at end of file diff --git a/src/it/mskins-107/verify.groovy b/src/it/mskins-107/verify.groovy index 4d32471..9bc5604 100644 --- a/src/it/mskins-107/verify.groovy +++ b/src/it/mskins-107/verify.groovy @@ -20,4 +20,4 @@ File index = new File( basedir, "target/site/index.html" ) assert index.exists() -assert 1 == index.getText().count("<meta name=\"generator\" content=\"Apache Maven Doxia Site Renderer 2.0.0-M4\" />") +assert index.text.contains("<meta name=\"generator\" content=\"Apache Maven Doxia Site Renderer 2.0.0-M4\" />") diff --git a/src/it/mskins-13/verify.groovy b/src/it/mskins-13/verify.groovy index 94f5619..12d809e 100644 --- a/src/it/mskins-13/verify.groovy +++ b/src/it/mskins-13/verify.groovy @@ -19,4 +19,4 @@ File index = new File( basedir, "target/site/index.html" ) assert index.exists() -assert 0 == index.getText().count( 'Generated by Apache Maven Doxia at' ) \ No newline at end of file +assert !index.text.contains( 'Generated by Apache Maven Doxia at' ) \ No newline at end of file diff --git a/src/it/mskins-143_default/verify.groovy b/src/it/mskins-143_default/verify.groovy index d561d4f..794a4b6 100644 --- a/src/it/mskins-143_default/verify.groovy +++ b/src/it/mskins-143_default/verify.groovy @@ -19,7 +19,7 @@ File index = new File( basedir, "target/site/index.html" ) assert index.exists() -assert 0 == index.getText().count( '_gaq.push([\'_setAccount\', \'FOO-BAR\']);' ) -assert 1 == index.getText().count( 'ga(\'create\', \'FOO-BAR\', \'auto\');' ) -assert 1 == index.getText().count( 'ga(\'set\', \'anonymizeIp\', true);' ) -assert 1 == index.getText().count( 'ga(\'set\', \'forceSSL\', true);' ) \ No newline at end of file +assert !index.text.contains( '_gaq.push([\'_setAccount\', \'FOO-BAR\']);' ) +assert index.text.contains( 'ga(\'create\', \'FOO-BAR\', \'auto\');' ) +assert index.text.contains( 'ga(\'set\', \'anonymizeIp\', true);' ) +assert index.text.contains( 'ga(\'set\', \'forceSSL\', true);' ) \ No newline at end of file diff --git a/src/it/mskins-143_false/verify.groovy b/src/it/mskins-143_false/verify.groovy index 7a4559d..2547ed8 100644 --- a/src/it/mskins-143_false/verify.groovy +++ b/src/it/mskins-143_false/verify.groovy @@ -19,7 +19,7 @@ File index = new File( basedir, "target/site/index.html" ) assert index.exists() -assert 0 == index.getText().count( '_gaq.push([\'_setAccount\', \'FOO-BAR\']);' ) -assert 1 == index.getText().count( 'ga(\'create\', \'FOO-BAR\', \'auto\');' ) -assert 0 == index.getText().count( 'ga(\'set\', \'anonymizeIp\', true);' ) -assert 0 == index.getText().count( 'ga(\'set\', \'forceSSL\', true);' ) \ No newline at end of file +assert !index.text.contains( '_gaq.push([\'_setAccount\', \'FOO-BAR\']);' ) +assert index.text.contains( 'ga(\'create\', \'FOO-BAR\', \'auto\');' ) +assert !index.text.contains( 'ga(\'set\', \'anonymizeIp\', true);' ) +assert !index.text.contains( 'ga(\'set\', \'forceSSL\', true);' ) \ No newline at end of file diff --git a/src/it/mskins-143_true/verify.groovy b/src/it/mskins-143_true/verify.groovy index d561d4f..794a4b6 100644 --- a/src/it/mskins-143_true/verify.groovy +++ b/src/it/mskins-143_true/verify.groovy @@ -19,7 +19,7 @@ File index = new File( basedir, "target/site/index.html" ) assert index.exists() -assert 0 == index.getText().count( '_gaq.push([\'_setAccount\', \'FOO-BAR\']);' ) -assert 1 == index.getText().count( 'ga(\'create\', \'FOO-BAR\', \'auto\');' ) -assert 1 == index.getText().count( 'ga(\'set\', \'anonymizeIp\', true);' ) -assert 1 == index.getText().count( 'ga(\'set\', \'forceSSL\', true);' ) \ No newline at end of file +assert !index.text.contains( '_gaq.push([\'_setAccount\', \'FOO-BAR\']);' ) +assert index.text.contains( 'ga(\'create\', \'FOO-BAR\', \'auto\');' ) +assert index.text.contains( 'ga(\'set\', \'anonymizeIp\', true);' ) +assert index.text.contains( 'ga(\'set\', \'forceSSL\', true);' ) \ No newline at end of file diff --git a/src/it/mskins-17/verify.groovy b/src/it/mskins-17/verify.groovy index 0a99140..865757c 100644 --- a/src/it/mskins-17/verify.groovy +++ b/src/it/mskins-17/verify.groovy @@ -19,4 +19,4 @@ File index = new File( basedir, "target/site/index.html" ) assert index.exists() -assert 1 == index.getText().count( '<li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 1970-01-01</li>' ) \ No newline at end of file +assert index.text.contains( '<li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 1970-01-01</li>' ) \ No newline at end of file diff --git a/src/it/mskins-174/verify.groovy b/src/it/mskins-174/verify.groovy index 0e8f566..bf7a685 100644 --- a/src/it/mskins-174/verify.groovy +++ b/src/it/mskins-174/verify.groovy @@ -19,4 +19,4 @@ File index = new File( basedir, "target/site/index.html" ) assert index.exists() -assert !index.getText().contains( '<div id="breadcrumbs">') +assert !index.text.contains( '<div id="breadcrumbs">') diff --git a/src/it/mskins-177-apache-analytics/verify.groovy b/src/it/mskins-177-apache-analytics/verify.groovy index e0a6415..7112448 100644 --- a/src/it/mskins-177-apache-analytics/verify.groovy +++ b/src/it/mskins-177-apache-analytics/verify.groovy @@ -19,10 +19,10 @@ File index = new File( basedir, "target/site/index.html" ) assert index.exists() -assert index.getText().contains( 'var u=\"https://analytics.apache.org\";') -assert index.getText().contains( '_paq.push([\'setSiteId\', \'3\']);') -assert index.getText().contains( '_paq.push([\'setTrackerUrl\', u+\'/matomo.php\']'); -assert index.getText().contains( '_paq.push([\'disableCookies\']);') -assert index.getText().contains( '_paq.push([\'trackPageView\']);') -assert index.getText().contains( '_paq.push([\'enableLinkTracking\']);') -assert index.getText().contains( '_paq.push([\'foo\', \'Bar\']);') \ No newline at end of file +assert index.text.contains( 'var u=\"https://analytics.apache.org\";') +assert index.text.contains( '_paq.push([\'setSiteId\', \'3\']);') +assert index.text.contains( '_paq.push([\'setTrackerUrl\', u+\'/matomo.php\']'); +assert index.text.contains( '_paq.push([\'disableCookies\']);') +assert index.text.contains( '_paq.push([\'trackPageView\']);') +assert index.text.contains( '_paq.push([\'enableLinkTracking\']);') +assert index.text.contains( '_paq.push([\'foo\', \'Bar\']);') \ No newline at end of file diff --git a/src/it/mskins-177-matomo-no-options/verify.groovy b/src/it/mskins-177-matomo-no-options/verify.groovy index ae47ac2..bb53086 100644 --- a/src/it/mskins-177-matomo-no-options/verify.groovy +++ b/src/it/mskins-177-matomo-no-options/verify.groovy @@ -19,10 +19,10 @@ File index = new File( basedir, "target/site/index.html" ) assert index.exists() -assert index.getText().contains( 'var u=\"https://analytics.apache.org\";') -assert index.getText().contains( '_paq.push([\'setSiteId\', \'3\']);') -assert index.getText().contains( '_paq.push([\'setTrackerUrl\', u+\'/matomo.php\']'); -assert !index.getText().contains( '_paq.push([\'disableCookies\']);') -assert !index.getText().contains( '_paq.push([\'trackPageView\']);') -assert !index.getText().contains( '_paq.push([\'enableLinkTracking\']);') -assert !index.getText().contains( '_paq.push([\'foo\', \'Bar\']);') \ No newline at end of file +assert index.text.contains( 'var u=\"https://analytics.apache.org\";') +assert index.text.contains( '_paq.push([\'setSiteId\', \'3\']);') +assert index.text.contains( '_paq.push([\'setTrackerUrl\', u+\'/matomo.php\']'); +assert !index.text.contains( '_paq.push([\'disableCookies\']);') +assert !index.text.contains( '_paq.push([\'trackPageView\']);') +assert !index.text.contains( '_paq.push([\'enableLinkTracking\']);') +assert !index.text.contains( '_paq.push([\'foo\', \'Bar\']);') \ No newline at end of file diff --git a/src/it/mskins-47/verify.groovy b/src/it/mskins-47/verify.groovy index 4556bec..ae82f2a 100644 --- a/src/it/mskins-47/verify.groovy +++ b/src/it/mskins-47/verify.groovy @@ -19,4 +19,4 @@ File index = new File( basedir, "target/site/index.html" ) assert index.exists() -assert !index.getText().contains( '$headContent' ) \ No newline at end of file +assert !index.text.contains( '$headContent' ) \ No newline at end of file diff --git a/src/it/mskins-72/verify.groovy b/src/it/mskins-72/verify.groovy index 176e8f8..1b663b5 100644 --- a/src/it/mskins-72/verify.groovy +++ b/src/it/mskins-72/verify.groovy @@ -21,4 +21,4 @@ File index = new File( basedir, "target/site/index.html" ) int inceptionYear = 2002 int currentYear = Calendar.getInstance().get(Calendar.YEAR) assert index.exists() -assert 1 == index.getText().count( "<p class=\"pull-right\">©" ) +assert index.text.contains( "<p class=\"pull-right\">©" ) diff --git a/src/it/mskins-76/verify.groovy b/src/it/mskins-76/verify.groovy index 9d4deec..7b6983e 100644 --- a/src/it/mskins-76/verify.groovy +++ b/src/it/mskins-76/verify.groovy @@ -19,8 +19,8 @@ File index = new File( basedir, "target/site/index.html" ) assert index.exists() -String text = index.getText().replaceAll( "\r?\n", System.lineSeparator() ) -assert 1 == text.count( '''\ +String text = index.text.normalize() +assert text.contains( '''\ <script> /* <![CDATA[ */ (function() { @@ -29,9 +29,9 @@ assert 1 == text.count( '''\ s.src = 'https://api.flattr.com/js/0.6/load.js?mode=auto'; t.parentNode.insertBefore(s, t); })(); - /* ]]> */</script>'''.replaceAll( "\r?\n", System.lineSeparator() ) ) + /* ]]> */</script>'''.normalize() ) -assert 1 == text.count( '''\ +assert text.contains( '''\ <a class="FlattrButton" style="display:none;" href="http://opensource.org/"></a> <noscript><a href="https://flattr.com/thing/448050/Open-Source-Initiative-OSI" target="_blank"> - <img src="https://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" style="border: 0;" /></a></noscript>'''.replaceAll( "\r?\n", System.lineSeparator() ) ) + <img src="https://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" style="border: 0;" /></a></noscript>'''.normalize() ) diff --git a/src/it/mskins-76_topbar/verify.groovy b/src/it/mskins-76_topbar/verify.groovy index bf651d0..4ea467d 100644 --- a/src/it/mskins-76_topbar/verify.groovy +++ b/src/it/mskins-76_topbar/verify.groovy @@ -19,8 +19,8 @@ File index = new File( basedir, "target/site/index.html" ) assert index.exists() -String text = index.getText().replaceAll( "\r?\n", System.lineSeparator() ) -assert 1 == text.count( '''\ +String text = index.text.normalize() +assert text.contains( '''\ <script> /* <![CDATA[ */ (function() { @@ -29,9 +29,9 @@ assert 1 == text.count( '''\ s.src = 'https://api.flattr.com/js/0.6/load.js?mode=auto'; t.parentNode.insertBefore(s, t); })(); - /* ]]> */</script>'''.replaceAll( "\r?\n", System.lineSeparator() ) ) + /* ]]> */</script>'''.normalize() ) -assert 1 == text.count( '''\ +assert text.contains( '''\ <a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="http://opensource.org/"></a> <noscript><a href="https://flattr.com/thing/448050/Open-Source-Initiative-OSI" target="_blank"> - <img src="https://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" style="border: 0;" /></a></noscript>'''.replaceAll( "\r?\n", System.lineSeparator() ) ) + <img src="https://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" style="border: 0;" /></a></noscript>'''.normalize() ) diff --git a/src/it/sidebar/verify.groovy b/src/it/sidebar/verify.groovy index 66defc8..98b6cab 100644 --- a/src/it/sidebar/verify.groovy +++ b/src/it/sidebar/verify.groovy @@ -21,7 +21,7 @@ File index = new File( basedir, "target/site/index.html" ) assert index.exists() // MSKINS-130 check that html structure is as clean as possible -String html = index.getText() +String html = index.text // active menu assert html.contains( '<li class="active"><a><span class="none"></span>About</a>' ) // inactive menu diff --git a/src/it/topbar/verify.groovy b/src/it/topbar/verify.groovy index 9cef326..82704fd 100644 --- a/src/it/topbar/verify.groovy +++ b/src/it/topbar/verify.groovy @@ -21,7 +21,7 @@ File index = new File( basedir, "target/site/index.html" ) assert index.exists() // MSKINS-130 check that html structure is as clean as possible -String html = index.getText() +String html = index.text // active menu assert html.contains( '<li><a title="About">About</a></li>' ) // inactive menu