提交 9e223613 编写于 作者: K kohsuke

Merged revisions 29309-29311,29421,29449,29451,29459 via svnmerge from

https://svn.dev.java.net/svn/hudson/branches/rc

........
  r29309 | kohsuke | 2010-03-26 14:44:45 -0700 (Fri, 26 Mar 2010) | 1 line
  
  Work around for http://n4.nabble.com/hudson-logging-LogRecorderManagerTest-failing-tp1589811p1589811.html
........
  r29310 | kohsuke | 2010-03-26 14:45:29 -0700 (Fri, 26 Mar 2010) | 1 line
  
  unnecessary boxing
........
  r29311 | kohsuke | 2010-03-26 16:00:41 -0700 (Fri, 26 Mar 2010) | 1 line
  
  fixed a stability in the test.
........
  r29421 | kohsuke | 2010-03-29 11:40:37 -0700 (Mon, 29 Mar 2010) | 1 line
  
  improving the test stability
........
  r29449 | kohsuke | 2010-03-29 18:08:26 -0700 (Mon, 29 Mar 2010) | 1 line
  
  [maven-release-plugin] prepare release hudson-1_353
........
  r29451 | kohsuke | 2010-03-29 18:08:46 -0700 (Mon, 29 Mar 2010) | 1 line
  
  [maven-release-plugin] prepare for next development iteration
........
  r29459 | kohsuke | 2010-03-29 19:20:42 -0700 (Mon, 29 Mar 2010) | 1 line
  
  updated changelog as a part of the release
........


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@29490 71c3de6d-444a-0410-be80-ed276b4c234a
上级 cc4c17b9
......@@ -4,7 +4,7 @@
<parent>
<artifactId>pom</artifactId>
<groupId>org.jvnet.hudson.main</groupId>
<version>1.353-SNAPSHOT</version>
<version>1.354-SNAPSHOT</version>
</parent>
<artifactId>cli</artifactId>
<name>Hudson CLI</name>
......
......@@ -28,7 +28,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.353-SNAPSHOT</version>
<version>1.354-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -104,12 +104,15 @@ import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.ConcurrentModificationException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.Date;
import java.util.logging.LogManager;
import java.util.logging.LogRecord;
import java.util.logging.SimpleFormatter;
import java.util.regex.Pattern;
......@@ -1213,6 +1216,23 @@ public class Functions {
}
return buf.toString();
}
/**
* Work around for bug 6935026.
*/
public List<String> getLoggerNames() {
while (true) {
try {
List<String> r = new ArrayList<String>();
Enumeration<String> e = LogManager.getLogManager().getLoggerNames();
while (e.hasMoreElements())
r.add(e.nextElement());
return r;
} catch (ConcurrentModificationException e) {
// retry
}
}
}
private static final Pattern SCHEME = Pattern.compile("[a-z]+://.+");
......
......@@ -39,7 +39,7 @@ THE SOFTWARE.
<th>${%Level}</th>
</tr>
<j:invokeStatic var="lm" className="java.util.logging.LogManager" method="getLogManager"/>
<j:forEach var="name" items="${lm.loggerNames}">
<j:forEach var="name" items="${h.loggerNames}">
<j:set var="logger" value="${lm.getLogger(name)}"/>
<j:if test="${logger.level != null}">
<tr>
......
hudson (1.353) unstable; urgency=low
* See http://hudson.dev.java.net/changelog.html for more details.
-- Kohsuke Kawaguchi <kk@kohsuke.org> Mon, 29 Mar 2010 19:16:50 -0700
hudson (1.353) unstable; urgency=low
* See http://hudson.dev.java.net/changelog.html for more details.
-- Kohsuke Kawaguchi <kk@kohsuke.org> Mon, 29 Mar 2010 19:15:53 -0700
hudson (1.352) unstable; urgency=low
* See http://hudson.dev.java.net/changelog.html for more details.
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.353-SNAPSHOT</version>
<version>1.354-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.353-SNAPSHOT</version>
<version>1.354-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.353-SNAPSHOT</version>
<version>1.354-SNAPSHOT</version>
</parent>
<artifactId>maven-plugin</artifactId>
......
......@@ -33,7 +33,7 @@ THE SOFTWARE.
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.353-SNAPSHOT</version>
<version>1.354-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Hudson main module</name>
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.353-SNAPSHOT</version>
<version>1.354-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<artifactId>pom</artifactId>
<groupId>org.jvnet.hudson.main</groupId>
<version>1.353-SNAPSHOT</version>
<version>1.354-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jvnet.hudson.main</groupId>
......
......@@ -1413,9 +1413,6 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
* by tweaking {@link Dim.StackFrame#onLineChange(Context, int)}.
*/
public Dim interactiveJavaScriptDebugger() {
// this can be too late, depending on when this method is invoked.
Functions.DEBUG_YUI = true;
Global global = new Global();
HtmlUnitContextFactory cf = getJavaScriptEngine().getContextFactory();
global.init(cf);
......@@ -1479,5 +1476,6 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
public static final MimeTypes MIME_TYPES = new MimeTypes();
static {
MIME_TYPES.addMimeMapping("js","application/javascript");
Functions.DEBUG_YUI = true;
}
}
......@@ -24,10 +24,16 @@
package lib.form;
import com.gargoylesoftware.htmlunit.ElementNotFoundException;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJob;
import com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJobManagerImpl;
import net.sf.json.JSONObject;
import org.jvnet.hudson.test.HudsonTestCase;
import org.kohsuke.stapler.DataBoundConstructor;
......@@ -92,7 +98,7 @@ public class RepeatableTest extends HudsonTestCase {
}
public void testMinimum() throws Exception {
minimum = new Integer(3);
minimum = 3;
HtmlPage p = createWebClient().goTo("self/testSimple");
HtmlForm f = p.getFormByName("config");
f.getInputByValue("").setValueAttribute("value one");
......@@ -108,7 +114,7 @@ public class RepeatableTest extends HudsonTestCase {
public void testMinimum_ExistingData() throws Exception {
addData();
minimum = new Integer(3);
minimum = 3;
HtmlPage p = createWebClient().goTo("self/testSimple");
HtmlForm f = p.getFormByName("config");
f.getInputByValue("").setValueAttribute("new one");
......@@ -200,15 +206,14 @@ public class RepeatableTest extends HudsonTestCase {
HtmlPage p = createWebClient().goTo("self/testNested");
HtmlForm f = p.getFormByName("config");
try {
f.getButtonByCaption("Add").click();
clickButton(p, f, "Add");
f.getInputByValue("").setValueAttribute("title one");
Thread.sleep(1000); // Saw intermittent failures w/o this
f.getButtonByCaption("Add Foo").click();
clickButton(p,f,"Add Foo");
f.getInputByValue("").setValueAttribute("txt one");
f.getButtonByCaption("Add Foo").click();
clickButton(p,f,"Add Foo");
f.getInputByValue("").setValueAttribute("txt two");
f.getInputsByName("bool").get(1).click();
f.getButtonByCaption("Add").click();
clickButton(p, f, "Add");
f.getInputByValue("").setValueAttribute("title two");
f.getElementsByTagName("button").get(1).click(); // 2nd "Add Foo" button
f.getInputByValue("").setValueAttribute("txt 2.1");
......@@ -222,22 +227,29 @@ public class RepeatableTest extends HudsonTestCase {
+ "FooList:title two:[foo:txt 2.1:false]]", bindResult.toString());
}
private void clickButton(HtmlPage p, HtmlForm f, String caption) throws IOException {
f.getButtonByCaption(caption).click();
waitForJavaScript(p);
}
public void testNestedRadio() throws Exception {
HtmlPage p = createWebClient().goTo("self/testNestedRadio");
HtmlForm f = p.getFormByName("config");
try {
f.getButtonByCaption("Add").click();
clickButton(p, f, "Add");
f.getElementsByAttribute("input", "type", "radio").get(1).click(); // outer=two
Thread.sleep(500); // Saw intermittent failures w/o this
f.getButtonByCaption("Add Moo").click();
waitForJavaScript(p);
f.getElementsByAttribute("input", "type", "radio").get(2).click(); // inner=inone
f.getButtonByCaption("Add").click();
waitForJavaScript(p);
f.getElementsByAttribute("input", "type", "radio").get(4).click(); // outer=one
Thread.sleep(500);
f.getElementsByTagName("button").get(1).click(); // 2nd "Add Moo" button
waitForJavaScript(p);
f.getElementsByAttribute("input", "type", "radio").get(7).click(); // inner=intwo
Thread.sleep(500);
f.getElementsByTagName("button").get(1).click();
waitForJavaScript(p);
f.getElementsByAttribute("input", "type", "radio").get(8).click(); // inner=inone
} catch (Exception e) {
System.err.println("HTML at time of failure:\n" + p.getBody().asXml());
......@@ -248,4 +260,17 @@ public class RepeatableTest extends HudsonTestCase {
+ "{\"moo\":[{\"inner\":\"intwo\"},{\"inner\":\"inone\"}],\"outer\":\"one\"}]",
formData.get("items").toString());
}
/**
* YUI internally partially relies on setTimeout/setInterval when we add a new chunk of HTML
* to the page. So wait for the completion of it.
*
* <p>
* To see where such asynchronous activity is happening, set a breakpoint to
* {@link JavaScriptJobManagerImpl#addJob(JavaScriptJob, Page)} and look at the call stack.
* Also see {@link #jsDebugger} at that time to see the JavaScript callstack.
*/
private void waitForJavaScript(HtmlPage p) {
p.getEnclosingWindow().getJobManager().waitForJobsStartingBefore(50);
}
}
\ No newline at end of file
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.353-SNAPSHOT</version>
<version>1.354-SNAPSHOT</version>
</parent>
<artifactId>ui-samples-plugin</artifactId>
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.353-SNAPSHOT</version>
<version>1.354-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册