Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] aspectj-dev Digest, Vol 96, Issue 3

Hello,

I'm well aware of what I'm doing. My question is " Can someone please help with a step by step instruction on how to integrate annotation based aspects into an android project?."

Thanks,
Deepak


On Fri, Apr 19, 2013 at 10:45 AM, <aspectj-dev-request@xxxxxxxxxxx> wrote:
Send aspectj-dev mailing list submissions to
        aspectj-dev@xxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
        https://dev.eclipse.org/mailman/listinfo/aspectj-dev
or, via email, send a message with subject or body 'help' to
        aspectj-dev-request@xxxxxxxxxxx

You can reach the person managing the list at
        aspectj-dev-owner@xxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of aspectj-dev digest..."


Today's Topics:

   1. Android AspectJ Integration issue (Deepak Gopalakrishnan)
   2. Re: Android AspectJ Integration issue (Andrew Eisenberg)
   3. Re: Getting wired behavior from junit while running a Weka
      test suite with ajc (Hossein Mehrfard)


----------------------------------------------------------------------

Message: 1
Date: Fri, 19 Apr 2013 10:09:22 +0530
From: Deepak Gopalakrishnan <dgkris@xxxxxxxxx>
To: aspectj-dev@xxxxxxxxxxx
Subject: [aspectj-dev] Android AspectJ Integration issue
Message-ID:
        <CAJtCzuiWZ1Um+N8etndpCEGFYxqJzeZdX11jX6ed+fkwmXXmiw@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="iso-8859-1"

Hello,

I'm trying to code out few aspects into an android project.  Below is the
aspect. I'm very particular about using the annotation based solution(
because I want to use java compiler and not ajc). I've added aspectjrt jar
and ajdtweaver jar to my class path. But I cannot see this working. Can
anyone please help with a step by step instruction. I'm sure this can help
lots of others who have been trying this.

@Aspect

public class ActivityAspect {

@AfterReturning(pointcut = "execution(* *.*(..)) &&
this(android.app.Activity)")

public void log(JoinPoint jp) {

.......

}


}

--
Regards,
*Deepak Gopalakrishnan*
*Mobile*:+918891509774
*Skype* : deepakgk87
http://myexps.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://dev.eclipse.org/mailman/private/aspectj-dev/attachments/20130419/7cb95f0c/attachment.html>

------------------------------

Message: 2
Date: Thu, 18 Apr 2013 22:06:40 -0700
From: Andrew Eisenberg <andrew@xxxxxxxxxxxx>
To: AspectJ developer discussions <aspectj-dev@xxxxxxxxxxx>
Subject: Re: [aspectj-dev] Android AspectJ Integration issue
Message-ID:
        <CAJPxihfdz=tpVQEnBYLT3dM5yOqRm4wyCyoA2A2M-HbFHfuH8A@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="iso-8859-1"

Looks like you are trying to weave into core Android classes.  It's
probably not a good idea (just like weaving into the JDK).  There are
bootstrapping issues with this.  I'd avoid this if you can.  In general,
you should only be weaving into your own application classes unless you
really know what you are doing.


On Thu, Apr 18, 2013 at 9:39 PM, Deepak Gopalakrishnan <dgkris@xxxxxxxxx>wrote:

> Hello,
>
> I'm trying to code out few aspects into an android project.  Below is the
> aspect. I'm very particular about using the annotation based solution(
> because I want to use java compiler and not ajc). I've added aspectjrt jar
> and ajdtweaver jar to my class path. But I cannot see this working. Can
> anyone please help with a step by step instruction. I'm sure this can help
> lots of others who have been trying this.
>
> @Aspect
>
> public class ActivityAspect {
>
> @AfterReturning(pointcut = "execution(* *.*(..)) &&
> this(android.app.Activity)")
>
> public void log(JoinPoint jp) {
>
> .......
>
> }
>
>
> }
>
> --
> Regards,
> *Deepak Gopalakrishnan*
> *Mobile*:+918891509774
> *Skype* : deepakgk87
> http://myexps.blogspot.com
>
>
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://dev.eclipse.org/mailman/private/aspectj-dev/attachments/20130418/41a64f86/attachment.html>

------------------------------

Message: 3
Date: Fri, 19 Apr 2013 01:15:10 -0400
From: Hossein Mehrfard <hossein.mehrfard@xxxxxxxxx>
To: aspectj-dev <aspectj-dev@xxxxxxxxxxx>
Subject: Re: [aspectj-dev] Getting wired behavior from junit while
        running a Weka test suite with ajc
Message-ID:
        <CAOyxUGk_GAnnAnbCZvk=k_WPCrj8XNGAnjQQvvKdn+c-qNB=vg@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="iso-8859-1"

I was able to fix the problem, apparently it was logging problem that took
junit this long to be executed.

Hossein


On Thu, Apr 18, 2013 at 9:08 PM, Hossein Mehrfard <
hossein.mehrfard@xxxxxxxxx> wrote:

> Hello,
>
> I conducted a set of experiments on the Weka source code. I intercepted
> all method calls in Weka at runtime with aspectj to investigate its
> behavior with different interception mechanisms (I gathered information
> about caller and callee objects). I used one of the test suites (weka.core)
> already existed in Weka packages to feed my execution. I ran that test
> suite using "ant build" and changed Junit compiler from "javac" to "ajc".
> The total number 251 Junit tests took about 45 minutes to finish with ajc compiler,
> while that similar test suite took just a minute to execute and compile
> with "javac" compiler (again ant used for execution). The excerpt of Junit
> execution on the intercepted version of Weka follows:
>
>  [junit] Utils.java:551
>  [junit] Utils.java:567
>  [junit] Utils.java:588
>  [junit] Utils.java:605
>  [junit] Utils.java:605
>  [junit] Utils.java:551
>  [junit] Utils.java:567
>  [junit] Utils.java:551
>  [junit] Utils.java:567
>  [junit] Utils.java:588
>  [junit] Utils.java:605
>  [junit] Utils.java:605
>  [junit] Utils.java:605
>  [junit] Utils.java:605
>  [junit] Utils.java:605
>  [junit] Utils.java:605
>  [junit] Utils.java:605
>  [junit] Utils.java:605
>  [junit] .....
>  [junit] Time: 2,625.089
>  [junit]
>  [junit] OK (251 tests)
>  [junit]
>
> BUILD SUCCESSFULTotal time: 44 minutes 30 seconds
>
>  I am almost sure something goes wrong with this test suite execution and
> should not take this long. Junit keeps printing some Weka class names
> (such as: *Utils.java, Attribute.java, SerializationHelper.java,
> BallNode.java* ) with different line numbers. This Junit output is
> totally different with the one executed with "javac".
>
> I don't know:
>
> 1. What does this behavior mean in Junit?
>
> 2. Was the the test suite correctly passed?
>
> 3. Whether the problem is from junit or my aspect?
>
> I executed the intercepted Weka successfully with a simpler set of
> execution from the command line before, but this problem appears when I use
> Junit.
>
> Any insight is very much appreciated.
>
>
> Thanks,
>
> Hossien
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://dev.eclipse.org/mailman/private/aspectj-dev/attachments/20130419/9fb76fa2/attachment.html>

------------------------------

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


End of aspectj-dev Digest, Vol 96, Issue 3
******************************************



--
Regards,
Deepak Gopalakrishnan
Mobile:+918891509774
Skype : deepakgk87
http://myexps.blogspot.com


Back to the top