You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2011/05/08 18:16:41 UTC

svn commit: r1100762 - in /maven/plugins/trunk/maven-project-info-reports-plugin/src/it: full-pom/pom.xml full-pom/verify.bsh minimal-pom/verify.bsh

Author: hboutemy
Date: Sun May  8 16:16:40 2011
New Revision: 1100762

URL: http://svn.apache.org/viewvc?rev=1100762&view=rev
Log:
[MPIR-182] added an IT for custom reports order, even if disabled since it doesn't work

Modified:
    maven/plugins/trunk/maven-project-info-reports-plugin/src/it/full-pom/pom.xml
    maven/plugins/trunk/maven-project-info-reports-plugin/src/it/full-pom/verify.bsh
    maven/plugins/trunk/maven-project-info-reports-plugin/src/it/minimal-pom/verify.bsh

Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/full-pom/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/it/full-pom/pom.xml?rev=1100762&r1=1100761&r2=1100762&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/it/full-pom/pom.xml (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/it/full-pom/pom.xml Sun May  8 16:16:40 2011
@@ -180,6 +180,25 @@
           <introduction>mail list intro text foo</introduction>
           <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
         </configuration>
+        <reportSets>
+          <reportSet>
+            <reports>
+              <report>index</report>
+              <report>summary</report>
+              <report>license</report>
+              <report>project-team</report>
+              <report>scm</report>
+              <report>issue-tracking</report>
+              <report>mailing-list</report>
+              <report>dependency-management</report>
+              <report>dependencies</report>
+              <report>cim</report>
+              <report>plugin-management</report>
+              <report>plugins</report>
+              <report>distribution-management</report>
+            </reports>
+          </reportSet>
+        </reportSets>
       </plugin>
     </plugins>
   </reporting>

Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/full-pom/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/it/full-pom/verify.bsh?rev=1100762&r1=1100761&r2=1100762&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/it/full-pom/verify.bsh (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/it/full-pom/verify.bsh Sun May  8 16:16:40 2011
@@ -31,19 +31,24 @@ try
         return false;
     }
 
-    String[] reports = { "dependencies",
-                         "index",
-                         "integration",
-                         "issue-tracking",
-                         "license",
-                         "mail-lists",
-                         "plugin-management",
-                         "plugins",
-                         "project-info",
-                         "project-summary",
-                         "source-repository",
-                         "team-list"
+    String[] reports = { "index",                  // <report>index</report>
+                         "project-summary",        // <report>summary</report>
+                         "license",                // <report>license</report>
+                         "team-list",              // <report>project-team</report>
+                         "source-repository",      // <report>scm</report>
+                         "issue-tracking",         // <report>issue-tracking</report>
+                         "mail-lists",             // <report>mailing-list</report>
+                         "dependency-management",  // <report>dependency-management</report>
+                         "dependencies",           // <report>dependencies</report>
+                         "integration",            // <report>cim</report>
+                         "plugin-management",      // <report>plugin-management</report>
+                         "plugins",                // <report>plugins</report>
+                         "distribution-management" // <report>distribution-management</report>
                        };
+    String info = FileUtils.fileRead( new File( siteDir, "project-info.html"), "UTF-8" );
+    int index1 = 10;
+    int index2 = 10;
+    String previousReportLink;
     for ( String report : reports )
     {
         File reportFile = new File( siteDir, report + ".html" );
@@ -52,6 +57,27 @@ try
             System.out.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 )
+        {
+            System.out.println( "Wrong order for first report link: expected " + previousReportLink + " -> " + link + ", but found " + i1 + " < " + index1 );
+            System.out.println( "   previous report link: " + info.substring( index1 - 10, index1 + 70 ) );
+            System.out.println( "     actual report link: " + info.substring( i1 - 10, i1 + 70 ) );
+            //return false; // test known to fail: MPIR-182
+        }
+        if ( i2 < index2 )
+        {
+            System.out.println( "Wrong order for second report link: expected " + previousReportLink + " -> " + link + ", but found " + i2 + " < " + index2 );
+            System.out.println( "   previous report link: " + info.substring( index2 - 10, index2 + 70 ) );
+            System.out.println( "     actual report link: " + info.substring( i2 - 10, i2 + 70 ) );
+            //return false; // test known to fail: MPIR-182
+        }
+        index1 = i1;
+        index2 = i2;
+        previousReportLink = link;
     }
 
     File maillist = new File( siteDir, "mail-lists.html");

Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/minimal-pom/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/it/minimal-pom/verify.bsh?rev=1100762&r1=1100761&r2=1100762&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/it/minimal-pom/verify.bsh (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/it/minimal-pom/verify.bsh Sun May  8 16:16:40 2011
@@ -41,7 +41,8 @@ try
                          "project-info",
                          "project-summary",
                          "source-repository",
-                         "team-list"
+                         "team-list",
+                         "distribution-management"
                        };
     for ( String report : reports )
     {