All Downloads are FREE. Search and download functionalities are using the official Maven repository.

build.please.test.result.SkippedCaseResult Maven / Gradle / Ivy

There is a newer version: 13.4.0
Show newest version
package build.please.test.result;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

public final class SkippedCaseResult extends TestCaseResult {
  private final String message;

  public SkippedCaseResult(String testClassName,
                           String testMethodName,
                           String message) {
    super(testClassName, testMethodName);
    this.message = message;
  }

  @Override
  public boolean isSuccess() {
    // Skipped tests don't cause a failure result
    return true;
  }

  @Override
  public void renderToXml(Document doc, Element testCaseElement) {
    super.renderToXml(doc, testCaseElement);
    Element skipped = doc.createElement("skipped");
    if (message != null) {
      skipped.setAttribute("message", message);
    }
    testCaseElement.appendChild(skipped);
  }

  public String getMessage() {
    return message;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy