mirror of https://github.com/apache/maven.git
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:
parent
1071c589dc
commit
a07cafc3fa
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue