Package org.testng.internal.annotations

Examples of org.testng.internal.annotations.IConfiguration


                                             tm,
                                             null,
                                             System.currentTimeMillis(),
                                             System.currentTimeMillis());

      IConfiguration configurationAnnotation= null;
      try {
        Object[] instances= tm.getInstances();
        if (instances == null || instances.length == 0) instances = new Object[] { instance };
        Class objectClass= instances[0].getClass();
        Method method= tm.getMethod();
View Full Code Here


    List<ITestNGMethod> vResult = new ArrayList<ITestNGMethod>();
   
    Set<Method> methods = ClassHelper.getAvailableMethods(clazz);

    for(Method m : methods) {
      IConfiguration configuration = AnnotationHelper.findConfiguration(m_annotationFinder, m);

      if(null == configuration) {
        continue;
      }
     
      boolean create = false;
      boolean isBeforeSuite = false;
      boolean isAfterSuite = false;
      boolean isBeforeTest = false;
      boolean isAfterTest = false;
      boolean isBeforeClass = false;
      boolean isAfterClass = false;
      boolean isBeforeTestMethod = false;
      boolean isAfterTestMethod = false;
      String[] beforeGroups = null;
      String[] afterGroups = null;
     
      switch(configurationType) {
        case BEFORE_SUITE:
          create = configuration.getBeforeSuite();
          isBeforeSuite = true;
          break;
        case AFTER_SUITE:
          create = configuration.getAfterSuite();
          isAfterSuite = true;
          break;
        case BEFORE_TEST:
          create = configuration.getBeforeTest();
          isBeforeTest = true;
          break;
        case AFTER_TEST:
          create = configuration.getAfterTest();
          isAfterTest = true;
          break;
        case BEFORE_CLASS:
          create = configuration.getBeforeTestClass();
          isBeforeClass = true;
          break;
        case AFTER_CLASS:
          create = configuration.getAfterTestClass();
          isAfterClass = true;
          break;
        case BEFORE_TESTMETHOD:
          create = configuration.getBeforeTestMethod();
          isBeforeTestMethod = true;
          break;
        case AFTER_TESTMETHOD:
          create = configuration.getAfterTestMethod();
          isAfterTestMethod = true;
          break;
        case BEFORE_GROUPS:
          beforeGroups = configuration.getBeforeGroups();
          create = beforeGroups.length > 0;
          isBeforeTestMethod = true;
          break;
        case AFTER_GROUPS:
          afterGroups = configuration.getAfterGroups();
          create = afterGroups.length > 0;
          isBeforeTestMethod = true;
          break;
      }
   
View Full Code Here

    return m_inheritGroupsFromTestClass;
  }
 
  private void init() {
    IAnnotation a = AnnotationHelper.findConfiguration(m_annotationFinder, m_method);
    IConfiguration annotation = (IConfiguration) a;
    if (a != null) {
      m_inheritGroupsFromTestClass = annotation.getInheritGroups();
      setDescription(annotation.getDescription());
    }

    if (annotation != null && annotation.isFakeConfiguration()) {
     if (annotation.getBeforeSuite()) initGroups(IBeforeSuite.class)
     if (annotation.getAfterSuite()) initGroups(IAfterSuite.class)
     if (annotation.getBeforeTest()) initGroups(IBeforeTest.class)
     if (annotation.getAfterTest()) initGroups(IAfterTest.class)
     if (annotation.getBeforeGroups().length != 0) initGroups(IBeforeGroups.class)
     if (annotation.getAfterGroups().length != 0) initGroups(IAfterGroups.class);
     if (annotation.getBeforeTestClass()) initGroups(IBeforeClass.class)
     if (annotation.getAfterTestClass()) initGroups(IAfterClass.class)
     if (annotation.getBeforeTestMethod()) initGroups(IBeforeMethod.class)
     if (annotation.getAfterTestMethod()) initGroups(IAfterMethod.class)
    }
    else {
      initGroups(IConfiguration.class);
    }
View Full Code Here

     
      //
      // @Configuration method
      //
      else {
        IConfiguration annotation = AnnotationHelper.findConfiguration(finder, m);
        if (annotation.getAlwaysRun()) {
          in = true;
        }
        else {
          in = includeMethod(AnnotationHelper.findTest(finder, m),
              runInfo, tm, forTests, unique, outIncludedMethods);
View Full Code Here

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

    // Collect groups on the method
    IConfiguration tm = AnnotationHelper.findConfiguration(finder, m);
    if (null != tm) {
      result = tm.getDependsOnGroups();
    }

    return result;
  }
View Full Code Here

    return m_inheritGroupsFromTestClass;
  }
 
  private void init() {
    IAnnotation a = AnnotationHelper.findConfiguration(m_annotationFinder, m_method);
    IConfiguration annotation = (IConfiguration) a;
    if (a != null) {
      m_inheritGroupsFromTestClass = annotation.getInheritGroups();
      setDescription(annotation.getDescription());
    }

    if (annotation != null && annotation.isFakeConfiguration()) {
     if (annotation.getBeforeSuite()) initGroups(IBeforeSuite.class)
     if (annotation.getAfterSuite()) initGroups(IAfterSuite.class)
     if (annotation.getBeforeTest()) initGroups(IBeforeTest.class)
     if (annotation.getAfterTest()) initGroups(IAfterTest.class)
     if (annotation.getBeforeGroups().length != 0) initGroups(IBeforeGroups.class)
     if (annotation.getAfterGroups().length != 0) initGroups(IAfterGroups.class);
     if (annotation.getBeforeTestClass()) initGroups(IBeforeClass.class)
     if (annotation.getAfterTestClass()) initGroups(IAfterClass.class)
     if (annotation.getBeforeTestMethod()) initGroups(IBeforeMethod.class)
     if (annotation.getAfterTestMethod()) initGroups(IAfterMethod.class)
    }
    else {
      initGroups(IConfiguration.class);
    }
View Full Code Here

    List<ITestNGMethod> vResult = new ArrayList<ITestNGMethod>();
   
    Set<Method> methods = ClassHelper.getAvailableMethods(clazz);

    for(Method m : methods) {
      IConfiguration configuration = AnnotationHelper.findConfiguration(m_annotationFinder, m);

      if(null == configuration) {
        continue;
      }
     
      boolean create = false;
      boolean isBeforeSuite = false;
      boolean isAfterSuite = false;
      boolean isBeforeTest = false;
      boolean isAfterTest = false;
      boolean isBeforeClass = false;
      boolean isAfterClass = false;
      boolean isBeforeTestMethod = false;
      boolean isAfterTestMethod = false;
      String[] beforeGroups = null;
      String[] afterGroups = null;
     
      switch(configurationType) {
        case BEFORE_SUITE:
          create = configuration.getBeforeSuite();
          isBeforeSuite = true;
          break;
        case AFTER_SUITE:
          create = configuration.getAfterSuite();
          isAfterSuite = true;
          break;
        case BEFORE_TEST:
          create = configuration.getBeforeTest();
          isBeforeTest = true;
          break;
        case AFTER_TEST:
          create = configuration.getAfterTest();
          isAfterTest = true;
          break;
        case BEFORE_CLASS:
          create = configuration.getBeforeTestClass();
          isBeforeClass = true;
          break;
        case AFTER_CLASS:
          create = configuration.getAfterTestClass();
          isAfterClass = true;
          break;
        case BEFORE_TESTMETHOD:
          create = configuration.getBeforeTestMethod();
          isBeforeTestMethod = true;
          break;
        case AFTER_TESTMETHOD:
          create = configuration.getAfterTestMethod();
          isAfterTestMethod = true;
          break;
        case BEFORE_GROUPS:
          beforeGroups = configuration.getBeforeGroups();
          create = beforeGroups.length > 0;
          isBeforeTestMethod = true;
          break;
        case AFTER_GROUPS:
          afterGroups = configuration.getAfterGroups();
          create = afterGroups.length > 0;
          isBeforeTestMethod = true;
          break;
      }
   
View Full Code Here

                                             tm,
                                             null,
                                             System.currentTimeMillis(),
                                             System.currentTimeMillis());

      IConfiguration configurationAnnotation= null;
      try {
        Object[] instances= tm.getInstances();
        if (instances == null || instances.length == 0) instances = new Object[] { instance };
        Class<?> objectClass= instances[0].getClass();
        Method method= tm.getMethod();
View Full Code Here

     
      //
      // @Configuration method
      //
      else {
        IConfiguration annotation = AnnotationHelper.findConfiguration(finder, m);
        if (annotation.getAlwaysRun()) {
          in = true;
        }
        else {
          in = includeMethod(AnnotationHelper.findTest(finder, m),
              runInfo, tm, forTests, unique, outIncludedMethods);
View Full Code Here

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

    // Collect groups on the method
    IConfiguration tm = AnnotationHelper.findConfiguration(finder, m);
    if (null != tm) {
      result = tm.getDependsOnGroups();
    }

    return result;
  }
View Full Code Here

TOP

Related Classes of org.testng.internal.annotations.IConfiguration

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.