From 125fdc90e0252a410b35af2d6d306b04d1c3f6dc Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Sat, 14 Oct 2006 03:26:12 +0000 Subject: [PATCH] o create a top-level POM with a module listed for each of the ITs git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@463889 13f79535-47bb-0310-9956-ffa450edef68 --- mavenexecute.pl | 75 +++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 40 deletions(-) diff --git a/mavenexecute.pl b/mavenexecute.pl index df9d8c5cb3..6c3dbf3e5a 100644 --- a/mavenexecute.pl +++ b/mavenexecute.pl @@ -18,6 +18,16 @@ for $desc (@descriptions) { } system( "rm -rf $newITs" ); +system( "mkdir -p $newITs" ); + +open( POM, "> $newITs/pom.xml" ); +print POM "\n"; +print POM " 4.0.0\n"; +print POM " org.apache.maven.it\n"; +print POM " maven-core-its\n"; +print POM " 1.0-SNAPSHOT\n"; +print POM " pom\n"; +print POM " \n"; opendir(DIR, $dirname) or die "can't opendir $dirname: $!"; while (defined($filename = readdir(DIR))) { @@ -31,15 +41,19 @@ while (defined($filename = readdir(DIR))) { $fileGoals = "$dirname/$filename/goals.txt"; $fileExpectedResults = "$dirname/$filename/expected-results.txt"; $failOnErrorOutput = 1; + + print POM " $filename\n"; + if (!exists($comment{$filename})) { die "no comment: $filename\n"; } $itBaseDirectory = "$newITs/$filename"; $itPOM = "$itBaseDirectory/pom.xml"; - $itTestCaseDirectory = "$itBaseDirectory/src/test/java/org/apache/maven/it"; - $testFile = "$itTestCaseDirectory/MavenIntegrationTest_$filename" . ".java"; - $testProjectDirectory = "$itBaseDirectory/src/test-projects"; + $itTestCaseDirectory = "$itBaseDirectory/src/test/java/org/apache/maven/it"; + $itTestName = "Maven" . uc($filename) . "Test"; + $testFile = "$itTestCaseDirectory/$itTestName" . ".java"; + $testProjectDirectory = "$itBaseDirectory/src/test-project"; system( "mkdir -p $itTestCaseDirectory" ); system( "cp -r $dirname/$filename $testProjectDirectory" ); @@ -48,47 +62,25 @@ while (defined($filename = readdir(DIR))) { system( "rm $testProjectDirectory/verifier.properties > /dev/null 2>&1" ); system( "rm $testProjectDirectory/goals.txt > /dev/null 2>&1" ); system( "rm $testProjectDirectory/expected-results.txt > /dev/null 2>&1" ); + system( "rm $testProjectDirectory/prebuild-hook.txt > /dev/null 2>&1" ); system( "rm $testProjectDirectory/log.txt > /dev/null 2>&1" ); - open( P, "> $itPOM" ) or die; - + open( P, "> $itPOM" ) or die; print P "\n"; print P " 4.0.0\n"; print P " org.apache.maven.it\n"; print P " maven-core-it-$filename\n"; print P " 1.0-SNAPSHOT\n"; + print P " Maven Integration Tests :: $filename\n"; $build = < - - org.apache.maven - maven-core-it-verifier - 2.1-SNAPSHOT - - - - - - maven-invoker-plugin - - true - src/test-projects - - **/pom.xml - - - - - integration-test - integration-test - - run - - - - - - + + + org.apache.maven + maven-core-it-verifier + 2.1-SNAPSHOT + + EOF print P "$build"; @@ -100,12 +92,12 @@ EOF print T "package org.apache.maven.it;\n"; print T "import java.io.File;\n"; print T "import junit.framework.*;\n"; - print T "public class MavenIntegrationTest_${filename} extends TestCase /*extends AbstractMavenIntegrationTest*/ {\n"; + print T "public class $itTestName extends TestCase /*extends AbstractMavenIntegrationTest*/ {\n"; print T "/** $comment{$filename} */\n"; - print T "public void test_$filename() throws Exception {\n"; - print T "String rootdir = System.getProperty(\"rootdir\");\n"; - print T "File basedir = new File(rootdir, \"$filename\");\n"; - print T "Verifier verifier = new Verifier(basedir.getAbsolutePath());\n"; + print T "public void test$filename() throws Exception {\n"; + print T "String basedir = System.getProperty(\"basedir\");\n"; + print T "File testDir = new File(basedir, \"src\/test-project\");\n"; + print T "Verifier verifier = new Verifier(testDir.getAbsolutePath());\n"; if (-e "$filePrebuildHook") { open (FILE, "$filePrebuildHook"); @@ -222,6 +214,9 @@ EOF print T "}}\n\n"; } + +print POM " \n"; +print POM ""; print T $postamble;