Package com.sun.faban.driver

Examples of com.sun.faban.driver.CustomMetrics$Element


            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

    /**
     * @see org.andromda.metafacades.uml.EventFacade#getTransition()
     */
    protected java.lang.Object handleGetTransition()
    {
        Element owner = this.metaObject.getOwner();
        if (owner instanceof Transition)
        {
            return owner;
        }
        return null;
View Full Code Here

    /**
     * @see org.andromda.metafacades.uml.EventFacade#getState()
     */
    protected java.lang.Object handleGetState()
    {
        Element owner = this.metaObject.getOwner();
        if (owner instanceof State)
        {
            return owner;
        }
        return null;
View Full Code Here

    /**
     * @see org.andromda.metafacades.uml.FrontEndController#getUseCase()
     */
    protected java.lang.Object handleGetUseCase()
    {
        Element owner = (Classifier)this.metaObject;
        while (!(owner == null || owner instanceof UseCase))
        {
            owner = owner.getOwner();
        }
        return owner;
    }
View Full Code Here

    /**
     * @see org.andromda.metafacades.uml.ActivityGraphFacade#getUseCase()
     */
    protected java.lang.Object handleGetUseCase()
    {
        Element owner = (this.metaObject).getOwner();
        if (owner instanceof UseCase)
        {
            return owner;
        }

View Full Code Here

    {
        // TODO: What should this method return ?
      // As I've seen in uml1.4 impl, it should return the statemachine which this element is the context for.
      // Let's say for UML2: Return the owner if the latter is a StateMachine
      StateMachine stateMachine = null;
        Element owner = this.metaObject.getOwner();
        if(owner instanceof StateMachine)
        {
          stateMachine = (StateMachine) owner;
        }
        return stateMachine;
View Full Code Here

    /**
     * @see org.andromda.metafacades.uml.GuardFacade#getTransition()
     */
    protected java.lang.Object handleGetTransition()
    {
        Element owner = this.metaObject.getOwner();
        if (owner instanceof Transition)
        {
            return owner;
        }
        return null;
View Full Code Here

    /**
     * @see org.andromda.metafacades.uml.StateVertexFacade#getStateMachine()
     */
    protected java.lang.Object handleGetStateMachine()
    {
        Element owner = this.metaObject;
        while (!(owner instanceof StateMachine))
        {
            owner = owner.getOwner();
        }
        return owner;
    }
View Full Code Here

            modelElement);

        Collection stereotypeNames = Collections.EMPTY_LIST;
        if (modelElement instanceof Element)
        {
            Element element = (Element)modelElement;
            stereotypeNames = UmlUtilities.getStereotypeNames(element);
        }
        else if (modelElement instanceof ModelElementFacade)
        {
            stereotypeNames = ((ModelElementFacade)modelElement).getStereotypeNames();
View Full Code Here

TOP

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

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.