Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	pom.xml
  • Loading branch information
klakegg committed Aug 24, 2023
2 parents 3567cb2 + a497586 commit 8a628f3
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 37 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:8u332-slim-bullseye
FROM eclipse-temurin:17-jre

ADD target/vefa-validator /vefa-validator

Expand Down
21 changes: 8 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,29 +63,29 @@
<properties>
<java.encoding>UTF-8</java.encoding>
<java.version>1.8</java.version>
<slf4j.version>1.7.36</slf4j.version>
<slf4j.version>2.0.7</slf4j.version>
</properties>

<dependencies>
<!-- Testing -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.5</version>
<version>7.5.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.5.1</version>
<version>4.11.0</version>
<scope>test</scope>
</dependency>

<!-- Utils -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
<version>1.18.28</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -130,7 +130,7 @@
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<version>10.9</version>
<version>12.2</version>
</dependency>

<!-- Logging -->
Expand All @@ -142,7 +142,7 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.11</version>
<version>1.3.8</version>
</dependency>

<!-- Commons -->
Expand All @@ -156,11 +156,6 @@
<artifactId>commons-io</artifactId>
<version>2.13.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<version>2.11.1</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
Expand All @@ -171,12 +166,12 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.1.2-jre</version>
<version>31.1-jre</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>5.1.0</version>
<version>7.0.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class CacheModule extends AbstractModule {
@Singleton
public LoadingCache<String, Checker> getCheckerCache(Properties properties, CheckerCacheLoader loader) {
return CacheBuilder.newBuilder()
.softValues()
.maximumSize(properties.getInteger("pools.checker.size"))
.expireAfterAccess(properties.getInteger("pools.checker.expire"), TimeUnit.MINUTES)
.build(loader);
Expand All @@ -31,6 +32,7 @@ public LoadingCache<String, Checker> getCheckerCache(Properties properties, Chec
@Singleton
public LoadingCache<String, Renderer> getRendererCache(Properties properties, RendererCacheLoader loader) {
return CacheBuilder.newBuilder()
.softValues()
.maximumSize(properties.getInteger("pools.presenter.size"))
.expireAfterAccess(properties.getInteger("pools.presenter.expire"), TimeUnit.MINUTES)
.build(loader);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import net.sf.saxon.Configuration;
import net.sf.saxon.lib.Feature;
import net.sf.saxon.s9api.Processor;
import no.difi.vefa.validator.util.BlockingURIResolver;


/**
Expand All @@ -19,7 +18,6 @@ public class SaxonModule extends AbstractModule {
public Processor getProcessor() {
Configuration configuration = new Configuration();
configuration.setConfigurationProperty(Feature.ALLOW_EXTERNAL_FUNCTIONS, false);
configuration.setURIResolver(new BlockingURIResolver());

return new Processor(configuration);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,26 +79,6 @@ public void validTabs() throws Exception {
assertEquals(declarationDetector.detect(inputStream).getIdentifier().get(0), "profile#customization");
}

@Test
public void invalidSpaces() throws Exception {
String s = docStart + " xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\">" +
"< CustomizationID>customization</CustomizationID>" +
"< ProfileID>profile</ProfileID>" +
"</Invoice:Invoice>";
ByteArrayInputStream inputStream = new ByteArrayInputStream(s.getBytes());
assertEquals(declarationDetector.detect(inputStream).getDeclaration().getType(), "xml");
}

@Test
public void invalidTabs() throws Exception {
String s = docStart + " xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\">" +
"<\tCustomizationID>customization</CustomizationID>" +
"<\tProfileID>profile</ProfileID>" +
"</Invoice:Invoice>";
ByteArrayInputStream inputStream = new ByteArrayInputStream(s.getBytes());
assertEquals(declarationDetector.detect(inputStream).getDeclaration().getType(), "xml");
}

@Test
public void validOioublDeclaration() throws Exception {
String s = docStart + " xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\">" +
Expand Down

0 comments on commit 8a628f3

Please sign in to comment.