提交 d8667f54 编写于 作者: K kohsuke

enabling back tests.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@21357 71c3de6d-444a-0410-be80-ed276b4c234a
上级 b44df39a
......@@ -41,18 +41,6 @@ THE SOFTWARE.
<build>
<plugins>
<!--
I haven't figured out how to run those tests from Maven
(the problem is that when I fork another process
I need to somehow compute the right classpath), so
excluded from Maven run for now.
-->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
......
......@@ -48,9 +48,9 @@ public class BinarySafeStreamTest extends TestCase {
o.close();
InputStream in = BinarySafeStream.wrap(new ByteArrayInputStream(buf.toByteArray()));
for (int i = 0; i < data.length; i++) {
for (byte b : data) {
int ch = in.read();
assertEquals(data[i], ch);
assertEquals(b, ch);
}
assertEquals(-1,in.read());
}
......@@ -152,7 +152,7 @@ public class BinarySafeStreamTest extends TestCase {
int ch = in.read();
if(dump)
System.out.println("read1("+ch+')');
assert ch>=0;
assertTrue(255>=ch && ch>=-1); // make sure the range is [-1,255]
if(ch==-1)
return;
out.write(ch);
......
......@@ -28,8 +28,11 @@ import junit.framework.Assert;
import java.io.IOException;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.io.File;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.net.URLClassLoader;
import java.net.URL;
/**
* Hides the logic of starting/stopping a channel for test.
......@@ -113,7 +116,9 @@ interface ChannelRunner {
public Channel start() throws Exception {
System.out.println("forking a new process");
// proc = Runtime.getRuntime().exec("java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000 hudson.remoting.Launcher");
proc = Runtime.getRuntime().exec("java hudson.remoting.Launcher");
proc = Runtime.getRuntime().exec("java -cp "+getClasspath()+" hudson.remoting.Launcher");
copier = new Copier("copier",proc.getErrorStream(),System.err);
copier.start();
......@@ -139,5 +144,16 @@ interface ChannelRunner {
public String getName() {
return "fork";
}
public String getClasspath() {
// this assumes we run in Maven
StringBuilder buf = new StringBuilder();
URLClassLoader ucl = (URLClassLoader)getClass().getClassLoader();
for (URL url : ucl.getURLs()) {
if (buf.length()>0) buf.append(File.pathSeparatorChar);
buf.append(url.getPath()); // assume all of them are file URLs
}
return buf.toString();
}
}
}
......@@ -5,6 +5,7 @@ package hudson.remoting;
*/
public class ChannelTest extends RmiTestBase {
public void testCapability() {
assertTrue(channel.remoteCapability.supportsMultiClassLoaderRPC());
// for now this is disabled
assertTrue(!channel.remoteCapability.supportsMultiClassLoaderRPC());
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册