public void evaluate() { try { // clear problems and console messages problemsView.setText(""); consoleView.setText(""); // update status view statusView.setText(" Parsing ..."); tabbedPane.setSelectedIndex(0); LispExpr root = Parser.parse(textView.getText()); statusView.setText(" Running ..."); tabbedPane.setSelectedIndex(1); // update run button runButton.setIcon(stopImage); runButton.setActionCommand("Stop"); // start run thread runThread = new RunThread(root); runThread.start(); } catch (SyntaxError e) { tabbedPane.setSelectedIndex(0); System.err.println( "Syntax Error at " + e.getLine() + ", " + e.getColumn() + " : " + e.getMessage()); } catch (Error e) { // parsing error System.err.println(e.getMessage()); statusView.setText(" Errors."); } }
/** * Begin processing the given operations. * * @param operations the given operations * @param user the user who will be processing the operations * @exception IllegalStateException if the processing is already running */ public synchronized void process(Collection<Operation> operations, User user) { if (isRunning()) { throw new IllegalStateException("Can't begin processing while already processing"); } runThread = new RunThread(operations, user); runThread.start(); runs++; }
private boolean processThread(RunThread runThread, long timeout) throws InterruptedException { runThread.start(); runThread.join(timeout * 1000); if (runThread.isAlive()) { TestVerifier.testStatus = TestVerifier.TEST_STATUS.TIMEOUT; runThread.interrupt(); return false; } return true; }
public void compileAndRunTests() throws Exception { Object[] sources = this.compiler.compile(this.sources); if (sources.length == 0) { throw new RuntimeException("No classes found in '" + this.sources + "'"); } // Run in new thread to ensure that the context classloader is setup RunThread runThread = new RunThread(sources); runThread.start(); runThread.join(); }