elharo commented on a change in pull request #9:
URL: https://github.com/apache/maven-verifier/pull/9#discussion_r823641093



##########
File path: src/main/java/org/apache/maven/it/Verifier.java
##########
@@ -1007,11 +1007,27 @@ public Properties newDefaultFilterProperties()
         return filterProperties;
     }
 
+    /**
+     * Verifies that the given file exists

Review comment:
       nit: period and blank line at end of sentence

##########
File path: src/main/java/org/apache/maven/it/Verifier.java
##########
@@ -1020,66 +1036,146 @@ public void assertFilePresent( String file )
     }
 
     /**
-     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists
-     * and is readable.
+     * Verifies that given file's content matches an regular expression. 
+     * Note this method also checks that the file exists and is readable.
      *
-     * @param file  the file to check.
-     * @param regex a regular expression.
+     * @param file the path of the file to check
+     * @param regex a regular expression
+     * @throws VerificationException in case the file was not found or its 
content does not match the given pattern
      * @see Pattern
      */
-    public void assertFileMatches( String file, String regex )
+    public void verifyFileContentMatches( String file, String regex ) throws 
VerificationException
     {
-        assertFilePresent( file );
+        verifyFilePresent( file );
         try
         {
             String content = FileUtils.fileRead( file );
             if ( !Pattern.matches( regex, content ) )
             {
-                Assert.fail( "Content of " + file + " does not match " + regex 
);
+                throw new VerificationException( "Content of " + file + " does 
not match " + regex );
             }
         }
         catch ( IOException e )
+        {
+            throw new VerificationException( "Could not read from " + file + 
":" + e.getMessage(), e );
+        }
+    }
+
+    /**
+     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists
+     * and is readable.
+     *
+     * @param file the path of the file to check
+     * @param regex a regular expression

Review comment:
       a regular expression that the file's contents should match 

##########
File path: src/main/java/org/apache/maven/it/Verifier.java
##########
@@ -1020,66 +1036,146 @@ public void assertFilePresent( String file )
     }
 
     /**
-     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists
-     * and is readable.
+     * Verifies that given file's content matches an regular expression. 
+     * Note this method also checks that the file exists and is readable.
      *
-     * @param file  the file to check.
-     * @param regex a regular expression.
+     * @param file the path of the file to check
+     * @param regex a regular expression
+     * @throws VerificationException in case the file was not found or its 
content does not match the given pattern
      * @see Pattern
      */
-    public void assertFileMatches( String file, String regex )
+    public void verifyFileContentMatches( String file, String regex ) throws 
VerificationException
     {
-        assertFilePresent( file );
+        verifyFilePresent( file );
         try
         {
             String content = FileUtils.fileRead( file );
             if ( !Pattern.matches( regex, content ) )
             {
-                Assert.fail( "Content of " + file + " does not match " + regex 
);
+                throw new VerificationException( "Content of " + file + " does 
not match " + regex );
             }
         }
         catch ( IOException e )
+        {
+            throw new VerificationException( "Could not read from " + file + 
":" + e.getMessage(), e );

Review comment:
       space after colon; i.e. ": "

##########
File path: src/main/java/org/apache/maven/it/Verifier.java
##########
@@ -1020,66 +1036,146 @@ public void assertFilePresent( String file )
     }
 
     /**
-     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists
-     * and is readable.
+     * Verifies that given file's content matches an regular expression. 
+     * Note this method also checks that the file exists and is readable.
      *
-     * @param file  the file to check.
-     * @param regex a regular expression.
+     * @param file the path of the file to check
+     * @param regex a regular expression
+     * @throws VerificationException in case the file was not found or its 
content does not match the given pattern
      * @see Pattern
      */
-    public void assertFileMatches( String file, String regex )
+    public void verifyFileContentMatches( String file, String regex ) throws 
VerificationException
     {
-        assertFilePresent( file );
+        verifyFilePresent( file );
         try
         {
             String content = FileUtils.fileRead( file );
             if ( !Pattern.matches( regex, content ) )
             {
-                Assert.fail( "Content of " + file + " does not match " + regex 
);
+                throw new VerificationException( "Content of " + file + " does 
not match " + regex );
             }
         }
         catch ( IOException e )
+        {
+            throw new VerificationException( "Could not read from " + file + 
":" + e.getMessage(), e );
+        }
+    }
+
+    /**
+     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists
+     * and is readable.
+     *
+     * @param file the path of the file to check
+     * @param regex a regular expression
+     * @see Pattern
+     * @deprecated Use {@link #verifyFileContentMatches(String, String)} 
instead.
+     */
+    @Deprecated
+    public void assertFileMatches( String file, String regex )
+    {
+        try
+        {
+            verifyFileContentMatches( file, regex );
+        }
+        catch ( VerificationException e )
         {
             Assert.fail( e.getMessage() );
         }
     }
 
+    /**
+     * Verifies that the given file does not exist

Review comment:
       . line break

##########
File path: src/main/java/org/apache/maven/it/Verifier.java
##########
@@ -1020,66 +1036,146 @@ public void assertFilePresent( String file )
     }
 
     /**
-     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists
-     * and is readable.
+     * Verifies that given file's content matches an regular expression. 
+     * Note this method also checks that the file exists and is readable.
      *
-     * @param file  the file to check.
-     * @param regex a regular expression.
+     * @param file the path of the file to check
+     * @param regex a regular expression
+     * @throws VerificationException in case the file was not found or its 
content does not match the given pattern
      * @see Pattern
      */
-    public void assertFileMatches( String file, String regex )
+    public void verifyFileContentMatches( String file, String regex ) throws 
VerificationException
     {
-        assertFilePresent( file );
+        verifyFilePresent( file );
         try
         {
             String content = FileUtils.fileRead( file );
             if ( !Pattern.matches( regex, content ) )
             {
-                Assert.fail( "Content of " + file + " does not match " + regex 
);
+                throw new VerificationException( "Content of " + file + " does 
not match " + regex );
             }
         }
         catch ( IOException e )
+        {
+            throw new VerificationException( "Could not read from " + file + 
":" + e.getMessage(), e );
+        }
+    }
+
+    /**
+     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists

Review comment:
       the given file's
   a regular

##########
File path: src/main/java/org/apache/maven/it/Verifier.java
##########
@@ -1020,66 +1036,146 @@ public void assertFilePresent( String file )
     }
 
     /**
-     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists
-     * and is readable.
+     * Verifies that given file's content matches an regular expression. 
+     * Note this method also checks that the file exists and is readable.
      *
-     * @param file  the file to check.
-     * @param regex a regular expression.
+     * @param file the path of the file to check
+     * @param regex a regular expression
+     * @throws VerificationException in case the file was not found or its 
content does not match the given pattern
      * @see Pattern
      */
-    public void assertFileMatches( String file, String regex )
+    public void verifyFileContentMatches( String file, String regex ) throws 
VerificationException
     {
-        assertFilePresent( file );
+        verifyFilePresent( file );
         try
         {
             String content = FileUtils.fileRead( file );
             if ( !Pattern.matches( regex, content ) )
             {
-                Assert.fail( "Content of " + file + " does not match " + regex 
);
+                throw new VerificationException( "Content of " + file + " does 
not match " + regex );
             }
         }
         catch ( IOException e )
+        {
+            throw new VerificationException( "Could not read from " + file + 
":" + e.getMessage(), e );
+        }
+    }
+
+    /**
+     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists
+     * and is readable.
+     *
+     * @param file the path of the file to check
+     * @param regex a regular expression
+     * @see Pattern
+     * @deprecated Use {@link #verifyFileContentMatches(String, String)} 
instead.
+     */
+    @Deprecated
+    public void assertFileMatches( String file, String regex )
+    {
+        try
+        {
+            verifyFileContentMatches( file, regex );
+        }
+        catch ( VerificationException e )
         {
             Assert.fail( e.getMessage() );
         }
     }
 
+    /**
+     * Verifies that the given file does not exist
+     * @param file the path of the file to check
+     * @throws VerificationException in case the given file exists
+     */
+    public void verifyFileNotPresent( String file ) throws 
VerificationException
+    {
+        verifyFilePresence( file, false );
+    }
+
+    /**
+     * 
+     * @param file the path of the file to check
+     * @deprecated Use {@link #verifyFileNotPresent(String)} instead.
+     */

Review comment:
       Do we use `@Deprecated` annotations? I'm not sure.

##########
File path: src/main/java/org/apache/maven/it/Verifier.java
##########
@@ -1020,66 +1036,146 @@ public void assertFilePresent( String file )
     }
 
     /**
-     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists
-     * and is readable.
+     * Verifies that given file's content matches an regular expression. 
+     * Note this method also checks that the file exists and is readable.
      *
-     * @param file  the file to check.
-     * @param regex a regular expression.
+     * @param file the path of the file to check
+     * @param regex a regular expression
+     * @throws VerificationException in case the file was not found or its 
content does not match the given pattern
      * @see Pattern
      */
-    public void assertFileMatches( String file, String regex )
+    public void verifyFileContentMatches( String file, String regex ) throws 
VerificationException
     {
-        assertFilePresent( file );
+        verifyFilePresent( file );
         try
         {
             String content = FileUtils.fileRead( file );
             if ( !Pattern.matches( regex, content ) )
             {
-                Assert.fail( "Content of " + file + " does not match " + regex 
);
+                throw new VerificationException( "Content of " + file + " does 
not match " + regex );
             }
         }
         catch ( IOException e )
+        {
+            throw new VerificationException( "Could not read from " + file + 
":" + e.getMessage(), e );
+        }
+    }
+
+    /**
+     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists
+     * and is readable.
+     *
+     * @param file the path of the file to check
+     * @param regex a regular expression
+     * @see Pattern
+     * @deprecated Use {@link #verifyFileContentMatches(String, String)} 
instead.
+     */
+    @Deprecated
+    public void assertFileMatches( String file, String regex )
+    {
+        try
+        {
+            verifyFileContentMatches( file, regex );
+        }
+        catch ( VerificationException e )
         {
             Assert.fail( e.getMessage() );
         }
     }
 
+    /**
+     * Verifies that the given file does not exist
+     * @param file the path of the file to check
+     * @throws VerificationException in case the given file exists
+     */
+    public void verifyFileNotPresent( String file ) throws 
VerificationException
+    {
+        verifyFilePresence( file, false );
+    }
+
+    /**
+     * 
+     * @param file the path of the file to check
+     * @deprecated Use {@link #verifyFileNotPresent(String)} instead.
+     */
     public void assertFileNotPresent( String file )
     {
         try
         {
-            verifyExpectedResult( file, false );
+            verifyFileNotPresent( file );
         }
         catch ( VerificationException e )
         {
             Assert.fail( e.getMessage() );
         }
     }
 
-    private void verifyArtifactPresence( boolean wanted, String org, String 
name, String version, String ext )
+    private void verifyArtifactPresence( boolean wanted, String groupId, 
String artifactId, String version, String ext )
+                    throws VerificationException
     {
-        List<String> files = getArtifactFileNameList( org, name, version, ext 
);
+        List<String> files = getArtifactFileNameList( groupId, artifactId, 
version, ext );
         for ( String fileName : files )
         {
-            try
-            {
-                verifyExpectedResult( fileName, wanted );
-            }
-            catch ( VerificationException e )
-            {
-                Assert.fail( e.getMessage() );
-            }
+            verifyFilePresence( fileName, wanted );
         }
     }
 
+    /**
+     * Verifies that the artifact given through its Maven coordinates exists.
+     * @param groupId the groupId of the artifact (must not be null)
+     * @param artifactId the artifactId of the artifact (must not be null)
+     * @param version the version of the artifact (must not be null)
+     * @param ext the extension of the artifact (must not be null)
+     * @throws VerificationException in case the given artifact does not exist
+     */
+    public void verifyArtifactPresent( String groupId, String artifactId, 
String version, String ext )
+                    throws VerificationException
+    {
+        verifyArtifactPresence( true, groupId, artifactId, version, ext );
+    }
+
+    /**
+     * Verifies that the artifact given through its Maven coordinates does not 
exist.
+     * @param groupId the groupId of the artifact (must not be null)
+     * @param artifactId the artifactId of the artifact (must not be null)
+     * @param version the version of the artifact (must not be null)
+     * @param ext the extension of the artifact (must not be null)
+     * @throws VerificationException in case the given artifact exists
+     */
+    public void verifyArtifactNotPresent( String groupId, String artifactId, 
String version, String ext )
+                    throws VerificationException
+    {
+        verifyArtifactPresence( false, groupId, artifactId, version, ext );
+    }
+
+    private void assertArtifactPresence( boolean wanted, String org, String 
name, String version, String ext )
+    {
+        try
+        {
+            verifyArtifactPresence( wanted, org, name, version, ext );
+        }
+        catch ( VerificationException e )
+        {
+            Assert.fail( e.getMessage() );
+        }
+    }
+
+    /**
+     * @deprecated Use {@link #verifyArtifactPresent(String, String, String, 
String)} instead.
+     */
+    @Deprecated

Review comment:
       I guess we do. Use this elsewhere where needed. 

##########
File path: src/main/java/org/apache/maven/it/Verifier.java
##########
@@ -1768,6 +1864,29 @@ private static void runIntegrationTest( Verifier 
verifier )
         System.out.println( "OK" );
     }
 
+    /**
+     * Verifies that the artifact given by its Maven coordinates exists and 
contains the given content.
+     * @param groupId the groupId of the artifact (must not be null)
+     * @param artifactId the artifactId of the artifact (must not be null)
+     * @param version the version of the artifact (must not be null)
+     * @param ext the extension of the artifact (must not be null)
+     * @param content the expected content
+     * @throws IOException in case reading from the artifact fails 
+     * @throws VerificationException in case the content of the artifact 
differs

Review comment:
       if

##########
File path: src/main/java/org/apache/maven/it/Verifier.java
##########
@@ -1020,66 +1036,146 @@ public void assertFilePresent( String file )
     }
 
     /**
-     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists
-     * and is readable.
+     * Verifies that given file's content matches an regular expression. 

Review comment:
       the given file's

##########
File path: src/main/java/org/apache/maven/it/Verifier.java
##########
@@ -1020,66 +1036,146 @@ public void assertFilePresent( String file )
     }
 
     /**
-     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists
-     * and is readable.
+     * Verifies that given file's content matches an regular expression. 
+     * Note this method also checks that the file exists and is readable.
      *
-     * @param file  the file to check.
-     * @param regex a regular expression.
+     * @param file the path of the file to check
+     * @param regex a regular expression
+     * @throws VerificationException in case the file was not found or its 
content does not match the given pattern
      * @see Pattern
      */
-    public void assertFileMatches( String file, String regex )
+    public void verifyFileContentMatches( String file, String regex ) throws 
VerificationException
     {
-        assertFilePresent( file );
+        verifyFilePresent( file );
         try
         {
             String content = FileUtils.fileRead( file );
             if ( !Pattern.matches( regex, content ) )
             {
-                Assert.fail( "Content of " + file + " does not match " + regex 
);
+                throw new VerificationException( "Content of " + file + " does 
not match " + regex );
             }
         }
         catch ( IOException e )
+        {
+            throw new VerificationException( "Could not read from " + file + 
":" + e.getMessage(), e );
+        }
+    }
+
+    /**
+     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists
+     * and is readable.
+     *
+     * @param file the path of the file to check
+     * @param regex a regular expression
+     * @see Pattern
+     * @deprecated Use {@link #verifyFileContentMatches(String, String)} 
instead.
+     */
+    @Deprecated
+    public void assertFileMatches( String file, String regex )
+    {
+        try
+        {
+            verifyFileContentMatches( file, regex );
+        }
+        catch ( VerificationException e )
         {
             Assert.fail( e.getMessage() );
         }
     }
 
+    /**
+     * Verifies that the given file does not exist
+     * @param file the path of the file to check
+     * @throws VerificationException in case the given file exists
+     */
+    public void verifyFileNotPresent( String file ) throws 
VerificationException
+    {
+        verifyFilePresence( file, false );
+    }
+
+    /**
+     * 
+     * @param file the path of the file to check
+     * @deprecated Use {@link #verifyFileNotPresent(String)} instead.
+     */
     public void assertFileNotPresent( String file )
     {
         try
         {
-            verifyExpectedResult( file, false );
+            verifyFileNotPresent( file );
         }
         catch ( VerificationException e )
         {
             Assert.fail( e.getMessage() );
         }
     }
 
-    private void verifyArtifactPresence( boolean wanted, String org, String 
name, String version, String ext )
+    private void verifyArtifactPresence( boolean wanted, String groupId, 
String artifactId, String version, String ext )
+                    throws VerificationException
     {
-        List<String> files = getArtifactFileNameList( org, name, version, ext 
);
+        List<String> files = getArtifactFileNameList( groupId, artifactId, 
version, ext );
         for ( String fileName : files )
         {
-            try
-            {
-                verifyExpectedResult( fileName, wanted );
-            }
-            catch ( VerificationException e )
-            {
-                Assert.fail( e.getMessage() );
-            }
+            verifyFilePresence( fileName, wanted );
         }
     }
 
+    /**
+     * Verifies that the artifact given through its Maven coordinates exists.
+     * @param groupId the groupId of the artifact (must not be null)
+     * @param artifactId the artifactId of the artifact (must not be null)
+     * @param version the version of the artifact (must not be null)
+     * @param ext the extension of the artifact (must not be null)
+     * @throws VerificationException in case the given artifact does not exist

Review comment:
       in case --> if

##########
File path: src/main/java/org/apache/maven/it/Verifier.java
##########
@@ -1768,6 +1864,29 @@ private static void runIntegrationTest( Verifier 
verifier )
         System.out.println( "OK" );
     }
 
+    /**
+     * Verifies that the artifact given by its Maven coordinates exists and 
contains the given content.

Review comment:
       blank line at end

##########
File path: src/main/java/org/apache/maven/it/Verifier.java
##########
@@ -1020,66 +1036,146 @@ public void assertFilePresent( String file )
     }
 
     /**
-     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists
-     * and is readable.
+     * Verifies that given file's content matches an regular expression. 
+     * Note this method also checks that the file exists and is readable.
      *
-     * @param file  the file to check.
-     * @param regex a regular expression.
+     * @param file the path of the file to check
+     * @param regex a regular expression
+     * @throws VerificationException in case the file was not found or its 
content does not match the given pattern
      * @see Pattern
      */
-    public void assertFileMatches( String file, String regex )
+    public void verifyFileContentMatches( String file, String regex ) throws 
VerificationException
     {
-        assertFilePresent( file );
+        verifyFilePresent( file );
         try
         {
             String content = FileUtils.fileRead( file );
             if ( !Pattern.matches( regex, content ) )
             {
-                Assert.fail( "Content of " + file + " does not match " + regex 
);
+                throw new VerificationException( "Content of " + file + " does 
not match " + regex );
             }
         }
         catch ( IOException e )
+        {
+            throw new VerificationException( "Could not read from " + file + 
":" + e.getMessage(), e );
+        }
+    }
+
+    /**
+     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists
+     * and is readable.
+     *
+     * @param file the path of the file to check
+     * @param regex a regular expression
+     * @see Pattern
+     * @deprecated Use {@link #verifyFileContentMatches(String, String)} 
instead.
+     */
+    @Deprecated
+    public void assertFileMatches( String file, String regex )
+    {
+        try
+        {
+            verifyFileContentMatches( file, regex );
+        }
+        catch ( VerificationException e )
         {
             Assert.fail( e.getMessage() );
         }
     }
 
+    /**
+     * Verifies that the given file does not exist
+     * @param file the path of the file to check
+     * @throws VerificationException in case the given file exists

Review comment:
       in case --> if

##########
File path: src/main/java/org/apache/maven/it/Verifier.java
##########
@@ -1020,66 +1036,146 @@ public void assertFilePresent( String file )
     }
 
     /**
-     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists
-     * and is readable.
+     * Verifies that given file's content matches an regular expression. 
+     * Note this method also checks that the file exists and is readable.
      *
-     * @param file  the file to check.
-     * @param regex a regular expression.
+     * @param file the path of the file to check
+     * @param regex a regular expression
+     * @throws VerificationException in case the file was not found or its 
content does not match the given pattern
      * @see Pattern
      */
-    public void assertFileMatches( String file, String regex )
+    public void verifyFileContentMatches( String file, String regex ) throws 
VerificationException
     {
-        assertFilePresent( file );
+        verifyFilePresent( file );
         try
         {
             String content = FileUtils.fileRead( file );
             if ( !Pattern.matches( regex, content ) )
             {
-                Assert.fail( "Content of " + file + " does not match " + regex 
);
+                throw new VerificationException( "Content of " + file + " does 
not match " + regex );
             }
         }
         catch ( IOException e )
+        {
+            throw new VerificationException( "Could not read from " + file + 
":" + e.getMessage(), e );
+        }
+    }
+
+    /**
+     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists
+     * and is readable.
+     *
+     * @param file the path of the file to check
+     * @param regex a regular expression
+     * @see Pattern
+     * @deprecated Use {@link #verifyFileContentMatches(String, String)} 
instead.
+     */
+    @Deprecated
+    public void assertFileMatches( String file, String regex )
+    {
+        try
+        {
+            verifyFileContentMatches( file, regex );
+        }
+        catch ( VerificationException e )
         {
             Assert.fail( e.getMessage() );
         }
     }
 
+    /**
+     * Verifies that the given file does not exist
+     * @param file the path of the file to check
+     * @throws VerificationException in case the given file exists
+     */
+    public void verifyFileNotPresent( String file ) throws 
VerificationException
+    {
+        verifyFilePresence( file, false );
+    }
+
+    /**
+     * 
+     * @param file the path of the file to check
+     * @deprecated Use {@link #verifyFileNotPresent(String)} instead.
+     */
     public void assertFileNotPresent( String file )
     {
         try
         {
-            verifyExpectedResult( file, false );
+            verifyFileNotPresent( file );
         }
         catch ( VerificationException e )
         {
             Assert.fail( e.getMessage() );
         }
     }
 
-    private void verifyArtifactPresence( boolean wanted, String org, String 
name, String version, String ext )
+    private void verifyArtifactPresence( boolean wanted, String groupId, 
String artifactId, String version, String ext )
+                    throws VerificationException
     {
-        List<String> files = getArtifactFileNameList( org, name, version, ext 
);
+        List<String> files = getArtifactFileNameList( groupId, artifactId, 
version, ext );
         for ( String fileName : files )
         {
-            try
-            {
-                verifyExpectedResult( fileName, wanted );
-            }
-            catch ( VerificationException e )
-            {
-                Assert.fail( e.getMessage() );
-            }
+            verifyFilePresence( fileName, wanted );
         }
     }
 
+    /**
+     * Verifies that the artifact given through its Maven coordinates exists.
+     * @param groupId the groupId of the artifact (must not be null)
+     * @param artifactId the artifactId of the artifact (must not be null)
+     * @param version the version of the artifact (must not be null)
+     * @param ext the extension of the artifact (must not be null)
+     * @throws VerificationException in case the given artifact does not exist
+     */
+    public void verifyArtifactPresent( String groupId, String artifactId, 
String version, String ext )
+                    throws VerificationException
+    {
+        verifyArtifactPresence( true, groupId, artifactId, version, ext );
+    }
+
+    /**
+     * Verifies that the artifact given through its Maven coordinates does not 
exist.
+     * @param groupId the groupId of the artifact (must not be null)
+     * @param artifactId the artifactId of the artifact (must not be null)
+     * @param version the version of the artifact (must not be null)
+     * @param ext the extension of the artifact (must not be null)
+     * @throws VerificationException in case the given artifact exists

Review comment:
       in case --> if

##########
File path: src/main/java/org/apache/maven/it/Verifier.java
##########
@@ -1020,66 +1036,146 @@ public void assertFilePresent( String file )
     }
 
     /**
-     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists
-     * and is readable.
+     * Verifies that given file's content matches an regular expression. 
+     * Note this method also checks that the file exists and is readable.
      *
-     * @param file  the file to check.
-     * @param regex a regular expression.
+     * @param file the path of the file to check
+     * @param regex a regular expression
+     * @throws VerificationException in case the file was not found or its 
content does not match the given pattern
      * @see Pattern
      */
-    public void assertFileMatches( String file, String regex )
+    public void verifyFileContentMatches( String file, String regex ) throws 
VerificationException
     {
-        assertFilePresent( file );
+        verifyFilePresent( file );
         try
         {
             String content = FileUtils.fileRead( file );
             if ( !Pattern.matches( regex, content ) )
             {
-                Assert.fail( "Content of " + file + " does not match " + regex 
);
+                throw new VerificationException( "Content of " + file + " does 
not match " + regex );
             }
         }
         catch ( IOException e )
+        {
+            throw new VerificationException( "Could not read from " + file + 
":" + e.getMessage(), e );
+        }
+    }
+
+    /**
+     * Check that given file's content matches an regular expression. Note 
this method also checks that the file exists
+     * and is readable.
+     *
+     * @param file the path of the file to check
+     * @param regex a regular expression
+     * @see Pattern
+     * @deprecated Use {@link #verifyFileContentMatches(String, String)} 
instead.
+     */
+    @Deprecated
+    public void assertFileMatches( String file, String regex )
+    {
+        try
+        {
+            verifyFileContentMatches( file, regex );
+        }
+        catch ( VerificationException e )
         {
             Assert.fail( e.getMessage() );
         }
     }
 
+    /**
+     * Verifies that the given file does not exist
+     * @param file the path of the file to check
+     * @throws VerificationException in case the given file exists
+     */
+    public void verifyFileNotPresent( String file ) throws 
VerificationException
+    {
+        verifyFilePresence( file, false );
+    }
+
+    /**
+     * 
+     * @param file the path of the file to check
+     * @deprecated Use {@link #verifyFileNotPresent(String)} instead.
+     */
     public void assertFileNotPresent( String file )
     {
         try
         {
-            verifyExpectedResult( file, false );
+            verifyFileNotPresent( file );
         }
         catch ( VerificationException e )
         {
             Assert.fail( e.getMessage() );
         }
     }
 
-    private void verifyArtifactPresence( boolean wanted, String org, String 
name, String version, String ext )
+    private void verifyArtifactPresence( boolean wanted, String groupId, 
String artifactId, String version, String ext )
+                    throws VerificationException
     {
-        List<String> files = getArtifactFileNameList( org, name, version, ext 
);
+        List<String> files = getArtifactFileNameList( groupId, artifactId, 
version, ext );
         for ( String fileName : files )
         {
-            try
-            {
-                verifyExpectedResult( fileName, wanted );
-            }
-            catch ( VerificationException e )
-            {
-                Assert.fail( e.getMessage() );
-            }
+            verifyFilePresence( fileName, wanted );
         }
     }
 
+    /**
+     * Verifies that the artifact given through its Maven coordinates exists.

Review comment:
       . \n




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to