@Test public void should_forward_process_streams() throws Exception { cssAnalyzerBridgeServer = createCssAnalyzerBridgeServer("testLogs.js"); cssAnalyzerBridgeServer.startServerLazily(context); assertThat(logTester.logs(DEBUG)).contains("testing debug log"); assertThat(logTester.logs(WARN)).contains("testing warn log"); assertThat(logTester.logs(INFO)).contains("testing info log"); assertThat(logTester.logs(ERROR)).contains("testing error log"); }
public boolean startServerLazily(SensorContext context) throws IOException { if (failedToStart) { LOG.debug("Skipping start of css-bundle server due to the failure during first analysis"); LOG.debug("Skipping execution of CSS rules due to the problems with css-bundle server"); return false; } try { if (isAlive()) { LOG.debug("css-bundle server is up, no need to start."); return true; } deploy(context.fileSystem().workDir()); startServer(context); return true; } catch (NodeCommandException e) { failedToStart = true; processNodeCommandException(e, context); return false; } }
CssAnalyzerBridgeServer implements Startable { public boolean startServerLazily(SensorContext context) throws IOException { if (failedToStart) { LOG.debug("Skipping start of css-bundle server due to the failure during first analysis"); LOG.debug("Skipping execution of CSS rules due to the problems with css-bundle server"); return false; } try { if (isAlive()) { LOG.debug("css-bundle server is up, no need to start."); return true; } deploy(context.fileSystem().workDir()); startServer(context); return true; } catch (NodeCommandException e) { failedToStart = true; processNodeCommandException(e, context); return false; } } }
CssAnalyzerBridgeServer implements Startable { public boolean startServerLazily(SensorContext context) throws IOException { if (failedToStart) { LOG.debug("Skipping start of css-bundle server due to the failure during first analysis"); LOG.debug("Skipping execution of CSS rules due to the problems with css-bundle server"); return false; } try { if (isAlive()) { LOG.debug("css-bundle server is up, no need to start."); return true; } deploy(context.fileSystem().workDir()); startServer(context); return true; } catch (NodeCommandException e) { failedToStart = true; processNodeCommandException(e, context); return false; } } @SuppressWarnings("unused")  CssAnalyzerBridgeServer(Bundle bundle, @Nullable AnalysisWarnings analysisWarnings); protected  CssAnalyzerBridgeServer(NodeCommandBuilder nodeCommandBuilder, int timeoutSeconds, Bundle bundle, @Nullable AnalysisWarnings analysisWarnings); }
CssAnalyzerBridgeServer implements Startable { public boolean startServerLazily(SensorContext context) throws IOException { if (failedToStart) { LOG.debug("Skipping start of css-bundle server due to the failure during first analysis"); LOG.debug("Skipping execution of CSS rules due to the problems with css-bundle server"); return false; } try { if (isAlive()) { LOG.debug("css-bundle server is up, no need to start."); return true; } deploy(context.fileSystem().workDir()); startServer(context); return true; } catch (NodeCommandException e) { failedToStart = true; processNodeCommandException(e, context); return false; } } @SuppressWarnings("unused")  CssAnalyzerBridgeServer(Bundle bundle, @Nullable AnalysisWarnings analysisWarnings); protected  CssAnalyzerBridgeServer(NodeCommandBuilder nodeCommandBuilder, int timeoutSeconds, Bundle bundle, @Nullable AnalysisWarnings analysisWarnings); void deploy(File deployLocation); void startServer(SensorContext context); boolean startServerLazily(SensorContext context); Issue[] analyze(Request request); boolean isAlive(); String getCommandInfo(); @Override void start(); @Override void stop(); void setPort(int port); }
CssAnalyzerBridgeServer implements Startable { public boolean startServerLazily(SensorContext context) throws IOException { if (failedToStart) { LOG.debug("Skipping start of css-bundle server due to the failure during first analysis"); LOG.debug("Skipping execution of CSS rules due to the problems with css-bundle server"); return false; } try { if (isAlive()) { LOG.debug("css-bundle server is up, no need to start."); return true; } deploy(context.fileSystem().workDir()); startServer(context); return true; } catch (NodeCommandException e) { failedToStart = true; processNodeCommandException(e, context); return false; } } @SuppressWarnings("unused")  CssAnalyzerBridgeServer(Bundle bundle, @Nullable AnalysisWarnings analysisWarnings); protected  CssAnalyzerBridgeServer(NodeCommandBuilder nodeCommandBuilder, int timeoutSeconds, Bundle bundle, @Nullable AnalysisWarnings analysisWarnings); void deploy(File deployLocation); void startServer(SensorContext context); boolean startServerLazily(SensorContext context); Issue[] analyze(Request request); boolean isAlive(); String getCommandInfo(); @Override void start(); @Override void stop(); void setPort(int port);  }