changeset 13833:dbb0fd7f2a2b

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 1c7bad079890
children 81cf21b33839
files test/sample/TEST.properties test/sample/chatserver/ChatTest.java 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/test/sample/TEST.properties	Tue Mar 08 09:33:31 2016 +0800
@@ -0,0 +1,1 @@
+external.lib.roots = ../../
--- a/test/sample/chatserver/ChatTest.java	Mon Mar 07 12:10:55 2016 -0800
+++ b/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/test/sample/mergesort/MergeSortTest.java	Mon Mar 07 12:10:55 2016 -0800
+++ b/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();
     }