Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
<logback.version>1.5.36</logback.version>
<log4j2.version>2.26.0</log4j2.version>
<saxon.version>9.8.0-15</saxon.version>
<spring.boot.version>3.5.15</spring.boot.version>
<spring.version>6.2.19</spring.version>
<spring.data.version>3.5.12</spring.data.version>
<spring.boot.version>4.1.1</spring.boot.version>
<spring.version>7.0.9</spring.version>
<spring.data.version>4.1.1</spring.data.version>
<netty.version>4.1.137.Final</netty.version>
<zookeeper.version>3.9.5</zookeeper.version>
<jackson.version>2.18.9</jackson.version>
Expand All @@ -57,8 +57,9 @@
<netbeans.hint.license>gpl30</netbeans.hint.license>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<jakarta.servlet.version>6.1.0</jakarta.servlet.version>
<wicket.version>10.11.0</wicket.version>
<junit.version>5.13.4</junit.version>
<junit.version>6.0.3</junit.version>
</properties>

<dependencies>
Expand All @@ -68,22 +69,33 @@
<version>${slf4j.version}</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>

</dependencies>

<dependencyManagement>
<dependencies>
<!-- Pins junit-jupiter-api/-engine/-params pulled in
transitively ( by wicket-tester) with the version required
by Spring Framework 7 / Spring Boot 4 -->
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
</dependency>
<!-- JUnit 4, still required by the two tests that extend Solr's
SolrTestCaseJ4, and by the vintage engine that runs them. -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
Expand Down
9 changes: 7 additions & 2 deletions vlo-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>5.0.0</version>
<version>${jakarta.servlet.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -245,7 +245,12 @@
</dependency>

<!-- TEST DEPENDENCIES -->


<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
Expand Down
46 changes: 23 additions & 23 deletions vlo-commons/src/test/java/eu/clarin/cmdi/vlo/PIDUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import java.util.List;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;

/**
*
Expand Down Expand Up @@ -122,52 +122,52 @@ public class PIDUtilsTest {
*/
@Test
public void testIsPid() {
VALID_HANDLES.forEach(h -> assertTrue(h, PIDUtils.isPid(h)));
VALID_DOIS.forEach(h -> assertTrue(h, PIDUtils.isPid(h)));
VALID_URN_NBNS.forEach(h -> assertTrue(h, PIDUtils.isPid(h)));
VALID_HANDLES.forEach(h -> assertTrue(PIDUtils.isPid(h), h));
VALID_DOIS.forEach(h -> assertTrue(PIDUtils.isPid(h), h));
VALID_URN_NBNS.forEach(h -> assertTrue(PIDUtils.isPid(h), h));

//negatives
NOT_PIDS.forEach(h -> assertFalse(h, PIDUtils.isPid(h)));
assertFalse("null", PIDUtils.isPid(null));
NOT_PIDS.forEach(h -> assertFalse(PIDUtils.isPid(h), h));
assertFalse(PIDUtils.isPid(null), "null");
}

/**
* Test of isHandle method, of class PIDUtils.
*/
@Test
public void testIsHandle() {
VALID_HANDLES.forEach(h -> assertTrue(h, PIDUtils.isHandle(h)));
VALID_HANDLES.forEach(h -> assertTrue(PIDUtils.isHandle(h), h));

//negatives
NOT_HANDLES.forEach(h -> assertFalse(h, PIDUtils.isHandle(h)));
NOT_PIDS.forEach(h -> assertFalse(h, PIDUtils.isHandle(h)));
assertFalse("null", PIDUtils.isHandle(null));
NOT_HANDLES.forEach(h -> assertFalse(PIDUtils.isHandle(h), h));
NOT_PIDS.forEach(h -> assertFalse(PIDUtils.isHandle(h), h));
assertFalse(PIDUtils.isHandle(null), "null");
}

/**
* Test of isHandle method, of class PIDUtils.
*/
@Test
public void testIsDoi() {
VALID_DOIS.forEach(h -> assertTrue(h, PIDUtils.isDoi(h)));
VALID_DOIS.forEach(h -> assertTrue(PIDUtils.isDoi(h), h));

//negatives
NOT_DOIS.forEach(h -> assertFalse(h, PIDUtils.isDoi(h)));
NOT_PIDS.forEach(h -> assertFalse(h, PIDUtils.isDoi(h)));
assertFalse("null", PIDUtils.isDoi(null));
NOT_DOIS.forEach(h -> assertFalse(PIDUtils.isDoi(h), h));
NOT_PIDS.forEach(h -> assertFalse(PIDUtils.isDoi(h), h));
assertFalse(PIDUtils.isDoi(null), "null");
}

/**
* Test of isHandle method, of class PIDUtils.
*/
@Test
public void testIsUrnNbn() {
VALID_URN_NBNS.forEach(h -> assertTrue(h, PIDUtils.isUrnNbn(h)));
VALID_URN_NBNS.forEach(h -> assertTrue(PIDUtils.isUrnNbn(h), h));

//negatives
NOT_URN_NBNS.forEach(h -> assertFalse(h, PIDUtils.isUrnNbn(h)));
NOT_PIDS.forEach(h -> assertFalse(h, PIDUtils.isUrnNbn(h)));
assertFalse("null", PIDUtils.isUrnNbn(null));
NOT_URN_NBNS.forEach(h -> assertFalse(PIDUtils.isUrnNbn(h), h));
NOT_PIDS.forEach(h -> assertFalse(PIDUtils.isUrnNbn(h), h));
assertFalse(PIDUtils.isUrnNbn(null), "null");
}

@Test
Expand Down Expand Up @@ -197,15 +197,15 @@ public void testIsActionable() {
ACTIONABLE.forEach(h -> assertTrue(PIDUtils.isActionableLink(h)));
NON_ACTIONABLE_PIDS.forEach(h -> assertFalse(PIDUtils.isActionableLink(h)));
INVALID.forEach(h -> assertFalse(PIDUtils.isActionableLink(h)));
ACTIONABLE.forEach(h -> assertFalse("input should be trimmed", PIDUtils.isActionableLink(" " + h + " ")));
ACTIONABLE.forEach(h -> assertFalse(PIDUtils.isActionableLink(" " + h + " "), "input should be trimmed"));
}

@Test
public void testGetActionableLinkForPid() {
ACTIONABLE_PIDS.forEach(h -> assertEquals("actionable pids should not be changed", h, PIDUtils.getActionableLinkForPid(h)));
ACTIONABLE.forEach(h -> assertEquals("actionable links should not be changed", h, PIDUtils.getActionableLinkForPid(h)));
ACTIONABLE_PIDS.forEach(h -> assertEquals(h, PIDUtils.getActionableLinkForPid(h), "actionable pids should not be changed"));
ACTIONABLE.forEach(h -> assertEquals(h, PIDUtils.getActionableLinkForPid(h), "actionable links should not be changed"));
NON_ACTIONABLE_PIDS.forEach(h -> assertNotEquals("non-actionable PIDs should be changed into links", h, PIDUtils.getActionableLinkForPid(h)));
INVALID.forEach(h -> assertEquals("invalid links should not be changed", h, PIDUtils.getActionableLinkForPid(h)));
INVALID.forEach(h -> assertEquals(h, PIDUtils.getActionableLinkForPid(h), "invalid links should not be changed"));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*/
package eu.clarin.cmdi.vlo;

import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*/
package eu.clarin.cmdi.vlo;

import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

/**
*
Expand All @@ -20,7 +20,7 @@ public class DefaultVloConfigFactoryTest {
private VloConfig config;
private Properties testProps;

@Before
@BeforeEach
public void setUp() throws Exception {
config = new DefaultVloConfigFactory().newConfig();
testProps = new Properties();
Expand All @@ -38,13 +38,13 @@ public void testGetDataRoots() {
final List<DataRoot> rootsReturned = config.getDataRoots();

assertNotNull(rootsReturned);
assertTrue("One or more data roots should be defined", rootsReturned.size() > 0);
assertTrue(rootsReturned.size() > 0, "One or more data roots should be defined");
assertNotNull(rootsReturned.get(0).getOriginName());
assertTrue("Origin name cannot be empty", rootsReturned.get(0).getOriginName().length() > 0);
assertTrue(rootsReturned.get(0).getOriginName().length() > 0, "Origin name cannot be empty");
assertNotNull(rootsReturned.get(0).getPrefix());
assertTrue("Prefix cannot be empty", rootsReturned.get(0).getPrefix().length() > 0);
assertTrue(rootsReturned.get(0).getPrefix().length() > 0, "Prefix cannot be empty");
assertNotNull(rootsReturned.get(0).getRootFile());
assertTrue("Root file cannot be empty", rootsReturned.get(0).getRootFile().getName().length() > 0);
assertTrue(rootsReturned.get(0).getRootFile().getName().length() > 0, "Root file cannot be empty");
assertNotNull(rootsReturned.get(0).getToStrip());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import java.util.stream.DoubleStream;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

/**
*
Expand All @@ -39,7 +39,7 @@ public class FieldNameServiceImplTest {
private VloConfig vloConfig;
private HashMap<String, String> fieldsMap;

@Before
@BeforeEach
public void setUp() {
vloConfig = new VloConfig();
fieldsMap = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
import jakarta.xml.bind.ValidationEventHandler;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import org.junit.Before;
import org.junit.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.fail;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -43,7 +43,7 @@ public class VloConfigMarshallerTest {
private VloConfigMarshaller instance;
private Properties testProps;

@Before
@BeforeEach
public void setUp() throws Exception {
instance = new VloConfigMarshaller();
testProps = new Properties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,8 @@
*/
package eu.clarin.cmdi.vlo.config;

import java.io.InputStream;
import java.net.URI;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;

/**
*
Expand All @@ -34,19 +34,19 @@ public class FacetConceptsMarshallerTest {
public FacetConceptsMarshallerTest() {
}

@BeforeClass
@BeforeAll
public static void setUpClass() {
}

@AfterClass
@AfterAll
public static void tearDownClass() {
}

@Before
@BeforeEach
public void setUp() {
}

@After
@AfterEach
public void tearDown() {
}

Expand Down
Loading
Loading