当前位置: 首页>>代码示例>>Java>>正文


Java ITestNGMethod.getGroups方法代码示例

本文整理汇总了Java中org.testng.ITestNGMethod.getGroups方法的典型用法代码示例。如果您正苦于以下问题:Java ITestNGMethod.getGroups方法的具体用法?Java ITestNGMethod.getGroups怎么用?Java ITestNGMethod.getGroups使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.testng.ITestNGMethod的用法示例。


在下文中一共展示了ITestNGMethod.getGroups方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: qualifiedName

import org.testng.ITestNGMethod; //导入方法依赖的package包/类
private String qualifiedName(ITestNGMethod method) {
	StringBuilder addon = new StringBuilder();
	String[] groups = method.getGroups();
	int length = groups.length;
	if (length > 0 && !"basic".equalsIgnoreCase(groups[0])) {
		addon.append("(");
		for (int i = 0; i < length; i++) {
			if (i > 0) {
				addon.append(", ");
			}
			addon.append(groups[i]);
		}
		addon.append(")");
	}

	return "<b>" + method.getMethodName() + "</b> " + addon;
}
 
开发者ID:quanqinle,项目名称:WebAndAppUITesting,代码行数:18,代码来源:PowerEmailableReporter.java

示例2: qualifiedName

import org.testng.ITestNGMethod; //导入方法依赖的package包/类
private String qualifiedName(ITestNGMethod method)
{
    StringBuilder addon = new StringBuilder();
    String[] groups = method.getGroups();
    int length = groups.length;
    if (length > 0 && !"basic".equalsIgnoreCase(groups[0]))
    {
        addon.append("(");
        for (int i = 0; i < length; i++)
        {
            if (i > 0) addon.append(", ");
            addon.append(groups[i]);
        }
        addon.append(")");
    }

    return "<b>" + method.getMethodName() + "</b> " + addon;
}
 
开发者ID:basavaraj1985,项目名称:DolphinNG,代码行数:19,代码来源:EmailableReporter.java

示例3: isInActiveGroupWithIncludes

import org.testng.ITestNGMethod; //导入方法依赖的package包/类
private boolean isInActiveGroupWithIncludes(ITestNGMethod method, List<String> includeGroups, List<String> excludeGroups) {
    if (method.getGroups() != null) {
        boolean included = false;
        boolean excluded = false;
        for (String group : method.getGroups()) {
            if (includeGroups.contains(group)) {
                included = true;
            }
            if (excludeGroups.contains(group)) {
                excluded = true;
            }
        }
        if (included && !excluded) {
            return true; // a group of the method is included and not excluded
        }
    }
    return false; // no groups of the method are included
}
 
开发者ID:allure-framework,项目名称:allure1,代码行数:19,代码来源:AllureTestListener.java

示例4: isInActiveGroupWithoutIncludes

import org.testng.ITestNGMethod; //导入方法依赖的package包/类
private boolean isInActiveGroupWithoutIncludes(ITestNGMethod method, List<String> excludeGroups) {
    if (method.getGroups() != null) {
        for (String group : method.getGroups()) {
            if (excludeGroups.contains(group)) {
                return false; // a group of the method is excluded
            }
        }
    }
    return true; // no groups of the method are excluded
}
 
开发者ID:allure-framework,项目名称:allure1,代码行数:11,代码来源:AllureTestListener.java

示例5: getIncludedModulesForTest

import org.testng.ITestNGMethod; //导入方法依赖的package包/类
public List<String> getIncludedModulesForTest(String testName)
{
    ITestContext overview = null;

    List<String> includedModules = new ArrayList<String>();
    String includedModule = "";
    String modulesCommaSeparated = config.getProperty("application.modules").replaceAll("\\s+", "");

    for (ISuite suite : suites)
    {
        suiteName = suite.getName();

        Map<String, ISuiteResult> tests = suite.getResults();

        for (ISuiteResult r : tests.values())
        {
            overview = r.getTestContext();

            if (overview.getName().equalsIgnoreCase(testName))
            {
                String[] allDefinedModules = null;

                if (modulesCommaSeparated == null || modulesCommaSeparated.trim().length() == 0)
                {
                    Assert.fail("ERROR - Modules are not found in properties file");
                } else
                {
                    allDefinedModules = new String[modulesCommaSeparated.length()];
                    allDefinedModules = modulesCommaSeparated.split(",");
                }

                ITestNGMethod[] allTestMethods = overview.getAllTestMethods();

                for (ITestNGMethod testngMethod : allTestMethods)
                {
                    String[] modules = testngMethod.getGroups();
                    for (String module : modules)
                    {
                        for (String moduleName : allDefinedModules)
                        {
                            if (module.equalsIgnoreCase(moduleName))
                            {
                                if (!(includedModule.contains(module)))
                                {
                                    includedModules.add(module);
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    return includedModules;
}
 
开发者ID:pradeeptaswain,项目名称:oldmonk,代码行数:57,代码来源:ReporterAPI.java

示例6: getIncludedGroupsForTest

import org.testng.ITestNGMethod; //导入方法依赖的package包/类
public List<String> getIncludedGroupsForTest(String testName)
{
    ITestContext overview = null;

    List<String> includedGroups = new ArrayList<String>();
    String includedGroup = "";
    String groupsCommaSeparated = config.getProperty("test.groups").replaceAll("\\s+", "");

    for (ISuite suite : suites)
    {
        suiteName = suite.getName();

        Map<String, ISuiteResult> tests = suite.getResults();

        for (ISuiteResult r : tests.values())
        {
            overview = r.getTestContext();

            if (overview.getName().equalsIgnoreCase(testName))
            {

                String[] allDefinedGroups = null;

                if (groupsCommaSeparated == null || groupsCommaSeparated.trim().length() == 0)
                {
                    Assert.fail("ERROR - Test Groups are not found in properties file");
                } else
                {
                    allDefinedGroups = new String[groupsCommaSeparated.length()];
                    allDefinedGroups = groupsCommaSeparated.split(",");
                }

                ITestNGMethod[] allTestMethods = overview.getAllTestMethods();

                for (ITestNGMethod testngMethod : allTestMethods)
                {
                    String[] groups = testngMethod.getGroups();
                    for (String group : groups)
                    {
                        for (String groupName : allDefinedGroups)
                        {
                            if (group.equalsIgnoreCase(groupName))
                            {
                                if (!(includedGroup.contains(group)))
                                {
                                    includedGroups.add(group);
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    return includedGroups;
}
 
开发者ID:pradeeptaswain,项目名称:oldmonk,代码行数:58,代码来源:ReporterAPI.java


注:本文中的org.testng.ITestNGMethod.getGroups方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。