jeudi 11 juin 2015

Java JUnitCore fails with No runnable methods due @Test annotation being loaded as a com.sun.proxy.Proxy [duplicate]

This question already has an answer here:

I am attempting to load a class using a URLClassLoader and when the class is loaded I will be using JUnitCore to run a specific test that is annotated with @Test.

The Problem is that when I attempt to do so JUnitCore throws saying "No runnable methods" and further debugging shos that the class is loaded the methods are there but the annotations of said methods return as Class "com.sun.proxy.$Proxy85". I know they are the correct annotation because "org.junit.Test"

I assume because the annotation @Test is a proxy then JUnitCore cant pick up the method and throws "No runnable methods."

I am looking for a work around to either A: load the class to avoid loading proxy annotations. B: Find a work around for JUnitCore so that it can correctly pick up the methods





Aucun commentaire:

Enregistrer un commentaire