zoukankan      html  css  js  c++  java
  • TestNG(八) 类分组测试

    package com.course.testng.groups;
    
    import org.testng.annotations.Test;
    
    @Test(groups = "stu")
    public class GroupsOneClass1 {
        public void student1(){
            System.out.println("Class中的student1运行..................");
        }
        public void student2(){
            System.out.println("Class中的student2运行..................");
        }
    }
    package com.course.testng.groups;
    
    import org.testng.annotations.Test;
    
    @Test(groups = "stu")
    public class GroupsOneClass2 {
        public void student1(){
            System.out.println("Class2中的student1运行..................");
        }
        public void student2(){
            System.out.println("Class2中的student2运行..................");
        }
    }
    package com.course.testng.groups;
    
    import org.testng.annotations.Test;
    
    @Test(groups = "teah")
    public class GroupsOneClass3 {
        public void teacher1(){
            System.out.println("Class3中的teacher1运行..................");
        }
        public void teacher2(){
            System.out.println("Class3中的teacher2运行..................");
        }
    }
    <?xml version="1.0" encoding="utf-8" ?>
    <suite name = "test">
        <test name = "RunAll">
            <classes>
                <class name = "com.course.testng.groups.GroupsOneClass1"/>
                <class name = "com.course.testng.groups.GroupsOneClass2"/>
                <class name = "com.course.testng.groups.GroupsOneClass3"/>
            </classes>
        </test>
    
        <test name = "RunStu">
            <groups>
                <run>
                    <include name = "stu"/>
                </run>
            </groups>
            <classes>
                <class name = "com.course.testng.groups.GroupsOneClass1"/>
                <class name = "com.course.testng.groups.GroupsOneClass2"/>
                <class name = "com.course.testng.groups.GroupsOneClass3"/>
            </classes>
        </test>
    </suite>

  • 相关阅读:
    L1-061 新胖子公式 (10 分)
    L1-060 心理阴影面积 (5 分)
    L1-059 敲笨钟 (20 分)
    Linux高性能服务器编程—进程池和线程池
    epoll系列系统调用
    18.5.2 多线程并发服务器端的实现
    10.4 基于多任务的并发服务器
    侯捷C++(complex类)
    Qt 事件机制
    C++篇49问49答
  • 原文地址:https://www.cnblogs.com/dwdw/p/11405098.html
Copyright © 2011-2022 走看看