-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Streamline overloaded assertion methods for Groovy
Closes #2854
- Loading branch information
1 parent
5ac0021
commit 89dc584
Showing
5 changed files
with
233 additions
and
5 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
57 changes: 57 additions & 0 deletions
57
testng-core/src/test/groovy/test/groovy/issue2854/AssertionsTestSample.groovy
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,57 @@ | ||
package test.groovy.issue2854 | ||
|
||
import org.testng.annotations.Test | ||
|
||
import static org.testng.Assert.assertEquals | ||
|
||
class AssertionsTestSample { | ||
|
||
@Test | ||
void testAssertEqualsWorksWithBooleans() { | ||
assertEquals(true, true) | ||
assertEquals(true, true, "Sample Message") | ||
} | ||
|
||
@Test | ||
void testAssertEqualsWorksWithBytes() { | ||
assertEquals(Byte.valueOf((byte) 10), Byte.valueOf((byte) 10)) | ||
assertEquals(Byte.valueOf((byte) 10), Byte.valueOf((byte) 10), "Sample Message") | ||
} | ||
|
||
@Test | ||
void testAssertEqualsWorksWithChars() { | ||
assertEquals(Character.valueOf((char) 10), Character.valueOf((char) 10)) | ||
assertEquals(Character.valueOf((char) 10), Character.valueOf((char) 10), "Sample Message") | ||
} | ||
|
||
@Test | ||
void testAssertEqualsWorksWithShorts() { | ||
assertEquals(Short.valueOf((short) 10), Short.valueOf((short) 10)) | ||
assertEquals(Short.valueOf((short) 10), Short.valueOf((short) 10), "Sample Message") | ||
} | ||
|
||
@Test | ||
void testAssertEqualsWorksWithInts() { | ||
assertEquals(10, 10) | ||
assertEquals(10, 10, "Sample Message") | ||
} | ||
|
||
@Test | ||
void testAssertEqualsWorksWithLongs() { | ||
assertEquals(Long.valueOf((long) 10), Long.valueOf((long) 10)) | ||
assertEquals(Long.valueOf((long) 10), Long.valueOf((long) 10), "Sample Message") | ||
} | ||
|
||
@Test | ||
void testAssertEqualsWorksWithFloats() { | ||
assertEquals(Float.valueOf((float) 10), Float.valueOf((float) 10)) | ||
assertEquals(Float.valueOf((float) 10), Float.valueOf((float) 10), "Sample Message") | ||
} | ||
|
||
@Test | ||
void testAssertEqualsWorksWithDoubles() { | ||
assertEquals(Double.valueOf((double) 10), Double.valueOf((double) 10)) | ||
assertEquals(Double.valueOf((double) 10), Double.valueOf((double) 10), "Sample Message") | ||
} | ||
|
||
} |