Fix display names of versioning system tests

This commit is contained in:
JeremyStar™ 2024-07-11 14:32:20 +02:00
parent 165855c122
commit 3a734ece70
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
5 changed files with 75 additions and 4 deletions

View file

@ -35,7 +35,7 @@ import static org.junit.jupiter.api.Assertions.fail;
* Tests the class {@link FourNumberVersioningSystem}. * Tests the class {@link FourNumberVersioningSystem}.
*/ */
@SuppressWarnings({ "unused" }) @SuppressWarnings({ "unused" })
@DisplayName("SemanticVersioningSystem") @DisplayName("FourNumberVersioningSystem")
public class FourNumberVersioningSystemTest { public class FourNumberVersioningSystemTest {
/** /**
* The unit logger for this instance. * The unit logger for this instance.

View file

@ -0,0 +1,71 @@
/*
* STAROPENSOURCE ENGINE SOURCE FILE
* Copyright (c) 2024 The StarOpenSource Engine Contributors
* Licensed under the GNU Affero General Public License v3
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.staropensource.sosengine.base.srctests.data.versioning;
import de.staropensource.sosengine.base.data.versioning.OneNumberVersioningSystem;
import de.staropensource.sosengine.base.data.versioning.TwoNumberVersioningSystem;
import de.staropensource.sosengine.base.exceptions.InvalidVersionStringException;
import de.staropensource.sosengine.unittests.UnitLogger;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
/**
* Tests the class {@link TwoNumberVersioningSystem}.
*/
@SuppressWarnings({ "unused" })
@DisplayName("OneNumberVersioningSystem")
public class OneNumberVersioningSystemTest {
/**
* The unit logger for this instance.
*/
private static final UnitLogger logger = new UnitLogger(OneNumberVersioningSystemTest.class);
private static final Logger log = LoggerFactory.getLogger(OneNumberVersioningSystemTest.class);
/**
* Tests the method {@code compare}.
*/
@ParameterizedTest
@DisplayName("compare")
@CsvSource({
"1, 0, 0",
"1, 1, 1",
"1, 2, 2",
})
void testCompare(String a, String b, int expected) throws Throwable {
logger.testCall("testCompare", a, b, expected);
try {
assertEquals(expected, new OneNumberVersioningSystem(a).compare(new OneNumberVersioningSystem(b)));
} catch (InvalidVersionStringException exception) {
logger.error("Got InvalidVersionStringException: " + exception.getMessage());
if (exception.getThrowable() != null) {
logger.error("Original stack trace:");
throw exception.getThrowable();
}
fail("Got InvalidVersionStringException");
}
}
}

View file

@ -34,7 +34,7 @@ import static org.junit.jupiter.api.Assertions.fail;
* Tests the class {@link SemanticVersioningSystem}. * Tests the class {@link SemanticVersioningSystem}.
*/ */
@SuppressWarnings({ "unused" }) @SuppressWarnings({ "unused" })
@DisplayName("SemanticVersioningSystem") @DisplayName("StarOpenSourceVersioningSystem")
public class StarOpenSourceVersioningSystemTest { public class StarOpenSourceVersioningSystemTest {
/** /**
* The unit logger for this instance. * The unit logger for this instance.

View file

@ -35,7 +35,7 @@ import static org.junit.jupiter.api.Assertions.fail;
* Tests the class {@link ThreeNumberVersioningSystem}. * Tests the class {@link ThreeNumberVersioningSystem}.
*/ */
@SuppressWarnings({ "unused" }) @SuppressWarnings({ "unused" })
@DisplayName("SemanticVersioningSystem") @DisplayName("ThreeNumberVersioningSystem")
public class ThreeNumberVersioningSystemTest { public class ThreeNumberVersioningSystemTest {
/** /**
* The unit logger for this instance. * The unit logger for this instance.

View file

@ -35,7 +35,7 @@ import static org.junit.jupiter.api.Assertions.fail;
* Tests the class {@link TwoNumberVersioningSystem}. * Tests the class {@link TwoNumberVersioningSystem}.
*/ */
@SuppressWarnings({ "unused" }) @SuppressWarnings({ "unused" })
@DisplayName("SemanticVersioningSystem") @DisplayName("TwoNumberVersioningSystem")
public class TwoNumberVersioningSystemTest { public class TwoNumberVersioningSystemTest {
/** /**
* The unit logger for this instance. * The unit logger for this instance.