[
https://issues.apache.org/jira/browse/MNG-7277?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Karl Heinz Marbaise updated MNG-7277:
-------------------------------------
Description:
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.
This means this test is wrong. The {{catch}} part will never being executed but
the test is reported being green!
The following test: {{public void testOsActivationProfile()}} in
{{DefaultProfileManagerTest}} class has been commented out for years now (seen
on maven-3.8.x branch) which means it has never run for years. In current
master it's defined {{@Disabled}} which means it does not run either.
was:
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.
This means this test is wrong. The {{catch}} part will never being executed but
the test is reported being green!
The following test: {{public void testOsActivationProfile()}} in
{{DefaultProfileManagerTest}} class has been commented out for years now (seen
on maven-3.8.x branch) which means it has never been run which means it has not
run ever.
> Remove Wrong or useless Tests
> -----------------------------
>
> 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
> Assignee: Karl Heinz Marbaise
> Priority: Minor
> 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.
> This means this test is wrong. The {{catch}} part will never being executed
> but the test is reported being green!
> The following test: {{public void testOsActivationProfile()}} in
> {{DefaultProfileManagerTest}} class has been commented out for years now
> (seen on maven-3.8.x branch) which means it has never run for years. In
> current master it's defined {{@Disabled}} which means it does not run
> either.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)