You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Karl Heinz Marbaise (Jira)" <ji...@apache.org> on 2021/09/30 17:42:00 UTC

[jira] [Created] (MNG-7277) Wrong Test - testNonNumericVersionRepresentationReturnsANumberFormatException

Karl Heinz Marbaise created MNG-7277:
----------------------------------------

             Summary: Wrong Test - testNonNumericVersionRepresentationReturnsANumberFormatException
                 Key: MNG-7277
                 URL: https://issues.apache.org/jira/browse/MNG-7277
             Project: Maven
          Issue Type: Improvement
    Affects Versions: 4.0.0-alpha-1
            Reporter: Karl Heinz Marbaise
             Fix For: 4.0.0


Currently the following test:
{code:java}
    public void testNonNumericVersionRepresentationReturnsANumberFormatException()
    {
        try
        {
            new DefaultArtifactVersion( "..." );
        }
        catch ( Exception e )
        {
            assertTrue( "We expect a NumberFormatException to be thrown.", e instanceof NumberFormatException );
        }
    }
{code}
is expected to throw an {{NumberFormatException}} which is not the case because
The exception is not thrown by the underlying code. 
The reason is simply this test is wrong. The {{catch}} part will not being executed. This results in the green reported test.




--
This message was sent by Atlassian Jira
(v8.3.4#803005)