@Test public void should_throw_when_not_existing_start_script() throws Exception { cssAnalyzerBridgeServer = createCssAnalyzerBridgeServer("NOT_EXISTING.js"); thrown.expect(NodeCommandException.class); thrown.expectMessage("Node.js script to start css-bundle server doesn't exist"); cssAnalyzerBridgeServer.startServer(context); }
public void startServer(SensorContext context) throws IOException { PROFILER.startDebug("Starting server"); port = NetUtils.findOpenPort(); File scriptFile = new File(bundle.startServerScript()); if (!scriptFile.exists()) { throw new NodeCommandException("Node.js script to start css-bundle server doesn't exist: " + scriptFile.getAbsolutePath()); } initNodeCommand(context, scriptFile); LOG.debug("Starting Node.js process to start css-bundle server at port " + port); nodeCommand.start(); if (!waitServerToStart(timeoutSeconds * 1000)) { throw new NodeCommandException("Failed to start server (" + timeoutSeconds + "s timeout)"); } PROFILER.stopDebug(); }
CssAnalyzerBridgeServer implements Startable { public void startServer(SensorContext context) throws IOException { PROFILER.startDebug("Starting server"); port = NetUtils.findOpenPort(); File scriptFile = new File(bundle.startServerScript()); if (!scriptFile.exists()) { throw new NodeCommandException("Node.js script to start css-bundle server doesn't exist: " + scriptFile.getAbsolutePath()); } initNodeCommand(context, scriptFile); LOG.debug("Starting Node.js process to start css-bundle server at port " + port); nodeCommand.start(); if (!waitServerToStart(timeoutSeconds * 1000)) { throw new NodeCommandException("Failed to start server (" + timeoutSeconds + "s timeout)"); } PROFILER.stopDebug(); } }
CssAnalyzerBridgeServer implements Startable { public void startServer(SensorContext context) throws IOException { PROFILER.startDebug("Starting server"); port = NetUtils.findOpenPort(); File scriptFile = new File(bundle.startServerScript()); if (!scriptFile.exists()) { throw new NodeCommandException("Node.js script to start css-bundle server doesn't exist: " + scriptFile.getAbsolutePath()); } initNodeCommand(context, scriptFile); LOG.debug("Starting Node.js process to start css-bundle server at port " + port); nodeCommand.start(); if (!waitServerToStart(timeoutSeconds * 1000)) { throw new NodeCommandException("Failed to start server (" + timeoutSeconds + "s timeout)"); } PROFILER.stopDebug(); } @SuppressWarnings("unused")  CssAnalyzerBridgeServer(Bundle bundle, @Nullable AnalysisWarnings analysisWarnings); protected  CssAnalyzerBridgeServer(NodeCommandBuilder nodeCommandBuilder, int timeoutSeconds, Bundle bundle, @Nullable AnalysisWarnings analysisWarnings); }
CssAnalyzerBridgeServer implements Startable { public void startServer(SensorContext context) throws IOException { PROFILER.startDebug("Starting server"); port = NetUtils.findOpenPort(); File scriptFile = new File(bundle.startServerScript()); if (!scriptFile.exists()) { throw new NodeCommandException("Node.js script to start css-bundle server doesn't exist: " + scriptFile.getAbsolutePath()); } initNodeCommand(context, scriptFile); LOG.debug("Starting Node.js process to start css-bundle server at port " + port); nodeCommand.start(); if (!waitServerToStart(timeoutSeconds * 1000)) { throw new NodeCommandException("Failed to start server (" + timeoutSeconds + "s timeout)"); } PROFILER.stopDebug(); } @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 void startServer(SensorContext context) throws IOException { PROFILER.startDebug("Starting server"); port = NetUtils.findOpenPort(); File scriptFile = new File(bundle.startServerScript()); if (!scriptFile.exists()) { throw new NodeCommandException("Node.js script to start css-bundle server doesn't exist: " + scriptFile.getAbsolutePath()); } initNodeCommand(context, scriptFile); LOG.debug("Starting Node.js process to start css-bundle server at port " + port); nodeCommand.start(); if (!waitServerToStart(timeoutSeconds * 1000)) { throw new NodeCommandException("Failed to start server (" + timeoutSeconds + "s timeout)"); } PROFILER.stopDebug(); } @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);  }