changeset 36409:9e5dc071e2d2

8151352: jdk/test/sample fails with "effective library path is outside the test suite" Reviewed-by: darcy Contributed-by: Felix Yang <felix.yang@oracle.com>
author amlu
date Tue, 08 Mar 2016 09:33:31 +0800
parents c870cb782aca
children c2ef247d0b6f
files jdk/test/sample/TEST.properties jdk/test/sample/chatserver/ChatTest.java jdk/test/sample/mergesort/MergeSortTest.java
diffstat 3 files changed, 13 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sample/TEST.properties	Tue Mar 08 09:33:31 2016 +0800
@@ -0,0 +1,1 @@
+external.lib.roots = ../../
--- a/jdk/test/sample/chatserver/ChatTest.java	Wed Jul 05 21:25:35 2017 +0200
+++ b/jdk/test/sample/chatserver/ChatTest.java	Tue Mar 08 09:33:31 2016 +0800
@@ -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.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();
--- a/jdk/test/sample/mergesort/MergeSortTest.java	Wed Jul 05 21:25:35 2017 +0200
+++ b/jdk/test/sample/mergesort/MergeSortTest.java	Tue Mar 08 09:33:31 2016 +0800
@@ -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 @@
         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();
     }