Package org.junit.runners.model

Examples of org.junit.runners.model.InitializationError


        }

        // override by getter method, if present
        List<FrameworkMethod> getters = getTestClass().getAnnotatedMethods(ArchivePathGetter.class);
        if (getters.size() > 1) {
            throw new InitializationError("Only one method should be annotated with @ArchivePathGetter. "
                + "The test case \"" + getTestClass().getName() + "\" has " + getters.size() + " annotated methods.");
        }
        if (classAnnotation == null && getters.size() == 0) {
            throw new InitializationError("No archive path annotations found. The test case \""
                + getTestClass().getName() + "\" should be annotated with @ArchivePath or @ArchivePathGetter");
        }
        if (getters.size() == 1) {
            path = invokeGetter(getters.get(0).getMethod());
        }

        // validate the path
        if (path == null) {
            throw new InitializationError("Archive path is null.");
        }
        return path;
    }
View Full Code Here


        }
        if (getter.getParameterTypes().length != 0) {
            errors.add(new Exception("The method " + getterName + " should have no parameters."));
        }
        if (errors.size() != 0) {
            throw new InitializationError(errors);
        }
        try {
            Object result = getter.invoke(null);
            if (result instanceof String) {
                return (String) result;
            }
        } catch (Exception exception) {
            throw new InitializationError(exception);
        }
        return null;
    }
View Full Code Here

        classSingleScriptAnnotation = testKlazz.getAnnotation(BMScript.class);
        classMultiScriptAnnotation = testKlazz.getAnnotation(BMScripts.class);
        classMultiRuleAnnotation = testKlazz.getAnnotation(BMRules.class);
        classSingleRuleAnnotation = testKlazz.getAnnotation((BMRule.class));
        if (classMultiRuleAnnotation != null && classSingleRuleAnnotation != null) {
            throw new InitializationError("Use either BMRule or BMRules annotation but not both");
        }
        if (classMultiScriptAnnotation != null && classSingleScriptAnnotation != null) {
            throw new InitializationError("Use either BMScript or BMScripts annotation but not both");
        }
    }
View Full Code Here

               adaptor.beforeSuite();
               deployableTest.set(adaptor);
            }
            catch (Exception e)
            {
               throw new InitializationError(Arrays.asList((Throwable)e));
            }
         }
      }
      finally
      {
View Full Code Here

               adaptor.beforeSuite();
               deployableTest.set(adaptor);
            }
            catch (Exception e)
            {
               throw new InitializationError(Arrays.asList((Throwable)e));
            }
         }
      }
      finally
      {
View Full Code Here

      runners = buildWebDriverRunners(webDriverConfiguration, klass);
    } else if (wrappedDriverConfiguration != null) {
      runners = buildWrappedDriverRunners(wrappedDriverConfiguration,
          klass);
    } else {
      throw new InitializationError(
          "Annotate test class with either ServerConfiguration, WebDriverConfiguration or WrappedDriverConfiguration");
    }
    return runners;
  }
View Full Code Here

            configuration, webDriverClass);
        runners.add(new SeleniumWebDriverJUnit4ClassRunner(factory,
            klass));
      }
    } catch (final Exception e) {
      throw new InitializationError(e);
    }
    return runners;
  }
View Full Code Here

        final WrappedDriverFactory factory = new WrappedDriverFactory(
            configuration, webDriverClass);
        runners.add(new SeleniumServerJUnit4ClassRunner(factory, klass));
      }
    } catch (final Exception e) {
      throw new InitializationError(e);
    }
    return runners;
  }
View Full Code Here

        final ServerFactory factory = new ServerFactory(configuration,
            browserStartCommand);
        runners.add(new SeleniumServerJUnit4ClassRunner(factory, klass));
      }
    } catch (final Exception e) {
      throw new InitializationError(e);
    }
    return runners;
  }
View Full Code Here

        this.testClazz = testClazz;
        try {
            delegate = getDelegateRunner(testClazz);
        }
        catch (Throwable e) {
            throw new InitializationError(Arrays.asList(e));
        }
    }
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.