Examples of InitializationError


Examples of org.junit.runners.model.InitializationError

        if (parserErrors.isEmpty()) {
            Request request = Request.classes(
                    computer, classes.toArray(new Class<?>[classes.size()]));
            return applyFilterSpecs(request);
        } else {
            return errorReport(new InitializationError(parserErrors));
        }
    }
View Full Code Here

Examples of org.junit.runners.model.InitializationError

  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

Examples of org.junit.runners.model.InitializationError

    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

Examples of org.junit.runners.model.InitializationError

        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

Examples of org.junit.runners.model.InitializationError

         {
            deployableTest.get().beforeSuite();
         }
         catch (Exception e)
         {
            throw new InitializationError(Arrays.asList((Throwable)e));
         }
      }
      /* TODO: HACK
       *  If in-container, the Thread will be reused between multiple TestRuns.
       *  We need to call BeginSuite before everyone. But only once if not.
       */
      else if(ContainerProfile.CONTAINER == DeployableTestBuilder.getProfile())
      {
         try
         {
            deployableTest.get().beforeSuite();
         }
         catch (Exception e)
         {
            throw new InitializationError(Arrays.asList((Throwable)e));
         }
      }
   }
View Full Code Here

Examples of org.junit.runners.model.InitializationError

            final String gripe = "Test class should have at least one @Module method";
            errors.add(new Exception(gripe));
        }

        if (!errors.isEmpty()) {
            throw new InitializationError(errors);
        }
    }
View Full Code Here

Examples of org.junit.runners.model.InitializationError

        this.testClazz = testClazz;
        try {
            delegate = getDelegateRunner(testClazz);
        }
        catch (Throwable e) {
            throw new InitializationError(Arrays.asList(e));
        }
    }
View Full Code Here

Examples of org.junit.runners.model.InitializationError

  }

  public OSGiBDTJUnitRunner(Class<?> testClass, OSGiBDTTestWrapper testClassAnnotation, File testBundleFile,
      Map<String, Object> parameters) throws InitializationError {
    if (testClassAnnotation == null) {
      throw new InitializationError("OSGiBDTTest annotation is missing");
    }
    testClassName = testClass.getName();
    this.testClassAnnotation = testClassAnnotation;
    this.testClass = new TestClass(testClass);
    repositories = loadRepositories(testClassAnnotation.repositories());
View Full Code Here

Examples of org.junit.runners.model.InitializationError

    for (String repositoryLocation : repositoryLocations) {
      File repositoryDirectory;
      if (repositoryLocation.startsWith("${") && repositoryLocation.endsWith("}")) {
        String location = System.getenv(repositoryLocation.substring(2, repositoryLocation.length() - 1));
        if (location == null) {
          throw new InitializationError("Repository environment variable " + repositoryLocation + " is not defined");
        }
        repositoryDirectory = new File(location);
      } else {
        repositoryDirectory = new File(repositoryLocation);
      }
      if (!repositoryDirectory.exists() || !repositoryDirectory.isDirectory()) {
        throw new InitializationError("Repository " + repositoryDirectory + " does not exist or is not a directory");
      }
      BundleRepositoryPersister persister = new BundleRepositoryPersister(repositoryDirectory);
      try {
        repositories.add(persister.load());
      } catch (IOException e) {
        List<Throwable> list = new ArrayList<Throwable>(1);
        list.add(e);
        throw new InitializationError(list);
      }
    }
    return (BundleRepository[]) repositories.toArray(new BundleRepository[repositories.size()]);
  }
View Full Code Here

Examples of org.junit.runners.model.InitializationError

      }
      return testBundleFile;
    } catch (IOException e) {
      List<Throwable> list = new ArrayList<Throwable>(1);
      list.add(e);
      throw new InitializationError(list);
    }
  }
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.