equal
deleted
inserted
replaced
22 */ |
22 */ |
23 |
23 |
24 /* @test |
24 /* @test |
25 * @bug 4429043 8002180 |
25 * @bug 4429043 8002180 |
26 * @summary Test file mapping with FileChannel |
26 * @summary Test file mapping with FileChannel |
27 * @run main/othervm MapTest |
27 * @run main/othervm/timeout=240 MapTest |
28 * @key randomness |
28 * @key randomness |
29 */ |
29 */ |
30 |
30 |
31 import java.io.*; |
31 import java.io.*; |
32 import java.nio.MappedByteBuffer; |
32 import java.nio.MappedByteBuffer; |
193 /** |
193 /** |
194 * Maps blah file, writes some data and forcing writeback of |
194 * Maps blah file, writes some data and forcing writeback of |
195 * the data exercising various valid and invalid writeback ranges. |
195 * the data exercising various valid and invalid writeback ranges. |
196 */ |
196 */ |
197 private static void testForce() throws Exception { |
197 private static void testForce() throws Exception { |
198 for (int x=0; x<100; x++) { |
198 for (int x=0; x<50; x++) { |
199 try (RandomAccessFile raf = new RandomAccessFile(blah, "rw")) { |
199 try (RandomAccessFile raf = new RandomAccessFile(blah, "rw")) { |
200 FileChannel fc = raf.getChannel(); |
200 FileChannel fc = raf.getChannel(); |
201 final int BLOCK_SIZE = 64; |
201 final int BLOCK_SIZE = 64; |
202 final int BLOCK_COUNT = (4096 * 2)/ BLOCK_SIZE; |
202 final int BLOCK_COUNT = (4096 * 2)/ BLOCK_SIZE; |
203 int offset = 0; |
203 int offset = 0; |