Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pom.xml2
-rw-r--r--src/test/java/hudson/UDPBroadcastThreadTest.java89
2 files changed, 2 insertions, 89 deletions
diff --git a/pom.xml b/pom.xml
index 74386ad..d454385 100644
--- a/pom.xml
+++ b/pom.xml
@@ -219,11 +219,13 @@
<type>jar</type>
</dependency>
+ <!--
<dependency>
<groupId>org.hudsonci.plugins</groupId>
<artifactId>rest-plugin</artifactId>
<version>${rest.plugin.version}</version>
</dependency>
+ -->
<dependency>
<groupId>org.hudsonci.plugins</groupId>
diff --git a/src/test/java/hudson/UDPBroadcastThreadTest.java b/src/test/java/hudson/UDPBroadcastThreadTest.java
deleted file mode 100644
index 3109d01..0000000
--- a/src/test/java/hudson/UDPBroadcastThreadTest.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- *
- * Copyright (c) 2004-2010 Oracle Corporation.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- *
- *******************************************************************************/
-
-package hudson;
-
-import org.jvnet.hudson.test.HudsonTestCase;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import java.net.DatagramSocket;
-import java.net.DatagramPacket;
-import java.net.InetAddress;
-import java.io.StringReader;
-import java.io.IOException;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-public class UDPBroadcastThreadTest extends HudsonTestCase {
- /* Disable this failing test - multicast no longer enabled by default
- /**
- * Old unicast based clients should still be able to receive some reply,
- * as we haven't changed the port.
- * /
- public void testLegacy() throws Exception {
- DatagramSocket s = new DatagramSocket();
- sendQueryTo(s, InetAddress.getLocalHost());
- s.setSoTimeout(5000); // to prevent test hang
- receiveAndVerify(s);
- }
-
- /**
- * Multicast based clients should be able to receive multiple replies.
- * /
- public void testMulticast() throws Exception {
- UDPBroadcastThread second = new UDPBroadcastThread(hudson);
- second.start();
- second.ready.block();
-
- try {
- DatagramSocket s = new DatagramSocket();
- sendQueryTo(s, UDPBroadcastThread.MULTICAST);
- s.setSoTimeout(5000); // to prevent test hang
-
- // we should at least get two replies since we run two broadcasts
- receiveAndVerify(s);
- receiveAndVerify(s);
- } finally {
- second.interrupt();
- }
- }
-
- private void sendQueryTo(DatagramSocket s, InetAddress dest) throws IOException {
- DatagramPacket p = new DatagramPacket(new byte[1024],1024);
- p.setAddress(dest);
- p.setPort(UDPBroadcastThread.PORT);
- s.send(p);
- }
-
- /**
- * Reads a reply from the socket and makes sure its shape is in order.
- * /
- private void receiveAndVerify(DatagramSocket s) throws IOException, SAXException, ParserConfigurationException {
- DatagramPacket p = new DatagramPacket(new byte[1024],1024);
- s.receive(p);
- String xml = new String(p.getData(), 0, p.getLength(), "UTF-8");
- System.out.println(xml);
-
- // make sure at least this XML parses
- SAXParserFactory spf = SAXParserFactory.newInstance();
- spf.setNamespaceAware(true);
- spf.newSAXParser().parse(new InputSource(new StringReader(xml)),new DefaultHandler());
- }
- */
-}

Back to the top