< prev index next >

test/jdk/jigsaw/util/ServiceLoader/ServicesTest.java

Print this page




  23 
  24 import java.io.File;
  25 import java.lang.module.Configuration;
  26 import java.lang.module.ModuleFinder;
  27 import java.lang.reflect.Layer;
  28 import java.nio.file.Files;
  29 import java.nio.file.Path;
  30 import java.nio.file.Paths;
  31 import java.util.ServiceLoader;
  32 import javax.script.ScriptEngineFactory;
  33 
  34 import static jdk.testlibrary.ProcessTools.executeTestJava;
  35 
  36 import org.testng.annotations.BeforeTest;
  37 import org.testng.annotations.Test;
  38 import static org.testng.Assert.*;
  39 
  40 /**
  41  * @test
  42  * @library ../../lib /lib/testlibrary


  43  * @build ServicesTest CompilerUtils jdk.testlibrary.*
  44  * @run testng ServicesTest
  45  * @summary Tests ServiceLoader to locate service providers on the module path
  46  *          and class path. Also tests ServiceLoader with a custom Layer.
  47  */
  48 
  49 @Test
  50 public class ServicesTest {
  51 
  52     private static final String TEST_SRC = System.getProperty("test.src");
  53 
  54     private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
  55     private static final Path CLASSES_DIR = Paths.get("classes");
  56     private static final Path MODS_DIR = Paths.get("mods");
  57 
  58     // modules to compile to the module path
  59     private static final String MODULES[] = { "test", "bananascript" };
  60 
  61     // directories of classes to compile to the class path
  62     private static final String CLASSES[] = { "pearscript" };




  23 
  24 import java.io.File;
  25 import java.lang.module.Configuration;
  26 import java.lang.module.ModuleFinder;
  27 import java.lang.reflect.Layer;
  28 import java.nio.file.Files;
  29 import java.nio.file.Path;
  30 import java.nio.file.Paths;
  31 import java.util.ServiceLoader;
  32 import javax.script.ScriptEngineFactory;
  33 
  34 import static jdk.testlibrary.ProcessTools.executeTestJava;
  35 
  36 import org.testng.annotations.BeforeTest;
  37 import org.testng.annotations.Test;
  38 import static org.testng.Assert.*;
  39 
  40 /**
  41  * @test
  42  * @library ../../lib /lib/testlibrary
  43  * @modules java.scripting
  44             jdk.compiler
  45  * @build ServicesTest CompilerUtils jdk.testlibrary.*
  46  * @run testng ServicesTest
  47  * @summary Tests ServiceLoader to locate service providers on the module path
  48  *          and class path. Also tests ServiceLoader with a custom Layer.
  49  */
  50 
  51 @Test
  52 public class ServicesTest {
  53 
  54     private static final String TEST_SRC = System.getProperty("test.src");
  55 
  56     private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
  57     private static final Path CLASSES_DIR = Paths.get("classes");
  58     private static final Path MODS_DIR = Paths.get("mods");
  59 
  60     // modules to compile to the module path
  61     private static final String MODULES[] = { "test", "bananascript" };
  62 
  63     // directories of classes to compile to the class path
  64     private static final String CLASSES[] = { "pearscript" };


< prev index next >