Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Declaring Annotations




Couple of things, firstly you might have hit bug bug 98901 (
https://bugs.eclipse.org/bugs/show_bug.cgi?id=98901 )  - it has been fixed
but the fix isn't available in a build yet.

Secondly, do you know which method is returning an empty set of
annotations?  It might be worth printing it out to confirm its one you
expect to be matched by the declared @method construct - since I see no
logic in your loop that only ensures you ask for the  annotations on the
public declared methods.

cheers,
Andy.



                                                                           
             Valerio Schiavoni                                             
             <ervalerio@tiscal                                             
             i.it>                                                      To 
             Sent by:                  aspectj-users@xxxxxxxxxxx           
             aspectj-users-bou                                          cc 
             nces@xxxxxxxxxxx                                              
                                                                   Subject 
                                       Re: [aspectj-users] Declaring       
             12/07/2005 13:49          Annotations                         
                                                                           
                                                                           
             Please respond to                                             
             aspectj-users@ecl                                             
                 ipse.org                                                  
                                                                           
                                                                           




sorry, the previous one was almost unreadable, don't know why,

/**
* An annotation is added via the AnnotatorAspect, so
 * after the weaving phase, the annotation should be there.
 *
 *
 * @throws NoSuchInterfaceException
 *
 */
public void testDeclareAnnotation() throws NoSuchInterfaceException{

    Pusher p = (Pusher) fComponentNoDelegators.getFcInterface("m");
    Method[] annotatedMethods = p.getClass().getDeclaredMethods();

    //every method on the pusher interface should be annotated
    for (Method m :annotatedMethods){
        //get declared annotations
        Annotation [] annots = m.getDeclaredAnnotations();
        assertNotNull(annots);
        assertTrue(annots.length != 0);
    }


Valerio Schiavoni ha scritto:

> Hello Adrian,
>
> i corrected the test case, so that it tests if *methods* are annotated.
> http://veleno.pastebin.com/311834
>
> and now i get an assertion failed..
>

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users




Back to the top