Examples of ITestAnnotation


Examples of org.testng.annotations.ITestAnnotation

  //
  // End of public methods
  // ///

  public static boolean isEnabled(Class<?> objectClass, IAnnotationFinder finder) {
    ITestAnnotation testClassAnnotation= AnnotationHelper.findTest(finder, objectClass);

    return isEnabled(testClassAnnotation);
  }
View Full Code Here

Examples of org.testng.annotations.ITestAnnotation

    return isEnabled(testClassAnnotation);
  }
 
  public static boolean isEnabled(Method m, IAnnotationFinder finder) {
    ITestAnnotation annotation = AnnotationHelper.findTest(finder, m);
   
    // If no method annotation, look for one on the class
    if (null == annotation) {
      annotation = AnnotationHelper.findTest(finder, m.getDeclaringClass());
    }
View Full Code Here

Examples of org.testng.annotations.ITestAnnotation

    }

    // If this configuration method has inherit-groups=true, add the groups
    // defined in the @Test class
    if (inheritGroupsFromTestClass()) {
      ITestAnnotation classAnnotation =
        (ITestAnnotation) m_annotationFinder.findAnnotation(m_methodClass, ITestAnnotation.class);
      if (classAnnotation != null) {
        String[] groups = classAnnotation.getGroups();
        Map<String, String> newGroups = Maps.newHashMap();
        for (String g : getGroups()) {
          newGroups.put(g, g);
        }
        if (groups != null) {
View Full Code Here

Examples of org.testng.annotations.ITestAnnotation

      IAnnotationFinder finder) {
    DataProviderHolder result = null;
    String dataProviderName = null;
    Class dataProviderClass = null;
   
    ITestAnnotation annotation = AnnotationHelper.findTest(finder, m);
    if (annotation == null) {
      annotation = AnnotationHelper.findTest(finder, clazz);
    }
    if (annotation != null) {
      dataProviderName = annotation.getDataProvider();
      dataProviderClass = annotation.getDataProviderClass();
    }
   
    if (dataProviderName == null) {
      IFactoryAnnotation factory = AnnotationHelper.findFactory(finder, m);
      if (factory != null) {
View Full Code Here

Examples of org.testng.annotations.ITestAnnotation

  public static String[] groupsForThisMethodForTest(Method m, IAnnotationFinder finder) {
    List<String> vResult = Lists.newArrayList();
    Class<?> cls = m.getDeclaringClass();

    // Collect groups on the class
    ITestAnnotation tc = AnnotationHelper.findTest(finder, cls);
    if (null != tc) {
      for (String group : tc.getGroups()) {
        vResult.add(group);
      }
    }

    // Collect groups on the method
    ITestAnnotation tm = AnnotationHelper.findTest(finder, m);
    if (null != tm) {
      String[] groups = tm.getGroups();

      //       ppp("Method:" + m + " #Groups:" + groups.length);
      for (String group : groups) {
        vResult.add(group);
      }
View Full Code Here

Examples of org.testng.annotations.ITestAnnotation

   */
  public static String[] groupsForThisMethodForConfiguration(Method m, IAnnotationFinder finder) {
    String[] result = {};

    // Collect groups on the method
    ITestAnnotation tm = AnnotationHelper.findTest(finder, m);
    if (null != tm) {
      result = tm.getGroups();
    }

    return result;
  }
View Full Code Here

Examples of org.testng.annotations.ITestAnnotation

  public static String[] dependentGroupsForThisMethodForTest(Method m, IAnnotationFinder finder) {
    List<String> vResult = Lists.newArrayList();
    Class<?> cls = m.getDeclaringClass();

    // Collect groups on the class
    ITestAnnotation tc = AnnotationHelper.findTest(finder, cls);
    if (null != tc) {
      for (String group : tc.getDependsOnGroups()) {
        vResult.add(group);
      }
    }

    // Collect groups on the method
    ITestAnnotation tm = AnnotationHelper.findTest(finder, m);
    if (null != tm) {
      String[] groups = tm.getDependsOnGroups();

      //       ppp("Method:" + m + " #Groups:" + groups.length);
      for (String group : groups) {
        vResult.add(group);
      }
View Full Code Here

Examples of org.testng.annotations.ITestAnnotation

    return result;
  }

  protected static boolean isEnabled(Class<?> objectClass, IAnnotationFinder finder) {
    ITestAnnotation testClassAnnotation = AnnotationHelper.findTest(finder, objectClass);
    return isEnabled(testClassAnnotation);
  }
View Full Code Here

Examples of org.testng.annotations.ITestAnnotation

    ITestAnnotation testClassAnnotation = AnnotationHelper.findTest(finder, objectClass);
    return isEnabled(testClassAnnotation);
  }

  protected static boolean isEnabled(Method m, IAnnotationFinder finder) {
    ITestAnnotation annotation = AnnotationHelper.findTest(finder, m);

    // If no method annotation, look for one on the class
    if (null == annotation) {
      annotation = AnnotationHelper.findTest(finder, m.getDeclaringClass());
    }
View Full Code Here

Examples of org.testng.annotations.ITestAnnotation

    if (expectedExceptions != null) {
      result = new ExpectedExceptionsHolder(expectedExceptions.getValue(), ".*");
    }
    else {
      // New syntax
      ITestAnnotation testAnnotation =
        (ITestAnnotation) finder.findAnnotation(method, ITestAnnotation.class);
      if (testAnnotation != null) {
        Class<?>[] ee = testAnnotation.getExpectedExceptions();
        if (testAnnotation != null && ee.length > 0) {
          result = new ExpectedExceptionsHolder(ee,
              testAnnotation.getExpectedExceptionsMessageRegExp());
        }
      }
    }

    return result;
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.