public static void main(String[] args) { new TestRunner().start(args); }
synchronized public void runSuite() { if (fRunner != null) { fTestResult.stop(); } else { setLoading(shouldReload()); reset(); showInfo("Load Test Case..."); final String suiteName= getSuiteText(); final Test testSuite= getTest(suiteName); if (testSuite != null) { addToHistory(suiteName); doRunTest(testSuite); } } }
public void actionPerformed(ActionEvent e) { browseTestClasses(); } }
protected JFrame createUI(String suiteName) { JFrame frame= createFrame(); JMenuBar mb= new JMenuBar(); createMenus(mb); frame.setJMenuBar(mb); fSuiteCombo= createSuiteCombo(); fRun= createRunButton(); frame.getRootPane().setDefaultButton(fRun); Component browseButton= createBrowseButton(); fUseLoadingRunner= createUseLoaderCheckBox(); fStatusLine= createStatusLine(); if (inMac()) fProgressIndicator= new MacProgressBar(fStatusLine); else fProgressIndicator= new ProgressBar(); fCounterPanel= createCounterPanel(); fTestViewTab= createTestRunViews(); JPanel failedPanel= createFailedPanel(); fFailureView= createFailureDetailView(); JScrollPane tracePane= new JScrollPane(fFailureView.getComponent(), ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); fQuitButton= createQuitButton(); fLogo= createLogo(); addGrid(panel, suiteLabel, 0, 0, 2, GridBagConstraints.HORIZONTAL, 1.0, GridBagConstraints.WEST);
private void doRunTest(final Test testSuite) { setButtonLabel(fRun, "Stop"); fRunner= new Thread("TestRunner-Thread") { public void run() { TestRunner.this.start(testSuite); postInfo("Running..."); long startTime= System.currentTimeMillis(); testSuite.run(fTestResult); if (fTestResult.shouldStop()) { postStatus("Stopped"); } else { long endTime= System.currentTimeMillis(); long runTime= endTime-startTime; postInfo("Finished: " + elapsedTimeAsString(runTime) + " seconds"); } runFinished(testSuite); setButtonLabel(fRun, "Run"); fRunner= null; System.gc(); } }; // make sure that the test result is created before we start the // test runner thread so that listeners can register for it. fTestResult= createTestResult(); fTestResult.addListener(TestRunner.this); aboutToStart(testSuite); fRunner.start(); }
public void textChanged() { fRun.setEnabled(getSuiteText().length() > 0); clearStatus(); }