two more error-reporting unit tests.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@611992 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2008-01-15 01:32:58 +00:00
parent 1071c589dc
commit a07cafc3fa
5 changed files with 65 additions and 2 deletions

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?><project>
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>testReportErrorParsingParentProjectModel_IOException</artifactId>
<groupId>org.apache.maven.errortest</groupId>
<version>1</version>
</parent>
<artifactId>testReportErrorParsingParentProjectModel_IOException-child</artifactId>
</project>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?><project>
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>testReportErrorParsingParentProjectModel_XmlPullParserException</artifactId>
<groupId>org.apache.maven.errortest</groupId>
<version>1</version>
</parent>
<artifactId>testReportErrorParsingParentProjectModel_XmlPullParserException-child</artifactId>
</project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?><project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.errortest</groupId>
<artifactId>testReportErrorParsingParentProjectModel_XmlPullParserException</artifactId>
<version>1</ver>
</project>

View File

@ -950,15 +950,51 @@ public class ErrorReporterPointcutTest
} }
public void testReportErrorParsingParentProjectModel_XmlPullParserException() public void testReportErrorParsingParentProjectModel_XmlPullParserException()
throws URISyntaxException, IOException
{ {
// TODO Auto-generated method stub File projectDir = prepareProjectDir();
File childDir = new File( projectDir, "child" );
reporter.reportErrorParsingParentProjectModel( null, null, (XmlPullParserException) null );
reporterCtl.setMatcher( MockControl.ALWAYS_MATCHER );
reporterCtl.setVoidCallable();
reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( childDir )
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request );
reporterCtl.verify();
} }
public void testReportErrorParsingParentProjectModel_IOException() public void testReportErrorParsingParentProjectModel_IOException()
throws URISyntaxException, IOException
{ {
// TODO Auto-generated method stub File projectDir = prepareProjectDir();
File childDir = new File( projectDir, "child" );
reporter.reportErrorParsingParentProjectModel( null, null, (IOException) null );
reporterCtl.setMatcher( MockControl.ALWAYS_MATCHER );
reporterCtl.setVoidCallable();
reporterCtl.replay();
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory( childDir )
.setShowErrors( true )
.setErrorReporter( reporter )
.setGoals( Arrays.asList( new String[] {
"initialize"
} ) );
maven.execute( request );
reporterCtl.verify();
} }
public void testReportErrorParsingProjectModel_XmlPullParserException() public void testReportErrorParsingProjectModel_XmlPullParserException()