Examples of InitializationError


Examples of org.junit.runners.model.InitializationError

  }

  private static Class<?> startServerAndIsolateClass(Class<?> klass) throws InitializationError {
    DevAppServerTest testAnno = klass.getAnnotation(DevAppServerTest.class);
    if (testAnno == null) {
      throw new InitializationError(String.format(
          "Test uses %s but is not also annotated with %s.",
          DevAppServerTestRunner.class.getSimpleName(), DevAppServerTest.class.getSimpleName()));
    }
    try {
      DevAppServerTestConfig config = testAnno.value().newInstance();
      DevAppServer devServer = DevAppServerTestHelper.startServer(config);
      return devServer.getAppContext().getClassLoader().loadClass(klass.getName());
    } catch (InstantiationException e) {
      throw new InitializationError(e);
    } catch (IllegalAccessException e) {
      throw new InitializationError(e);
    } catch (ClassNotFoundException e) {
      throw new InitializationError(e);
    }
  }
View Full Code Here

Examples of org.junit.runners.model.InitializationError

      ClassLoader junitClassLoader = getClass().getClassLoader();
      for (Map.Entry<Class<?>, List<?>> entry : copy.entrySet()) {
        annotationMap.put(junitClassLoader.loadClass(entry.getKey().getName()), entry.getValue());
      }
    } catch (NoSuchFieldException e) {
      throw new InitializationError(e);
    } catch (IllegalAccessException e) {
      throw new InitializationError(e);
    } catch (ClassNotFoundException e) {
      throw new InitializationError(e);
    }
  }
View Full Code Here

Examples of org.junit.runners.model.InitializationError

    protected static class SuiteWithStringInName extends Suite
    {
      private static Class<?>[] getAnnotatedClasses(Class<?> klass) throws InitializationError {
        SuiteClasses annotation= klass.getAnnotation(SuiteClasses.class);
        if (annotation == null)
          throw new InitializationError(String.format("class '%s' must have a SuiteClasses annotation", klass.getName()));
        return annotation.value();
      }
View Full Code Here

Examples of org.junit.runners.model.InitializationError

    protected static class SuiteWithStringInName extends Suite
    {
      private static Class<?>[] getAnnotatedClasses(Class<?> klass) throws InitializationError {
        SuiteClasses annotation= klass.getAnnotation(SuiteClasses.class);
        if (annotation == null)
          throw new InitializationError(String.format("class '%s' must have a SuiteClasses annotation", klass.getName()));
        return annotation.value();
      }
View Full Code Here

Examples of org.junit.runners.model.InitializationError

      if (url == null) {
        throw new NullPointerException("resource missing: " + catalogName);
      }
      catalog = BrowserTestCatalog.get(url);
    } catch (Exception e) {
      throw new InitializationError(e);
    }
  }
View Full Code Here

Examples of org.junit.runners.model.InitializationError

      // Collect all test candidates, regardless if they will be executed or not.
      suiteDescription = Description.createSuiteDescription(suiteClass);
      testCandidates = collectTestCandidates(suiteDescription);
      this.groupEvaluator = new GroupEvaluator(testCandidates);
    } catch (Throwable t) {
      throw new InitializationError(t);
    }
  }
View Full Code Here

Examples of org.junit.runners.model.InitializationError

            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

Examples of org.junit.runners.model.InitializationError

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

Examples of org.junit.runners.model.InitializationError

                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

Examples of org.junit.runners.model.InitializationError

                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
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.