aboutsummaryrefslogtreecommitdiffstats
path: root/vid-automation/TestNg-ApiTest.xml
blob: e0ca82cb856c2b4af467bf8b1ee89346b482bf15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">

<suite verbose="1" name="VID API Tests" annotations="JDK">

    <listeners>
        <listener class-name="vid.automation.test.infra.SkipTestsTestngTransformer" />
    </listeners>

    <test name="test">
        <method-selectors>
            <method-selector>
                <script language="beanshell">
                    <![CDATA[

                        //these tests call to MaintenanceController which is restricted to localhost, so it can not run on jenkins pipeline

                        String [] exclusionGroups = new String [] {
                            "worksOnlyWithLocalASDC",
                            "worksOnlyWithLocalhostVID",
                            "underDevelopment"
                        };

                        String [] testClassesToRunAlways = new String [] {
                            "LoggerFormatTest"
                        };

                        String [] classes1 = new String [] {
                            "AsyncInstantiationALaCarteApiTest"
                        };
                        int selectPart = 0;

                        for (g: exclusionGroups) {
                            if (groups.containsKey(g)) return false;
                        }
                        if (selectPart == 0) return true;

                        methodClass = method.getDeclaringClass().toString();

                        if (methodClass.contains("org.onap.vid.api.Base")) return true;

                        for (c: testClassesToRunAlways) {
                            if (methodClass.endsWith(c)) return true; // repeat in any selectPart value
                        }

                        for (c: classes1) {
                            if (methodClass.endsWith(c)) return selectPart==1;
                        }

                        // else
                        return selectPart==2;
                    ]]>
                </script>
            </method-selector>
        </method-selectors>
        <packages>
            <package name="org.onap.vid.*"/>
        </packages>
    </test>
</suite>