public void test_XMLAttributes_add_get()
{
XMLAttributes attrs = new XMLAttributes();
assertTrue( attrs.getLength() == 0 );
assertEquals( true, attrs.isEmpty() );
attrs.add("xmlns", "http://foo.org/");
assertTrue( attrs.getLength() == 1 );
assertTrue( attrs.isEmpty() == false );
attrs.add("foo", "bar");
assertTrue( attrs.getLength() == 2 );
assertTrue( attrs.isEmpty() == false );
assertTrue( attrs.getIndex("xmlns") == 0 );
assertTrue( attrs.getIndex("foo" ) == 1 );
assertTrue( attrs.getIndex("bar" ) == -1 );
assertTrue( attrs.getValue("xmlns") == "http://foo.org/" );
assertTrue( attrs.getValue("foo" ) == "bar" );
assertTrue( attrs.getValue("bar" ) == "" );
assertTrue( attrs.getName(0) == "xmlns" );
assertTrue( attrs.getName(1) == "foo" );
assertTrue( attrs.getName(2) == "" );
}