Examples of ParametersFactory


Examples of at.bestsolution.efxclipse.tooling.jdt.ui.internal.editors.model.anttasks.parameters.ParametersFactory

   * <!-- end-user-doc -->
   * @generated
   */
  public static ParametersFactory init() {
    try {
      ParametersFactory theParametersFactory = (ParametersFactory)EPackage.Registry.INSTANCE.getEFactory("http://at.bestsolution.efxclipse.tooling.jdt/parameters/1.0");
      if (theParametersFactory != null) {
        return theParametersFactory;
      }
    }
    catch (Exception exception) {
View Full Code Here

Examples of com.carrotsearch.randomizedtesting.annotations.ParametersFactory

    for (Method m : classModel.getAnnotatedLeafMethods(ParametersFactory.class).keySet()) {
      Validation.checkThat(m)
        .isStatic()
        .isPublic();

      ParametersFactory pfAnnotation = m.getAnnotation(ParametersFactory.class);
      assert pfAnnotation != null;

      if (!Iterable.class.isAssignableFrom(m.getReturnType())) {
        throw new RuntimeException("@" + ParametersFactory.class.getSimpleName() + " annotated " +
            "methods must be public, static and returning Iterable<Object[]>:" + m);
      }

      List<Object[]> result = new ArrayList<Object[]>();
      try {
        for (Object [] p : (Iterable<Object[]>) m.invoke(null)) {
          result.add(p);
        }
      } catch (InvocationTargetException e) {
        Rethrow.rethrow(e.getCause());
      } catch (Throwable t) {
        throw new RuntimeException("Error collecting parameters from: " + m, t);
      }

      if (result.isEmpty()) {
        throw new InternalAssumptionViolatedException("Parameters set should not be empty. Ignoring tests.");
      }

      if (pfAnnotation.shuffle()) {
        Collections.shuffle(result, new Random(runnerRandomness.getSeed()));
      }

      parameters.addAll(result);
    }
View Full Code Here

Examples of com.carrotsearch.randomizedtesting.annotations.ParametersFactory

    for (Method m : classModel.getAnnotatedLeafMethods(ParametersFactory.class).keySet()) {
      Validation.checkThat(m)
        .isStatic()
        .isPublic();

      ParametersFactory pfAnnotation = m.getAnnotation(ParametersFactory.class);
      assert pfAnnotation != null;

      if (!Iterable.class.isAssignableFrom(m.getReturnType())) {
        throw new RuntimeException("@" + ParametersFactory.class.getSimpleName() + " annotated " +
            "methods must be public, static and returning Iterable<Object[]>:" + m);
      }

      List<Object[]> result = new ArrayList<Object[]>();
      try {
        for (Object [] p : (Iterable<Object[]>) m.invoke(null)) {
          result.add(p);
        }
      } catch (InvocationTargetException e) {
        Rethrow.rethrow(e.getCause());
      } catch (Throwable t) {
        throw new RuntimeException("Error collecting parameters from: " + m, t);
      }

      if (result.isEmpty()) {
        throw new InternalAssumptionViolatedException("Parameters set should not be empty. Ignoring tests.");
      }

      if (pfAnnotation.shuffle()) {
        Collections.shuffle(result, new Random(runnerRandomness.getSeed()));
      }

      parameters.addAll(result);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.