Our Play Tests are running fine but I am getting an unexpected exception when one of the test class threads is closing down
[error] c.a.e.s.c.DefaultServer - Error unregistering Ebean:server=default2
java ax.management.InstanceNotFoundException: Ebean:server=default2,key=AutoFetch at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1095) ~[na:1.8.0_31]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.exclusiveUnregisterMBean(DefaultMBeanServerInterceptor.java:427) ~[na:1.8.0_31]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.unregisterMBean(DefaultMBeanServerInterceptor.java:415) ~[na:1.8.0_31]
at com.sun.jmx.mbeanserver.JmxMBeanServer.unregisterMBean(JmxMBeanServer.java:546) ~[na:1.8.0_31]
at com.avaje.ebeaninternal.server.core.DefaultServer.shutdownInternal(DefaultServer.java:406) [avaje-ebeanorm-3.2.2.jar:na]
at com.avaje.ebeaninternal.server.core.DefaultServer.shutdownManaged(DefaultServer.java:379) [avaje-ebeanorm-3.2.2.jar:na]
Here is the set up of the class that I have isolated the problem to.
@PowerMockIgnore({"javax.management.*", "javax.net.ssl.*"})
@RunWith(PowerMockRunner.class)
@PrepareForTest(AccountNote.class)
public class ReportManagerTest extends FakeApplicationTestingBaseClass {
I have seen this similiar post Ebean shutdown is broken on Play Test. The solution of changing a server name has been implemented in the FakeApplicationTestingBaseClass class and set as the default server.
ServerConfig config = new ServerConfig();
config.setName("default" + UUID.randomUUID().toString());
config.setDefaultServer(true);
config.setRegister(true);
config.setDataSourceConfig(oraDb);
EbeanServerFactory.create(config);
The problem seems to be coming from using @PowerMockIgnore and extending the used of FarkeApplicationTestingBaseClass. We have other Test Classes that only use Mockito or the fake application and they all work fine. This is the only instance where the two are used together.
Any ideas what might be happening?
Aucun commentaire:
Enregistrer un commentaire