Package org.junit.runners.model

Examples of org.junit.runners.model.InitializationError


        for(Graph.OptOut optOut : optOuts) {
            final Class testClass;
            try {
                testClass = Class.forName(optOut.test());
            } catch (Exception ex) {
                throw new InitializationError(String.format("Invalid @OptOut on Graph instance.  Could not instantiate test class (it may have been renamed): %s", optOut.test()));
            }

            if (!Arrays.stream(testClass.getMethods()).anyMatch(m -> m.getName().equals(optOut.method())))
                throw new InitializationError(String.format("Invalid @OptOut on Graph instance.  Could not match @OptOut test name %s on test class %s (it may have been renamed)", optOut.method(), optOut.test()));
        }
    }
View Full Code Here


         {
            deployableTest.get().getContainerController().start();
         }
         catch (Exception e)
         {
            throw new InitializationError(Arrays.asList((Throwable)e));
         }
         Runtime.getRuntime().addShutdownHook(new Thread() {
            @Override
            public void run()
            {
View Full Code Here

  public TestRegistryManager(Class<?> type) throws InitializationError {
    super();
   
    Registry annotation = type.getAnnotation(Registry.class);
    if (annotation == null) {
      throw new InitializationError(type.getName() + " does not specify a @Registry");
    }
   
    this.annotation = annotation;
    this.moduleDefFactories = findModuleDefFactories(type);
  }
View Full Code Here

    int modifiers = method.getModifiers();
    if (method.getParameterTypes().length != 0
        || !Modifier.isStatic(modifiers)
        || !Modifier.isPublic(modifiers)) {

      throw new InitializationError(
          String.format("@ModuleDef method %s must be public static and accept no arguments",
          method.getName()));
    }
    if (!org.apache.tapestry5.ioc.def.ModuleDef.class.isAssignableFrom(method.getReturnType())) {
      throw new InitializationError(
          String.format("@ModuleDef method %s return type %s is not valid",
          method.getName(), method.getReturnType().getName()));
    }
  }
View Full Code Here

                return setSchedulers( suiteSuites.wrappingSuite, suiteClasses.wrappingSuite );
            }
            catch ( TestSetFailedException e )
            {
                throw new InitializationError( e );
            }
        }
View Full Code Here

    public Categories(Class<?> klass, RunnerBuilder builder) throws InitializationError {
        super(klass, builder);
        try {
            filter(new CategoryFilter(getIncludedCategory(klass), getExcludedCategory(klass)));
        } catch (NoTestsRemainException e) {
            throw new InitializationError(e);
        }
    }
View Full Code Here

    super(klass, builder);
    try {
      filter(new CategoryFilter(getIncludedCategory(klass),
          getExcludedCategory(klass)));
    } catch (NoTestsRemainException e) {
      throw new InitializationError(e);
    }
  }
View Full Code Here

  private void validate() throws InitializationError {
    List<Throwable> errors= new ArrayList<Throwable>();
    collectInitializationErrors(errors);
    if (!errors.isEmpty())
      throw new InitializationError(errors);
  }
View Full Code Here

    super(klass, builder);
    try {
      filter(new CategoryFilter(getIncludedCategory(klass),
          getExcludedCategory(klass)));
    } catch (NoTestsRemainException e) {
      throw new InitializationError(e);
    }
  }
View Full Code Here

  private void validate() throws InitializationError {
    List<Throwable> errors= new ArrayList<Throwable>();
    collectInitializationErrors(errors);
    if (!errors.isEmpty())
      throw new InitializationError(errors);
  }
View Full Code Here

TOP

Related Classes of org.junit.runners.model.InitializationError

Copyright © 2018 www.massapicom. 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.