/**
   * Runs the test case.
   *
   * @throws Throwable Any uncaught exception causes test to fail
   */
  public void runTest() throws Throwable {
    DOMImplementation domImpl;
    Document doc;
    DOMConfiguration domConfig;
    DocumentType nullDocType = null;

    boolean canSet;
    boolean state;
    String parameter = "nAmEspace-declarations";
    domImpl = getImplementation();
    doc = domImpl.createDocument("http://www.w3.org/1999/xhtml", "html", nullDocType);
    domConfig = doc.getDomConfig();
    state = ((Boolean) domConfig.getParameter(parameter)).booleanValue();
    assertTrue("defaultFalse", state);
    canSet = domConfig.canSetParameter(parameter, Boolean.FALSE);
    assertTrue("canSetFalse", canSet);
    canSet = domConfig.canSetParameter(parameter, Boolean.TRUE);
    assertTrue("canSetTrue", canSet);
    domConfig.setParameter(parameter, Boolean.FALSE);
    state = ((Boolean) domConfig.getParameter(parameter)).booleanValue();
    assertFalse("setFalseEffective", state);
    domConfig.setParameter(parameter, Boolean.TRUE);
    state = ((Boolean) domConfig.getParameter(parameter)).booleanValue();
    assertTrue("setTrueEffective", state);
  }
Esempio n. 2
0
  /**
   * Runs the test case.
   *
   * @throws Throwable Any uncaught exception causes test to fail
   */
  public void runTest() throws Throwable {
    DOMImplementation domImpl;
    Document doc;
    DOMConfiguration domConfig;
    DocumentType nullDocType = null;

    boolean canSet;
    DOMErrorHandler errorHandler = null;

    String parameter = "error-handler";
    DOMErrorHandler state;
    domImpl = getImplementation();
    doc = domImpl.createDocument("http://www.w3.org/1999/xhtml", "html", nullDocType);
    domConfig = doc.getDomConfig();
    canSet = domConfig.canSetParameter(parameter, ((Object) /*DOMErrorHandler */ errorHandler));
    assertTrue("canSetNull", canSet);
    domConfig.setParameter(parameter, ((Object) /*DOMErrorHandler */ errorHandler));
    state = (DOMErrorHandler) domConfig.getParameter(parameter);
    assertNull("errorHandlerIsNull", state);
  }
  /**
   * Runs the test case.
   *
   * @throws Throwable Any uncaught exception causes test to fail
   */
  public void runTest() throws Throwable {
    DOMImplementation domImpl;
    Document doc;
    DOMConfiguration domConfig;
    DocumentType nullDocType = null;

    boolean canSet;
    boolean state;
    String parameter = "datatype-normalization";
    domImpl = getImplementation();
    doc = domImpl.createDocument("http://www.w3.org/1999/xhtml", "html", nullDocType);
    domConfig = doc.getDomConfig();
    domConfig.setParameter("validate", Boolean.FALSE);
    canSet = domConfig.canSetParameter(parameter, Boolean.TRUE);

    if (canSet) {
      domConfig.setParameter(parameter, Boolean.TRUE);
      state = ((Boolean) domConfig.getParameter("validate")).booleanValue();
      assertTrue("validateSet", state);
    }
  }