ServiceConfig extends ServiceConfigBase<T> { public void unexport() { if (!exported) { return; } if (unexported) { return; } if (!exporters.isEmpty()) { for (Exporter<?> exporter : exporters) { try { exporter.unexport(); } catch (Throwable t) { logger.warn("Unexpected error occured when unexport " + exporter, t); } } exporters.clear(); } unexported = true; dispatch(new ServiceConfigUnexportedEvent(this)); } ServiceConfig();  ServiceConfig(Service service); @Parameter(excluded = true) boolean isExported(); @Parameter(excluded = true) boolean isUnexported(); void unexport(); synchronized void export(); void exported(); DubboBootstrap getBootstrap(); void setBootstrap(DubboBootstrap bootstrap); static final Logger logger; }
@Test @Disabled("cannot pass in travis") public void testUnexport() throws Exception { System.setProperty(SHUTDOWN_WAIT_KEY, "0"); try { service.export(); service.unexport(); Thread.sleep(1000); Mockito.verify(exporter, Mockito.atLeastOnce()).unexport(); } finally { System.clearProperty(SHUTDOWN_TIMEOUT_KEY); } }