testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestName3DefaultPrefix.java [51:100]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        OMElement root = f.createOMElement("root", rootNS);
        root.addChild(element);

        // Test getting the namespace, localpart and prefix.  This should used not result in
        // expansion
        assertTrue(element.getLocalName().equals("DUMMYNAME"));
        assertTrue(element.getNamespace().getNamespaceURI().equals("http://DUMMYNS"));
        assertTrue(element.getNamespace().getPrefix().equals("DUMMYPREFIX"));

        // Serialize and cache.  This should cause expansion and update the name to match the
        // testDocument string
        StringWriter writer = new StringWriter();

        try {
            root.serialize(writer);
        } catch (Exception e) {
            // Current Behavior
            // The current OMSourceElementImpl ensures that the namespace and localName
            // are consistent with the original setting.
            return;
        }

        String result = writer.toString();

        assertTrue(element.getLocalName().equals("library"));
        assertTrue(
                element.getNamespace()
                        .getNamespaceURI()
                        .equals("http://www.sosnoski.com/uwjws/library"));
        assertTrue(element.getNamespace().getPrefix().equals(""));
        // Make sure that the serialized string does not contain the DUMMY values
        assertTrue(result.indexOf("DUMMY") < 0);

        assertTrue("Serialized text error" + result, result.indexOf("1930110111") > 0);

        // Serialize again
        writer = new StringWriter();
        root.serialize(writer);
        result = writer.toString();

        assertTrue(element.getLocalName().equals("library"));
        assertTrue(
                element.getNamespace()
                        .getNamespaceURI()
                        .equals("http://www.sosnoski.com/uwjws/library"));
        assertTrue(element.getNamespace().getPrefix().equals(""));
        // Make sure that the serialized string does not contain the DUMMY values
        assertTrue(result.indexOf("DUMMY") < 0);

        assertTrue("Serialized text error" + result, result.indexOf("1930110111") > 0);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestName3QualifiedPrefix.java [51:100]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        OMElement root = f.createOMElement("root", rootNS);
        root.addChild(element);

        // Test getting the namespace, localpart and prefix.  This should used not result in
        // expansion
        assertTrue(element.getLocalName().equals("DUMMYNAME"));
        assertTrue(element.getNamespace().getNamespaceURI().equals("http://DUMMYNS"));
        assertTrue(element.getNamespace().getPrefix().equals("DUMMYPREFIX"));

        // Serialize and cache.  This should cause expansion and update the name to match the
        // testDocument string
        StringWriter writer = new StringWriter();

        try {
            root.serialize(writer);
        } catch (Exception e) {
            // Current Behavior
            // The current OMSourceElementImpl ensures that the namespace and localName
            // are consistent with the original setting.
            return;
        }

        String result = writer.toString();

        assertTrue(element.getLocalName().equals("library"));
        assertTrue(
                element.getNamespace()
                        .getNamespaceURI()
                        .equals("http://www.sosnoski.com/uwjws/library"));
        assertTrue(element.getNamespace().getPrefix().equals(""));
        // Make sure that the serialized string does not contain the DUMMY values
        assertTrue(result.indexOf("DUMMY") < 0);

        assertTrue("Serialized text error" + result, result.indexOf("1930110111") > 0);

        // Serialize again
        writer = new StringWriter();
        root.serialize(writer);
        result = writer.toString();

        assertTrue(element.getLocalName().equals("library"));
        assertTrue(
                element.getNamespace()
                        .getNamespaceURI()
                        .equals("http://www.sosnoski.com/uwjws/library"));
        assertTrue(element.getNamespace().getPrefix().equals(""));
        // Make sure that the serialized string does not contain the DUMMY values
        assertTrue(result.indexOf("DUMMY") < 0);

        assertTrue("Serialized text error" + result, result.indexOf("1930110111") > 0);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



