@Override public void write(Block block) { syncNeeded = true ; file.write(block) ; }
@Test public void fileaccess_02() { Block b = data(file, blkSize) ; file.write(b) ; }
@Test public void fileaccess_02() { Block b = data(file, blkSize) ; file.write(b) ; }
@Test(expected=FileException.class) public void fileaccess_05() { Block b1 = data(file, 10) ; Block b2 = data(file, 20) ; file.write(b1) ; // Should not work. b2 not written. Block b2a = file.read(b2.getId()) ; } }
@Test(expected=FileException.class) public void fileaccess_05() { Block b1 = data(file, 10) ; Block b2 = data(file, 20) ; file.write(b1) ; // Should not work. b2 not written. Block b2a = file.read(b2.getId()) ; } }
@Test public void fileaccess_50() { BlockAccess file = make() ; Block b1 = data(file, 10) ; Block b2 = data(file, 20) ; file.write(b1) ; file.write(b2) ; Block b1a = file.read(b1.getId()) ; Block b2a = file.read(b2.getId()) ; assertNotSame(b1a, b1) ; assertNotSame(b2a, b2) ; sameValue(b1, b1a) ; sameValue(b2, b2a) ; } }
@Test public void fileaccess_50() { BlockAccess file = make() ; Block b1 = data(file, 10) ; Block b2 = data(file, 20) ; file.write(b1) ; file.write(b2) ; Block b1a = file.read(b1.getId()) ; Block b2a = file.read(b2.getId()) ; assertNotSame(b1a, b1) ; assertNotSame(b2a, b2) ; sameValue(b1, b1a) ; sameValue(b2, b2a) ; } }
@Test public void fileaccess_03() { Block b1 = data(file, blkSize) ; file.write(b1) ; long x = b1.getId() ; Block b9 = file.read(x) ; assertNotSame(b1, b9) ; assertTrue(sameValue(b1, b9)) ; b9 = file.read(x) ; assertNotSame(b1, b9) ; assertTrue(sameValue(b1, b9)) ; }
@Test public void fileaccess_03() { Block b1 = data(file, blkSize) ; file.write(b1) ; long x = b1.getId() ; Block b9 = file.read(x) ; assertNotSame(b1, b9) ; assertTrue(sameValue(b1, b9)) ; b9 = file.read(x) ; assertNotSame(b1, b9) ; assertTrue(sameValue(b1, b9)) ; }