Skip to content

Commit

Permalink
MochiKit 1.4.2 test suite added
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Oct 3, 2023
1 parent b0b24d6 commit 67846d3
Show file tree
Hide file tree
Showing 212 changed files with 18,706 additions and 30,965 deletions.
3 changes: 3 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
New method WebClient.reset() added, this is like close() but restarting the js engine
and open a new empty window afterwards.
</action>
<action type="add" dev="rbri">
MochiKit 1.4.2 test suite added.
</action>
<action type="update" dev="rbri">
Upgrade Apache commons-io to 2.14.0.
</action>
Expand Down
8 changes: 3 additions & 5 deletions src/site/xdoc/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,13 @@
The unit tests of some well-known JavaScript libraries are included in HtmlUnit's own unit tests; based on these unit
tests, the following libraries are known to work well with HtmlUnit:
<ul>
<li>htmx 1.6.1: Full support (see unit test <a href="https://github.com/HtmlUnit/htmlunit/blob/master/src/test/java/org/htmlunit/libraries/HtmxTest1x6x1.java">here</a>)</li>
<li>htmx 1.7.0: Full support (see unit test <a href="https://github.com/HtmlUnit/htmlunit/blob/master/src/test/java/org/htmlunit/libraries/HtmxTest1x7x0.java">here</a>)</li>
<li>htmx 1.8.4: Full support (see unit test <a href="https://github.com/HtmlUnit/htmlunit/blob/master/src/test/java/org/htmlunit/libraries/HtmxTest1x8x4.java">here</a>)</li>
<li>htmx 1.9.2: Full support (see unit test <a href="https://github.com/HtmlUnit/htmlunit/blob/master/src/test/java/org/htmlunit/libraries/HtmxTest1x9x2.java">here</a>)</li>
<li>htmx 1.9.3: Full support (see unit test <a href="https://github.com/HtmlUnit/htmlunit/blob/master/src/test/java/org/htmlunit/libraries/HtmxTest1x9x3.java">here</a>)</li>
<li>htmx 1.9.4: Full support (see unit test <a href="https://github.com/HtmlUnit/htmlunit/blob/master/src/test/java/org/htmlunit/libraries/HtmxTest1x9x4.java">here</a>)</li>
<li>htmx 1.9.x: Full support (see unit test <a href="https://github.com/HtmlUnit/htmlunit/blob/master/src/test/java/org/htmlunit/libraries/HtmxTest1x9x6.java">here</a>)</li>
<li>jQuery 1.11.3: Full support (see unit test <a href="https://github.com/HtmlUnit/htmlunit/blob/master/src/test/java/org/htmlunit/libraries/JQuery1x11x3Test.java">here</a>)</li>
<li>jQuery 1.8.2: Full support (see unit test <a href="https://github.com/HtmlUnit/htmlunit/blob/master/src/test/java/org/htmlunit/libraries/JQuery182Test.java">here</a>)</li>
<li>MochiKit 1.4.1: Full support (see unit tests <a href="https://github.com/HtmlUnit/htmlunit/blob/master/src/test/java/org/htmlunit/libraries/MochiKitTest.java">here</a>)</li>
<li>MochiKit 1.4.1: Full support (see unit tests <a href="https://github.com/HtmlUnit/htmlunit/blob/master/src/test/java/org/htmlunit/libraries/MochiKitTest1x4x1.java">here</a>)</li>
<li>MochiKit 1.4.2: Full support (see unit tests <a href="https://github.com/HtmlUnit/htmlunit/blob/master/src/test/java/org/htmlunit/libraries/MochiKitTest1x4x2.java">here</a>)</li>
<li>GWT 2.5.0: Full support (see unit test <a href="https://github.com/HtmlUnit/htmlunit/blob/master/src/test/java/org/htmlunit/libraries/GWT250Test.java">here</a>)</li>
<li>Sarissa 0.9.9.3: Full support (see unit test <a href="https://github.com/HtmlUnit/htmlunit/blob/master/src/test/java/org/htmlunit/libraries/Sarissa0993Test.java">here</a>)</li>
<li>MooTools 1.2.1: Full support (see unit test <a href="https://github.com/HtmlUnit/htmlunit/blob/master/src/test/java/org/htmlunit/libraries/MooTools121Test.java">here</a>)</li>
Expand Down
34 changes: 24 additions & 10 deletions src/test/java/org/htmlunit/libraries/MochiKitTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,15 @@

/**
* Tests for compatibility with <a href="http://mochikit.com">MochiKit</a>.
* <p>
* Note: the tests test_MochiKit-DOM-Safari.html, test_MochiKit-DragAndDrop.html and test_MochiKit-JSAN.html
* are not run as they don't even pass in a "real" Firefox 3.
* </p>
*
* @author Marc Guillemot
* @author Frank Danek
* @author Ronald Brill
* @author Ronald Brill#
*/
@RunWith(BrowserRunner.class)
public class MochiKitTest extends WebDriverTestCase {
public abstract class MochiKitTest extends WebDriverTestCase {

private static final String BASE_FILE_PATH = "libraries/MochiKit/1.4.1";
public abstract String srcFolder();

/**
* @throws Exception if the test fails
Expand Down Expand Up @@ -77,10 +74,27 @@ public void dateTime() throws Exception {
* @throws Exception if the test fails
*/
@Test
public void DOM() throws Exception {
public void dom() throws Exception {
doTest("DOM");
}

/**
* @throws Exception if the test fails
*/
@Test
public void domSafari() throws Exception {
doTest("DOM-Safari");
}

/**
* @throws Exception if the test fails
*/
// have to investigate why this fails in HtmlUnit
// @Test
public void dragAndDrop() throws Exception {
doTest("DragAndDrop");
}

/**
* @throws Exception if the test fails
*/
Expand Down Expand Up @@ -170,7 +184,7 @@ private void doTest(final String testName) throws Exception {
}

private String loadExpectation(final String testName) throws Exception {
final String resourcePrefix = "/" + BASE_FILE_PATH + "/test-" + testName;
final String resourcePrefix = "/libraries/MochiKit/" + srcFolder() + "/test-" + testName;
return loadExpectation(resourcePrefix, ".expected.txt");
}

Expand All @@ -180,6 +194,6 @@ private String loadExpectation(final String testName) throws Exception {
*/
@Before
public void setUp() throws Exception {
startWebServer("src/test/resources/libraries/MochiKit/1.4.1", null, null);
startWebServer("src/test/resources/libraries/MochiKit/" + srcFolder(), null, null);
}
}
35 changes: 35 additions & 0 deletions src/test/java/org/htmlunit/libraries/MochiKitTest1x4x1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2002-2023 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
* https://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 org.htmlunit.libraries;

import org.htmlunit.junit.BrowserRunner;
import org.junit.runner.RunWith;

/**
* Tests for compatibility with <a href="http://mochikit.com">MochiKit</a>.
*
* @author Marc Guillemot
* @author Frank Danek
* @author Ronald Brill
*/
@RunWith(BrowserRunner.class)
public class MochiKitTest1x4x1 extends MochiKitTest {

@Override
public String srcFolder() {
return "1.4.1";
}

}
32 changes: 32 additions & 0 deletions src/test/java/org/htmlunit/libraries/MochiKitTest1x4x2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2002-2023 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
* https://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 org.htmlunit.libraries;

import org.htmlunit.junit.BrowserRunner;
import org.junit.runner.RunWith;

/**
* Tests for compatibility with <a href="http://mochikit.com">MochiKit</a>.
* @author Ronald Brill
*/
@RunWith(BrowserRunner.class)
public class MochiKitTest1x4x2 extends MochiKitTest {

@Override
public String srcFolder() {
return "1.4.2";
}

}
Loading

0 comments on commit 67846d3

Please sign in to comment.