private void runTests(String aStr, String bStr, int signum) throws Exception { ImmutableBytesWritable a = new ImmutableBytesWritable( Bytes.toBytes(aStr)); ImmutableBytesWritable b = new ImmutableBytesWritable( Bytes.toBytes(bStr)); doComparisonsOnObjects(a, b, signum); doComparisonsOnRaw(a, b, signum); // Tests for when the offset is non-zero a = new ImmutableBytesWritable(Bytes.toBytes("xxx" + aStr), 3, aStr.length()); b = new ImmutableBytesWritable(Bytes.toBytes("yy" + bStr), 2, bStr.length()); doComparisonsOnObjects(a, b, signum); doComparisonsOnRaw(a, b, signum); // Tests for when offset is nonzero and length doesn't extend to end a = new ImmutableBytesWritable(Bytes.toBytes("xxx" + aStr + "zzz"), 3, aStr.length()); b = new ImmutableBytesWritable(Bytes.toBytes("yy" + bStr + "aaa"), 2, bStr.length()); doComparisonsOnObjects(a, b, signum); doComparisonsOnRaw(a, b, signum); }
private void runTests(String aStr, String bStr, int signum) throws Exception { ImmutableBytesWritable a = new ImmutableBytesWritable( Bytes.toBytes(aStr)); ImmutableBytesWritable b = new ImmutableBytesWritable( Bytes.toBytes(bStr)); doComparisonsOnObjects(a, b, signum); doComparisonsOnRaw(a, b, signum); // Tests for when the offset is non-zero a = new ImmutableBytesWritable(Bytes.toBytes("xxx" + aStr), 3, aStr.length()); b = new ImmutableBytesWritable(Bytes.toBytes("yy" + bStr), 2, bStr.length()); doComparisonsOnObjects(a, b, signum); doComparisonsOnRaw(a, b, signum); // Tests for when offset is nonzero and length doesn't extend to end a = new ImmutableBytesWritable(Bytes.toBytes("xxx" + aStr + "zzz"), 3, aStr.length()); b = new ImmutableBytesWritable(Bytes.toBytes("yy" + bStr + "aaa"), 2, bStr.length()); doComparisonsOnObjects(a, b, signum); doComparisonsOnRaw(a, b, signum); }