update to xbib netty http 4.1.39.2, xbib net 2.0.1, junit 5

This commit is contained in:
Jörg Prante 2019-08-29 19:30:04 +02:00
parent ab2ceaa579
commit bcf18d08b4
13 changed files with 52 additions and 61 deletions

View file

@ -21,7 +21,10 @@ subprojects {
} }
dependencies { dependencies {
testCompile "junit:junit:${project.property('junit.version')}" testCompile "org.junit.jupiter:junit-jupiter-api:${project.property('junit.version')}"
testCompile "org.junit.jupiter:junit-jupiter-params:${project.property('junit.version')}"
testCompile "org.junit.jupiter:junit-jupiter-engine:${project.property('junit.version')}"
//testCompile "org.junit.vintage:junit-vintage-engine:${project.property('junit.version')}"
testCompile "org.xbib:bibliographic-character-sets:${project.property('xbib-bibliographic-character-sets.version')}" testCompile "org.xbib:bibliographic-character-sets:${project.property('xbib-bibliographic-character-sets.version')}"
} }
@ -45,10 +48,20 @@ subprojects {
} }
test { test {
systemProperty 'java.util.logging.config.file', 'src/test/resources/logging.properties' useJUnitPlatform()
failFast = false
testLogging { testLogging {
showStandardStreams = true events 'STARTED', 'PASSED', 'FAILED', 'SKIPPED'
exceptionFormat = 'full' showStandardStreams = false
}
afterSuite { desc, result ->
if (!desc.parent) {
println "\nTest result: ${result.resultType}"
println "Test summary: ${result.testCount} tests, " +
"${result.successfulTestCount} succeeded, " +
"${result.failedTestCount} failed, " +
"${result.skippedTestCount} skipped"
}
} }
} }

View file

@ -1,18 +1,16 @@
group = org.xbib group = org.xbib
name = oai name = oai
version = 2.0.0 version = 2.0.1
xbib-content.version = 2.0.0 xbib-content.version = 2.0.1
xbib-netty-http.version = 4.1.38.3 xbib-netty-http.version = 4.1.39.2
tcnative.version = 2.0.25.Final tcnative.version = 2.0.25.Final
# test # test
junit.version = 4.12 junit.version = 5.5.1
junit4.version = 4.12
xbib-bibliographic-character-sets.version = 1.0.0 xbib-bibliographic-character-sets.version = 1.0.0
xbib-marc.version = 2.0.0 xbib-marc.version = 2.0.0
# doc # doc
asciidoclet.version = 1.5.4 asciidoclet.version = 1.5.4
org.gradle.warning.mode = all
org.gradle.daemon = false

View file

@ -1,5 +1,5 @@
#Wed Aug 07 14:17:29 CEST 2019 #Thu Aug 29 18:18:25 CEST 2019
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-5.6-all.zip
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

6
gradlew vendored
View file

@ -7,7 +7,7 @@
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # https://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
@ -125,8 +125,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi fi
# For Cygwin, switch paths to Windows format before running java # For Cygwin or MSYS, switch paths to Windows format before running java
if $cygwin ; then if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"` APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"` JAVACMD=`cygpath --unix "$JAVACMD"`

2
gradlew.bat vendored
View file

@ -5,7 +5,7 @@
@rem you may not use this file except in compliance with the License. @rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at @rem You may obtain a copy of the License at
@rem @rem
@rem http://www.apache.org/licenses/LICENSE-2.0 @rem https://www.apache.org/licenses/LICENSE-2.0
@rem @rem
@rem Unless required by applicable law or agreed to in writing, software @rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS, @rem distributed under the License is distributed on an "AS IS" BASIS,

View file

@ -1,9 +1,8 @@
package org.xbib.oai.client; package org.xbib.oai.client;
import static org.junit.Assert.assertTrue;
import io.netty.handler.codec.http.HttpHeaderNames; import io.netty.handler.codec.http.HttpHeaderNames;
import org.junit.Test; import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
import org.xbib.net.URL; import org.xbib.net.URL;
import org.xbib.netty.http.client.Client; import org.xbib.netty.http.client.Client;
import org.xbib.netty.http.client.Request; import org.xbib.netty.http.client.Request;
@ -28,12 +27,12 @@ import java.util.logging.Logger;
/** /**
* *
*/ */
public class ArxivClientTest { class ArxivClientTest {
private static final Logger logger = Logger.getLogger(ArxivClientTest.class.getName()); private static final Logger logger = Logger.getLogger(ArxivClientTest.class.getName());
@Test @Test
public void testListRecordsArxiv() { void testListRecordsArxiv() {
final URL url = URL.create("http://export.arxiv.org/oai2/"); final URL url = URL.create("http://export.arxiv.org/oai2/");
try (OAIClient client = new OAIClient(url)) { try (OAIClient client = new OAIClient(url)) {
IdentifyRequest identifyRequest = client.newIdentifyRequest(); IdentifyRequest identifyRequest = client.newIdentifyRequest();

View file

@ -1,8 +1,8 @@
package org.xbib.oai.client; package org.xbib.oai.client;
import io.netty.handler.codec.http.HttpHeaderNames; import io.netty.handler.codec.http.HttpHeaderNames;
import org.junit.Ignore; import org.junit.jupiter.api.Disabled;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.xbib.marc.Marc; import org.xbib.marc.Marc;
import org.xbib.marc.json.MarcJsonWriter; import org.xbib.marc.json.MarcJsonWriter;
import org.xbib.marc.xml.MarcContentHandler; import org.xbib.marc.xml.MarcContentHandler;
@ -27,13 +27,13 @@ import java.util.logging.Logger;
/** /**
* *
*/ */
@Ignore @Disabled
public class BundeskunsthalleTest { class BundeskunsthalleTest {
private static final Logger logger = Logger.getLogger(BundeskunsthalleTest.class.getName()); private static final Logger logger = Logger.getLogger(BundeskunsthalleTest.class.getName());
@Test @Test
public void testListRecords() { void testListRecords() {
URL url = URL.create("https://www.bundeskunsthalle.de/cgi-bin/bib/oai-pmh"); URL url = URL.create("https://www.bundeskunsthalle.de/cgi-bin/bib/oai-pmh");
try (OAIClient oaiClient = new OAIClient(url)) { try (OAIClient oaiClient = new OAIClient(url)) {
Client httpClient = Client.builder() Client httpClient = Client.builder()

View file

@ -1,8 +1,7 @@
package org.xbib.oai.client; package org.xbib.oai.client;
import io.netty.handler.codec.http.HttpHeaderNames; import io.netty.handler.codec.http.HttpHeaderNames;
import org.junit.Ignore; import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.xbib.net.URL; import org.xbib.net.URL;
import org.xbib.netty.http.client.Client; import org.xbib.netty.http.client.Client;
import org.xbib.netty.http.client.Request; import org.xbib.netty.http.client.Request;
@ -28,12 +27,12 @@ import java.util.logging.Logger;
/** /**
* *
*/ */
public class DNBClientTest { class DNBClientTest {
private static final Logger logger = Logger.getLogger(DNBClientTest.class.getName()); private static final Logger logger = Logger.getLogger(DNBClientTest.class.getName());
@Test @Test
public void testBibdat() { void testBibdat() {
URL url = URL.create("http://services.dnb.de/oai/repository"); URL url = URL.create("http://services.dnb.de/oai/repository");
try (OAIClient oaiClient = new OAIClient(url)) { try (OAIClient oaiClient = new OAIClient(url)) {
Client httpClient = Client.builder() Client httpClient = Client.builder()

View file

@ -1,8 +1,8 @@
package org.xbib.oai.client; package org.xbib.oai.client;
import io.netty.handler.codec.http.HttpHeaderNames; import io.netty.handler.codec.http.HttpHeaderNames;
import org.junit.Ignore; import org.junit.jupiter.api.Disabled;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.xbib.net.URL; import org.xbib.net.URL;
import org.xbib.netty.http.client.Client; import org.xbib.netty.http.client.Client;
import org.xbib.netty.http.client.Request; import org.xbib.netty.http.client.Request;
@ -25,13 +25,13 @@ import java.util.logging.Logger;
/** /**
* *
*/ */
public class DOAJClientTest { class DOAJClientTest {
private static final Logger logger = Logger.getLogger(DOAJClientTest.class.getName()); private static final Logger logger = Logger.getLogger(DOAJClientTest.class.getName());
@Test @Test
@Ignore // takes too long time @Disabled // takes too long time
public void testListRecordsDOAJ() { void testListRecordsDOAJ() {
URL url = URL.create("https://doaj.org/oai"); URL url = URL.create("https://doaj.org/oai");
try (OAIClient oaiClient = new OAIClient(url)) { try (OAIClient oaiClient = new OAIClient(url)) {
Client httpClient = Client.builder() Client httpClient = Client.builder()

View file

@ -1,5 +0,0 @@
handlers = java.util.logging.ConsoleHandler
.level = INFO
java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.SimpleFormatter.format = %1$tFT%1$tT.%1$tL%1$tz [%4$-11s] [%3$s] %5$s %6$s%n

View file

@ -1,4 +1,3 @@
dependencies { dependencies {
compile project(':oai-common') compile project(':oai-common')
} }

View file

@ -1,6 +1,6 @@
package org.xbib.oai.server; package org.xbib.oai.server;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.xbib.oai.server.identify.IdentifyServerRequest; import org.xbib.oai.server.identify.IdentifyServerRequest;
import org.xbib.oai.server.identify.IdentifyServerResponse; import org.xbib.oai.server.identify.IdentifyServerResponse;
@ -10,17 +10,18 @@ import javax.xml.stream.XMLOutputFactory;
/** /**
* *
*/ */
public class SimpleServiceTest { class SimpleServiceTest {
@Test @Test
public void testIdentifyService() throws Exception { void testIdentifyService() throws Exception {
OAIServer service = OAIServiceFactory.getDefaultService();
StringWriter sw = new StringWriter(); StringWriter sw = new StringWriter();
XMLOutputFactory factory = XMLOutputFactory.newInstance(); XMLOutputFactory factory = XMLOutputFactory.newInstance();
IdentifyServerRequest request = new IdentifyServerRequest(); IdentifyServerRequest request = new IdentifyServerRequest();
IdentifyServerResponse response = new IdentifyServerResponse(); IdentifyServerResponse response = new IdentifyServerResponse();
response.setConsumer(factory.createXMLEventWriter(sw)); response.setConsumer(factory.createXMLEventWriter(sw));
service.identify(request, response); OAIServer service = OAIServiceFactory.getDefaultService();
if (service != null) {
service.identify(request, response);
}
} }
} }

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration status="OFF">
<appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="[%d{ABSOLUTE}][%-5p][%-25c][%t] %m%n"/>
</Console>
</appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console" />
</Root>
</Loggers>
</configuration>