diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-01-06 11:25:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-06 11:25:42 +0100 |
commit | 64b48c88fe68f58668ba8386cde39bda9e213b8c (patch) | |
tree | 3e6ae81456c4b27addf0d813fabda2b6535b19ea /application | |
parent | 44cb0815efd0c477ceeb7058d96d2eb9bfb2e49b (diff) | |
parent | 13570aa31b7810c352f1c3b62952a06b7c288b5b (diff) |
Merge pull request #11649 from vespa-engine/bjorncs/apache-commons-libraries-cleanup
Bjorncs/apache commons libraries cleanup
Diffstat (limited to 'application')
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))); } } |