< prev index next >

test/jdk/java/lang/module/AutomaticModulesTest.java

Print this page
rev 51881 : [mq]: 8211171
rev 51882 : [mq]: 8211171-1


   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @library /lib/testlibrary
  27  * @build AutomaticModulesTest ModuleUtils JarUtils

  28  * @run testng AutomaticModulesTest
  29  * @summary Basic tests for automatic modules
  30  */
  31 
  32 import java.io.IOException;
  33 import java.lang.module.Configuration;
  34 import java.lang.module.FindException;
  35 import java.lang.module.ModuleDescriptor;
  36 import java.lang.module.ModuleDescriptor.Requires.Modifier;
  37 import java.lang.module.ModuleFinder;
  38 import java.lang.module.ModuleReference;
  39 import java.lang.module.ResolutionException;
  40 import java.lang.module.ResolvedModule;
  41 import java.nio.file.Files;
  42 import java.nio.file.Path;
  43 import java.nio.file.Paths;
  44 import java.util.Optional;
  45 import java.util.Set;
  46 import java.util.jar.Attributes;
  47 import java.util.jar.Manifest;
  48 import java.util.stream.Collectors;
  49 import java.util.stream.Stream;
  50 


  51 import org.testng.annotations.DataProvider;
  52 import org.testng.annotations.Test;
  53 import static org.testng.Assert.*;
  54 
  55 @Test
  56 public class AutomaticModulesTest {
  57 
  58     private static final Path USER_DIR
  59          = Paths.get(System.getProperty("user.dir"));
  60 
  61     @DataProvider(name = "jarnames")
  62     public Object[][] createJarNames() {
  63         return new Object[][] {
  64 
  65             // JAR file name                module-name[/version]
  66 
  67             { "foo.jar",                    "foo" },
  68             { "foo4j.jar",                  "foo4j", },
  69 
  70             { "foo1.jar",                   "foo1" },




   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @library /lib/testlibrary /test/lib
  27  * @build AutomaticModulesTest ModuleUtils
  28  *        jdk.test.lib.util.JarUtils
  29  * @run testng AutomaticModulesTest
  30  * @summary Basic tests for automatic modules
  31  */
  32 
  33 import java.io.IOException;
  34 import java.lang.module.Configuration;
  35 import java.lang.module.FindException;
  36 import java.lang.module.ModuleDescriptor;
  37 import java.lang.module.ModuleDescriptor.Requires.Modifier;
  38 import java.lang.module.ModuleFinder;
  39 import java.lang.module.ModuleReference;
  40 import java.lang.module.ResolutionException;
  41 import java.lang.module.ResolvedModule;
  42 import java.nio.file.Files;
  43 import java.nio.file.Path;
  44 import java.nio.file.Paths;
  45 import java.util.Optional;
  46 import java.util.Set;
  47 import java.util.jar.Attributes;
  48 import java.util.jar.Manifest;
  49 import java.util.stream.Collectors;
  50 import java.util.stream.Stream;
  51 
  52 import jdk.test.lib.util.JarUtils;
  53 
  54 import org.testng.annotations.DataProvider;
  55 import org.testng.annotations.Test;
  56 import static org.testng.Assert.*;
  57 
  58 @Test
  59 public class AutomaticModulesTest {
  60 
  61     private static final Path USER_DIR
  62          = Paths.get(System.getProperty("user.dir"));
  63 
  64     @DataProvider(name = "jarnames")
  65     public Object[][] createJarNames() {
  66         return new Object[][] {
  67 
  68             // JAR file name                module-name[/version]
  69 
  70             { "foo.jar",                    "foo" },
  71             { "foo4j.jar",                  "foo4j", },
  72 
  73             { "foo1.jar",                   "foo1" },


< prev index next >