aboutsummaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2020-01-03 15:54:36 +0100
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2020-01-03 17:24:53 +0100
commit11c0391cef31f03a317e043e537cad86fca4393d (patch)
treedffe341a3599bc3d4efcc1e5923784b6addd1397 /application
parentfd9a51908e8e71dee9c37034cb552f001a7cf401 (diff)
Remove use of apache commons libraries in application
Diffstat (limited to 'application')
-rw-r--r--application/pom.xml28
-rw-r--r--application/src/test/java/com/yahoo/application/ApplicationTest.java8
-rw-r--r--application/src/test/java/com/yahoo/application/container/jersey/JerseyTest.java4
3 files changed, 6 insertions, 34 deletions
diff --git a/application/pom.xml b/application/pom.xml
index 5a370e9ffe6..7bcda0ce386 100644
--- a/application/pom.xml
+++ b/application/pom.xml
@@ -97,10 +97,6 @@
</exclusions>
</dependency>
<dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </dependency>
- <dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr-runtime</artifactId>
</dependency>
@@ -109,10 +105,6 @@
<artifactId>antlr4-runtime</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-exec</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.opennlp</groupId>
<artifactId>opennlp-tools</artifactId>
</dependency>
@@ -136,26 +128,6 @@
<scope>test</scope>
</dependency>
- <!-- These dependencies are necessary in test classpath when using jdisc_http_filters -->
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.7.0</version>
- </dependency>
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils-core</artifactId>
- <version>1.8.0</version>
- </dependency>
- <dependency>
- <groupId>commons-configuration</groupId>
- <artifactId>commons-configuration</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-digester</groupId>
- <artifactId>commons-digester</artifactId>
- <version>1.8</version>
- </dependency>
</dependencies>
<build>
diff --git a/application/src/test/java/com/yahoo/application/ApplicationTest.java b/application/src/test/java/com/yahoo/application/ApplicationTest.java
index d4a9c75b713..f2af5537490 100644
--- a/application/src/test/java/com/yahoo/application/ApplicationTest.java
+++ b/application/src/test/java/com/yahoo/application/ApplicationTest.java
@@ -22,7 +22,6 @@ import com.yahoo.jdisc.handler.RequestHandler;
import com.yahoo.search.Query;
import com.yahoo.search.Result;
import com.yahoo.search.handler.SearchHandler;
-import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
@@ -34,6 +33,7 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.net.ConnectException;
import java.net.ServerSocket;
+import java.nio.charset.StandardCharsets;
import java.util.Map;
import static com.yahoo.vespa.defaults.Defaults.getDefaults;
@@ -223,7 +223,7 @@ public class ApplicationTest {
public void document_type() throws Exception {
try (
Application app = Application.fromBuilder(new Application.Builder()
- .documentType("test", IOUtils.toString(this.getClass().getResourceAsStream("/test.sd")))
+ .documentType("test", new String(this.getClass().getResourceAsStream("/test.sd").readAllBytes(), StandardCharsets.UTF_8))
.container("default", new Application.Builder.Container()
.documentProcessor(MockDocproc.class)
.config(new MockApplicationConfig(new MockApplicationConfig.Builder().mystruct(new MockApplicationConfig.Mystruct.Builder().id("foo").value("bar"))))))
@@ -264,7 +264,7 @@ public class ApplicationTest {
@Test
public void client() throws Exception {
try (ApplicationFacade app = new ApplicationFacade(Application.fromBuilder(new Application.Builder()
- .documentType("test", IOUtils.toString(this.getClass().getResourceAsStream("/test.sd")))
+ .documentType("test", new String(this.getClass().getResourceAsStream("/test.sd").readAllBytes(), StandardCharsets.UTF_8))
.container("default", new Application.Builder.Container()
.client("mbus://*/*", MockClient.class)
.documentProcessor(MockDispatchDocproc.class)
@@ -320,7 +320,7 @@ public class ApplicationTest {
"<field name=\"defaultage\" type=\"string\" />\n" +
"</query-profile-type>")
.rankExpression("re", "commonfirstphase(globalstaticrank)")
- .documentType("test", IOUtils.toString(this.getClass().getResourceAsStream("/test.sd")))
+ .documentType("test", new String(this.getClass().getResourceAsStream("/test.sd").readAllBytes(), StandardCharsets.UTF_8))
.container("default", new Application.Builder.Container()
.search(true)
))) {
diff --git a/application/src/test/java/com/yahoo/application/container/jersey/JerseyTest.java b/application/src/test/java/com/yahoo/application/container/jersey/JerseyTest.java
index b2d59dbe209..0eb308f124c 100644
--- a/application/src/test/java/com/yahoo/application/container/jersey/JerseyTest.java
+++ b/application/src/test/java/com/yahoo/application/container/jersey/JerseyTest.java
@@ -10,7 +10,6 @@ import com.yahoo.application.container.jersey.resources.nestedpackage2.NestedTes
import com.yahoo.container.test.jars.jersey.resources.TestResourceBase;
import com.yahoo.osgi.maven.ProjectBundleClassPaths;
import com.yahoo.osgi.maven.ProjectBundleClassPaths.BundleClasspathMapping;
-import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
@@ -19,6 +18,7 @@ import org.apache.http.util.EntityUtils;
import org.junit.Test;
import javax.ws.rs.core.UriBuilder;
+import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -158,7 +158,7 @@ public class JerseyTest {
HttpResponse response = httpGetter.get(path(resource));
assertThat("Failed sending response to " + resource, response.getStatusLine().getStatusCode(), is(200));
- String content = IOUtils.toString(response.getEntity().getContent());
+ String content = new String(response.getEntity().getContent().readAllBytes(), StandardCharsets.UTF_8);
assertThat(content, is(TestResourceBase.content(resource)));
}
}