Package com.qspin.qtaste.ui.reporter

Examples of com.qspin.qtaste.ui.reporter.TestCaseReportTable


        int tabIndex = this.getTabIndex("Run1");
        if (tabIndex==-1) return;
       
        Object reportObject = runTabbedPane.getClientProperty("TestCaseReportTable_" + runTabbedPane.getTitleAt(tabIndex));
        if (reportObject instanceof TestCaseReportTable) {
            TestCaseReportTable reportTable = (TestCaseReportTable)reportObject;
            reportTable.resetTable();
        }
       
        tcLogsPane.clearLogs();
    }
View Full Code Here


        int tabIndex = this.getTabIndex(tabName);
        if (tabIndex!=-1) {
            // clear the result
            Object reportObject = runTabbedPane.getClientProperty("TestCaseReportTable_" + tabName);
            if (reportObject instanceof TestCaseReportTable) {
                TestCaseReportTable reportTable = (TestCaseReportTable)reportObject;
                reportTable.resetTable();
                // listen to events
                TestCaseReporter.addTestCaseReportTableListener(reportTable);
                this.runTabbedPane.setSelectedIndex(tabIndex);
            }
            return;
        }
        // create a new tab
        JTextArea nstackTrace = new JTextArea();
        DefaultTableModel ntcReasonModel = new DefaultTableModel(new Object[]{"Line", "File", "Method", "."}, 0) {

            @Override
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        };

        TestCaseReportTable ntcTable = new TestCaseReportTable(tabName, ntcReasonModel, nstackTrace, mTestCasePane);
        TestCaseReporter.addTestCaseReportTableListener(ntcTable);

        JTable ntcReasonTable = new JTable(ntcReasonModel) {

            @Override
            public String getToolTipText(MouseEvent e) {
                Point p = e.getPoint();
                int rowIndex = rowAtPoint(p);
                int colIndex = columnAtPoint(p);
                return convertObjectToToolTip(getValueAt(rowIndex, colIndex));
            }

            @Override
            public boolean isCellEditable(int row, int column) {
                return false;
            }
        };


        ntcReasonTable.getColumn("Line").setPreferredWidth(40);
        ntcReasonTable.getColumn("Line").setMaxWidth(40);
        ntcReasonTable.getColumn("File").setPreferredWidth(500);
        ntcReasonTable.getColumn("File").setMaxWidth(750);
        ntcReasonTable.getColumn("Method").setPreferredWidth(250);
        ntcReasonTable.getColumn("Method").setMaxWidth(500);
        ntcReasonTable.removeColumn(ntcReasonTable.getColumn("."));
        ntcReasonTable.setColumnSelectionAllowed(false);

        //tcReasonTable.getColumn("Failed Reason").setCellRenderer(new MultiLineCellRenderer());
        try {
            ntcReasonTable.setDefaultRenderer(Class.forName("java.lang.Object"), new TableReasonCellRenderer());
        } catch (ClassNotFoundException ex) {
        }
       
        ntcReasonTable.setRowSelectionAllowed(false);
        ntcReasonTable.setName("ntcReasonTable");
        ntcReasonTable.addMouseListener(new TableMouseListener(ntcReasonTable));

        nstackTrace.setRows(5);
       
        // add runTabbed panel
        JSplitPane resultMainpanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
       
        JPanel reasonMainPanel = new JPanel(new BorderLayout());
        JScrollPane reasonScrollPane = new JScrollPane(ntcReasonTable);
        reasonScrollPane.setPreferredSize(new Dimension(100, 100));
        JSplitPane reasonPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
        reasonPanel.setResizeWeight(0.5);
        reasonPanel.setDividerSize(4);
        reasonPanel.setTopComponent(reasonScrollPane);

        JPanel stackTracePanel = new JPanel(new BorderLayout());
        JLabel stackTraceLabel = new JLabel("Stack trace:");
        stackTracePanel.add(stackTraceLabel, BorderLayout.NORTH);
        stackTracePanel.add(nstackTrace);

        reasonPanel.setBottomComponent(new JScrollPane(stackTracePanel));
        reasonMainPanel.add(reasonPanel, BorderLayout.CENTER);


        resultMainpanel.setResizeWeight(0.5);
       
        resultMainpanel.setTopComponent(new JScrollPane(ntcTable.getTable()));
        resultMainpanel.setBottomComponent(reasonMainPanel);
       
        runTabbedPane.putClientProperty("TestCaseReportTable_" + tabName, ntcTable);
        runTabbedPane.addTab(tabName, resultMainpanel);       
        this.runTabbedPane.setSelectedIndex(this.runTabbedPane.getTabCount() -1);
View Full Code Here

        int tabIndex = this.getTabIndex(report);
        if (tabIndex!=-1) {
            // clear the result
            Object reportObject = runTabbedPane.getClientProperty("TestCaseReportTable_" + report);
            if (reportObject instanceof TestCaseReportTable) {
                TestCaseReportTable reportTable = (TestCaseReportTable)reportObject;
                TestCaseReporter.removeTestCaseReportTableListener(reportTable);
            }
            return;
        }
    }
View Full Code Here

    }
    public void init() {
        initIcons();
        this.setName("Test results");
       
        tcTable = new TestCaseReportTable(tcInteractivePanel);
       
        this.add(new JScrollPane(getTcTable().getTable()), BorderLayout.CENTER);
    }
View Full Code Here

TOP

Related Classes of com.qspin.qtaste.ui.reporter.TestCaseReportTable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.