久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<small id='YLamc'></small><noframes id='YLamc'>

    <bdo id='YLamc'></bdo><ul id='YLamc'></ul>

      1. <legend id='YLamc'><style id='YLamc'><dir id='YLamc'><q id='YLamc'></q></dir></style></legend>
      2. <i id='YLamc'><tr id='YLamc'><dt id='YLamc'><q id='YLamc'><span id='YLamc'><b id='YLamc'><form id='YLamc'><ins id='YLamc'></ins><ul id='YLamc'></ul><sub id='YLamc'></sub></form><legend id='YLamc'></legend><bdo id='YLamc'><pre id='YLamc'><center id='YLamc'></center></pre></bdo></b><th id='YLamc'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='YLamc'><tfoot id='YLamc'></tfoot><dl id='YLamc'><fieldset id='YLamc'></fieldset></dl></div>
        <tfoot id='YLamc'></tfoot>

      3. TestNG 依賴于不同類的方法

        TestNG dependsOnMethods from different class(TestNG 依賴于不同類的方法)

          • <bdo id='XwlRX'></bdo><ul id='XwlRX'></ul>

              <tbody id='XwlRX'></tbody>

            • <i id='XwlRX'><tr id='XwlRX'><dt id='XwlRX'><q id='XwlRX'><span id='XwlRX'><b id='XwlRX'><form id='XwlRX'><ins id='XwlRX'></ins><ul id='XwlRX'></ul><sub id='XwlRX'></sub></form><legend id='XwlRX'></legend><bdo id='XwlRX'><pre id='XwlRX'><center id='XwlRX'></center></pre></bdo></b><th id='XwlRX'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='XwlRX'><tfoot id='XwlRX'></tfoot><dl id='XwlRX'><fieldset id='XwlRX'></fieldset></dl></div>

              <tfoot id='XwlRX'></tfoot>
                <legend id='XwlRX'><style id='XwlRX'><dir id='XwlRX'><q id='XwlRX'></q></dir></style></legend>

                <small id='XwlRX'></small><noframes id='XwlRX'>

                1. 本文介紹了TestNG 依賴于不同類的方法的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  @Test 注釋的 dependsOnMethods 屬性在要依賴的測試與具有此注釋的測試屬于同一類時正常工作.但是如果要測試的方法和依賴的方法在不同的類中,則不起作用.示例如下:

                  The dependsOnMethods attribute of the @Test annotation works fine when the test to be depended upon is in the same class as that of the test that has this annotation. But it does not work if the to-be-tested method and depended-upon method are in different classes. Example is as follows:

                  class c1 {
                    @Test
                    public void verifyConfig() {
                      //verify some test config parameters
                    }
                  }
                  
                  class c2 {
                    @Test(dependsOnMethods={"c1.verifyConfig"})
                    public void dotest() {
                      //Actual test
                    }
                  }
                  

                  有沒有辦法繞過這個限制?一種簡單的方法是在 class c2 中創(chuàng)建一個調(diào)用 c1.verifyConfig() 的測試.但這將是太多的重復(fù).

                  Is there any way to get around this limitation? One easy way out is to create a test in class c2 that calls c1.verifyConfig(). But this would be too much repetition.

                  推薦答案

                  把方法放在一個group中,使用dependsOnGroups.

                  Put the method in a group and use dependsOnGroups.

                  class c1 {
                    @Test(groups={"c1.verifyConfig"})
                    public void verifyConfig() {
                      //verify some test config parameters
                    }
                  }
                  
                  class c2 {
                    @Test(dependsOnGroups={"c1.verifyConfig"})
                    public void dotest() {
                      //Actual test
                    }
                  }
                  

                  建議在 @Before* 中驗證配置并在出現(xiàn)問題時拋出,這樣測試就不會運(yùn)行.這樣,測試就可以專注于測試.

                  It is recommended to verify configuration in a @Before* and throw if something goes wrong there so the tests won't run. This way the tests can focus on just testing.

                  class c2 {
                    @BeforeClass
                    public static void verifyConfig() {
                      //verify some test config parameters
                      //Usually just throw exceptions
                      //Assert statements will work
                    }
                  
                    @Test
                    public void dotest() {
                      //Actual test
                    }
                  }
                  

                  這篇關(guān)于TestNG 依賴于不同類的方法的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數(shù)溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關(guān)系嗎?)
                  How to convert Integer to int?(如何將整數(shù)轉(zhuǎn)換為整數(shù)?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內(nèi)創(chuàng)建一個隨機(jī)打亂數(shù)字的 int 數(shù)組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠?qū)?0xff000000 存儲為 int?)

                  <legend id='P07Y6'><style id='P07Y6'><dir id='P07Y6'><q id='P07Y6'></q></dir></style></legend>

                  <small id='P07Y6'></small><noframes id='P07Y6'>

                    <tbody id='P07Y6'></tbody>

                    1. <i id='P07Y6'><tr id='P07Y6'><dt id='P07Y6'><q id='P07Y6'><span id='P07Y6'><b id='P07Y6'><form id='P07Y6'><ins id='P07Y6'></ins><ul id='P07Y6'></ul><sub id='P07Y6'></sub></form><legend id='P07Y6'></legend><bdo id='P07Y6'><pre id='P07Y6'><center id='P07Y6'></center></pre></bdo></b><th id='P07Y6'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='P07Y6'><tfoot id='P07Y6'></tfoot><dl id='P07Y6'><fieldset id='P07Y6'></fieldset></dl></div>
                      <tfoot id='P07Y6'></tfoot>
                          <bdo id='P07Y6'></bdo><ul id='P07Y6'></ul>
                            主站蜘蛛池模板: 日韩欧美中文字幕在线观看 | 中文成人在线 | 一区二区三区不卡视频 | 最新中文字幕第一页视频 | av香港经典三级级 在线 | 激情久久久久 | 91视频官网 | 九热在线 | 久久一区精品 | 日本一二区视频 | 久久av一区二区三区 | 日韩区 | 北条麻妃99精品青青久久 | 亚洲一区二区三区福利 | 久久亚洲一区二区三 | 自拍偷拍第一页 | 成年人网站国产 | 成人午夜视频在线观看 | a在线观看 | 欧美在线视频一区二区 | 亚洲天天干 | 一级欧美日韩 | 成人免费看黄网站在线观看 | 久久精品影视 | 超碰激情 | 91精品久久久久久久久久 | 一区二区三区视频在线 | 亚洲精品国产成人 | 手机在线观看 | 男女爱爱福利视频 | 精品91 | 午夜精品一区二区三区在线观看 | 欧美区在线 | 人人射人人 | 狠狠色综合久久婷婷 | 99tv成人影院 | 亚洲欧美第一视频 | 久久国产精品免费一区二区三区 | 天堂网中文字幕在线观看 | 日日日视频 | 日韩免费福利视频 |