提交 ea92d3aa 编写于 作者: K kohsuke

Integrated a newer version of htmlunit that performs XHR calls at the correct timing.

This fixes the false positive test failure that I was struggling with since yesterday.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@28266 71c3de6d-444a-0410-be80-ed276b4c234a
上级 9adb62ae
......@@ -151,7 +151,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jvnet.hudson</groupId>
<artifactId>htmlunit</artifactId>
<version>2.6-hudson-1</version>
<version>2.6-hudson-2</version>
<exclusions>
<exclusion>
<!-- hides JDK DOM classes in Eclipse -->
......
......@@ -1154,11 +1154,10 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
// setJavaScriptEnabled(false);
setPageCreator(HudsonPageCreator.INSTANCE);
clients.add(new WeakReference<WebClient>(this));
// make ajax calls synchronous for predictable behaviors that simplify debugging
// make ajax calls run as post-action for predictable behaviors that simplify debugging
setAjaxController(new AjaxController() {
@Override
public boolean processSynchron(HtmlPage page, WebRequestSettings settings, boolean async) {
return true;
return false;
}
});
......
......@@ -13,25 +13,23 @@ import org.mozilla.javascript.tools.debugger.Dim;
* @author Kohsuke Kawaguchi
*/
public class AntTargetAnnotationTest extends HudsonTestCase {
public void testDummy() {}
public void test1() throws Exception {
FreeStyleProject p = createFreeStyleProject();
p.getBuildersList().add(new Ant("foo",null,null,null,null));
p.setScm(new SingleFileSCM("build.xml",getClass().getResource("simple-build.xml")));
FreeStyleBuild b = buildAndAssertSuccess(p);
// public void test1() throws Exception {
// FreeStyleProject p = createFreeStyleProject();
// p.getBuildersList().add(new Ant("foo",null,null,null,null));
// p.setScm(new SingleFileSCM("build.xml",getClass().getResource("simple-build.xml")));
// FreeStyleBuild b = buildAndAssertSuccess(p);
//
// AntTargetNote.ENABLED = true;
// try {
// HudsonTestCase.WebClient wc = createWebClient();
// wc.interactiveJavaScriptDebugger();
// HtmlPage c = wc.getPage(b, "console");
// System.out.println(c.asText());
//
// HtmlElement o = c.getElementById("console-outline");
// assertEquals(2,o.selectNodes("LI").size());
// } finally {
// AntTargetNote.ENABLED = false;
// }
// }
AntTargetNote.ENABLED = true;
try {
HudsonTestCase.WebClient wc = createWebClient();
wc.interactiveJavaScriptDebugger();
HtmlPage c = wc.getPage(b, "console");
System.out.println(c.asText());
HtmlElement o = c.getElementById("console-outline");
assertEquals(2,o.selectNodes(".//LI").size());
} finally {
AntTargetNote.ENABLED = false;
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册