From bb8bb21da2472e626d3bb2ce6a92d0b5a7fb70d9 Mon Sep 17 00:00:00 2001 From: cs01lg Date: Fri, 10 Feb 2017 11:01:45 +0000 Subject: [PATCH] Add test for #46 where processDependencyManagement = true --- .../it-dependency-updates-report-004/pom.xml | 93 +++++++++++++++++++ .../verify.bsh | 33 +++++++ 2 files changed, 126 insertions(+) create mode 100644 src/it/it-dependency-updates-report-004/pom.xml create mode 100644 src/it/it-dependency-updates-report-004/verify.bsh diff --git a/src/it/it-dependency-updates-report-004/pom.xml b/src/it/it-dependency-updates-report-004/pom.xml new file mode 100644 index 0000000000..d86f020b4b --- /dev/null +++ b/src/it/it-dependency-updates-report-004/pom.xml @@ -0,0 +1,93 @@ + + 4.0.0 + localhost + it-dependency-updates-report-001 + 1.0 + pom + dependency-updates-report + http://localhost/ + + + true + + + + + + localhost + dummy-api + 2.0 + + + + + + localhost + dummy-api + 1.1 + + + + + + + localhost + dummy-maven-plugin + 1.0 + + + localhost + dummy-api + 1.1 + + + + + maven-clean-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-site-plugin + @sitePluginVersion@ + + + maven-project-info-reports-plugin + 2.1 + + + + + + + + + maven-project-info-reports-plugin + 2.1 + + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + + dependency-updates-report + + + + + + + diff --git a/src/it/it-dependency-updates-report-004/verify.bsh b/src/it/it-dependency-updates-report-004/verify.bsh new file mode 100644 index 0000000000..68f0bf3825 --- /dev/null +++ b/src/it/it-dependency-updates-report-004/verify.bsh @@ -0,0 +1,33 @@ +import java.io.*; +import org.codehaus.plexus.util.FileUtils; + +try +{ + File file = new File( basedir, "target/site/dependency-updates-report.html" ); + String buf = FileUtils.fileRead( file, "UTF-8" ); + + String result = buf.toString() + .replaceAll( "<[^>]+>", " " ) + .replaceAll( "&[^;]+;", " " ) + .replaceAll( "\\s+", " " ); + + if ( result.indexOf( "localhost dummy-api 1.1 compile jar 1.1.0-2 1.1.1 1.2 2.0" ) < 0 ) + { + System.out.println( "Did not pick up updated in dependencies section" ); + System.out.println( "Result = \"" + result +"\"" ); + return false; + } + if ( !result.contains("localhost dummy-api 2.0 jar 2.1 3.0")) + { + System.out.println( "Did not pick up updated in dependencies management section" ); + System.out.println( "Result = \"" + result +"\"" ); + return false; + } +} +catch( Throwable t ) +{ + t.printStackTrace(); + return false; +} + +return true;