Package com.eviware.soapui.support.xml.XmlObjectTreeModel

Examples of com.eviware.soapui.support.xml.XmlObjectTreeModel.XmlTreeNode


            if( treeModel == null )
            {
              treeModel = new XmlObjectTreeModel( messagePart.getSchemaType().getTypeSystem(), rootXmlObject );
            }

            XmlTreeNode tn = treeModel.getXmlTreeNode( xmlObj );
            if( tn != null )
              schemaType = tn.getSchemaType();
          }

          if( AttachmentUtils.isSwaRefType( schemaType ) )
          {
            String textContent = XmlUtils.getNodeValue( cursor.getDomNode() );
View Full Code Here


                if (scp.getXpath().trim().length() > 0) {
                    model = SecurityScanUtil.getXmlObjectTreeModel(testStep, scp);
                    XmlTreeNode[] treeNodes = null;
                    treeNodes = model.selectTreeNodes(context.expand(scp.getXpath()));
                    if (treeNodes.length > 0) {
                        XmlTreeNode mynode = treeNodes[0];
                        String fuzzed = fuzzedValue();
                        mynode.setValue(1, fuzzed);
                        parameters.put(scp.getLabel(), fuzzed);
                    }
                    updateRequestProperty(testStep, scp.getName(), model.getXmlObject().toString());

                } else {
View Full Code Here

    /*
     * used for testing
     */
    private void printNode(NodeInfo node) {
        XmlTreeNode mynode = node.node;

        System.out.println(mynode.getNodeName());
        System.out.println(node.getType());
        System.out.println(node.xpath);
    }
View Full Code Here

     * actualy carry values.
     */
    TreeMap<String, NodeInfo> getElements(XmlTreeNode rootXmlTreeNode) {
        TreeMap<String, NodeInfo> result = new TreeMap<String, NodeInfo>();
        for (int cnt = 0; cnt < rootXmlTreeNode.getChildCount(); cnt++) {
            XmlTreeNode xmlTreeNodeChild = (XmlTreeNode) rootXmlTreeNode.getChild(cnt);

            if (xmlTreeNodeChild.getChildCount() > 0) {
                result.putAll(getElements(rootXmlTreeNode.getChild(cnt)));
            } else {
                if (xmlTreeNodeChild.getSchemaType() != null && xmlTreeNodeChild.getSchemaType().isPrimitiveType()) {
                    result.put(xmlTreeNodeChild.getDomNode().getLocalName(), new NodeInfo(rootXmlTreeNode.getChild(cnt)));
                }
            }
        }
        return result;
    }
View Full Code Here

                    if (scp.isChecked() && scp.getXpath().trim().length() > 0) {
                        model = SecurityScanUtil.getXmlObjectTreeModel(testStep, scp);
                        XmlTreeNode[] treeNodes = null;
                        treeNodes = model.selectTreeNodes(context.expand(scp.getXpath()));
                        if (treeNodes.length > 0) {
                            XmlTreeNode mynode = treeNodes[0];
                            mynode.setValue(1, parameters.get(scp.getLabel()));
                        }
                        updateRequestProperty(testStep, scp.getName(), model.getXmlObject().toString());

                    } else {
                        updateRequestProperty(testStep, scp.getName(), parameters.get(scp.getLabel()));
View Full Code Here

        return model.getXmlObject().toString();
    }

    private void getNextChild(XmlTreeNode node) {
        for (int i = 0; i < node.getChildCount(); i++) {
            XmlTreeNode mynode = node.getChild(i);

            if (mynode.getSchemaType() != null && mynode.getSchemaType().getEnumerationValues() != null
                    && mynode.getSchemaType().getEnumerationValues().length > 0) {
                EnumerationValues nodeInfo = new EnumerationValues(mynode.getSchemaType().getBaseType().getShortJavaName());
                for (XmlAnySimpleType s : mynode.getSchemaType().getEnumerationValues()) {
                    nodeInfo.addValue(s.getStringValue());
                }

                updateNodeValue(mynode, nodeInfo);
View Full Code Here

                    if (schemaType.isNoType()) {
                        if (treeModel == null) {
                            treeModel = new XmlObjectTreeModel(messagePart.getSchemaType().getTypeSystem(), rootXmlObject);
                        }

                        XmlTreeNode tn = treeModel.getXmlTreeNode(xmlObj);
                        if (tn != null) {
                            schemaType = tn.getSchemaType();
                        }
                    }

                    if (AttachmentUtils.isSwaRefType(schemaType)) {
                        String textContent = XmlUtils.getNodeValue(cursor.getDomNode());
View Full Code Here

                    XmlTreeNode[] treeNodes = null;

                    treeNodes = model.selectTreeNodes(context.expand(scp.getXpath()));

                    if (treeNodes.length > 0) {
                        XmlTreeNode mynode = treeNodes[0];

                        // work only for simple types
                        if (mynode.isLeaf()) {
                            mynode.setValue(1, value);

                            if (strategy.equals(StrategyTypeConfig.ONE_BY_ONE)) {
                                PropertyMutation oneByOnePropertyMutation = new PropertyMutation();
                                oneByOnePropertyMutation.setPropertyName(scp.getName());
                                oneByOnePropertyMutation.setPropertyValue(unescapEscaped(model.getXmlObject().toString()));
                                stsmap.put(scp.getLabel(), mynode.getNodeText());
                                oneByOnePropertyMutation.setMutatedParameters(stsmap);
                                oneByOnePropertyMutation.updateRequestProperty(testStepCopy);
                                oneByOnePropertyMutation.setTestStep(testStepCopy);
                                oneByOnePropertyMutation.addMutation(context);
                            } else {
                                allAtOncePropertyMutation.setPropertyName(scp.getName());
                                allAtOncePropertyMutation.setPropertyValue(unescapEscaped(model.getXmlObject().toString()));
                                stsmap.put(scp.getLabel(), mynode.getNodeText());
                                allAtOncePropertyMutation.setMutatedParameters(stsmap);
                                allAtOncePropertyMutation.updateRequestProperty(testStepCopy);
                                allAtOncePropertyMutation.setTestStep(testStepCopy);

                            }
View Full Code Here

    public static List<String> getRestrictions(XmlTreeNode node, List<String> restrictionsList) {
        String baseType = null;

        for (int i = 0; i < node.getChildCount(); i++) {
            XmlTreeNode mynode = node.getChild(i);

            if ("xsd:restriction".equals(mynode.getParent().getNodeName())) {
                if (mynode.getNodeName().equals("@base")) {
                    baseType = mynode.getNodeText();
                    restrictionsList.add("type = " + baseType);
                } else {
                    String nodeName = mynode.getNodeName();
                    String nodeValue = mynode.getChild(0).getNodeText();
                    restrictionsList.add(nodeName + " = " + nodeValue);
                }
            }
            getRestrictions(mynode, restrictionsList);
        }
View Full Code Here

    public static List<String> getType(XmlTreeNode node, List<String> restrictionsList) {
        String baseType = null;

        for (int i = 0; i < node.getChildCount(); i++) {
            XmlTreeNode mynode = node.getChild(i);

            if (mynode.getNodeName().equals("@base")) {
                baseType = mynode.getNodeText();
                if (baseType.contains(":")) {
                    baseType = baseType.substring(baseType.indexOf(":") + 1);
                }
                restrictionsList.add("type = " + baseType);
            }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.support.xml.XmlObjectTreeModel.XmlTreeNode

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.