-
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.
Merge pull request #208 from oleksandr-fomenko/RPP_Agents_Java_TestNG…
…_Annotation_DisplayName Added support of the @DisplayName annotation
- Loading branch information
Showing
7 changed files
with
143 additions
and
4 deletions.
There are no files selected for viewing
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
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
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
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
19 changes: 19 additions & 0 deletions
19
...portportal/testng/integration/feature/name/AnnotationNamedDisplayNameMethodClassTest.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,19 @@ | ||
package com.epam.reportportal.testng.integration.feature.name; | ||
|
||
import com.epam.reportportal.annotations.DisplayName; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.testng.annotations.Test; | ||
|
||
public class AnnotationNamedDisplayNameMethodClassTest { | ||
private static final Logger LOGGER = LoggerFactory.getLogger(AnnotationNamedDisplayNameMethodClassTest.class); | ||
|
||
public static final String TEST_NAME_DISPLAY = "My display test name"; | ||
|
||
@Test | ||
@DisplayName(TEST_NAME_DISPLAY) | ||
public void testNameDisplayNameMethodTest() { | ||
LOGGER.info("Inside 'testNameDisplayNameMethodTest' method"); | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
...tal/testng/integration/feature/name/AnnotationNamedDisplayNameParameterizedClassTest.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,34 @@ | ||
package com.epam.reportportal.testng.integration.feature.name; | ||
|
||
import com.epam.reportportal.annotations.DisplayName; | ||
import com.ibm.icu.text.RuleBasedNumberFormat; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.testng.annotations.DataProvider; | ||
import org.testng.annotations.Test; | ||
|
||
import java.util.Locale; | ||
|
||
import static com.epam.reportportal.testng.integration.feature.name.AnnotationNamedParameterizedClassTest.TEST_NAME; | ||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.equalTo; | ||
|
||
@Test(testName = TEST_NAME) | ||
public class AnnotationNamedDisplayNameParameterizedClassTest { | ||
private static final Logger LOGGER = LoggerFactory.getLogger(AnnotationNamedDisplayNameParameterizedClassTest.class); | ||
|
||
@DataProvider(name = "provider") | ||
public static Object[][] getData() { | ||
return new Object[][] { new Object[] { 1, "one" }, new Object[] { 2, "two" } }; | ||
} | ||
|
||
@Test(dataProvider = "provider") | ||
@DisplayName(AnnotationNamedDisplayNameMethodClassTest.TEST_NAME_DISPLAY) | ||
public void testNumberConversionDisplayName(int num, String numWord) { | ||
LOGGER.info("Number: " + num + "; expected result: " + numWord); | ||
Locale us = Locale.US; | ||
RuleBasedNumberFormat formatter = new RuleBasedNumberFormat(us, RuleBasedNumberFormat.SPELLOUT); | ||
String result = formatter.format(num, "%spellout-numbering"); | ||
assertThat(result, equalTo(numWord)); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...tal/testng/integration/feature/name/AnnotationNamedTestAndDisplayNameMethodClassTest.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,18 @@ | ||
package com.epam.reportportal.testng.integration.feature.name; | ||
|
||
import com.epam.reportportal.annotations.DisplayName; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.testng.annotations.Test; | ||
|
||
@Test(testName = "Name from test annotation") | ||
public class AnnotationNamedTestAndDisplayNameMethodClassTest { | ||
private static final Logger LOGGER = LoggerFactory.getLogger(AnnotationNamedTestAndDisplayNameMethodClassTest.class); | ||
|
||
@Test | ||
@DisplayName(AnnotationNamedDisplayNameMethodClassTest.TEST_NAME_DISPLAY) | ||
public void testNameDisplayNameMethodTest() { | ||
LOGGER.info("Inside 'testNameDisplayNameMethodTest' method"); | ||
} | ||
|
||
} |