From a07cafc3fad48a671e15d3400231b7195f29ea9e Mon Sep 17 00:00:00 2001 From: John Dennis Casey Date: Tue, 15 Jan 2008 01:32:58 +0000 Subject: [PATCH] two more error-reporting unit tests. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@611992 13f79535-47bb-0310-9956-ffa450edef68 --- .../child/pom.xml | 10 +++++ .../pom.xml | 0 .../child/pom.xml | 10 +++++ .../pom.xml | 7 ++++ .../error/ErrorReporterPointcutTest.java | 40 ++++++++++++++++++- 5 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 maven-embedder/src/test/error-reporting-projects/testReportErrorParsingParentProjectModel_IOException/child/pom.xml create mode 100644 maven-embedder/src/test/error-reporting-projects/testReportErrorParsingParentProjectModel_IOException/pom.xml create mode 100644 maven-embedder/src/test/error-reporting-projects/testReportErrorParsingParentProjectModel_XmlPullParserException/child/pom.xml create mode 100644 maven-embedder/src/test/error-reporting-projects/testReportErrorParsingParentProjectModel_XmlPullParserException/pom.xml diff --git a/maven-embedder/src/test/error-reporting-projects/testReportErrorParsingParentProjectModel_IOException/child/pom.xml b/maven-embedder/src/test/error-reporting-projects/testReportErrorParsingParentProjectModel_IOException/child/pom.xml new file mode 100644 index 0000000000..cd81abb339 --- /dev/null +++ b/maven-embedder/src/test/error-reporting-projects/testReportErrorParsingParentProjectModel_IOException/child/pom.xml @@ -0,0 +1,10 @@ + + 4.0.0 + + testReportErrorParsingParentProjectModel_IOException + org.apache.maven.errortest + 1 + + testReportErrorParsingParentProjectModel_IOException-child + + \ No newline at end of file diff --git a/maven-embedder/src/test/error-reporting-projects/testReportErrorParsingParentProjectModel_IOException/pom.xml b/maven-embedder/src/test/error-reporting-projects/testReportErrorParsingParentProjectModel_IOException/pom.xml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/maven-embedder/src/test/error-reporting-projects/testReportErrorParsingParentProjectModel_XmlPullParserException/child/pom.xml b/maven-embedder/src/test/error-reporting-projects/testReportErrorParsingParentProjectModel_XmlPullParserException/child/pom.xml new file mode 100644 index 0000000000..e6ae46bf39 --- /dev/null +++ b/maven-embedder/src/test/error-reporting-projects/testReportErrorParsingParentProjectModel_XmlPullParserException/child/pom.xml @@ -0,0 +1,10 @@ + + 4.0.0 + + testReportErrorParsingParentProjectModel_XmlPullParserException + org.apache.maven.errortest + 1 + + testReportErrorParsingParentProjectModel_XmlPullParserException-child + + \ No newline at end of file diff --git a/maven-embedder/src/test/error-reporting-projects/testReportErrorParsingParentProjectModel_XmlPullParserException/pom.xml b/maven-embedder/src/test/error-reporting-projects/testReportErrorParsingParentProjectModel_XmlPullParserException/pom.xml new file mode 100644 index 0000000000..b85840104b --- /dev/null +++ b/maven-embedder/src/test/error-reporting-projects/testReportErrorParsingParentProjectModel_XmlPullParserException/pom.xml @@ -0,0 +1,7 @@ + + 4.0.0 + org.apache.maven.errortest + testReportErrorParsingParentProjectModel_XmlPullParserException + 1 + + \ No newline at end of file diff --git a/maven-embedder/src/test/java/org/apache/maven/error/ErrorReporterPointcutTest.java b/maven-embedder/src/test/java/org/apache/maven/error/ErrorReporterPointcutTest.java index 5897d140bb..cf8d0c316c 100644 --- a/maven-embedder/src/test/java/org/apache/maven/error/ErrorReporterPointcutTest.java +++ b/maven-embedder/src/test/java/org/apache/maven/error/ErrorReporterPointcutTest.java @@ -950,15 +950,51 @@ public class ErrorReporterPointcutTest } 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() + 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()