-
1. Re: problem using AFTER WRITE on local variable
adinn Oct 18, 2012 12:21 PM (in response to msulliv1)Hi Mike,
I am a little puzzled by the output you are seeing. I just ran bmcheck and got this output
[adinn@sputstik byteman]$ bmcheck -cp . foo.btm
checking rule test debug against class Foo
parsed rule "test debug" for class Foo
type checked rule "test debug"
TestScript: no errors
I used this class definition
[adinn@sputstik byteman]$ cat Foo.java
public class Foo {
public static void main(String[] args)
{
Foo foo = new Foo();
foo.bar(1, "hello");
}
public void bar(int i, String myText) {
String current="hi there";
System.out.println(i+ " ... " + current);
}
}
and when I run it I get this
[adinn@sputstik byteman]$ bmjava -l foo.btm Foo
byteman is here
1 ... hi there
How did you compile your code? You should use command
javac -g Foo.java
Also, which java JDK are you using?
-
2. Re: problem using AFTER WRITE on local variable
msulliv1 Oct 18, 2012 12:26 PM (in response to adinn)Andrew,
Ah! I should have known. You are correct I was missing '-g' option to java compile. Once I did that I got the expected output. Thanks for you help.
Mike
-
3. Re: problem using AFTER WRITE on local variable
adinn Oct 18, 2012 12:31 PM (in response to msulliv1)Hi Mike
Mike Sullivan wrote:
Ah! I should have known. You are correct I was missing '-g' option to java compile. Once I did that I got the expected output. Thanks for you help.
No problem. Let me know how you get on with using Byteman. Please report any things you like or dislike and would like to see improved. Also, f you can, please publish details of your use cases so others can see how it has helped you.
regards,
ndrew Dinn
-
4. Re: problem using AFTER WRITE on local variable
msulliv1 Oct 19, 2012 9:34 AM (in response to adinn)Andrew,
Here was my most useful use case so far, causing a failure in 2-phase commit to verify integration of Websphere MQ and JBoss EAP works: https://community.jboss.org/wiki/UsingJBossWithWebsphereMQSettingUpAXARecoveryModule. Where would I place these use cases?
Mike
-
5. Re: problem using AFTER WRITE on local variable
adinn Oct 19, 2012 10:36 AM (in response to msulliv1)Hi Mike,
Mike Sullivan wrote:
Here was my most useful use case so far, causing a failure in 2-phase commit to verify integration of Websphere MQ and JBoss EAP works: https://community.jboss.org/wiki/UsingJBossWithWebsphereMQSettingUpAXARecoveryModule. Where would I place these use cases?
Wow, that's a great article. Thanks very much for publishing it.
Your link is all that is needed to provide other Byteman users with an example of how to use Byteman to easily set up the test scenario. It would be hard to find a simpler or quicker way to implement this scenario where you are able both to exercise real code but also break execution at a highly specific point and ensure recovery kicks in. Thanks again.
regards,
Andrew Dinn