Package java.io

Examples of java.io.RandomAccessFile.writeLong()


     * @tests java.io.RandomAccessFile#readLong()
     */
    public void test_readLong() throws IOException {
        // Test for method long java.io.RandomAccessFile.readLong()
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeLong(Long.MAX_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Long.MAX_VALUE, raf
                .readLong());
        raf.close();
    }
View Full Code Here


     * @tests java.io.RandomAccessFile#writeLong(long)
     */
    public void test_writeLongJ() throws IOException {
        // Test for method void java.io.RandomAccessFile.writeLong(long)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeLong(Long.MAX_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Long.MAX_VALUE, raf
                .readLong());
        raf.close();
    }
View Full Code Here

     * @tests java.io.RandomAccessFile#readLong()
     */
    public void test_readLong() throws IOException {
        // Test for method long java.io.RandomAccessFile.readLong()
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeLong(Long.MAX_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Long.MAX_VALUE, raf
                .readLong());
        raf.close();
    }
View Full Code Here

     * @tests java.io.RandomAccessFile#writeLong(long)
     */
    public void test_writeLongJ() throws IOException {
        // Test for method void java.io.RandomAccessFile.writeLong(long)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeLong(Long.MAX_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Long.MAX_VALUE, raf
                .readLong());
        raf.close();
    }
View Full Code Here

                break;
            case LoadCorrupt:
                // loadable but invalid metadata
                // location of order index low priority index for first destination...
                raf.seek(8*1024 + 57);
                raf.writeLong(Integer.MAX_VALUE-10);
                break;
            case LoadOrderIndex0:
                // loadable but invalid metadata
                // location of order index default priority index size
                // so looks like there are no ids in the order index
View Full Code Here

                // so looks like there are no ids in the order index
                // picked up by setCheckForCorruptJournalFiles
                raf.seek(12*1024 + 21);
                raf.writeShort(0);
                raf.writeChar(0);
                raf.writeLong(-1);
                break;
            default:
        }
        raf.close();

View Full Code Here

     * @tests java.io.RandomAccessFile#writeLong(long)
     */
    public void test_writeLongJ() throws IOException {
        // Test for method void java.io.RandomAccessFile.writeLong(long)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeLong(Long.MAX_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Long.MAX_VALUE, raf
                .readLong());
        raf.close();
    }
View Full Code Here

     * @tests java.io.RandomAccessFile#readLong()
     */
    public void test_readLong() throws IOException {
        // Test for method long java.io.RandomAccessFile.readLong()
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeLong(Long.MAX_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Long.MAX_VALUE, raf
                .readLong());
        raf.close();
    }
View Full Code Here

                break;
            case LoadCorrupt:
                // loadable but invalid metadata
                // location of order index low priority index for first destination...
                raf.seek(8*1024 + 57);
                raf.writeLong(Integer.MAX_VALUE-10);
                break;
            default:
        }
        raf.close();

View Full Code Here

    SortedMap<Long, Long> offsetToTxId = Maps.newTreeMap();
    File logFile = prepareUnfinalizedTestEditLog(testDir, 2, offsetToTxId);
    RandomAccessFile rwf = new RandomAccessFile(logFile, "rw");
    try {
      rwf.seek(0);
      rwf.writeLong(42); // corrupt header
    } finally {
      rwf.close();
    }
    EditLogValidation validation = EditLogFileInputStream.validateEditLog(logFile);
    assertTrue(validation.hasCorruptHeader());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.