@Override protected void initialize(IProgressMonitor monitor) { super.initialize(monitor); // register for Server started and Server stopped events EventService.getInstance().subscribe(this, new ServerStartedAndStoppedFilter()); EventService.getInstance().subscribe(this, new LiveReloadClientRefreshFilter()); }
@Before public void setup() throws IOException, CoreException { // remove all servers for (final IServer server : ServerCore.getServers()) { server.stop(true); TaskMonitor monitor = new TaskMonitor() { @Override public boolean isComplete() { return !(server.canStop().isOK()); } }; TimeoutUtils.timeout(monitor, 2, TimeUnit.SECONDS); server.delete(); } // EventService.getInstance().resetSubscribers(); liveReloadServerPort = SocketUtil.findUnusedPort(50000, 55000); }