ThreadWeaver 0.20 on Maven Central and "No instrumented object" error

60 views
Skip to first unread message

Minh Nguyen

unread,
Aug 24, 2013, 5:14:25 PM8/24/13
to thread...@googlegroups.com
Thanks for creating this project, it appears to be the easiest option for creating multithreaded testing scenarios. I have a couple of questions:
  1. Has there been any effort towards creating a Maven project of version 0.20? I imagine the project could gain a lot more visibility / adoption if it was easily accessible through Maven (a few lines to add to a pom.xml rather than the larger effort of adding it to an Ant script). If this seems worthwhile, I would like to volunteer to assist
  2. I've been trying to have my mainThread and secondaryThread interweave using "Scripts" as described in the Wiki's example (https://code.google.com/p/thread-weaver/wiki/UsersGuide) but encounter "no instrumented object" errors. I actually even copied the same example (with a minor typo edit) and experienced the same error. I plan to dive into the code a little bit but any guidance would be greatly appreciated.
Minh Nguyen

Minh Nguyen

unread,
Aug 24, 2013, 5:15:49 PM8/24/13
to thread...@googlegroups.com
To clarify, I get the "no object instrumented" error for the "list" object in the Scripts example on the wiki on the following line:

  Script<MyList> main = new Script<MyList>(list);

Alasdair Mackintosh

unread,
Aug 24, 2013, 6:09:24 PM8/24/13
to thread...@googlegroups.com
On Sat, Aug 24, 2013 at 2:14 PM, Minh Nguyen <minh.9...@gmail.com> wrote:
> Thanks for creating this project, it appears to be the easiest option for
> creating multithreaded testing scenarios. I have a couple of questions:
>
> Has there been any effort towards creating a Maven project of version 0.20?
> I imagine the project could gain a lot more visibility / adoption if it was
> easily accessible through Maven (a few lines to add to a pom.xml rather than
> the larger effort of adding it to an Ant script). If this seems worthwhile,
> I would like to volunteer to assist

Hi Minh,

Someone else had recently suggested this, and sent a sample pom.xml.
See http://code.google.com/p/thread-weaver/issues/detail?id=8 .

There was some issue about whether or not objenesis was available as a
Maven jar - see the last comment. I'm afraid I know very little about
Maven, having used Ant or proprietary build systems in the past.

> I've been trying to have my mainThread and secondaryThread interweave using
> "Scripts" as described in the Wiki's example
> (https://code.google.com/p/thread-weaver/wiki/UsersGuide) but encounter "no
> instrumented object" errors. I actually even copied the same example (with a
> minor typo edit) and experienced the same error. I plan to dive into the
> code a little bit but any guidance would be greatly appreciated.

Hmm. It should work. Do you have a traceback? And sample code that you're using?

You do still need to use the ThreadWeaver test annotations, rather
than direct test cases. The way ThreadWeaver works is that it reloads
the classes that you are testing using a custom classloader. (It has
to do this in order to instrument them, and add the breakpoints.) So
you can't call ThreadWeaver for a standard JUnit method - you need to
use ThreadWeaver's own annotations.

Please note that I will be on vacation tomorrow for a couple of weeks,
with limited email access, so I may be slow in reponding.

Alasdair

Minh Nguyen

unread,
Aug 24, 2013, 9:54:30 PM8/24/13
to thread...@googlegroups.com
Thanks, that was actually the issue -- I was running the sample code within a Junit test and not invoking it in @ThreadedMain, etc that's called by the AnnotationTestRunner. Works great now :)


On Saturday, August 24, 2013 5:14:25 PM UTC-4, Minh Nguyen wrote:

Scott Prater

unread,
Aug 24, 2013, 10:10:09 PM8/24/13
to thread...@googlegroups.com
I was the person who originally mavenized threadweaver, back in 2011:

https://code.google.com/p/thread-weaver/source/browse/tags/maven/0.1-SNAPSHOT/pom.xml?r=12

A 0.1 version of the maven package is available at the OSS Sonatype repo:

http://search.maven.org/#search%7Cga%7C1%7Cthreadweaver

It could probably use some substantial refactoring and updating. If
anyone wants to take that on, I can help get the latest version
uploaded to the central repository.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Thread Weaver" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to thread-weave...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Amit Vyas

unread,
Nov 25, 2013, 6:11:14 PM11/25/13
to thread...@googlegroups.com
Hi Scott,

I took up this activity and first draft is ready for review.

Do let me know your comments as I'm working to improve the structure.

After finalizing and testing you can help me to upload to repo.

Cheers,

Amit Vyas
Thread-Weaver.rar

Amit Vyas

unread,
Nov 25, 2013, 6:31:27 PM11/25/13
to thread...@googlegroups.com
Seems it is already completed task...

<dependency>
  <groupId>com.googlecode.thread-weaver</groupId>
  <artifactId>threadweaver</artifactId>
  <version>0.3-SNAPSHOT</version>
</dependency>

Sorry for re-invention and email........

Scott Prater

unread,
Nov 25, 2013, 6:35:27 PM11/25/13
to thread...@googlegroups.com
Yes, if you read back on this thread, you'll see Alasdair already did
it a few weeks ago. But thanks for the effort.

-- Scott
Reply all
Reply to author
Forward
0 new messages