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

org.testng.internal.GroupConfigMethodArguments Maven / Gradle / Ivy

There is a newer version: 7.10.1
Show newest version
package org.testng.internal;

import java.util.Map;
import org.testng.ITestNGMethod;
import org.testng.xml.XmlSuite;

public class GroupConfigMethodArguments extends Arguments {

  private final ConfigurationGroupMethods groupMethods;

  private GroupConfigMethodArguments(ITestNGMethod testMethod,
      ConfigurationGroupMethods groupMethods, Map params,
      Object instance) {
    super(instance, testMethod, params);
    this.groupMethods = groupMethods;
  }

  public ConfigurationGroupMethods getGroupMethods() {
    return groupMethods;
  }

  public XmlSuite getSuite() {
    return getTestMethod().getXmlTest().getSuite();
  }

  public Map getParameters() {
    return params;
  }

  public Object getInstance() {
    return instance;
  }

  public boolean isGroupFilteringDisabled() {
    return getTestMethod().getXmlTest().isGroupFilteringDisabled();
  }

  public static class Builder {

    private ITestNGMethod testMethod;
    private ConfigurationGroupMethods groupMethods;
    private Map params;
    private Object instance;

    public Builder forTestMethod(ITestNGMethod testMethod) {
      this.testMethod = testMethod;
      return this;
    }

    public Builder withGroupConfigMethods(ConfigurationGroupMethods groupMethods) {
      this.groupMethods = groupMethods;
      return this;
    }

    public Builder withParameters(Map params) {
      this.params = params;
      return this;
    }

    public Builder forInstance(Object instance) {
      this.instance = instance;
      return this;
    }

    public GroupConfigMethodArguments build() {
      return new GroupConfigMethodArguments(testMethod, groupMethods, params, instance);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy