Package com.google.guiceberry.util

Examples of com.google.guiceberry.util.AnnotatedGuiceBerryEnv


  }
 
  private static String getGbeNameFromGbeAnnotation(TestDescription testDescription) {
    Class<?> testCaseClass = testDescription.getTestCaseClass();
    GuiceBerryEnv gbeAnnotation = getGbeAnnotation(testCaseClass);
    AnnotatedGuiceBerryEnv annotatedGbeAnnotation = getAnnotatedGbeAnnotation(testCaseClass);

    if ((gbeAnnotation != null) && (annotatedGbeAnnotation != null)) {
      throw new IllegalArgumentException("It seems your test used both the "
          + "deprecated GuiceBerryEnv and AnnotatedGuiceBerryEnv annotations."
          + "Please remove the deprecated one.");
    }

    String declaredGbeName;
    if (gbeAnnotation != null) {
      declaredGbeName = gbeAnnotation.value();
    } else if (annotatedGbeAnnotation != null) {
      declaredGbeName = annotatedGbeAnnotation.value();
    } else {
      throw new IllegalArgumentException(String.format(
          "In order to use the deprecated GuiceBerryJunit3, your test class "
          + "must have a @GuiceBerryEnv annotation. Either add one, or, better "
          + "yet, upgrade your code to make use of the GuiceBerry 3.0 adapters. "
View Full Code Here


  private static boolean isOldAnnotation(Class<?> testCaseClass) {
    return getGbeAnnotation(testCaseClass) != null;
  }
 
  private static AnnotatedGuiceBerryEnv getAnnotatedGbeAnnotation(Class<?> testCaseClass) {
    AnnotatedGuiceBerryEnv gbeAnnotation =
      testCaseClass.getAnnotation(AnnotatedGuiceBerryEnv.class);
    return gbeAnnotation;
  }
View Full Code Here

TOP

Related Classes of com.google.guiceberry.util.AnnotatedGuiceBerryEnv

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.