< prev index next >

test/hotspot/jtreg/runtime/logging/ModulesTest.java

Print this page
rev 59076 : [mq]: 8243945


  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  * @summary -Xlog:module should emit logging output
  27  * @library /test/lib
  28  * @modules java.base/jdk.internal.misc
  29  *          java.management
  30  * @run main ModulesTest
  31  */
  32 
  33 import jdk.test.lib.process.OutputAnalyzer;
  34 import jdk.test.lib.process.ProcessTools;
  35 
  36 public class ModulesTest {
  37     public static void main(String[] args) throws Exception {
  38         testModuleTrace("-Xlog:module=trace", "-version");
  39         testModuleLoad("-Xlog:module+load", "-version");
  40         testModuleUnload("-Xlog:module+unload", "-version");
  41 
  42         // same as -Xlog:module+load -Xlog:module+unload
  43         testModuleLoad("-verbose:module", "-version");
  44     }
  45 
  46     static void testModuleTrace(String... args) throws Exception {
  47         OutputAnalyzer output = run(args);
  48         output.shouldContain("define_javabase_module(): Definition of module:");
  49         output.shouldContain("define_javabase_module(): creation of package");
  50         output.shouldContain("define_module(): creation of module");




  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  * @summary -Xlog:module should emit logging output
  27  * @library /test/lib
  28  * @modules java.base/jdk.internal.misc
  29  *          java.management
  30  * @run driver ModulesTest
  31  */
  32 
  33 import jdk.test.lib.process.OutputAnalyzer;
  34 import jdk.test.lib.process.ProcessTools;
  35 
  36 public class ModulesTest {
  37     public static void main(String[] args) throws Exception {
  38         testModuleTrace("-Xlog:module=trace", "-version");
  39         testModuleLoad("-Xlog:module+load", "-version");
  40         testModuleUnload("-Xlog:module+unload", "-version");
  41 
  42         // same as -Xlog:module+load -Xlog:module+unload
  43         testModuleLoad("-verbose:module", "-version");
  44     }
  45 
  46     static void testModuleTrace(String... args) throws Exception {
  47         OutputAnalyzer output = run(args);
  48         output.shouldContain("define_javabase_module(): Definition of module:");
  49         output.shouldContain("define_javabase_module(): creation of package");
  50         output.shouldContain("define_module(): creation of module");


< prev index next >