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

org.robolectric.pluginapi.config.ConfigurationStrategy Maven / Gradle / Ivy

There is a newer version: 4.13
Show newest version
package org.robolectric.pluginapi.config;

import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Map;

/**
 * Strategy for configuring individual tests.
 *
 * @since 4.2
 */
public interface ConfigurationStrategy {

  /**
   * Determine the configuration for the given test class and method.
   *
   * Since a method may be run on multiple test subclasses, {@param testClass} indicates which
   * test case is currently being evaluated.
   *
   * @param testClass the test class being evaluated; this might be a subclass of the method's
   *     declaring class.
   * @param method the test method to be evaluated
   * @return the set of configs
   */
  Configuration getConfig(Class testClass, Method method);

  /**
   * Heterogeneous typesafe collection of configuration objects managed by their {@link Configurer}.
   *
   * @since 4.2
   */
  interface Configuration {

    /** Returns the configuration instance of the specified class for the current test. */
     T get(Class configClass);

    /** Returns the set of known configuration classes. */
    Collection> keySet();

    /** Returns the map of known configuration classes to configuration instances. */
    Map, Object> map();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy