-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
179 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
...com/epam/reportportal/testng/integration/feature/issue/ParameterizedWithOneIssueTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright 2024 EPAM Systems | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.epam.reportportal.testng.integration.feature.issue; | ||
|
||
import com.epam.reportportal.annotations.Issue; | ||
import com.epam.reportportal.annotations.TestFilter; | ||
import com.epam.reportportal.annotations.TestParamFilter; | ||
import org.testng.annotations.DataProvider; | ||
import org.testng.annotations.Test; | ||
|
||
public class ParameterizedWithOneIssueTest { | ||
|
||
public static final String FAILURE_MESSAGE = "This parameterized test is expected to fail: "; | ||
public static final String ISSUE_MESSAGE = "This test is expected to fail"; | ||
|
||
public static final Object[][] PARAMS = { { true }, { false } }; | ||
|
||
@DataProvider | ||
public static Object[][] paramsProvider() { | ||
return PARAMS; | ||
} | ||
|
||
@Test(dataProvider = "paramsProvider") | ||
@Issue(value = "ab001", comment = ISSUE_MESSAGE, filter = @TestFilter(param = { @TestParamFilter(valueStartsWith = "false") })) | ||
public void failureTest(boolean param) { | ||
throw new IllegalStateException(FAILURE_MESSAGE + param); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...com/epam/reportportal/testng/integration/feature/issue/ParameterizedWithTwoIssueTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright 2024 EPAM Systems | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.epam.reportportal.testng.integration.feature.issue; | ||
|
||
import com.epam.reportportal.annotations.Issue; | ||
import com.epam.reportportal.annotations.TestFilter; | ||
import com.epam.reportportal.annotations.TestParamFilter; | ||
import org.testng.annotations.DataProvider; | ||
import org.testng.annotations.Test; | ||
|
||
public class ParameterizedWithTwoIssueTest { | ||
|
||
public static final String FAILURE_MESSAGE = "This parameterized test is expected to fail: "; | ||
public static final String ISSUE_MESSAGE = "This test is expected to fail"; | ||
|
||
public static final Object[][] PARAMS = { { true }, { false } }; | ||
|
||
@DataProvider | ||
public static Object[][] paramsProvider() { | ||
return PARAMS; | ||
} | ||
|
||
@Test(dataProvider = "paramsProvider") | ||
@Issue(value = "ab001", comment = ISSUE_MESSAGE, filter = @TestFilter(param = { @TestParamFilter(valueStartsWith = "true") })) | ||
@Issue(value = "pb001", comment = ISSUE_MESSAGE, filter = @TestFilter(param = { @TestParamFilter(valueStartsWith = "false") })) | ||
public void failureTest(boolean param) { | ||
throw new IllegalStateException(FAILURE_MESSAGE + param); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/test/java/com/epam/reportportal/testng/integration/feature/issue/SimpleIssueTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright 2024 EPAM Systems | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.epam.reportportal.testng.integration.feature.issue; | ||
|
||
import com.epam.reportportal.annotations.Issue; | ||
import org.testng.annotations.Test; | ||
|
||
public class SimpleIssueTest { | ||
|
||
public static final String FAILURE_MESSAGE = "This test is expected to fail"; | ||
|
||
@Test | ||
@Issue(value = "pb001", comment = FAILURE_MESSAGE) | ||
public void failureTest() { | ||
throw new IllegalStateException(FAILURE_MESSAGE); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...t/java/com/epam/reportportal/testng/integration/feature/issue/SimpleSkippedIssueTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright 2024 EPAM Systems | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.epam.reportportal.testng.integration.feature.issue; | ||
|
||
import com.epam.reportportal.annotations.Issue; | ||
import org.testng.annotations.Test; | ||
|
||
public class SimpleSkippedIssueTest { | ||
|
||
public static final String FAILURE_MESSAGE = "This test is expected to fail"; | ||
|
||
@Test(enabled = false) | ||
@Issue(value = "pb001", comment = FAILURE_MESSAGE) | ||
public void failureTest() { | ||
throw new IllegalStateException(FAILURE_MESSAGE); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...test/java/com/epam/reportportal/testng/integration/feature/issue/SimpleTwoIssuesTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright 2024 EPAM Systems | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.epam.reportportal.testng.integration.feature.issue; | ||
|
||
import com.epam.reportportal.annotations.Issue; | ||
import org.testng.annotations.Test; | ||
|
||
public class SimpleTwoIssuesTest { | ||
|
||
public static final String FAILURE_MESSAGE = "This test is expected to fail"; | ||
|
||
@Test | ||
@Issue(value = "ab001", comment = FAILURE_MESSAGE) | ||
@Issue(value = "pb001", comment = FAILURE_MESSAGE) | ||
public void failureTest() { | ||
throw new IllegalStateException(FAILURE_MESSAGE); | ||
} | ||
} |