use loopback (IDEA-57106)

This commit is contained in:
anna
2010-08-27 20:19:49 +04:00
parent 653e4a57b2
commit 307fe87d03
4 changed files with 5 additions and 4 deletions
@@ -108,7 +108,7 @@ public class TestPackage extends TestObject {
}
try {
final ServerSocket serverSocket = new ServerSocket(0);
final ServerSocket serverSocket = new ServerSocket(0, 0, InetAddress.getByName(null));
myJavaParameters.getProgramParametersList().add("-socket" + serverSocket.getLocalPort());
findTestsWithProgress(new FindCallback() {
public void found(@NotNull final Collection<PsiClass> classes, final boolean isJunit4) {
@@ -19,6 +19,7 @@ import com.intellij.junit3.JUnit3IdeaTestRunner;
import com.intellij.rt.execution.junit.segments.SegmentedOutputStream;
import junit.textui.TestRunner;
import javax.swing.*;
import java.io.*;
import java.net.InetAddress;
import java.net.Socket;
@@ -97,7 +98,7 @@ public class JUnitStarter {
} else if (arg.startsWith(SOCKET)) {
final int port = Integer.parseInt(arg.substring(SOCKET.length()));
try {
final Socket socket = new Socket(InetAddress.getLocalHost(), port); //start collecting tests
final Socket socket = new Socket(InetAddress.getByName(null), port); //start collecting tests
final DataInputStream os = new DataInputStream(socket.getInputStream());
try {
os.readBoolean();//wait for ready flag
@@ -329,7 +329,7 @@ public class TestNGRunnableState extends JavaCommandLineState {
javaParameters.getProgramParametersList().add(TestNGCommandLineArgs.SRC_COMMAND_OPT, sb.toString());
}
try {
final ServerSocket serverSocket = new ServerSocket(0);
final ServerSocket serverSocket = new ServerSocket(0, 0, InetAddress.getByName(null));
javaParameters.getProgramParametersList().add("-socket" + serverSocket.getLocalPort());
myTempFile = File.createTempFile("idea_testng", ".tmp");
myTempFile.deleteOnExit();
@@ -38,7 +38,7 @@ public class RemoteTestNGStarter {
if (arg.startsWith(SOCKET)) {
final int port = Integer.parseInt(arg.substring(SOCKET.length()));
try {
final Socket socket = new Socket(InetAddress.getLocalHost(), port); //start collecting tests
final Socket socket = new Socket(InetAddress.getByName(null), port); //start collecting tests
final DataInputStream os = new DataInputStream(socket.getInputStream());
try {
os.readBoolean();//wait for ready flag