< prev index next >

test/jdk/java/lang/String/StringRepeat.java

Print this page

 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 This exercises String#repeat patterns and limits.
 27  * @run main/othervm StringRepeat
 28  */
 29 
 30 /*
 31  * @test
 32  * @summary This exercises String#repeat patterns with 16 * 1024 * 1024 repeats.
 33  * @requires os.maxMemory >= 2G
 34  * @requires !(os.family == "windows" & sun.arch.data.model == "32")
 35  * @run main/othervm -Xmx2g StringRepeat 16777216
 36  */
 37 
 38 import java.nio.CharBuffer;
 39 
 40 public class StringRepeat {
 41     public static void main(String... args) {
 42         if (args.length > 0) {
 43             REPEATS = new int[args.length];
 44             for (int i = 0; i < args.length; ++i) {
 45                 REPEATS[i] = Integer.parseInt(args[i]);
 46             }
 47         }
 48         test1();
 49         test2();
 50     }
 51 
 52     /*
 53      * Default varitions of repeat count.
 54      */

 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 This exercises String#repeat patterns and limits.
 27  * @run main/othervm StringRepeat
 28  */
 29 
 30 /*
 31  * @test
 32  * @summary This exercises String#repeat patterns with 16 * 1024 * 1024 repeats.
 33  * @requires os.maxMemory >= 2G
 34  * @requires vm.bits == "64"
 35  * @run main/othervm -Xmx2g StringRepeat 16777216
 36  */
 37 
 38 import java.nio.CharBuffer;
 39 
 40 public class StringRepeat {
 41     public static void main(String... args) {
 42         if (args.length > 0) {
 43             REPEATS = new int[args.length];
 44             for (int i = 0; i < args.length; ++i) {
 45                 REPEATS[i] = Integer.parseInt(args[i]);
 46             }
 47         }
 48         test1();
 49         test2();
 50     }
 51 
 52     /*
 53      * Default varitions of repeat count.
 54      */
< prev index next >