public void testCreateDocument1() throws Throwable {
  String namespaceURI="http://www.ecommerce.org/";
  String malformedName="prefix::local";
  Document doc;
  DocumentType docType=null;
  DOMImplementation domImpl;
  doc=(Document)load("staffNS",builder);
  domImpl=doc.getImplementation();
  boolean success=false;
  try {
    domImpl.createDocument(namespaceURI,malformedName,docType);
  }
 catch (  DOMException ex) {
    success=(ex.code == DOMException.NAMESPACE_ERR);
  }
  assertTrue("throw_NAMESPACE_ERR",success);
}

public void testCreateDocument1 ( ) throws Throwable { String namespaceURI = "http://www.ecommerce.org/" ; String malformedName = "prefix::local" ; Document doc ; DocumentType docType = null ; DOMImplementation domImpl ; doc = ( Document ) load ( "staffNS" , builder ) ; domImpl = doc . getImplementation ( ) ; boolean success = false ; try { domImpl . createDocument ( namespaceURI , malformedName , docType ) ; } catch ( DOMException ex ) { success = ( ex . code == DOMException . NAMESPACE_ERR ) ; } assertTrue ( "throw_NAMESPACE_ERR" , success ) ; }
runs the test case .
