From 5668fd7b67dd28e2b5638a29bd677c581a505dd7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 3 Nov 2022 20:24:24 +0100 Subject: [PATCH] Continued: - renamed package - sorted members - fixed name --- .../CountryCoreTestSuite.xml | 6 +- .../model/data/CountryDataObjectTest.java | 80 +++++++++---------- .../test/model/utils/CountryUtilsTest.java | 2 +- 3 files changed, 44 insertions(+), 44 deletions(-) rename test/org/mxchange/{jcountrycore => jcountry}/CountryCoreTestSuite.xml (79%) rename test/org/mxchange/{jcountrycore => jcountry}/test/model/data/CountryDataObjectTest.java (99%) rename test/org/mxchange/{jcountrycore => jcountry}/test/model/utils/CountryUtilsTest.java (99%) diff --git a/test/org/mxchange/jcountrycore/CountryCoreTestSuite.xml b/test/org/mxchange/jcountry/CountryCoreTestSuite.xml similarity index 79% rename from test/org/mxchange/jcountrycore/CountryCoreTestSuite.xml rename to test/org/mxchange/jcountry/CountryCoreTestSuite.xml index d5a28b5..17380ed 100644 --- a/test/org/mxchange/jcountrycore/CountryCoreTestSuite.xml +++ b/test/org/mxchange/jcountry/CountryCoreTestSuite.xml @@ -1,6 +1,6 @@ - + - + - + diff --git a/test/org/mxchange/jcountrycore/test/model/data/CountryDataObjectTest.java b/test/org/mxchange/jcountry/test/model/data/CountryDataObjectTest.java similarity index 99% rename from test/org/mxchange/jcountrycore/test/model/data/CountryDataObjectTest.java rename to test/org/mxchange/jcountry/test/model/data/CountryDataObjectTest.java index f8a8fc6..1c5c526 100644 --- a/test/org/mxchange/jcountrycore/test/model/data/CountryDataObjectTest.java +++ b/test/org/mxchange/jcountry/test/model/data/CountryDataObjectTest.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.mxchange.jcountrycore.test.model.data; +package org.mxchange.jcountry.test.model.data; import java.util.Date; import org.mxchange.jcountry.model.data.Country; @@ -267,23 +267,30 @@ public class CountryDataObjectTest { Assert.fail("The required parameter must never be null and if so must cause a NPE being thrown: country=" + country); //NOI18N } - @Test (description = "Tests if Country.equals() returns false when a null reference is provided") - @SuppressWarnings ("ObjectEqualsNull") - public void testEqualsNullReference () { + @Test (description = "Tests Country.countryEntryCreated getter/setter") + public void testCountryEntryCreated () { + // Empty instance final Country country = new CountryData(); - Assert.assertFalse(country.equals(null)); - } + final Date date = new Date(); - @Test (description = "Tests if Country.equals() returns false when an other object is provided") - public void testEqualsOtherObject () { - final Country country = new CountryData(); - Assert.assertFalse(country.equals(new Object())); + // Set it + country.setCountryEntryCreated(date); + + // Should be the same! + Assert.assertEquals(country.getCountryEntryCreated(), date); } - @Test (description = "Tests if Country.equals() returns true when same instance is provided") - public void testEqualsSameInstance () { + @Test (description = "Tests Country.countryEntryUpdated getter/setter") + public void testCountryEntryUpdated () { + // Empty instance final Country country = new CountryData(); - Assert.assertTrue(country.equals(country)); + final Date date = new Date(); + + // Set it + country.setCountryEntryUpdated(date); + + // Should be the same! + Assert.assertEquals(country.getCountryEntryUpdated(), date); } @Test (description = "Tests if Country.equals() returns false when a field has been changed to an other value", dataProvider = "same-country-provider") @@ -302,6 +309,14 @@ public class CountryDataObjectTest { country1.setCountryCode(COUNTRY_CODE); } + @Test (description = "Tests if Country.equals() returns false when a field has been changed to an other value", dataProvider = "same-country-provider") + public void testEqualsDifferentCountryId (final Country country1, final Country country2) { + // Next is countryId + country1.setCountryId(1l); //NOI18N + Assert.assertFalse(country1.equals(country2)); + country1.setCountryId(null); + } + @Test (description = "Tests if Country.equals() returns false when a field has been changed to an other value", dataProvider = "same-country-provider") public void testEqualsDifferentExternalDialPrefix (final Country country1, final Country country2) { // Next is countryExternalDialPrefix @@ -318,14 +333,6 @@ public class CountryDataObjectTest { country1.setCountryI18nKey(COUNTRY_I18N_KEY); } - @Test (description = "Tests if Country.equals() returns false when a field has been changed to an other value", dataProvider = "same-country-provider") - public void testEqualsDifferentCountryId (final Country country1, final Country country2) { - // Next is countryId - country1.setCountryId(1l); //NOI18N - Assert.assertFalse(country1.equals(country2)); - country1.setCountryId(null); - } - @Test (description = "Tests if Country.equals() returns false when a field has been changed to an other value", dataProvider = "same-country-provider") public void testEqualsDifferentIsLocalDialPrefixRequired (final Country country1, final Country country2) { // Next is countryId @@ -342,30 +349,23 @@ public class CountryDataObjectTest { country1.setCountryPhoneCode(COUNTRY_PHONE_CODE1); } - @Test (description = "Tests Country.countryEntryCreated getter/setter") - public void testCountryEntryCreated () { - // Empty instance + @Test (description = "Tests if Country.equals() returns false when a null reference is provided") + @SuppressWarnings ("ObjectEqualsNull") + public void testEqualsNullReference () { final Country country = new CountryData(); - final Date date = new Date(); - - // Set it - country.setCountryEntryCreated(date); - - // Should be the same! - Assert.assertEquals(country.getCountryEntryCreated(), date); + Assert.assertFalse(country.equals(null)); } - @Test (description = "Tests Country.countryEntryUpdated getter/setter") - public void testCountryEntryUpdated () { - // Empty instance + @Test (description = "Tests if Country.equals() returns false when an other object is provided") + public void testEqualsOtherObject () { final Country country = new CountryData(); - final Date date = new Date(); - - // Set it - country.setCountryEntryUpdated(date); + Assert.assertFalse(country.equals(new Object())); + } - // Should be the same! - Assert.assertEquals(country.getCountryEntryUpdated(), date); + @Test (description = "Tests if Country.equals() returns true when same instance is provided") + public void testEqualsSameInstance () { + final Country country = new CountryData(); + Assert.assertTrue(country.equals(country)); } } diff --git a/test/org/mxchange/jcountrycore/test/model/utils/CountryUtilsTest.java b/test/org/mxchange/jcountry/test/model/utils/CountryUtilsTest.java similarity index 99% rename from test/org/mxchange/jcountrycore/test/model/utils/CountryUtilsTest.java rename to test/org/mxchange/jcountry/test/model/utils/CountryUtilsTest.java index 65bd817..6cf6fa2 100644 --- a/test/org/mxchange/jcountrycore/test/model/utils/CountryUtilsTest.java +++ b/test/org/mxchange/jcountry/test/model/utils/CountryUtilsTest.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.mxchange.jcountrycore.test.model.utils; +package org.mxchange.jcountry.test.model.utils; import org.mxchange.jcountry.model.data.Country; import org.mxchange.jcountry.model.data.CountryData; -- 2.39.2