Skip to content

Commit

Permalink
added new test dependency org.junit.jupiter:junit-jupiter in version …
Browse files Browse the repository at this point in the history
…5.11.0-M2

- remove of test dependency testng
  • Loading branch information
astrapisixtynine committed Jul 3, 2024
1 parent c15cab6 commit e7f8e50
Show file tree
Hide file tree
Showing 26 changed files with 203 additions and 196 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Version 10.3-SNAPSHOT
ADDED:

- new libs.versions.toml file for new automatic catalog versions update
- new test dependency org.junit.jupiter:junit-jupiter in version 5.11.0-M2

- update gradle to new version 8.8
- update of com.github.ben-manes.versions.gradle.plugin to new version 0.51.0
Expand All @@ -16,7 +17,7 @@ ADDED:
- update of dependency jobj-core to new version 8.2
- update of dependency silly-collection to new version 27.1
- update of test dependency equalsverifier to new version 3.16.1
- update of test dependency testng to new version 7.10.2
- remove of test dependency testng

Version 10.2
-------------
Expand Down
2 changes: 1 addition & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {
testImplementation libs.silly.strings
testImplementation libs.test.object
testImplementation libs.meanbean
testImplementation libs.testng
// Note: use of bundles...
testImplementation libs.bundles.unit.testing
testRuntimeOnly libs.junit.platform.launcher
}
11 changes: 8 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ silly-collection-version = "27.1"
silly-math-version = "2.3"
silly-strings-version = "9"
test-object-version = "8.2"
testng-version = "7.10.2"
vintage-time-version = "6"
junit-jupiter-params-version = "5.11.0-M2"
junit-jupiter-version = "5.11.0-M2"
junit-platform-launcher-version = "1.11.0-M2"

[libraries]
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter-version" }
junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit-jupiter-params-version" }
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher", version.ref = "junit-platform-launcher-version" }
commons-lang3 = { module = "org.apache.commons:commons-lang3", version.ref = "commons-lang3-version" }
equalsverifier = { module = "nl.jqno.equalsverifier:equalsverifier", version.ref = "equalsverifier-version" }
jobj-copy = { module = "io.github.astrapi69:jobj-copy", version.ref = "jobj-copy-version" }
Expand All @@ -28,14 +33,14 @@ silly-collection = { module = "io.github.astrapi69:silly-collection", version.re
silly-math = { module = "io.github.astrapi69:silly-math", version.ref = "silly-math-version" }
silly-strings = { module = "io.github.astrapi69:silly-strings", version.ref = "silly-strings-version" }
test-object = { module = "io.github.astrapi69:test-object", version.ref = "test-object-version" }
testng = { module = "org.testng:testng", version.ref = "testng-version" }
vintage-time = { module = "io.github.astrapi69:vintage-time", version.ref = "vintage-time-version" }

[bundles]
unit-testing = [
"meanbean",
"test-object",
"testng",
"junit-jupiter",
"junit-jupiter-params",
]

[plugins]
Expand Down
2 changes: 1 addition & 1 deletion gradle/testing.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

test {
useTestNG()
useJUnitPlatform()
}

jacocoTestReport {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
*/
package io.github.astrapi69.random;

import static org.testng.AssertJUnit.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import io.github.astrapi69.test.base.AbstractTestCase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
*/
package io.github.astrapi69.random;

import static org.testng.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import org.junit.jupiter.api.Test;
import org.meanbean.test.BeanTester;
import org.testng.annotations.Test;

import nl.jqno.equalsverifier.EqualsVerifier;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
*/
package io.github.astrapi69.random;

import static org.testng.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import java.security.SecureRandom;
import java.time.LocalDate;
import java.time.ZoneOffset;

import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

/**
* The unit test class for the class {@link SecureRandomBuilder}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
*/
package io.github.astrapi69.random;

import static org.testng.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import java.lang.reflect.InvocationTargetException;
import java.security.SecureRandom;
import java.time.LocalDate;
import java.time.ZoneOffset;

import org.junit.jupiter.api.Test;
import org.meanbean.test.BeanTestException;
import org.meanbean.test.BeanTester;
import org.testng.annotations.Test;

/**
* The unit test class for the class {@link SecureRandomFactory}
Expand Down Expand Up @@ -89,8 +89,7 @@ public void testNewSecureRandomAlgorithmProviderSeed()
/**
* Test method for {@link SecureRandomFactory} with {@link BeanTester}
*/
@Test(enabled = false, expectedExceptions = { BeanTestException.class,
InvocationTargetException.class, UnsupportedOperationException.class })
@Test
public void testWithBeanTester()
{
final BeanTester beanTester = new BeanTester();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@
*/
package io.github.astrapi69.random.address;

import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.IOException;
import java.util.Properties;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.meanbean.test.BeanTester;
import org.testng.AssertJUnit;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import io.github.astrapi69.random.util.PropertiesLoader;
import io.github.astrapi69.string.StringExtensions;
Expand All @@ -53,7 +54,7 @@ public class RandomAddressExtensionsTest extends BaseTestCase
* {@inheritDoc}
*/
@Override
@BeforeMethod
@BeforeEach
protected void setUp() throws Exception
{
super.setUp();
Expand All @@ -63,7 +64,7 @@ protected void setUp() throws Exception
* {@inheritDoc}
*/
@Override
@AfterMethod
@AfterEach
protected void tearDown() throws Exception
{
super.tearDown();
Expand All @@ -82,10 +83,10 @@ public void testGetRandomStreet() throws IOException
.loadProperties(RandomAddressExtensions.PROP_FILE_STREETS);
final String germanStreet = RandomAddressExtensions.getRandomStreet(germanstreets);
actual = germanStreet != null;
AssertJUnit.assertTrue("", actual);
assertTrue(actual);

actual = germanstreets.contains(germanStreet);
AssertJUnit.assertTrue("", actual);
assertTrue(actual);
}

/**
Expand All @@ -103,11 +104,11 @@ public void testGetRandomStreetWithNumber() throws IOException
final String germanStreetWithNumber = RandomAddressExtensions
.getRandomStreetWithNumber(germanstreets);
actual = germanStreetWithNumber != null;
AssertJUnit.assertTrue("", actual);
assertTrue(actual);
final String lastChar = germanStreetWithNumber
.substring(germanStreetWithNumber.length() - 1, germanStreetWithNumber.length());
actual = StringExtensions.isNumber(lastChar);
AssertJUnit.assertTrue("", actual);
assertTrue(actual);
}

/**
Expand All @@ -124,10 +125,10 @@ public void testGetRandomZip() throws IOException

final String randomZip = RandomAddressExtensions.getRandomZip(germanzips);
actual = randomZip != null;
AssertJUnit.assertTrue("", actual);
assertTrue(actual);

actual = StringExtensions.isNumber(randomZip);
AssertJUnit.assertTrue("", actual);
assertTrue(actual);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
*/
package io.github.astrapi69.random.date;

import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertNotNull;
import static org.testng.AssertJUnit.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.security.SecureRandom;
import java.text.ParseException;
Expand All @@ -36,9 +36,9 @@
import java.time.ZoneId;
import java.util.Date;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.meanbean.test.BeanTester;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import io.github.astrapi69.date.CalculateDateExtensions;
import io.github.astrapi69.date.DatePattern;
Expand All @@ -61,7 +61,7 @@ public class RandomDateFactoryTest
/** The date for now. */
private Date now;

@BeforeMethod
@BeforeEach
protected void setUp()
{
this.now = new Date(System.currentTimeMillis());
Expand Down Expand Up @@ -96,7 +96,7 @@ public void testCreateRandomBirthdayDateDate()
{
final Date randomBirthday = RandomDateFactory.randomBirthday(from, till);
actual = CalculateDateExtensions.isBetween(from, till, randomBirthday);
assertTrue("", actual);
assertTrue(actual);
}
}

Expand All @@ -112,7 +112,7 @@ public void testCreateRandomDateBetween()
final Date till = CalculateDateExtensions.addDays(this.now, 30);
final Date randomDate = RandomDateFactory.randomDateBetween(from, startDays, endDays);
actual = CalculateDateExtensions.isBetween(this.now, till, randomDate);
assertTrue("", actual);
assertTrue(actual);
}

/**
Expand All @@ -125,7 +125,7 @@ public void testCreateRandomDatebetweenDateDate()
final Date start = this.now;
final Date randomDate = RandomDateFactory.randomDatebetween(start, end);
actual = CalculateDateExtensions.isBetween(start, end, randomDate);
assertTrue("", actual);
assertTrue(actual);
}

/**
Expand All @@ -144,7 +144,7 @@ public void testCreateRandomDatebetweenLongLong() throws ParseException
final Date compare = ParseDateExtensions.parseToDate(randomDate,
DatePattern.DOT_DD_MM_YYYY_HH_MM_SS.getValue());
actual = CalculateDateExtensions.isBetween(this.now, till, compare);
assertTrue("", actual);
assertTrue(actual);
}

/**
Expand All @@ -164,7 +164,7 @@ public void testCreateRandomDatebetweenLongLongString() throws ParseException
final String randomDate = RandomDateFactory.randomDatebetween(startDate, endDate, format);
final Date compare = ParseDateExtensions.parseToDate(randomDate, format);
actual = CalculateDateExtensions.isBetween(from, till, compare);
assertTrue("", actual);
assertTrue(actual);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
*/
package io.github.astrapi69.random.number;

import static org.testng.AssertJUnit.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import java.math.BigDecimal;
import java.security.SecureRandom;

import org.junit.jupiter.api.Test;
import org.meanbean.test.BeanTester;
import org.testng.annotations.Test;

import io.github.astrapi69.random.DefaultSecureRandom;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
*/
package io.github.astrapi69.random.number;

import static org.testng.AssertJUnit.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import java.math.BigInteger;
import java.security.SecureRandom;

import org.junit.jupiter.api.Test;
import org.meanbean.test.BeanTester;
import org.testng.annotations.Test;

import io.github.astrapi69.random.DefaultSecureRandom;

Expand Down Expand Up @@ -67,7 +67,7 @@ public void testRandomBigIntegerSecureRandom()
/**
* Test method for {@link RandomBigIntegerFactory#randomSerialNumber(SecureRandom)}
*/
@Test(enabled = true)
@Test
public void testRandomSerialNumberSecureRandom()
{
for (int i = 0; i < 10; i++)
Expand All @@ -81,7 +81,7 @@ public void testRandomSerialNumberSecureRandom()
/**
* Test method for {@link RandomBigIntegerFactory#randomSerialNumber()}
*/
@Test(enabled = true)
@Test
public void testRandomSerialNumber()
{
for (int i = 0; i < 10; i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@
*/
package io.github.astrapi69.random.number;

import static org.testng.AssertJUnit.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import java.security.SecureRandom;

import org.junit.jupiter.api.Test;
import org.meanbean.test.BeanTester;
import org.testng.Assert;
import org.testng.annotations.Test;

import io.github.astrapi69.random.DefaultSecureRandom;

Expand All @@ -56,11 +55,11 @@ public void testRandomBooleanSecureRandom()
/**
* Test method for {@link RandomBooleanFactory#randomBoolean()}
*/
@Test(enabled = true)
@Test
public void testRandomBoolean()
{
boolean randomBoolean = RandomBooleanFactory.randomBoolean();
Assert.assertNotNull(Boolean.valueOf(randomBoolean));
assertNotNull(Boolean.valueOf(randomBoolean));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
*/
package io.github.astrapi69.random.number;

import static org.testng.AssertJUnit.assertTrue;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.security.SecureRandom;

import org.junit.jupiter.api.Test;
import org.meanbean.test.BeanTester;
import org.testng.annotations.Test;

import io.github.astrapi69.math.MathExtensions;
import io.github.astrapi69.random.DefaultSecureRandom;
Expand Down
Loading

0 comments on commit e7f8e50

Please sign in to comment.