-
1. Re: Byteman Fluent API
aslak Feb 17, 2012 6:26 AM (in response to davided80)Hi Davide, cool stuff.. At a conference at the moment so I'll look at it in more detail when I get back.
Support for targeting a specific container is currently lacking from the extension.
(there is a onducomented feature of adding a file called byteman.scipt in the Deployment cp which will get picked up but..
-
2. Re: Byteman Fluent API
davided80 Feb 21, 2012 12:57 PM (in response to aslak)Thanks,
I'm not sure on how to use that though.
Another issue that I have at the moment with this is when I start two containers. The Byteman agent seems to connect only on the first one.
By the way, I've noticed that in the RuleInstaller (https://github.com/arquillian/arquillian-extension-byteman/blob/master/src/main/java/org/jboss/arquillian/extension/byteman/impl/container/RuleInstaller.java#L48), the method
uninstallClass is actually calling SubmitUtil.install(...).
Is it correct?
-
3. Re: Byteman Fluent API
aslak May 2, 2012 6:13 AM (in response to davided80)Davide D\'Alto wrote:
Another issue that I have at the moment with this is when I start two containers. The Byteman agent seems to connect only on the first one.
By the way, I've noticed that in the RuleInstaller (https://github.com/arquillian/arquillian-extension-byteman/blob/master/src/main/java/org/jboss/arquillian/extension/byteman/impl/container/RuleInstaller.java#L48), the method
uninstallClass is actually calling SubmitUtil.install(...).
Is it correct?
No, that's a copy paste error.
-
4. Re: Byteman Fluent API
aslak May 2, 2012 6:20 AM (in response to davided80)To my knowledge the top level in byteman is a Script, and a script can contian multiple rules. Not sure you can insert just a Rule, or if that Rule has to be a single Rule in a Script.
I think it would fit better the have it named BytemanScriptDescriptor
Descriptors.create(BytemanScriptDescriptor.class) .rule(name) .classMatch() .methodMatch() .rule(otherName) ....
It's a bit clunky to have to escape the ", not sure what Byteman allows here, but we could allow single quotes and replace them as double if Byteman only allow double.
.doAction("debug('intercepted')")
-
5. Re: Byteman Fluent API
aslak May 2, 2012 6:26 AM (in response to davided80)Davide D\'Alto wrote:
Another issue that I have at the moment with this is when I start two containers. The Byteman agent seems to connect only on the first one.
-
6. Re: Byteman Fluent API
davided80 May 2, 2012 9:42 AM (in response to aslak)It's a bit clunky to have to escape the ", not sure what Byteman allows here, but we could allow single quotes and replace them as double if Byteman only allow double.
.doAction("debug('intercepted')")
That should work.
I was thinking to add some more specfic method related to the allowed actions in Bytema:
doAction(...) is a generic one but we could have doThrow(...), doDebug(..), doTraceln(...) and so on.
Aslak Knutsen wrote:
To my knowledge the top level in byteman is a Script, and a script can contian multiple rules. Not sure you can insert just a Rule, or if that Rule has to be a single Rule in a Script.
I think it would fit better the have it named BytemanScriptDescriptor
+1
-
7. Re: Byteman Fluent API
davided80 Jun 10, 2012 8:56 AM (in response to davided80)Hi,
I've applyed the changes you've suggested:
- Renaming
- String parsing
Single quote are now replaced in action, binding and if. A double single quote is used as escaped of a single quote.
I've added a method in the fluent API to disable the parsing of the string.
https://github.com/DavideD/arquillian-extension-byteman/commits/ARQ-355
Cheers,
Davide