(t *testing.T)
| 82 | } |
| 83 | |
| 84 | func TestInvokeStaticMethod(t *testing.T) { |
| 85 | ctx := log.Testing(t) |
| 86 | |
| 87 | class, err := connection.GetClassBySignature("LCalculator;") |
| 88 | if err != nil { |
| 89 | log.F(ctx, true, "GetClassesBySignature returned error: %v", err) |
| 90 | return |
| 91 | } |
| 92 | |
| 93 | methods, err := connection.GetMethods(class.TypeID) |
| 94 | if err != nil { |
| 95 | log.F(ctx, true, "GetMethods returned error: %v", err) |
| 96 | return |
| 97 | } |
| 98 | |
| 99 | add := methods.FindBySignature("Add", "(II)I") |
| 100 | if add == nil { |
| 101 | log.F(ctx, true, "Couldn't find method Add: %v", err) |
| 102 | return |
| 103 | } |
| 104 | |
| 105 | result, err := connection.InvokeStaticMethod(class.ClassID(), add.ID, thread, jdwp.InvokeSingleThreaded, 3, 7) |
| 106 | if err != nil { |
| 107 | log.F(ctx, true, "InvokeStaticMethod returned error: %v", err) |
| 108 | return |
| 109 | } |
| 110 | assert.For(ctx, "Add(3, 7)").That(result.Result).Equals(10) |
| 111 | } |
| 112 | |
| 113 | func TestInvokeMethod(t *testing.T) { |
| 114 | ctx := log.Testing(t) |
nothing calls this directly
no test coverage detected