-
Notifications
You must be signed in to change notification settings - Fork 4
Migrate Test Classes from TestNG to JUnit 5 #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
56a77f9
d41038e
f50949f
7ec116c
305d6fa
c58d749
155ad25
8d421a4
6d94dcf
330c1ef
56f5133
5888407
f96a705
7553d82
c565330
bbeace6
dc838ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,17 +23,17 @@ | |
|
|
||
| import org.bitrepository.bitrepositoryelements.AlarmCode; | ||
| import org.jaccept.structure.ExtendedTestCase; | ||
| import org.testng.Assert; | ||
| import org.testng.annotations.Test; | ||
|
|
||
| import org.junit.jupiter.api.Assertions; | ||
| import org.junit.jupiter.api.Tag; | ||
| import org.junit.jupiter.api.Test; | ||
| import java.util.Date; | ||
|
|
||
| /** | ||
| * Runs ExtendedTestCase with a regression test. | ||
| */ | ||
|
|
||
| public class AlarmDatabaseExtractionModelTest extends ExtendedTestCase { | ||
| @Test(groups = {"regressiontest"}) | ||
| @Test @Tag("regressiontest") | ||
| public void alarmExceptionTest() throws Exception { | ||
| addDescription("Test the AlarmDatabaseExtractionModel class"); | ||
| addStep("Define constants etc.", "Should be OK"); | ||
|
|
@@ -42,53 +42,53 @@ public void alarmExceptionTest() throws Exception { | |
| addStep("Create an empty model", "Should be populated with nulls."); | ||
| AlarmDatabaseExtractionModel model = new AlarmDatabaseExtractionModel(null, null, null, null, null, null, null, ascending); | ||
|
|
||
| Assert.assertNull(model.getAlarmCode()); | ||
| Assert.assertNull(model.getComponentId()); | ||
| Assert.assertNull(model.getEndDate()); | ||
| Assert.assertNull(model.getFileID()); | ||
| Assert.assertNull(model.getStartDate()); | ||
| Assert.assertNull(model.getCollectionID()); | ||
| Assert.assertEquals(model.getAscending(), ascending); | ||
| Assert.assertEquals(model.getMaxCount().intValue(), Integer.MAX_VALUE); | ||
| Assertions.assertNull(model.getAlarmCode()); | ||
| Assertions.assertNull(model.getComponentId()); | ||
| Assertions.assertNull(model.getEndDate()); | ||
| Assertions.assertNull(model.getFileID()); | ||
| Assertions.assertNull(model.getStartDate()); | ||
| Assertions.assertNull(model.getCollectionID()); | ||
| Assertions.assertEquals(model.getAscending(), ascending); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You have mostly remembered to swap arguments of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Found out that there it is possible to change everywhere that there is a warning in the project, so it should be done now. |
||
| Assertions.assertEquals(Integer.MAX_VALUE, model.getMaxCount().intValue()); | ||
|
|
||
| addStep("Test the AlarmCode", "Should be able to put a new one in and extract it again."); | ||
| AlarmCode defaultAlarmCode = AlarmCode.COMPONENT_FAILURE; | ||
| model.setAlarmCode(defaultAlarmCode); | ||
| Assert.assertEquals(model.getAlarmCode(), defaultAlarmCode); | ||
| Assertions.assertEquals(model.getAlarmCode(), defaultAlarmCode); | ||
|
|
||
| addStep("Test the ascending", "Should be able to put a new one in and extract it again."); | ||
| boolean defaultAscending = false; | ||
| model.setAscending(defaultAscending); | ||
| Assert.assertEquals(model.getAscending(), defaultAscending); | ||
| Assertions.assertEquals(model.getAscending(), defaultAscending); | ||
|
|
||
| addStep("Test the ComponentID", "Should be able to put a new one in and extract it again."); | ||
| String defaultComponentID = "DefaultComponentID"; | ||
| model.setComponentId(defaultComponentID); | ||
| Assert.assertEquals(model.getComponentId(), defaultComponentID); | ||
| Assertions.assertEquals(model.getComponentId(), defaultComponentID); | ||
|
|
||
| addStep("Test the EndDate", "Should be able to put a new one in and extract it again."); | ||
| Date defaultEndDate = new Date(987654321); | ||
| model.setEndDate(defaultEndDate); | ||
| Assert.assertEquals(model.getEndDate(), defaultEndDate); | ||
| Assertions.assertEquals(model.getEndDate(), defaultEndDate); | ||
|
|
||
| addStep("Test the FileID", "Should be able to put a new one in and extract it again."); | ||
| String defaultFileID = "DefaultFileID"; | ||
| model.setFileID(defaultFileID); | ||
| Assert.assertEquals(model.getFileID(), defaultFileID); | ||
| Assertions.assertEquals(model.getFileID(), defaultFileID); | ||
|
|
||
| addStep("Test the MaxCount", "Should be able to put a new one in and extract it again."); | ||
| Integer defaultMaxCount = 192837456; | ||
| model.setMaxCount(defaultMaxCount); | ||
| Assert.assertEquals(model.getMaxCount(), defaultMaxCount); | ||
| Assertions.assertEquals(model.getMaxCount(), defaultMaxCount); | ||
|
|
||
| addStep("Test the StartDate", "Should be able to put a new one in and extract it again."); | ||
| Date defaultStartDate = new Date(123456789); | ||
| model.setStartDate(defaultStartDate); | ||
| Assert.assertEquals(model.getStartDate(), defaultStartDate); | ||
| Assertions.assertEquals(model.getStartDate(), defaultStartDate); | ||
|
|
||
| addStep("Test the CollectionID", "Should be able to put a new one in and extract it again."); | ||
| String collectionID = "collection1"; | ||
| model.setCollectionID(collectionID); | ||
| Assert.assertEquals(model.getCollectionID(), collectionID); | ||
| Assertions.assertEquals(model.getCollectionID(), collectionID); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.