maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdca...@apache.org
Subject svn commit: r611979 - in /maven/components/trunk/maven-embedder/src/test: error-reporting-projects/testReportErrorInterpolatingModel_UsingModelInstance/ error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/ error-reporting-pr...
Date Tue, 15 Jan 2008 00:39:05 GMT
Author: jdcasey
Date: Mon Jan 14 16:39:03 2008
New Revision: 611979

URL: http://svn.apache.org/viewvc?rev=611979&view=rev
Log:
more unit tests.

Added:
    maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingModelInstance/
    maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingModelInstance/pom.xml
  (with props)
    maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/
    maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/local-repo/
    maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/local-repo/org/
    maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/local-repo/org/test/
    maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/local-repo/org/test/bad-pom/
    maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/local-repo/org/test/bad-pom/1/
    maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/local-repo/org/test/bad-pom/1/bad-pom-1.pom
  (with props)
    maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/project/
    maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/project/pom.xml
  (with props)
    maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_IOException/
    maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_IOException/pom.xml
  (with props)
    maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_IOException/profiles.xml/
    maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_XmlPullParserException/
    maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_XmlPullParserException/pom.xml
  (with props)
    maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_XmlPullParserException/profiles.xml
  (with props)
Modified:
    maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/error/ErrorReporterPointcutTest.java

Added: maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingModelInstance/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingModelInstance/pom.xml?rev=611979&view=auto
==============================================================================
--- maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingModelInstance/pom.xml
(added)
+++ maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingModelInstance/pom.xml
Mon Jan 14 16:39:03 2008
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.errortest</groupId>
+  <artifactId>testReportErrorInterpolatingModel_UsingModelInstance</artifactId>
+  <version>${version}</version>
+
+</project>
\ No newline at end of file

Propchange: maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingModelInstance/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingModelInstance/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/local-repo/org/test/bad-pom/1/bad-pom-1.pom
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/local-repo/org/test/bad-pom/1/bad-pom-1.pom?rev=611979&view=auto
==============================================================================
--- maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/local-repo/org/test/bad-pom/1/bad-pom-1.pom
(added)
+++ maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/local-repo/org/test/bad-pom/1/bad-pom-1.pom
Mon Jan 14 16:39:03 2008
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.test</groupId>
+  <artifactId>bad-pom</artifactId>
+  <version>1</version>
+  
+  <packaging>${packaging}</packaging>
+
+</project>
\ No newline at end of file

Propchange: maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/local-repo/org/test/bad-pom/1/bad-pom-1.pom
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/local-repo/org/test/bad-pom/1/bad-pom-1.pom
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/project/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/project/pom.xml?rev=611979&view=auto
==============================================================================
--- maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/project/pom.xml
(added)
+++ maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/project/pom.xml
Mon Jan 14 16:39:03 2008
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.errortest</groupId>
+  <artifactId>testReportErrorInterpolatingModel_UsingProjectInstance</artifactId>
+  <version>1</version>
+  
+  <dependencies>
+    <dependency>
+      <groupId>org.test</groupId>
+      <artifactId>bad-pom</artifactId>
+      <version>1</version>
+      <type>pom</type>
+    </dependency>
+  </dependencies>
+
+</project>
\ No newline at end of file

Propchange: maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/project/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorInterpolatingModel_UsingProjectInstance/project/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_IOException/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_IOException/pom.xml?rev=611979&view=auto
==============================================================================
--- maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_IOException/pom.xml
(added)
+++ maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_IOException/pom.xml
Mon Jan 14 16:39:03 2008
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.errortest</groupId>
+  <artifactId>testReportErrorLoadingExternalProfilesFromFile_IOException</artifactId>
+  <version>1</version>
+  
+</project>
\ No newline at end of file

Propchange: maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_IOException/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_IOException/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_XmlPullParserException/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_XmlPullParserException/pom.xml?rev=611979&view=auto
==============================================================================
--- maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_XmlPullParserException/pom.xml
(added)
+++ maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_XmlPullParserException/pom.xml
Mon Jan 14 16:39:03 2008
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.errortest</groupId>
+  <artifactId>testReportErrorLoadingExternalProfilesFromFile_XmlPullParserException</artifactId>
+  <version>1</version>
+  
+</project>
\ No newline at end of file

Propchange: maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_XmlPullParserException/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_XmlPullParserException/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_XmlPullParserException/profiles.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_XmlPullParserException/profiles.xml?rev=611979&view=auto
==============================================================================
--- maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_XmlPullParserException/profiles.xml
(added)
+++ maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_XmlPullParserException/profiles.xml
Mon Jan 14 16:39:03 2008
@@ -0,0 +1,4 @@
+<profilesXml>
+  <profiles>
+  </profile>
+</profilesXml>
\ No newline at end of file

Propchange: maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_XmlPullParserException/profiles.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-embedder/src/test/error-reporting-projects/testReportErrorLoadingExternalProfilesFromFile_XmlPullParserException/profiles.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/error/ErrorReporterPointcutTest.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/error/ErrorReporterPointcutTest.java?rev=611979&r1=611978&r2=611979&view=diff
==============================================================================
--- maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/error/ErrorReporterPointcutTest.java
(original)
+++ maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/error/ErrorReporterPointcutTest.java
Mon Jan 14 16:39:03 2008
@@ -17,7 +17,6 @@
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.plugin.PluginManagerException;
 import org.apache.maven.settings.Settings;
-import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 import org.easymock.MockControl;
@@ -352,9 +351,34 @@
     }
 
     public void testReportErrorInterpolatingModel_UsingProjectInstance()
+        throws URISyntaxException, IOException
     {
-        // TODO Auto-generated method stub
+        if ( !checkOnline() )
+        {
+            return;
+        }
+
+        File projectDir = prepareProjectDir();
+        File localRepo = new File( projectDir, "local-repo" );
+        File project = new File( projectDir, "project" );
+
+        reporter.reportErrorInterpolatingModel( null, null, null );
+        reporterCtl.setMatcher( MockControl.ALWAYS_MATCHER );
+        reporterCtl.setVoidCallable();
+
+        reporterCtl.replay();
+
+        MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory(
project )
+                                                                          .setLocalRepositoryPath(
localRepo )
+                                                                          .setShowErrors(
true )
+                                                                          .setErrorReporter(
reporter )
+                                                                          .setGoals( Arrays.asList(
new String[] {
+                                                                              "compile"
+                                                                          } ) );
+
+        maven.execute( request );
 
+        reporterCtl.verify();
     }
 
     public void testReportErrorLoadingPlugin()
@@ -510,7 +534,6 @@
 
         MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory(
projectDir )
                                                                           .setShowErrors(
true )
-                                                                          .setLoggingLevel(
Logger.LEVEL_DEBUG )
                                                                           .setSettings( settings
)
                                                                           .setErrorReporter(
reporter )
                                                                           .setGoals( Arrays.asList(
new String[] {
@@ -640,27 +663,28 @@
         reporterCtl.verify();
     }
 
+    // FIXME: Get the wagon to fail (in a way other than 'not found')
     public void testReportProjectDependenciesUnresolvable()
         throws URISyntaxException, IOException
     {
-        File projectDir = prepareProjectDir();
-
-        reporter.reportProjectDependenciesUnresolvable( null, null, null );
-        reporterCtl.setMatcher( MockControl.ALWAYS_MATCHER );
-        reporterCtl.setVoidCallable();
-
-        reporterCtl.replay();
-
-        MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory(
projectDir )
-                                                                          .setShowErrors(
true )
-                                                                          .setErrorReporter(
reporter )
-                                                                          .setGoals( Arrays.asList(
new String[] {
-                                                                              "compile"
-                                                                          } ) );
-
-        maven.execute( request );
-
-        reporterCtl.verify();
+//        File projectDir = prepareProjectDir();
+//
+//        reporter.reportProjectDependenciesUnresolvable( null, null, null );
+//        reporterCtl.setMatcher( MockControl.ALWAYS_MATCHER );
+//        reporterCtl.setVoidCallable();
+//
+//        reporterCtl.replay();
+//
+//        MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory(
projectDir )
+//                                                                          .setShowErrors(
true )
+//                                                                          .setErrorReporter(
reporter )
+//                                                                          .setGoals( Arrays.asList(
new String[] {
+//                                                                              "compile"
+//                                                                          } ) );
+//
+//        maven.execute( request );
+//
+//        reporterCtl.verify();
     }
 
     public void testReportProjectMojoFailureException()
@@ -857,21 +881,72 @@
     }
 
     public void testReportErrorInterpolatingModel_UsingModelInstance()
+        throws URISyntaxException, IOException
     {
-        // TODO Auto-generated method stub
+        File projectDir = prepareProjectDir();
+
+        reporter.reportErrorInterpolatingModel( null, null, null, null, null );
+        reporterCtl.setMatcher( MockControl.ALWAYS_MATCHER );
+        reporterCtl.setVoidCallable();
 
+        reporterCtl.replay();
+
+        MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory(
projectDir )
+                                                                          .setShowErrors(
true )
+                                                                          .setErrorReporter(
reporter )
+                                                                          .setGoals( Arrays.asList(
new String[] {
+                                                                              "compile"
+                                                                          } ) );
+
+        maven.execute( request );
+
+        reporterCtl.verify();
     }
 
     public void testReportErrorLoadingExternalProfilesFromFile_XmlPullParserException()
+        throws URISyntaxException, IOException
     {
-        // TODO Auto-generated method stub
+        File projectDir = prepareProjectDir();
+
+        reporter.reportErrorLoadingExternalProfilesFromFile( null, null, null, (XmlPullParserException)
null );
+        reporterCtl.setMatcher( MockControl.ALWAYS_MATCHER );
+        reporterCtl.setVoidCallable();
+
+        reporterCtl.replay();
+
+        MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory(
projectDir )
+                                                                          .setShowErrors(
true )
+                                                                          .setErrorReporter(
reporter )
+                                                                          .setGoals( Arrays.asList(
new String[] {
+                                                                              "initialize"
+                                                                          } ) );
 
+        maven.execute( request );
+
+        reporterCtl.verify();
     }
 
     public void testReportErrorLoadingExternalProfilesFromFile_IOException()
+        throws URISyntaxException, IOException
     {
-        // TODO Auto-generated method stub
+        File projectDir = prepareProjectDir();
+
+        reporter.reportErrorLoadingExternalProfilesFromFile( null, null, null, (IOException)
null );
+        reporterCtl.setMatcher( MockControl.ALWAYS_MATCHER );
+        reporterCtl.setVoidCallable();
 
+        reporterCtl.replay();
+
+        MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory(
projectDir )
+                                                                          .setShowErrors(
true )
+                                                                          .setErrorReporter(
reporter )
+                                                                          .setGoals( Arrays.asList(
new String[] {
+                                                                              "initialize"
+                                                                          } ) );
+
+        maven.execute( request );
+
+        reporterCtl.verify();
     }
 
     public void testReportErrorParsingParentProjectModel_XmlPullParserException()
@@ -898,7 +973,6 @@
         reporterCtl.replay();
 
         MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory(
projectDir )
-                                                                          .setLoggingLevel(
Logger.LEVEL_DEBUG )
                                                                           .setShowErrors(
true )
                                                                           .setErrorReporter(
reporter )
                                                                           .setGoals( Arrays.asList(
new String[] {



Mime
View raw message