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 /* @test
25 * @bug 4517279
26 * @summary Stochastic test of thread-local coder caches
27 */
28
29 import java.nio.*;
30 import java.nio.charset.*;
31 import java.util.*;
32
33
34 public class BashCache {
35
36 private static final int THREADS = 10;
37 private static final int TRIALS = 1000;
38
39 private static final Charset[] charsets
40 = new Charset[] {
41 Charset.forName("US-ASCII"),
42 Charset.forName("UTF-8"),
43 Charset.forName("CP1252"),
44 Charset.forName("UTF-16BE") };
45
46 private static volatile boolean failed = false;
|
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 /* @test
25 * @bug 4517279
26 * @summary Stochastic test of thread-local coder caches
27 * @key randomness
28 */
29
30 import java.nio.*;
31 import java.nio.charset.*;
32 import java.util.*;
33
34
35 public class BashCache {
36
37 private static final int THREADS = 10;
38 private static final int TRIALS = 1000;
39
40 private static final Charset[] charsets
41 = new Charset[] {
42 Charset.forName("US-ASCII"),
43 Charset.forName("UTF-8"),
44 Charset.forName("CP1252"),
45 Charset.forName("UTF-16BE") };
46
47 private static volatile boolean failed = false;
|