org.apache.axiom.ts.om.element
Class TestGetNamespaceNormalized

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.axiom.testutils.suite.TestCaseEx
              extended by org.apache.axiom.ts.AxiomTestCase
                  extended by org.apache.axiom.ts.om.element.TestGetNamespaceNormalized
All Implemented Interfaces:
junit.framework.Test

public class TestGetNamespaceNormalized
extends AxiomTestCase

Tests that OMNamedInformationItem.getNamespace() returns null for an element with no namespace. The case considered in this test is a programmatically created element without namespace that is added as a child to another element that has a default namespace. Earlier versions of Axiom returned a non null value in this case to work around an issue in the serialization code.

The test is executed twice: once with a null OMNamespace and once with an OMNamespace object with prefix and namespace URI set to the empty string. The expected result is the same in both cases.

This is a regression test for AXIOM-398.


Field Summary
 
Fields inherited from class org.apache.axiom.ts.AxiomTestCase
metaFactory, TEST_PARSER_CONFIGURATION
 
Constructor Summary
TestGetNamespaceNormalized(OMMetaFactory metaFactory, boolean useNull)
           
 
Method Summary
protected  void runTest()
           
 
Methods inherited from class org.apache.axiom.ts.AxiomTestCase
assertConsumed, getChildrenCount, getNumberOfOccurrences
 
Methods inherited from class org.apache.axiom.testutils.suite.TestCaseEx
addTestProperty, getTestProperties
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestGetNamespaceNormalized

public TestGetNamespaceNormalized(OMMetaFactory metaFactory,
                                  boolean useNull)
Method Detail

runTest

protected void runTest()
                throws Throwable
Specified by:
runTest in class org.apache.axiom.testutils.suite.TestCaseEx
Throws:
Throwable


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.