Author: olamy Date: Tue Nov 8 12:47:59 2011 New Revision: 1199220 URL: http://svn.apache.org/viewvc?rev=1199220&view=rev Log: improve it to test the verify script feature
Added: maven/archetype/trunk/maven-archetype-plugin/src/it/build-archetype/src/test/resources/projects/basic/verify.groovy (with props) maven/archetype/trunk/maven-archetype-plugin/src/it/build-archetype/test-settings.xml (with props) Modified: maven/archetype/trunk/maven-archetype-plugin/src/it/build-archetype/verify.bsh Added: maven/archetype/trunk/maven-archetype-plugin/src/it/build-archetype/src/test/resources/projects/basic/verify.groovy URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype-plugin/src/it/build-archetype/src/test/resources/projects/basic/verify.groovy?rev=1199220&view=auto ============================================================================== --- maven/archetype/trunk/maven-archetype-plugin/src/it/build-archetype/src/test/resources/projects/basic/verify.groovy (added) +++ maven/archetype/trunk/maven-archetype-plugin/src/it/build-archetype/src/test/resources/projects/basic/verify.groovy Tue Nov 8 12:47:59 2011 @@ -0,0 +1 @@ +System.out.println(" Yeah Baby it rocks!") \ No newline at end of file Propchange: maven/archetype/trunk/maven-archetype-plugin/src/it/build-archetype/src/test/resources/projects/basic/verify.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/archetype/trunk/maven-archetype-plugin/src/it/build-archetype/src/test/resources/projects/basic/verify.groovy ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/archetype/trunk/maven-archetype-plugin/src/it/build-archetype/test-settings.xml URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype-plugin/src/it/build-archetype/test-settings.xml?rev=1199220&view=auto ============================================================================== --- maven/archetype/trunk/maven-archetype-plugin/src/it/build-archetype/test-settings.xml (added) +++ maven/archetype/trunk/maven-archetype-plugin/src/it/build-archetype/test-settings.xml Tue Nov 8 12:47:59 2011 @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +<settings> + <profiles> + <profile> + <id>it-repo</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <repositories> + <repository> + <id>local.central</id> + <url>@localRepositoryUrl@</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>local.central</id> + <url>@localRepositoryUrl@</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + </profile> + </profiles> +</settings> \ No newline at end of file Propchange: maven/archetype/trunk/maven-archetype-plugin/src/it/build-archetype/test-settings.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/archetype/trunk/maven-archetype-plugin/src/it/build-archetype/test-settings.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Modified: maven/archetype/trunk/maven-archetype-plugin/src/it/build-archetype/verify.bsh URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype-plugin/src/it/build-archetype/verify.bsh?rev=1199220&r1=1199219&r2=1199220&view=diff ============================================================================== --- maven/archetype/trunk/maven-archetype-plugin/src/it/build-archetype/verify.bsh (original) +++ maven/archetype/trunk/maven-archetype-plugin/src/it/build-archetype/verify.bsh Tue Nov 8 12:47:59 2011 @@ -19,6 +19,7 @@ */ import java.io.*; +import org.codehaus.plexus.util.*; basedir = new File( basedir, "target/test-classes/projects/basic/project/basic" ); @@ -63,4 +64,12 @@ if ( !appClass.isFile() ) throw new Exception( appClass + " not here: generated project not compiled?" ); } -return true; +File buildLog = new File(basedir, "build.log"); + +String content = FileUtils.fileRead( buildLog, "UTF-8" ); + +int idx = content.indexOf( "Yeah Baby it rocks!"); +if ( idx < 0 ) +{ + throw new Exception( "build.log missing out.println from verify.groovy" ); +}