PropertyIndexStats extends AnnotatedStandardMBean implements PropertyIndexStatsMBean { @Deactivate private void deactivate() { if (reg != null) { reg.unregister(); } } PropertyIndexStats(); @Override TabularData getStatsForAllIndexes(String path, int maxValueCount, int maxDepth, int maxPathCount); @Override CompositeData getStatsForSpecificIndex(String path, int maxValueCount, int maxDepth, int maxPathCount);  }
@Test public void jmxReg() throws Exception{ activateMBean(); assertNotNull(context.getService(PropertyIndexStatsMBean.class)); MockOsgi.deactivate(mbean, context.bundleContext()); assertNull(context.getService(PropertyIndexStatsMBean.class)); }