< prev index next >

test/jdk/tools/launcher/modules/validate/ValidateModulesTest.java

Print this page
rev 51638 : [mq]: 8210112


   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  * @bug 8178380 8194937
  27  * @modules java.xml
  28  * @library src /lib/testlibrary
  29  * @build ValidateModulesTest hello/* JarUtils jdk.testlibrary.*
  30  * @run testng ValidateModulesTest
  31  * @summary Basic test for java --validate-modules
  32  */
  33 
  34 import java.io.File;
  35 import java.io.IOException;
  36 import java.nio.file.Files;
  37 import java.nio.file.Path;
  38 
  39 import jdk.testlibrary.ProcessTools;
  40 import jdk.testlibrary.OutputAnalyzer;
  41 
  42 import org.testng.annotations.Test;
  43 import static org.testng.Assert.*;
  44 
  45 @Test
  46 public class ValidateModulesTest {
  47 
  48     /**
  49      * Basic test --validate-modules when there are no errors.
  50      */
  51     public void testNoErrors() throws Exception {
  52         String modulePath = System.getProperty("test.module.path");
  53 
  54         test("--validate-modules");
  55 
  56         test("--validate-modules", "-version")
  57                 .shouldContain("Runtime Environment");
  58 
  59         test("--validate-modules", "--list-modules")
  60                 .shouldContain("java.base");




   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  * @bug 8178380 8194937
  27  * @modules java.xml
  28  * @library src /lib/testlibrary /test/lib
  29  * @build ValidateModulesTest hello/* JarUtils
  30  * @run testng ValidateModulesTest
  31  * @summary Basic test for java --validate-modules
  32  */
  33 
  34 import java.io.File;
  35 import java.io.IOException;
  36 import java.nio.file.Files;
  37 import java.nio.file.Path;
  38 
  39 import jdk.test.lib.process.ProcessTools;
  40 import jdk.test.lib.process.OutputAnalyzer;
  41 
  42 import org.testng.annotations.Test;
  43 import static org.testng.Assert.*;
  44 
  45 @Test
  46 public class ValidateModulesTest {
  47 
  48     /**
  49      * Basic test --validate-modules when there are no errors.
  50      */
  51     public void testNoErrors() throws Exception {
  52         String modulePath = System.getProperty("test.module.path");
  53 
  54         test("--validate-modules");
  55 
  56         test("--validate-modules", "-version")
  57                 .shouldContain("Runtime Environment");
  58 
  59         test("--validate-modules", "--list-modules")
  60                 .shouldContain("java.base");


< prev index next >