8151352: jdk/test/sample fails with "effective library path is outside the test suite"

Reviewed-by: darcy
This commit is contained in:
Felix Yang 2016-03-08 09:33:31 +08:00 committed by Amy Lu
parent 7f3c7fe56b
commit 8041d8453e
3 changed files with 13 additions and 6 deletions

View File

@ -0,0 +1 @@
external.lib.roots = ../../

View File

@ -25,9 +25,9 @@
/* @test
* @summary Test chat server chatserver test
*
* @library ../../../src/sample/share/nio/chatserver
* @library /src/sample/share/nio/chatserver
* @build ChatTest ChatServer Client ClientReader DataReader MessageReader NameReader
* @run main ChatTest
* @run testng ChatTest
*/
import java.io.*;
@ -38,10 +38,13 @@ import java.util.Collections;
import java.util.List;
import java.util.concurrent.CyclicBarrier;
import org.testng.annotations.Test;
public class ChatTest {
public static int listeningPort = 0;
public static void main(String[] args) throws Throwable {
@Test
public static void doTest() throws Throwable {
testStartStop();
testPortOpen();
testAsksForName();

View File

@ -25,14 +25,16 @@
/* @test
* @summary Test MergeSort
*
* @library ../../../src/sample/share/forkjoin/mergesort
* @library /src/sample/share/forkjoin/mergesort
* @build MergeSortTest MergeDemo MergeSort
* @run main MergeSortTest
* @run testng MergeSortTest
*/
import java.util.Arrays;
import java.util.Random;
import org.testng.annotations.Test;
public class MergeSortTest {
private Random random;
private MergeSort target;
@ -42,7 +44,8 @@ public class MergeSortTest {
this.target = target;
}
public static void main(String[] args) {
@Test
public static void doTest() {
MergeSortTest test = new MergeSortTest(new Random(), new MergeSort(Runtime.getRuntime().availableProcessors() * 4));
test.run();
}