(t *testing.T)
| 97 | } |
| 98 | |
| 99 | func TestInvokeMethod(t *testing.T) { |
| 100 | assert := assert.To(t) |
| 101 | err := jdbg.Do(conn, thread, func(j *jdbg.JDbg) error { |
| 102 | calcTy := j.Class("Calculator") |
| 103 | |
| 104 | calc := calcTy.New() |
| 105 | for _, i := range []int{3, 6, 8} { |
| 106 | calc.Call("Add", i) |
| 107 | } |
| 108 | |
| 109 | res := calc.Call("Result").Get() |
| 110 | assert.For("res").That(res).Equals(3 + 6 + 8) |
| 111 | return nil |
| 112 | }) |
| 113 | assert.For("err").That(err).Equals(nil) |
| 114 | |
| 115 | } |