提交 92fbb8fa 编写于 作者: B Brian Atkinson

Fix CLRF

上级 c6198ee2
/*
* The MIT License
*
* Copyright (c) 2004-2009, CollabNet
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.util;
import net.sf.json.JSONArray;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.export.Flavor;
import javax.servlet.ServletException;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import static java.util.Arrays.asList;
/**
* Model object for dynamically filed combo box, which is really just {@code ArrayList<String>}
*
* @author Kohsuke Kawaguchi
*/
public class ComboBoxModel extends ArrayList<String> implements HttpResponse {
public ComboBoxModel(int initialCapacity) {
super(initialCapacity);
}
public ComboBoxModel() {
}
public ComboBoxModel(Collection<? extends String> c) {
super(c);
}
public ComboBoxModel(String... values) {
this(asList(values));
}
public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException {
rsp.setContentType(Flavor.JSON.contentType);
PrintWriter w = rsp.getWriter();
w.print('(');
JSONArray.fromObject(this).write(w);
w.print(')');
}
}
/*
* The MIT License
*
* Copyright (c) 2004-2009, CollabNet
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.util;
import net.sf.json.JSONArray;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.export.Flavor;
import javax.servlet.ServletException;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import static java.util.Arrays.asList;
/**
* Model object for dynamically filed combo box, which is really just {@code ArrayList<String>}
*
* @author Kohsuke Kawaguchi
*/
public class ComboBoxModel extends ArrayList<String> implements HttpResponse {
public ComboBoxModel(int initialCapacity) {
super(initialCapacity);
}
public ComboBoxModel() {
}
public ComboBoxModel(Collection<? extends String> c) {
super(c);
}
public ComboBoxModel(String... values) {
this(asList(values));
}
public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException {
rsp.setContentType(Flavor.JSON.contentType);
PrintWriter w = rsp.getWriter();
w.print('(');
JSONArray.fromObject(this).write(w);
w.print(')');
}
}
......@@ -20,13 +20,13 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
All\ Failed\ Tests=Alle fehlgeschlagenen Tests
Test\ Name=Testname
Duration=Dauer
Age=Alter
All\ Tests=Alle Tests
Fail=Fehlgeschlagen
Skip=Übersprungen
All\ Failed\ Tests=Alle fehlgeschlagenen Tests
Test\ Name=Testname
Duration=Dauer
Age=Alter
All\ Tests=Alle Tests
Fail=Fehlgeschlagen
Skip=Übersprungen
diff=Diff.
Total=Summe
Loading...=Lade Daten...
Loading...=Lade Daten...
......@@ -20,5 +20,5 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
Last\ Duration=\u4E0A\u6B21\u6301\u7EED\u65F6\u95F4
Last\ Duration=\u4E0A\u6B21\u6301\u7EED\u65F6\u95F4
/*
* The MIT License
*
* Copyright (c) 2004-2010, CollabNet.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package lib.form;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import hudson.util.FormValidation;
import net.sf.json.JSONObject;
import org.jvnet.hudson.test.HudsonTestCase;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.HttpResponses;
import org.kohsuke.stapler.StaplerRequest;
/**
* Tests the handling of @nameRef in the form tree.
*
* @author Kohsuke Kawaguchi
*/
public class NameRefTest extends HudsonTestCase {
public void test1() throws Exception {
hudson.setCrumbIssuer(null);
HtmlPage p = createWebClient().goTo("self/test1");
submit(p.getFormByName("config"));
}
public HttpResponse doSubmitTest1(StaplerRequest req) throws Exception {
JSONObject f = req.getSubmittedForm();
System.out.println(f);
assertEquals("{\"foo\":{\"bar\":{\"zot\":\"zot\"}}}",f.toString());
return HttpResponses.ok();
}
}
/*
* The MIT License
*
* Copyright (c) 2004-2010, CollabNet.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package lib.form;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import hudson.util.FormValidation;
import net.sf.json.JSONObject;
import org.jvnet.hudson.test.HudsonTestCase;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.HttpResponses;
import org.kohsuke.stapler.StaplerRequest;
/**
* Tests the handling of @nameRef in the form tree.
*
* @author Kohsuke Kawaguchi
*/
public class NameRefTest extends HudsonTestCase {
public void test1() throws Exception {
hudson.setCrumbIssuer(null);
HtmlPage p = createWebClient().goTo("self/test1");
submit(p.getFormByName("config"));
}
public HttpResponse doSubmitTest1(StaplerRequest req) throws Exception {
JSONObject f = req.getSubmittedForm();
System.out.println(f);
assertEquals("{\"foo\":{\"bar\":{\"zot\":\"zot\"}}}",f.toString());
return HttpResponses.ok();
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册