Package org.junit.runners.model

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


    this.method = method;

    try {
      this.instance = klass.newInstance();
    } catch (InstantiationException e) {
      throw new InitializationError(e);
    } catch (IllegalAccessException e) {
      throw new InitializationError(e);
    }

    TestScript scriptData = klass.getAnnotation(TestScript.class);
    if (scriptData == null) {
      this.testScript = null;
    } else {
      try {
        String source = loadPath.load(scriptData.filename() + ".js");
        this.testScript = new Script(scriptData.filename(), source, loadPath, "hegemon/unittest");
      } catch (LoadError e) {
        throw new InitializationError(e);
      }
    }
  }
View Full Code Here

        Module m = (Module) testModule.value().newInstance();
        this.injector = Guice.createInjector(m);
      } catch (Exception e) {
        List<Throwable> t = new ArrayList<Throwable>();
        t.add(e);
        throw new InitializationError(t);
      }
    } else {
      // no TestModule annotation, so use no module
      this.injector = Guice.createInjector();
    }
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

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

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

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

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

  @Override
  protected String getSuiteName(Class<?> klass) throws InitializationError {
    Name nameAnnotation = klass.getAnnotation(Name.class);
    if (nameAnnotation == null) {
      throw new InitializationError("There must be a @Name annotation");
    }
    return nameAnnotation.value();
  }
View Full Code Here

  }

  protected String getSuiteName(Class<?> klass) throws InitializationError {
    Suite suiteAnnotation = klass.getAnnotation(Suite.class);
    if (suiteAnnotation == null) {
      throw new InitializationError("There must be a @Suite annotation");
    }

    if (!"".equals(suiteAnnotation.value())) {
      return suiteAnnotation.value();
    }
    if (!"".equals(suiteAnnotation.systemProperty())) {
      return System.getProperty(suiteAnnotation.systemProperty());
    }
    throw new InitializationError(
            "In annotation @Suite you have to specify either 'value' or 'systemProperty'");
  }
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.