Weird inconsistent SkipException behaviour

瀏覽次數:7 次
跳到第一則未讀訊息

Robert Krüger

未讀,
2017年1月14日 清晨7:58:242017/1/14
收件者:testng...@googlegroups.com
Hi,

I've been using SkipException for a long time to disable tests programmatically (e.g. depending on platform or other environment conditions) but now I have run into a few cases where the SkipException makes the test fail instead of be skipped and I do not see the difference.

Example:

    @Test
    public void testOSVersionAtLeast() {
        //FIXME: FND-317
        if (SystemInfo.isLinux())
            throw new SkipException("Skipping on linux until FND-317 is resolved");

        if(SystemInfo.isWindows()){
            // FIXME win
            throw new SkipException("Skipping on windows until TODO is resolved");
        }

...

this works while in another class

    @Test
    public void moveItemCaseChangeOnlyTest() throws Exception {
        // FIXME WIN fails because of ...
        if(SystemInfo.isWindows()){
            throw new SkipException("Disabled due to error");
        }
...

causes a failure.

In both cases code tests are executed using Idea's TestNG plugin on Windows.

What am I missing?

Thanks in advance,

Robert

回覆所有人
回覆作者
轉寄
0 則新訊息