diff options
author | Morten Tokle <mortent@yahooinc.com> | 2022-08-16 14:42:36 +0200 |
---|---|---|
committer | Morten Tokle <mortent@yahooinc.com> | 2022-08-17 13:02:27 +0200 |
commit | fc29e7e2d04706cf18bc0e7a2fee5263c79a8ea5 (patch) | |
tree | 5f1cbc8680692166c3ee6d0b2eac20f3c8d8fa9e /container-integration-test | |
parent | 45b29ca66acab2db74a225fc778ec81d667da335 (diff) |
Remove module container-integration-test
Diffstat (limited to 'container-integration-test')
-rw-r--r-- | container-integration-test/.gitignore | 2 | ||||
-rw-r--r-- | container-integration-test/OWNERS | 1 | ||||
-rw-r--r-- | container-integration-test/README.md | 9 | ||||
-rw-r--r-- | container-integration-test/pom.xml | 44 | ||||
-rw-r--r-- | container-integration-test/src/test/java/com/yahoo/search/query/gui/GUIHandlerTest.java | 83 |
5 files changed, 0 insertions, 139 deletions
diff --git a/container-integration-test/.gitignore b/container-integration-test/.gitignore deleted file mode 100644 index 3cc25b51fc4..00000000000 --- a/container-integration-test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/pom.xml.build -/target diff --git a/container-integration-test/OWNERS b/container-integration-test/OWNERS deleted file mode 100644 index 3b2ba1ede81..00000000000 --- a/container-integration-test/OWNERS +++ /dev/null @@ -1 +0,0 @@ -gjoranv diff --git a/container-integration-test/README.md b/container-integration-test/README.md deleted file mode 100644 index ccd4cdada87..00000000000 --- a/container-integration-test/README.md +++ /dev/null @@ -1,9 +0,0 @@ -<!-- Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> - -# Integration tests for JDisc components - -This module contains integration tests for container components. - -Tests that use the `application` framework cannot be added to the same maven -module as the component itself because that will usually create a cycle in the -dependency graph. diff --git a/container-integration-test/pom.xml b/container-integration-test/pom.xml deleted file mode 100644 index 5c915588bee..00000000000 --- a/container-integration-test/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0"?> -<!-- Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 - http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>com.yahoo.vespa</groupId> - <artifactId>parent</artifactId> - <version>8-SNAPSHOT</version> - <relativePath>../parent/pom.xml</relativePath> - </parent> - <artifactId>container-integration-test</artifactId> - <packaging>jar</packaging> - <version>8-SNAPSHOT</version> - <dependencies> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpclient</artifactId> - <version>${apache.httpclient.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>com.yahoo.vespa</groupId> - <artifactId>application</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - </plugin> - </plugins> - </build> -</project> diff --git a/container-integration-test/src/test/java/com/yahoo/search/query/gui/GUIHandlerTest.java b/container-integration-test/src/test/java/com/yahoo/search/query/gui/GUIHandlerTest.java deleted file mode 100644 index 4264492ca2b..00000000000 --- a/container-integration-test/src/test/java/com/yahoo/search/query/gui/GUIHandlerTest.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.search.query.gui; - -import com.yahoo.application.Networking; -import com.yahoo.application.container.JDisc; -import com.yahoo.application.container.handler.Request; -import com.yahoo.application.container.handler.Response; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import java.io.IOException; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - - -/** - * @author Henrik Høiness - */ - -public class GUIHandlerTest { - - private JDisc container; - - @Before - public void startContainer() { - container = JDisc.fromServicesXml(servicesXml(), Networking.disable); - } - - @After - public void stopContainer() { - /* - try { - Thread.sleep(100_000); - } catch (InterruptedException e) { - e.printStackTrace(); - }*/ - container.close(); - } - - @Test - public void testRequest() throws Exception { - assertResponse("/querybuilder/", "<!-- Copyright Yahoo.","text/html; charset=UTF-8", 200); - } - - @Test - public void testContentTypes() throws Exception{ - assertResponse("/querybuilder/_includes/css/vespa.css", "/**","text/css; charset=UTF-8", 200); - assertResponse("/querybuilder/js/agency.js", "/*!","application/javascript; charset=UTF-8", 200); - } - - @Test - public void testInvalidPath() throws Exception{ - assertResponse("/querybuilder/invalid_filepath", "{\"error-code\":\"NOT_FOUND\",\"message\":\"Nothing at path","application/json; charset=UTF-8", 404); - } - - - private void assertResponse(String path, String expectedStartString, String expectedContentType, int expectedStatusCode) throws IOException { - assertResponse(Request.Method.GET, path, expectedStartString,expectedContentType, expectedStatusCode); - } - - private void assertResponse(Request.Method method, String path, String expectedStartString, String expectedContentType, int expectedStatusCode) throws IOException { - Response response = container.handleRequest(new Request("http://localhost:8080" + path, new byte[0], method)); - assertEquals("Status code", expectedStatusCode, response.getStatus()); - assertEquals(expectedContentType, response.getHeaders().getFirst("Content-Type")); - if(expectedStartString != null){ - assertTrue(response.getBodyAsString().startsWith(expectedStartString)); - } - } - - private String servicesXml() { - return "<container version='1.0'>\n" + - " <accesslog type='disabled'/>\n" + - " <handler id='com.yahoo.search.query.gui.GUIHandler'>\n" + - " <binding>http://*/querybuilder/*</binding>\n" + - " </handler>\n" + - " <http>\n" + - " <server id='default' port='8080'/>\n" + - " </http>\n" + - "</container>"; - } - -}
\ No newline at end of file |