Examples of ODOMObservable


Examples of com.volantis.mcs.eclipse.common.odom.ODOMObservable

     * Test the removal of a Attribute node.
     */
    public void testRemoveAttribute() throws Exception {
        ODOMXPath path = new ODOMXPath("cd/@country");

        ODOMObservable removed = path.remove((ODOMObservable) root);

        assertNotNull("Removed element should exist", removed);
        assertTrue("Should be an Attribute", removed instanceof Attribute);
        Attribute attribute = (Attribute) removed;
        assertEquals("Name should match", "country", attribute.getName());
View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMObservable

     * Test the removal of a Text node.
     */
    public void testRemoveText() throws Exception {
        ODOMXPath path = new ODOMXPath("cd/title/text()");

        ODOMObservable removed = path.remove((ODOMObservable) root);

        assertNotNull("Removed element should exist", removed);
        assertTrue("Should be a Text node", removed instanceof Text);
        Text element = (Text) removed;
        assertEquals("Value should match", "Empire Burlesque",
View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMObservable

     * Test the removal of a node that doesn't exist.
     */
    public void testRemoveNodeUnknown() throws Exception {
        ODOMXPath path = new ODOMXPath("cd/@nocountry");

        ODOMObservable removed = path.remove((ODOMObservable) root);
        assertNull("Removed element should not exist", removed);
    }
View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMObservable

     * Test the removal of a node with an invalid context.
     */
    public void testRemoveInvalidContext() throws Exception {
        ODOMXPath path = new ODOMXPath("title");

        ODOMObservable removed = path.remove((ODOMObservable) root);
        assertNull("Removed element should not exist", removed);
    }
View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMObservable

     * Test the removal of a node which results in parent nodes being removed.
     */
    public void testRemoveParentNodesParentHasContent() throws Exception {
        ODOMXPath path = new ODOMXPath("cd/title/@testAttribute");

        ODOMObservable removed = path.remove((ODOMObservable) root);
        assertNotNull("Removed element should exist", removed);
        assertTrue("Should be an Attribute: " + removed,
                   removed instanceof Attribute);
        Attribute attribute = (Attribute) removed;
        assertEquals("Name should match", "testAttribute",
View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMObservable

     * Test the removal of a node which results in parent nodes being removed.
     */
    public void testRemoveParentNodes() throws Exception {
        ODOMXPath path = new ODOMXPath("cd/price/@testRemove");

        ODOMObservable removed = path.remove((ODOMObservable) root);
        assertNotNull("Removed element should exist", removed);
        assertTrue("Should be an Element: " + removed,
                   removed instanceof Element);
        Element element = (Element) removed;
        assertEquals("Name should match", "price", element.getName());
View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMObservable

        ODOMXPath oneToThree = new ODOMXPath("two/three");
        ODOMXPath oneToThreeAttrib = new ODOMXPath(oneToThree,
                                           "@" + threeAttrib.getName());

        // Do the removal.
        ODOMObservable observable = oneToThreeAttrib.remove(one);

        assertNotNull("Node shouldn't be null", observable);
        assertTrue("Type should match", observable instanceof ODOMElement);
        ODOMElement element = (ODOMElement) observable;
        assertEquals("Name should match", "two", element.getName());
View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMObservable

        ODOMElement grandchild = (ODOMElement) factory.element("grandchild");
        ODOMXPath path = new ODOMXPath("child/grandchild");

        root.addContent(child.addContent(grandchild));

        ODOMObservable deleted = path.remove(root);

        assertNotNull("The deleted grandchild should have been found",
                      deleted);

        assertTrue("The returned node should have been an element",
View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMObservable

        ODOMXPath path = new ODOMXPath("child/@grandchild");

        root.addContent(child);
        child.setAttribute(grandchild);

        ODOMObservable deleted = path.remove(root);

        assertNotNull("The deleted grandchild should have been found",
                      deleted);

        assertTrue("The returned node should have been an element",
View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMObservable

        ODOMText grandchild = (ODOMText) factory.text("grandchild");
        ODOMXPath path = new ODOMXPath("child/text()");

        root.addContent(child.addContent(grandchild));

        ODOMObservable deleted = path.remove(root);

        assertNotNull("The deleted grandchild should have been found",
                      deleted);

        assertTrue("The returned node should have been an element",
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.