Package com.sun.faban.driver

Examples of com.sun.faban.driver.CustomMetrics


            Set<Map.Entry<String, CustomMetrics>> entries =
                    s.metricAttachments.entrySet();
            for (Map.Entry<String, CustomMetrics> entry : entries) {
                String key = entry.getKey();
                if (metricAttachments.containsKey(key)) {
                    CustomMetrics m = metricAttachments.get(key);
                    m.add(entry.getValue());
                } else {
                    metricAttachments.put(key, entry.getValue());
                }
            }
        }

        // Aggregate the attached CustomTableMetrics.
        if (tableAttachments == null) {
            tableAttachments = s.tableAttachments;
        } else if (s.tableAttachments != null) {
            Set<Map.Entry<String, CustomTableMetrics>> entries =
                    s.tableAttachments.entrySet();
            for (Map.Entry<String, CustomTableMetrics> entry : entries) {
                String key = entry.getKey();
                if (tableAttachments.containsKey(key)) {
                    CustomTableMetrics m = tableAttachments.get(key);
                    m.add(entry.getValue());
                } else {
                    tableAttachments.put(key, entry.getValue());
                }
            }
        }
View Full Code Here


        if (metricAttachments != null) {
            Set<Map.Entry<String, CustomMetrics>> entries =
                    metricAttachments.entrySet();
            for (Map.Entry<String, CustomMetrics> entry : entries) {
                CustomMetrics attachment = entry.getValue();
                CustomMetrics.Element[] elements;
                try {
                    elements = attachment.getResults();
                } catch (Exception e) { // Ensure the getResults
                    // doesn't break report generation.
                    logger.log(Level.WARNING,
                            "Exceptions reporting CustomMetrics", e);
                    elements = null;
                }
                if (elements != null && elements.length > 0) {
                    space(8, buffer).append("<customStats name=\"").
                            append(entry.getKey()).append("\">\n");
                    for (CustomMetrics.Element element : elements) {
                        if (element == null) {
                            logger.warning("Null element returned from " +
                                    attachment.getClass().getName() +
                                    ".getResults, ignored!");
                            continue;
                        }
                        space(12, buffer).append("<stat>\n");
                        if (element.description != null) {
                            space(16, buffer).append("<description>");
                            Utilities.escapeXML(element.description, buffer);
                            buffer.append("</description>\n");
                        } else {
                            space(16, buffer).append("<description/>\n");
                        }
                        if (element.result != null) {
                            space(16, buffer).append("<result>");
                            Utilities.escapeXML(element.result, buffer);
                            buffer.append("</result>\n");
                        } else {
                            space(16, buffer).append("<result/>\n");
                        }
                        if (element.target != null) {
                            space(16, buffer).append("<target>");
                            Utilities.escapeXML(element.target, buffer);
                            buffer.append("</target>\n");
                        }
                        if (element.allowedDeviation != null) {
                            space(16, buffer).append("<allowedDeviation>");
                            Utilities.escapeXML(element.allowedDeviation,
                                                buffer);
                            buffer.append("</allowedDeviation>\n");
                        }
                        if (element.passed != null) {
                            space(16, buffer).append("<passed>").append(
                                    element.passed.booleanValue()).
                                    append("</passed>\n");
                            if (!element.passed) {
                                success = false;
                            }
                        }
                        space(12, buffer).append("</stat>\n");
                    }
                    space(8, buffer).append("</customStats>\n");
                }
            }
        }

        if (tableAttachments != null) {
            Set<Map.Entry<String, CustomTableMetrics>> entries =
                    tableAttachments.entrySet();
            for (Map.Entry<String, CustomTableMetrics> entry : entries) {
                CustomTableMetrics attachment = entry.getValue();
                TableModel table = null;
                try {
                    table = attachment.getResults();
                } catch (Exception e) { // Ensure the getResults
                    // doesn't break report generation.
                    logger.log(Level.WARNING,
                            "Exceptions reporting CustomTableMetrics", e);
                }
View Full Code Here

TOP

Related Classes of com.sun.faban.driver.CustomMetrics

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.