LogAlignmentTest.java revision 5551
606N/A * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved. 606N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1265N/A * This code is free software; you can redistribute it and/or modify it 606N/A * under the terms of the GNU General Public License version 2 only, as 606N/A * published by the Free Software Foundation. 919N/A * This code is distributed in the hope that it will be useful, but WITHOUT 919N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 919N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 919N/A * version 2 for more details (a copy is included in the LICENSE file that 919N/A * accompanied this code). 919N/A * You should have received a copy of the GNU General Public License version 919N/A * 2 along with this work; if not, write to the Free Software Foundation, 919N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 919N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 919N/A * or visit www.oracle.com if you need additional information or have any 606N/A * @summary rmid can have a corrupted log 606N/A * @run main LogAlignmentTest 970N/A/* Fault: ReliableLog used RandomAccessFile.skipBytes() to seek past the end 970N/A * of a file. Unfortunately, skipBytes() doesn't do that, so the file was 970N/A * Reproduced by writing an odd number of bytes into an update, and then 947N/A//import javasoft.sqe.harness.Status; 947N/A//import javasoft.sqe.harness.Test; 606N/A //Status status = test.run (argv, System.err, System.out); 606N/A //public Status run (String argv[], PrintStream log, PrintStream out) (
"Exception in regression test for bugid 4094889"));
//return (Status.passed ("OKAY")); // Write a preamble update // Generate the requested size update (single chars) up[i] = (
char)(
65 + (i %
26));
// Write it again, so we can misalign // Read it back using a new context. lg.
println (
"Matched OK. Test element passed.");
// Trash the log directory, so a new snap will be taken in the next test // implements LogHandler.applyUpdate() // basicUpdate appends the string // an "update" is a short string to append to this.contents (must ignore state)