langtools/test/jdk/jshell/SimpleRegressionTest.java
changeset 41158 957f4fa38bd6
parent 40516 9e0e107c39dd
child 42971 22c8c025a651
equal deleted inserted replaced
41157:b235a429089a 41158:957f4fa38bd6
     1 /*
     1 /*
     2  * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    20  * or visit www.oracle.com if you need additional information or have any
    20  * or visit www.oracle.com if you need additional information or have any
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test 8130450 8158906 8154374
    25  * @test 8130450 8158906 8154374 8166400
    26  * @summary simple regression test
    26  * @summary simple regression test
    27  * @build KullaTesting TestingInputStream
    27  * @build KullaTesting TestingInputStream
    28  * @run testng SimpleRegressionTest
    28  * @run testng SimpleRegressionTest
    29  */
    29  */
    30 
    30 
   147 
   147 
   148     public void testContextClassLoader() {
   148     public void testContextClassLoader() {
   149         assertEval("class C {}");
   149         assertEval("class C {}");
   150         assertEval("C.class.getClassLoader() == Thread.currentThread().getContextClassLoader()", "true");
   150         assertEval("C.class.getClassLoader() == Thread.currentThread().getContextClassLoader()", "true");
   151     }
   151     }
       
   152 
       
   153     public void testArayRepresentation() {
       
   154         assertEval("new int[4]", "int[4] { 0, 0, 0, 0 }");
       
   155         assertEval("new int[0]", "int[0] {  }");
       
   156         assertEval("new byte[2]", "byte[2] { 0, 0 }");
       
   157         assertEval("new short[] { 1234, 4321 }", "short[2] { 1234, 4321 }");
       
   158         assertEval("new long[] { 123456789 }", "long[1] { 123456789 }");
       
   159         assertEval("new float[] { -23.5645f, 1.0101f }", "float[2] { -23.5645, 1.0101 }");
       
   160         assertEval("new double[] { 1/8, Math.PI }", "double[2] { 0.0, 3.141592653589793 }");
       
   161         assertEval("new String[] { \"hi\", \"low\", null }", "String[3] { \"hi\", \"low\", null }");
       
   162         assertEval("new char[] { 'a', 34, 77 }", "char[3] { 'a', '\"', 'M' }");
       
   163         assertEval("new boolean[] { false, true }", "boolean[2] { false, true }");
       
   164         assertEval("new int[][] { new int[] {44, 55}, new int[] {88,99}}",
       
   165                 "int[][2] { int[2] { 44, 55 }, int[2] { 88, 99 } }");
       
   166         assertEval("new Object[] { \"howdy\", new int[] { 33, 44, 55 }, new String[] { \"up\", \"down\" }}",
       
   167                 "Object[3] { \"howdy\", int[3] { 33, 44, 55 }, String[2] { \"up\", \"down\" } }");
       
   168     }
   152 }
   169 }