commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abrasha <...@git.apache.org>
Subject [GitHub] commons-lang pull request #218: Fix/different annotations test
Date Thu, 24 Nov 2016 20:54:08 GMT
GitHub user Abrasha opened a pull request:

    https://github.com/apache/commons-lang/pull/218

    Fix/different annotations test

    ```
    @Test
    public void testAnnotationsOfDifferingTypes() {
        assertFalse(AnnotationUtils.equals(field1.getAnnotation(TestAnnotation.class), field4.getAnnotation(NestAnnotation.class)));
        assertFalse(AnnotationUtils.equals(field4.getAnnotation(NestAnnotation.class), field1.getAnnotation(TestAnnotation.class)));
    }
    ```
    
    This test is successful, but checks a different behaviour than expected.
    
    `field4.getAnnotation(NestAnnotation.class)` is expected to return an annotation of type
`NestAnnotation`, but actually it returns `null` because the Retention of annotation is set
to default.
    
    As a result, test did not cover quite important case.
    
    See discussion: [#217](https://github.com/apache/commons-lang/pull/217)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Abrasha/commons-lang fix/different-annotations-test

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-lang/pull/218.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #218
    
----
commit 6362660b3bfb4fb41719496f1037dc3acb0597ea
Author: Andrii <aabrasha@gmail.com>
Date:   2016-11-24T20:46:15Z

    add tests to cover ArrayUtils

commit d1a2d075356041974785247626922ac488755196
Author: Andrii <aabrasha@gmail.com>
Date:   2016-11-24T20:52:35Z

    fix an issue with not getting Annotation

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message