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

org.testng.reporters.jq.BasePanel Maven / Gradle / Ivy

The newest version!
package org.testng.reporters.jq;

import java.util.List;
import org.testng.ISuite;

public abstract class BasePanel implements IPanel {
  public static final String C = "class";
  public static final String D = "div";
  public static final String S = "span";
  public static final String B = "button";
  public static final String I = "id";

  private final Model m_model;

  public BasePanel(Model model) {
    m_model = model;
  }

  protected Model getModel() {
    return m_model;
  }

  protected List getSuites() {
    return getModel().getSuites();
  }

  protected static String pluralize(int count, String singular) {
    return count
        + " "
        + (count == 0 || count > 1
            ? (singular.endsWith("s") ? singular + "es" : singular + "s")
            : singular);
  }

  protected static String suiteToTag(ISuite suite) {
    return suite.getName().replaceAll("[^A-Za-z0-9]", "_");
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy