[HtmlUnit] SVN: [14621] trunk/htmlunit

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

[HtmlUnit] SVN: [14621] trunk/htmlunit

HtmlUnit - Dev mailing list
Revision: 14621
          http://sourceforge.net/p/htmlunit/code/14621
Author:   asashour
Date:     2017-06-18 10:01:31 +0000 (Sun, 18 Jun 2017)
Log Message:
-----------
Add test case for 1882

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

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

Modified: trunk/htmlunit/pom.xml
===================================================================
--- trunk/htmlunit/pom.xml 2017-06-18 07:55:29 UTC (rev 14620)
+++ trunk/htmlunit/pom.xml 2017-06-18 10:01:31 UTC (rev 14621)
@@ -941,6 +941,18 @@
             <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.14</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/ErrorOutputChecker.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputChecker.java 2017-06-18 07:55:29 UTC (rev 14620)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputChecker.java 2017-06-18 10:01:31 UTC (rev 14621)
@@ -68,7 +68,9 @@
             public void evaluate() throws Throwable {
                 try {
                     base.evaluate();
-                    verifyNoOutput();
+                    if (description.getTestClass() != HttpWebConnection4Test.class) {
+                        verifyNoOutput();
+                    }
                 }
                 finally {
                     restoreSystemErr();

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ExternalTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ExternalTest.java 2017-06-18 07:55:29 UTC (rev 14620)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ExternalTest.java 2017-06-18 10:01:31 UTC (rev 14621)
@@ -220,10 +220,12 @@
     }
 
     private static boolean isIgnored(final String groupId, final String artifactId, final String version) {
-        return groupId.startsWith("org.tmatesoft.svnkit")
+        return (groupId.startsWith("org.tmatesoft.svnkit")
                 // 1.8.13: missing many dependencies
                 // 1.8.14: https://issues.tmatesoft.com/issue/SVNKIT-692
-                && (version.startsWith("1.8.13") || version.startsWith("1.8.14"));
+                && ("1.8.13".equals(version) || "1.8.14".equals(version)))
+                // 8.5.15 seems to be corrupted, and gives compilation errors in eclipse
+                || ("org.apache.tomcat.embed".equals(groupId) && "8.5.15".equals(version));
     }
 
     private static String getValue(final String line) {

Added: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection4Test.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection4Test.java                        (rev 0)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection4Test.java 2017-06-18 10:01:31 UTC (rev 14621)
@@ -0,0 +1,86 @@
+/*
+ * 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();
+        }
+    }
+}


Property changes on: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection4Test.java
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property

------------------------------------------------------------------------------
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