提交 70f52cb1 编写于 作者: K kohsuke

commenting out the test while I work on the Rhino/HtmlUnit problem

In HtmlUnit emulated script, XmlHttpRequest runs synchronously. So all the callbacks are fired during the send() call.
This changes the ordering of script execution --- for example, in the following script:

            var u = new Ajax.Updater(...,
                { onComplete: function() {
                    if (!u.success())   return; // we can't us onSuccess because that kicks in before onComplete
                    ...
                }});

when run inside HtmlUnit, the onComplete handler is invoked even before the "new Ajax.Updater" call finishes. Thus 'u' is undefined, which causes a failure.

(There's also a separate problem of why this exception is swallowed without being reported.)

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@28232 71c3de6d-444a-0410-be80-ed276b4c234a
上级 88b27b9e
......@@ -7,32 +7,29 @@ import hudson.model.FreeStyleProject;
import hudson.tasks.Ant;
import org.jvnet.hudson.test.HudsonTestCase;
import org.jvnet.hudson.test.SingleFileSCM;
import org.mozilla.javascript.tools.debugger.Dim;
/**
* @author Kohsuke Kawaguchi
*/
public class AntTargetAnnotationTest extends HudsonTestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
AntTargetNote.ENABLED = true;
}
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 {
HtmlPage c = createWebClient().getPage(b, "console");
System.out.println(c.asText());
HtmlElement o = c.getElementById("console-outline");
assertEquals(2,o.selectNodes("LI").size());
} finally {
AntTargetNote.ENABLED = false;
}
}
// 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;
// }
// }
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册