Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
janvonde committed Jan 18, 2024
2 parents 69fdb42 + dd383fe commit 82e172a
Show file tree
Hide file tree
Showing 31 changed files with 453 additions and 527 deletions.
2 changes: 2 additions & 0 deletions goobi-viewer-connector/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
Expand All @@ -22,6 +23,7 @@
<attributes>
<attribute name="test" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v9.0">
Expand Down
3 changes: 2 additions & 1 deletion goobi-viewer-connector/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/build/
/doc/
rebel.xml
/target/
/.settings/
/.classpath
12 changes: 0 additions & 12 deletions goobi-viewer-connector/.settings/.jsdtscope

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions goobi-viewer-connector/.settings/org.eclipse.jdt.core.prefs

This file was deleted.

5 changes: 0 additions & 5 deletions goobi-viewer-connector/.settings/org.eclipse.jdt.ui.prefs

This file was deleted.

4 changes: 0 additions & 4 deletions goobi-viewer-connector/.settings/org.eclipse.m2e.core.prefs

This file was deleted.

16 changes: 0 additions & 16 deletions goobi-viewer-connector/.settings/org.eclipse.wst.common.component

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

33 changes: 22 additions & 11 deletions goobi-viewer-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.goobi.viewer</groupId>
<artifactId>viewer-connector</artifactId>
<version>23.10</version>
<version>23.11-SNAPSHOT</version>
<packaging>jar</packaging>


Expand Down Expand Up @@ -44,6 +44,8 @@
<skipDependencyCheck>true</skipDependencyCheck>

<!-- Sonar -->
<sonar.scanner.force-deprecated-java-version>true</sonar.scanner.force-deprecated-java-version>

<sonar.projectKey>intranda_goobi-viewer-connector</sonar.projectKey>
<sonar.organization>intranda</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
Expand All @@ -54,22 +56,22 @@
<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
<buildDate>${maven.build.timestamp}</buildDate>

<viewer-core.version>23.10</viewer-core.version>
<viewer-core.version>23.11-SNAPSHOT</viewer-core.version>

<commons-collections.version>3.2.2</commons-collections.version>
<commons-configuration2.version>2.9.0</commons-configuration2.version>
<commons-io.version>2.14.0</commons-io.version>
<commons-io.version>2.15.1</commons-io.version>
<commons-jxpath.version>1.3</commons-jxpath.version>
<commons-lang3.version>3.13.0</commons-lang3.version>
<commons-lang3.version>3.14.0</commons-lang3.version>
<httpclient.version>4.5.14</httpclient.version>
<httpcore.version>4.4.16</httpcore.version>
<jaxen.version>2.0.0</jaxen.version>
<jdom2.version>2.0.6.1</jdom2.version>
<json.version>20231013</json.version>
<junit.version>4.13.2</junit.version>
<log4j.version>2.21.1</log4j.version>
<junit.version>5.10.1</junit.version>
<log4j.version>2.22.1</log4j.version>
<solr.version>8.11.2</solr.version>
<tomcat.version>9.0.82</tomcat.version>
<tomcat.version>9.0.85</tomcat.version>
<xstream.version>1.4.20</xstream.version>
</properties>

Expand Down Expand Up @@ -139,12 +141,18 @@
<artifactId>json</artifactId>
<version>${json.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
Expand Down Expand Up @@ -233,6 +241,9 @@

<!-- jaxb-runtime needs to be available to remove the warning "JAXBContext implementation could not be found. WADL feature is disabled" during tomcat startup -->
<ignoredUnusedDeclaredDependency>org.glassfish.jaxb:jaxb-runtime</ignoredUnusedDeclaredDependency>

<!-- junit-jupiter is used to run the tests, otherwise it will fail in maven -->
<ignoredUnusedDeclaredDependency>org.junit.jupiter:junit-jupiter</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
package io.goobi.viewer.connector;

import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;

import io.goobi.viewer.connector.utils.SolrSearchIndex;

Expand All @@ -30,12 +28,12 @@ public abstract class AbstractSolrEnabledTest extends AbstractTest {

private static final String SOLR_TEST_URL = "https://viewer-testing-index.goobi.io/solr/collection1";

@BeforeClass
@BeforeAll
public static void setUpClass() throws Exception {
AbstractTest.setUpClass();
}

@Before
@BeforeEach
public void setUp() throws Exception {
HttpSolrClient client = SolrSearchIndex.getNewHttpSolrClient(SOLR_TEST_URL);
DataManager.getInstance().injectSearchIndex(new SolrSearchIndex(client, true));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import java.io.File;

import org.junit.BeforeClass;
import org.junit.jupiter.api.BeforeAll;

import io.goobi.viewer.connector.utils.Configuration;

Expand All @@ -29,7 +29,7 @@ public abstract class AbstractTest {
public static final String TEST_CONFIG_PATH = new File("src/test/resources/config_oai.test.xml").getAbsolutePath();
public static final String TEST_CONFIG_PATH_CORE = new File("src/test/resources/config_viewer.test.xml").getAbsolutePath();

@BeforeClass
@BeforeAll
public static void setUpClass() throws Exception {
System.setProperty("log4j.configurationFile", "src/test/resources/log4j2.test.xml");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@

import javax.servlet.ServletContextEvent;

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

class ContextListenerTest {

public class ContextListenerTest {

/**
* @see ContextListener#contextInitialized(ServletContextEvent)
* @verifies set version correctly
*/
@Test
public void contextInitialized_shouldSetVersionCorrectly() throws Exception {
void contextInitialized_shouldSetVersionCorrectly() throws Exception {
ContextListener listener = new ContextListener();
listener.contextInitialized(null);
Assert.assertNotNull(io.goobi.viewer.controller.DataManager.getInstance().getConnectorVersion());
Assertions.assertNotNull(io.goobi.viewer.controller.DataManager.getInstance().getConnectorVersion());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,50 +15,50 @@
*/
package io.goobi.viewer.connector.oai;

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

import io.goobi.viewer.connector.AbstractTest;
import io.goobi.viewer.connector.oai.servlets.OaiServlet;

public class OaiServletTest extends AbstractTest {
class OaiServletTest extends AbstractTest {
/**
* @see OaiServlet#checkDatestamps(String,String)
* @verifies return false if from is not well formed
*/
@Test
public void checkDatestamps_shouldReturnFalseIfFromIsNotWellFormed() throws Exception {
Assert.assertFalse(OaiServlet.checkDatestamps("2015-09-30T15:00:00X", "2015-09-30T15:00:01"));
Assert.assertFalse(OaiServlet.checkDatestamps("2015-09-2X", "2015-09-30"));
void checkDatestamps_shouldReturnFalseIfFromIsNotWellFormed() throws Exception {
Assertions.assertFalse(OaiServlet.checkDatestamps("2015-09-30T15:00:00X", "2015-09-30T15:00:01"));
Assertions.assertFalse(OaiServlet.checkDatestamps("2015-09-2X", "2015-09-30"));
}

/**
* @see OaiServlet#checkDatestamps(String,String)
* @verifies return false if until is not well formed
*/
@Test
public void checkDatestamps_shouldReturnFalseIfUntilIsNotWellFormed() throws Exception {
Assert.assertFalse(OaiServlet.checkDatestamps("2015-09-30T15:00:00", "2015-09-30T15:00:01Z"));
Assert.assertFalse(OaiServlet.checkDatestamps("2015-09-30", "2015-09-31"));
void checkDatestamps_shouldReturnFalseIfUntilIsNotWellFormed() throws Exception {
Assertions.assertFalse(OaiServlet.checkDatestamps("2015-09-30T15:00:00", "2015-09-30T15:00:01Z"));
Assertions.assertFalse(OaiServlet.checkDatestamps("2015-09-30", "2015-09-31"));
}

/**
* @see OaiServlet#checkDatestamps(String,String)
* @verifies return false if from after until
*/
@Test
public void checkDatestamps_shouldReturnFalseIfFromAfterUntil() throws Exception {
Assert.assertFalse(OaiServlet.checkDatestamps("2015-09-30T15:00:01", "2015-09-30T15:00:00"));
Assert.assertFalse(OaiServlet.checkDatestamps("2015-09-30", "2015-09-29"));
void checkDatestamps_shouldReturnFalseIfFromAfterUntil() throws Exception {
Assertions.assertFalse(OaiServlet.checkDatestamps("2015-09-30T15:00:01", "2015-09-30T15:00:00"));
Assertions.assertFalse(OaiServlet.checkDatestamps("2015-09-30", "2015-09-29"));
}

/**
* @see OaiServlet#checkDatestamps(String,String)
* @verifies return true if from and until correct
*/
@Test
public void checkDatestamps_shouldReturnTrueIfFromAndUntilCorrect() throws Exception {
Assert.assertTrue(OaiServlet.checkDatestamps("2015-09-30T15:00:00Z", "2015-09-30T15:00:01Z"));
Assert.assertTrue(OaiServlet.checkDatestamps("2015-09-29", "2015-09-30"));
void checkDatestamps_shouldReturnTrueIfFromAndUntilCorrect() throws Exception {
Assertions.assertTrue(OaiServlet.checkDatestamps("2015-09-30T15:00:00Z", "2015-09-30T15:00:01Z"));
Assertions.assertTrue(OaiServlet.checkDatestamps("2015-09-29", "2015-09-30"));
}
}
Loading

0 comments on commit 82e172a

Please sign in to comment.