Package org.dom4j

Examples of org.dom4j.Element.attributeCount()


                <to variable="ncname" part="ncname"? query="queryString"?/>
            */
            toFirstAtt = toElement.attribute("variable");
            toSecondAtt = toElement.attribute("part");
            toThirdAtt = toElement.attribute("query");
            if ((toFirstAtt != null && toElement.attributeCount() == 1)
                    || (toSecondAtt != null || toThirdAtt != null)) {
                toType = Assignment.VARIABLE_PART;
                toFirstValue = toFirstAtt != null ? toFirstAtt.getValue() : "";
                toSecondValue = toSecondAtt != null ? toSecondAtt.getValue() : "";
                toThirdValue = toThirdAtt != null ? toThirdAtt.getValue() : "";
View Full Code Here


   
    Document document = xmlReader.read(outputXml);
    Element root = document.getRootElement();
   
    // There are 7 attributes because there are defaults defined by the DTD makes up the missing entries
    assertEquals("Unexpected number of hibernate-mapping elements ", 7, root.attributeCount() );
    assertEquals("Unexpected package name", "org.hibernate.tool.hbm2x.hbm2hbmxml", root.attribute("package").getStringValue() );
    assertEquals("Unexpected schema name", "myschema", root.attribute("schema").getStringValue() );
    assertEquals("Unexpected mycatalog name", "mycatalog", root.attribute("catalog").getStringValue() );
   
  }
View Full Code Here

   
    Document document = xmlReader.read(outputXml);
    Element root = document.getRootElement();
   
    // There are 5 attributes because there are non-defaults not set for this test
    assertEquals("Unexpected number of hibernate-mapping elements ", 5, root.attributeCount() );
    assertEquals("Unexpected package name", "org.hibernate.tool.hbm2x.hbm2hbmxml", root.attribute("package").getStringValue() );
    assertEquals("Unexpected access setting", "field", root.attribute("default-access").getStringValue() );
    assertEquals("Unexpected cascade setting", "save-update", root.attribute("default-cascade").getStringValue() );
 
  }
View Full Code Here

   
    Document document = xmlReader.read(outputXml);
    Element root = document.getRootElement();
   
    // There are 5 attributes because there are non-defaults not set for this test
    assertEquals("Unexpected number of hibernate-mapping elements ", 5, root.attributeCount() );
    assertEquals("Unexpected package name", "org.hibernate.tool.hbm2x.hbm2hbmxml", root.attribute("package").getStringValue() );
    assertEquals("Unexpected access setting", "property", root.attribute("default-access").getStringValue() );
    assertEquals("Unexpected cascade setting", "none", root.attribute("default-cascade").getStringValue() );
   
  }
View Full Code Here

   
    Document document = xmlReader.read(outputXml);
    Element root = document.getRootElement();
   
    // There are 5 attributes because there are non-defaults not set for this test
    assertEquals("Unexpected number of hibernate-mapping elements ", 5, root.attributeCount() );
    assertEquals("Unexpected package name", "org.hibernate.tool.hbm2x.hbm2hbmxml", root.attribute("package").getStringValue() );
    assertEquals("Unexpected access setting", "false", root.attribute("default-lazy").getStringValue() );
    assertEquals("Unexpected cascade setting", "false", root.attribute("auto-import").getStringValue() );
   
  }
View Full Code Here

        Assert.assertEquals(rootElement.getName(), "connectors");

        // validate connector
        Assert.assertEquals(rootElement.elements("connector").size(), 1);
        Element connectorElement = rootElement.element("connector");
        Assert.assertEquals(connectorElement.attributeCount(), 3);
        Assert.assertEquals(connectorElement.attributeValue("id"), "test");
        Assert.assertEquals(connectorElement.attributeValue("priority"), "1000");
        Assert.assertEquals(connectorElement.attributeValue("className"), "org.mokai.types.mock.MockConnector");

        // validate no additional
View Full Code Here

        Assert.assertEquals(rootElement.getName(), "connectors");

        // validate connector
        Assert.assertEquals(1, rootElement.elements("connector").size());
        Element connectorElement = rootElement.element("connector");
        Assert.assertEquals(3, connectorElement.attributeCount());
        Assert.assertEquals(connectorElement.attributeValue("id"), "test");
        Assert.assertEquals(connectorElement.attributeValue("priority"), "1000");
        Assert.assertEquals(connectorElement.attributeValue("className"), "org.mokai.types.mock.MockConnector");

        // validate additional
View Full Code Here

        Assert.assertEquals(rootElement.getName(), "connectors");

        // validate connector
        Assert.assertEquals(rootElement.elements("connector").size(), 1);
        Element connectorElement = rootElement.element("connector");
        Assert.assertEquals(connectorElement.attributeCount(), 3);
        Assert.assertEquals(connectorElement.attributeValue("id"), "test");
        Assert.assertEquals(connectorElement.attributeValue("priority"), "1000");
        Assert.assertEquals(connectorElement.attributeValue("className"), "org.mokai.types.mock.MockConfigurableConnector");

        Element configurationElement = connectorElement.element("configuration");
View Full Code Here

        Assert.assertEquals(connectorElement.elements("acceptors").size(), 1);
        Element acceptorsElement = connectorElement.element("acceptors");

        Assert.assertEquals(acceptorsElement.elements("acceptor").size(), 1);
        Element acceptorElement = acceptorsElement.element("acceptor");
        Assert.assertEquals(acceptorElement.attributeCount(), 1);
        Assert.assertEquals(acceptorElement.attributeValue("className"), "org.mokai.types.mock.MockConfigurableAcceptor");
        validateProperties(acceptorElement, "test1", "1");

        // validate pre-processing-actions
        Assert.assertEquals(connectorElement.elements("pre-processing-actions").size(), 1);
View Full Code Here

        Assert.assertEquals(connectorElement.elements("pre-processing-actions").size(), 1);
        Element preProcessingActionsElement = connectorElement.element("pre-processing-actions");

        Assert.assertEquals(preProcessingActionsElement.elements("action").size(), 1);
        Element preProcessingActionElement = preProcessingActionsElement.element("action");
        Assert.assertEquals(preProcessingActionElement.attributeCount(), 1);
        Assert.assertEquals(preProcessingActionElement.attributeValue("className"), "org.mokai.types.mock.MockConfigurableAction");
        validateProperties(preProcessingActionElement, "test1", "1");

        // validate post-processing-actions
        Assert.assertEquals(connectorElement.elements("post-processing-actions").size(), 1);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.