Fixed comparison of VCFHeader as the set.equals() isn't working as expected
This commit is contained in:
parent
b0ea14ef0f
commit
8fc1a26ac7
|
|
@ -67,6 +67,7 @@ public class WalkerTest extends BaseTest {
|
||||||
logger.warn("Checking shadow BCF output file " + bcfFile + " against VCF file " + resultFile);
|
logger.warn("Checking shadow BCF output file " + bcfFile + " against VCF file " + resultFile);
|
||||||
try {
|
try {
|
||||||
VariantContextTestProvider.assertVCFandBCFFilesAreTheSame(resultFile, bcfFile);
|
VariantContextTestProvider.assertVCFandBCFFilesAreTheSame(resultFile, bcfFile);
|
||||||
|
logger.warn(" Shadow BCF PASSED!");
|
||||||
} catch ( Exception e ) {
|
} catch ( Exception e ) {
|
||||||
Assert.fail("Exception received reading shadow BCFFile " + bcfFile + " for test " + name, e);
|
Assert.fail("Exception received reading shadow BCFFile " + bcfFile + " for test " + name, e);
|
||||||
}
|
}
|
||||||
|
|
@ -103,9 +104,9 @@ public class WalkerTest extends BaseTest {
|
||||||
|
|
||||||
for (int i = 0; i < resultFiles.size(); i++) {
|
for (int i = 0; i < resultFiles.size(); i++) {
|
||||||
MD5DB.MD5Match result = assertMatchingMD5(name, resultFiles.get(i), expectedMD5s.get(i));
|
MD5DB.MD5Match result = assertMatchingMD5(name, resultFiles.get(i), expectedMD5s.get(i));
|
||||||
|
validateOutputBCFIfPossible(name, resultFiles.get(i));
|
||||||
if ( ! result.failed ) {
|
if ( ! result.failed ) {
|
||||||
validateOutputIndex(name, resultFiles.get(i));
|
validateOutputIndex(name, resultFiles.get(i));
|
||||||
validateOutputBCFIfPossible(name, resultFiles.get(i));
|
|
||||||
md5s.add(result.expectedMD5);
|
md5s.add(result.expectedMD5);
|
||||||
} else {
|
} else {
|
||||||
fails.add(result);
|
fails.add(result);
|
||||||
|
|
@ -337,8 +338,9 @@ public class WalkerTest extends BaseTest {
|
||||||
boolean gotAnException = false;
|
boolean gotAnException = false;
|
||||||
try {
|
try {
|
||||||
final String now = new SimpleDateFormat("HH:mm:ss").format(new Date());
|
final String now = new SimpleDateFormat("HH:mm:ss").format(new Date());
|
||||||
System.out.println(String.format("[%s] Executing test %s with GATK arguments: %s",
|
final String cmdline = Utils.join(" ",command);
|
||||||
now, name, Utils.join(" ",command)));
|
System.out.println(String.format("[%s] Executing test %s with GATK arguments: %s", now, name, cmdline));
|
||||||
|
BaseTest.log(cmdline); // also write the command line to the HTML log for convenient follow-up
|
||||||
CommandLineExecutable.start(instance, command);
|
CommandLineExecutable.start(instance, command);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gotAnException = true;
|
gotAnException = true;
|
||||||
|
|
|
||||||
|
|
@ -534,6 +534,13 @@ public class VariantContextTestProvider {
|
||||||
|
|
||||||
public static void assertEquals(final VCFHeader actual, final VCFHeader expected) {
|
public static void assertEquals(final VCFHeader actual, final VCFHeader expected) {
|
||||||
Assert.assertEquals(actual.getMetaData().size(), expected.getMetaData().size());
|
Assert.assertEquals(actual.getMetaData().size(), expected.getMetaData().size());
|
||||||
Assert.assertEquals(actual.getMetaData(), expected.getMetaData());
|
|
||||||
|
// for some reason set.equals() is returning false but all paired elements are .equals(). Perhaps compare to is busted?
|
||||||
|
//Assert.assertEquals(actual.getMetaData(), expected.getMetaData());
|
||||||
|
final List<VCFHeaderLine> actualLines = new ArrayList<VCFHeaderLine>(actual.getMetaData());
|
||||||
|
final List<VCFHeaderLine> expectedLines = new ArrayList<VCFHeaderLine>(expected.getMetaData());
|
||||||
|
for ( int i = 0; i < actualLines.size(); i++ ) {
|
||||||
|
Assert.assertEquals(actualLines.get(i), expectedLines.get(i));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue