You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.google.testing.threadtester.MethodCaller.invoke(MethodCaller.java:71)
at com.google.testing.threadtester.BaseThreadedTestRunner.runTests(BaseThreadedTestRunner.java:179)
at com.google.testing.threadtester.BaseThreadedTestRunner.runTests(BaseThreadedTestRunner.java:143)
at DoClassTest.runThreadedTests(DoClassTest.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.lang.reflect.Method.invoke(Method.java:483)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.google.testing.threadtester.MethodCaller.invoke(MethodCaller.java:68)
... 13 more
Caused by: java.lang.IllegalArgumentException: Cannot find method public static void DoClass.doTheThing()
at com.google.testing.threadtester.ClassInstrumentationImpl.getMethod(ClassInstrumentationImpl.java:113)
at com.google.testing.threadtester.InterleavedRunner.getMainMethod(InterleavedRunner.java:116)
at com.google.testing.threadtester.InterleavedRunner.doInterleave(InterleavedRunner.java:131)
at com.google.testing.threadtester.InterleavedRunner.interleave(InterleavedRunner.java:80)
at com.google.testing.threadtester.AnnotatedTestWrapper.runTestCases(AnnotatedTestWrapper.java:258)
at com.google.testing.threadtester.AnnotatedTestWrapper.runTests(AnnotatedTestWrapper.java:242)
... 16 more
Is this a known issue ? Am I doing something wrong ?
Thanks
The text was updated successfully, but these errors were encountered:
Sorry - I must have missed this the first time around.
I'm afraid there's currently no support for static methods. The logic that handles breakpoints is built around the assumption that we are invoking non-static methods on a specific object being tested. (And the logic for interleaving threads of execution is built on breakpoints, which allow us to pause one thread and run another.)
I'm not sure what would break if this assumption was removed. I will try and investigate, but it might not be feasible.
I hope it is feasible, I tried having a look at the instrumentation but I'm really not familiar enough with that kind of procedure and could not figure out the limitations of the mechanism.
Please keep me posted on your investigation, thanks in advance :)
Hi,
I tried getting information regarding this but could not find any. It seems I cannot instrument static methods to test them with thread weaver.
Here is a basic example of what I try to achieve:
All I end up with is this nasty exception:
Is this a known issue ? Am I doing something wrong ?
Thanks
The text was updated successfully, but these errors were encountered: