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

hydra.testing.TestGroup Maven / Gradle / Ivy

package hydra.testing;

import java.io.Serializable;

/**
 * A collection of test cases with a name and optional description
 */
public class TestGroup implements Serializable {
  public static final hydra.core.Name NAME = new hydra.core.Name("hydra/testing.TestGroup");
  
  public final String name;
  
  public final java.util.Optional description;
  
  public final java.util.List> subgroups;
  
  public final java.util.List> cases;
  
  public TestGroup (String name, java.util.Optional description, java.util.List> subgroups, java.util.List> cases) {
    this.name = name;
    this.description = description;
    this.subgroups = subgroups;
    this.cases = cases;
  }
  
  @Override
  public boolean equals(Object other) {
    if (!(other instanceof TestGroup)) {
      return false;
    }
    TestGroup o = (TestGroup) (other);
    return name.equals(o.name) && description.equals(o.description) && subgroups.equals(o.subgroups) && cases.equals(o.cases);
  }
  
  @Override
  public int hashCode() {
    return 2 * name.hashCode() + 3 * description.hashCode() + 5 * subgroups.hashCode() + 7 * cases.hashCode();
  }
  
  public TestGroup withName(String name) {
    return new TestGroup(name, description, subgroups, cases);
  }
  
  public TestGroup withDescription(java.util.Optional description) {
    return new TestGroup(name, description, subgroups, cases);
  }
  
  public TestGroup withSubgroups(java.util.List> subgroups) {
    return new TestGroup(name, description, subgroups, cases);
  }
  
  public TestGroup withCases(java.util.List> cases) {
    return new TestGroup(name, description, subgroups, cases);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy