提交 b37f6f14 编写于 作者: K kohsuke

[FIXED HUDSON-2095] Skip the test if java.net cannot be reached.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@10878 71c3de6d-444a-0410-be80-ed276b4c234a
上级 03603560
......@@ -14,6 +14,14 @@ import java.net.URL;
*/
public class UpdateCenterTest extends TestCase {
public void testData() throws IOException {
// check if we have the internet connectivity. See HUDSON-2095
try {
new URL("https://hudson.dev.java.net/").openStream();
} catch (IOException e) {
System.out.println("Skipping this test. No internet connectivity");
return;
}
URL url = new URL("https://hudson.dev.java.net/update-center.json?version=build");
String jsonp = IOUtils.toString(url.openStream());
String json = jsonp.substring(jsonp.indexOf('(')+1,jsonp.lastIndexOf(')'));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册