[HtmlUnit] SVN: [14751] trunk/htmlunit

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[HtmlUnit] SVN: [14751] trunk/htmlunit

HtmlUnit - Dev mailing list
Revision: 14751
          http://sourceforge.net/p/htmlunit/code/14751
Author:   rbri
Date:     2017-08-01 18:11:03 +0000 (Tue, 01 Aug 2017)
Log Message:
-----------
get rid of tomcat - one server seems to be enough

Modified Paths:
--------------
    trunk/htmlunit/pom.xml
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection3Test.java

Removed Paths:
-------------
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection4Test.java

Modified: trunk/htmlunit/pom.xml
===================================================================
--- trunk/htmlunit/pom.xml 2017-08-01 15:39:26 UTC (rev 14750)
+++ trunk/htmlunit/pom.xml 2017-08-01 18:11:03 UTC (rev 14751)
@@ -955,18 +955,6 @@
             <version>9.4.6.v20170531</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.apache.tomcat.embed</groupId>
-            <artifactId>tomcat-embed-core</artifactId>
-            <version>8.5.16</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.tomcat.embed</groupId>
-            <artifactId>tomcat-embed-logging-juli</artifactId>
-            <version>8.5.2</version>
-            <scope>test</scope>
-        </dependency>
         <!-- WebDriver -->
         <dependency>
             <groupId>org.seleniumhq.selenium</groupId>

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection3Test.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection3Test.java 2017-08-01 15:39:26 UTC (rev 14750)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection3Test.java 2017-08-01 18:11:03 UTC (rev 14751)
@@ -224,4 +224,26 @@
                 .collect(Collectors.toList());
         assertEquals(2, requests.size());
     }
+
+    /**
+     * Test case for Bug #1882.
+     *
+     * @throws Exception if the test fails
+     */
+    @Test
+//    @NotYetImplemented
+    public void queryString() throws Exception {
+        final String response = "HTTP/1.1 302 Found\r\n"
+                + "Content-Length: 0\r\n"
+                + "\r\n";
+
+        primitiveWebServer_ = new PrimitiveWebServer(PORT, response);
+        primitiveWebServer_.start();
+
+        final WebDriver driver = getWebDriver();
+
+        driver.get("http://localhost:" + PORT + "?para=%u65E5");
+        assertTrue(primitiveWebServer_.getRequests().get(0),
+                    primitiveWebServer_.getRequests().get(0).contains("para=%u65E5"));
+    }
 }

Deleted: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection4Test.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection4Test.java 2017-08-01 15:39:26 UTC (rev 14750)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection4Test.java 2017-08-01 18:11:03 UTC (rev 14751)
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2002-2017 Gargoyle Software Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.gargoylesoftware.htmlunit;
-import java.io.File;
-import java.io.IOException;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.catalina.Context;
-import org.apache.catalina.startup.Tomcat;
-import org.junit.After;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.openqa.selenium.WebDriver;
-
-import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented;
-
-/**
- * Tests using the Tomcat.
- *
- * @author Ahmed Ashour
- */
-@RunWith(BrowserRunner.class)
-public class HttpWebConnection4Test extends WebDriverTestCase {
-
-    private Tomcat tomcat_;
-
-    /**
-     * Test case for Bug #1882.
-     *
-     * @throws Exception if the test fails
-     */
-    @Test
-    @NotYetImplemented
-    public void queryString() throws Exception {
-        tomcat_ = new Tomcat();
-
-        tomcat_.setPort(PORT);
-        tomcat_.setBaseDir("target/tomcat");
-
-        final Context context = tomcat_.addContext("", new File(".").getAbsolutePath());
-        Tomcat.addServlet(context, "something", new HttpServlet() {
-            @Override
-            protected void service(final HttpServletRequest request, final HttpServletResponse response)
-                    throws ServletException, IOException {
-                String string = request.getQueryString();
-                if (string == null) {
-                    string = "";
-                }
-                response.getWriter().write(string);
-            }
-        });
-        context.addServletMappingDecoded("/*", "something");
-        tomcat_.start();
-
-        final WebDriver driver = getWebDriver();
-
-        driver.get("http://localhost:" + PORT + "?para=%u65E5");
-        assertTrue(driver.getPageSource().contains("para=%u65E5"));
-    }
-
-    /**
-     * @throws Exception if an error occurs
-     */
-    @After
-    public void stopServer() throws Exception {
-        if (tomcat_ != null) {
-            tomcat_.stop();
-            tomcat_.destroy();
-        }
-    }
-}


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Reply | Threaded
Open this post in threaded view
|

Re: [HtmlUnit] SVN: [14751] trunk/htmlunit

HtmlUnit - Dev mailing list
Then we lose a test case.

Ahmed

> Am 01.08.2017 um 20:11 schrieb rbri--- via HtmlUnit-develop <[hidden email]>:
>
> Revision: 14751
>          http://sourceforge.net/p/htmlunit/code/14751
> Author:   rbri
> Date:     2017-08-01 18:11:03 +0000 (Tue, 01 Aug 2017)
> Log Message:
> -----------
> get rid of tomcat - one server seems to be enough
>
> Modified Paths:
> --------------
>    trunk/htmlunit/pom.xml
>    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection3Test.java
>
> Removed Paths:
> -------------
>    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection4Test.java
>
> Modified: trunk/htmlunit/pom.xml
> ===================================================================
> --- trunk/htmlunit/pom.xml    2017-08-01 15:39:26 UTC (rev 14750)
> +++ trunk/htmlunit/pom.xml    2017-08-01 18:11:03 UTC (rev 14751)
> @@ -955,18 +955,6 @@
>             <version>9.4.6.v20170531</version>
>             <scope>test</scope>
>         </dependency>
> -        <dependency>
> -            <groupId>org.apache.tomcat.embed</groupId>
> -            <artifactId>tomcat-embed-core</artifactId>
> -            <version>8.5.16</version>
> -            <scope>test</scope>
> -        </dependency>
> -        <dependency>
> -            <groupId>org.apache.tomcat.embed</groupId>
> -            <artifactId>tomcat-embed-logging-juli</artifactId>
> -            <version>8.5.2</version>
> -            <scope>test</scope>
> -        </dependency>
>         <!-- WebDriver -->
>         <dependency>
>             <groupId>org.seleniumhq.selenium</groupId>
>
> Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection3Test.java
> ===================================================================
> --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection3Test.java    2017-08-01 15:39:26 UTC (rev 14750)
> +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection3Test.java    2017-08-01 18:11:03 UTC (rev 14751)
> @@ -224,4 +224,26 @@
>                 .collect(Collectors.toList());
>         assertEquals(2, requests.size());
>     }
> +
> +    /**
> +     * Test case for Bug #1882.
> +     *
> +     * @throws Exception if the test fails
> +     */
> +    @Test
> +//    @NotYetImplemented
> +    public void queryString() throws Exception {
> +        final String response = "HTTP/1.1 302 Found\r\n"
> +                + "Content-Length: 0\r\n"
> +                + "\r\n";
> +
> +        primitiveWebServer_ = new PrimitiveWebServer(PORT, response);
> +        primitiveWebServer_.start();
> +
> +        final WebDriver driver = getWebDriver();
> +
> +        driver.get("http://localhost:" + PORT + "?para=%u65E5");
> +        assertTrue(primitiveWebServer_.getRequests().get(0),
> +                    primitiveWebServer_.getRequests().get(0).contains("para=%u65E5"));
> +    }
> }
>
> Deleted: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection4Test.java
> ===================================================================
> --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection4Test.java    2017-08-01 15:39:26 UTC (rev 14750)
> +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection4Test.java    2017-08-01 18:11:03 UTC (rev 14751)
> @@ -1,87 +0,0 @@
> -/*
> - * Copyright (c) 2002-2017 Gargoyle Software Inc.
> - *
> - * Licensed under the Apache License, Version 2.0 (the "License");
> - * you may not use this file except in compliance with the License.
> - * You may obtain a copy of the License at
> - * http://www.apache.org/licenses/LICENSE-2.0
> - *
> - * Unless required by applicable law or agreed to in writing, software
> - * distributed under the License is distributed on an "AS IS" BASIS,
> - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> - * See the License for the specific language governing permissions and
> - * limitations under the License.
> - */
> -package com.gargoylesoftware.htmlunit;
> -import java.io.File;
> -import java.io.IOException;
> -
> -import javax.servlet.ServletException;
> -import javax.servlet.http.HttpServlet;
> -import javax.servlet.http.HttpServletRequest;
> -import javax.servlet.http.HttpServletResponse;
> -
> -import org.apache.catalina.Context;
> -import org.apache.catalina.startup.Tomcat;
> -import org.junit.After;
> -import org.junit.Test;
> -import org.junit.runner.RunWith;
> -import org.openqa.selenium.WebDriver;
> -
> -import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented;
> -
> -/**
> - * Tests using the Tomcat.
> - *
> - * @author Ahmed Ashour
> - */
> -@RunWith(BrowserRunner.class)
> -public class HttpWebConnection4Test extends WebDriverTestCase {
> -
> -    private Tomcat tomcat_;
> -
> -    /**
> -     * Test case for Bug #1882.
> -     *
> -     * @throws Exception if the test fails
> -     */
> -    @Test
> -    @NotYetImplemented
> -    public void queryString() throws Exception {
> -        tomcat_ = new Tomcat();
> -
> -        tomcat_.setPort(PORT);
> -        tomcat_.setBaseDir("target/tomcat");
> -
> -        final Context context = tomcat_.addContext("", new File(".").getAbsolutePath());
> -        Tomcat.addServlet(context, "something", new HttpServlet() {
> -            @Override
> -            protected void service(final HttpServletRequest request, final HttpServletResponse response)
> -                    throws ServletException, IOException {
> -                String string = request.getQueryString();
> -                if (string == null) {
> -                    string = "";
> -                }
> -                response.getWriter().write(string);
> -            }
> -        });
> -        context.addServletMappingDecoded("/*", "something");
> -        tomcat_.start();
> -
> -        final WebDriver driver = getWebDriver();
> -
> -        driver.get("http://localhost:" + PORT + "?para=%u65E5");
> -        assertTrue(driver.getPageSource().contains("para=%u65E5"));
> -    }
> -
> -    /**
> -     * @throws Exception if an error occurs
> -     */
> -    @After
> -    public void stopServer() throws Exception {
> -        if (tomcat_ != null) {
> -            tomcat_.stop();
> -            tomcat_.destroy();
> -        }
> -    }
> -}
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> HtmlUnit-develop mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/htmlunit-develop


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop