Merged bug fix from Stable into Unstable

This commit is contained in:
Mark DePristo 2012-07-25 22:11:35 -04:00
commit 5e9e1101a3
4 changed files with 16 additions and 13 deletions

View File

@ -358,7 +358,7 @@ public class HierarchicalMicroScheduler extends MicroScheduler implements Hierar
if (error instanceof RuntimeException)
this.error = (RuntimeException)error;
else
this.error = new ReviewedStingException("An error occurred during the traversal.", error);
this.error = new ReviewedStingException("An error occurred during the traversal. Message=" + error.getMessage(), error);
}

View File

@ -169,7 +169,6 @@ public class WalkerTest extends BaseTest {
Class expectedException = null;
boolean includeImplicitArgs = true;
boolean includeShadowBCF = true;
boolean repairHeader = false;
// the default output path for the integration test
private File outputFileLocation = null;
@ -211,8 +210,6 @@ public class WalkerTest extends BaseTest {
String.format(" -et %s -K %s ", GATKRunReport.PhoneHomeOption.NO_ET, gatkKeyFile));
if ( includeShadowBCF && GENERATE_SHADOW_BCF )
args = args + " --generateShadowBCF ";
if ( repairHeader )
args = args + " --repairVCFHeader public/data/vcfHeaderForRepairs.vcf ";
}
return args;
@ -224,7 +221,6 @@ public class WalkerTest extends BaseTest {
* which will ultimately blow up...
*/
public void disableShadowBCF() { this.includeShadowBCF = false; }
public void repairHeaders() { this.repairHeader = true; }
public void setOutputFileLocation(File outputFileLocation) {
this.outputFileLocation = outputFileLocation;
}
@ -367,10 +363,16 @@ public class WalkerTest extends BaseTest {
// it's the type we expected
//System.out.println(String.format(" => %s PASSED", name));
} else {
if ( e.getCause() != null )
e.getCause().printStackTrace(System.out); // must print to stdout to see the message
Assert.fail(String.format("Test %s expected exception %s but instead got %s with error message %s",
name, expectedException, e.getClass(), e.getMessage()));
final String message = String.format("Test %s expected exception %s but instead got %s with error message %s",
name, expectedException, e.getClass(), e.getMessage());
if ( e.getCause() != null ) {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final PrintStream ps = new PrintStream(baos);
e.getCause().printStackTrace(ps);
BaseTest.log(message);
BaseTest.log(baos.toString());
}
Assert.fail(message);
}
} else {
// we didn't expect an exception but we got one :-(

View File

@ -90,7 +90,7 @@ public class EngineFeaturesIntegrationTest extends WalkerTest {
super(EngineErrorHandlingTestProvider.class);
this.expectedException = exceptedException;
this.multiThreaded = multiThreaded;
this.iterationsToTest = multiThreaded ? 10 : 1;
this.iterationsToTest = multiThreaded ? 50 : 1;
setName(String.format("Engine error handling: expected %s, is-multithreaded %b", exceptedException, multiThreaded));
}
}
@ -110,7 +110,7 @@ public class EngineFeaturesIntegrationTest extends WalkerTest {
// Loop over errors to throw, make sure they are the errors we get back from the engine, regardless of NT type
//
@Test(dataProvider = "EngineErrorHandlingTestProvider")
public void testEngineErrorHandlingTestProvider(EngineErrorHandlingTestProvider cfg) {
public void testEngineErrorHandlingTestProvider(final EngineErrorHandlingTestProvider cfg) {
for ( int i = 0; i < cfg.iterationsToTest; i++ ) {
final String root = "-T ErrorThrowing -R " + b37KGReference;
final String args = root + (cfg.multiThreaded ? " -nt 2" : "") + " -E " + cfg.expectedException.getSimpleName();

View File

@ -131,7 +131,7 @@ public class RMDTrackBuilderUnitTest extends BaseTest {
@Test
public void testGenerateIndexForUnindexedFile() {
File vcfFile = new File(validationDataLocation + "/ROD_validation/always_reindex.vcf");
File vcfFile = new File(privateTestDir + "always_reindex.vcf");
File vcfFileIndex = Tribble.indexFile(vcfFile);
// if we can't write to the directory, don't fault the tester, just pass
@ -141,7 +141,8 @@ public class RMDTrackBuilderUnitTest extends BaseTest {
}
// clean-up our test, and previous tests that may have written the file
vcfFileIndex.deleteOnExit();
if (vcfFileIndex.exists()) vcfFileIndex.delete();
if (vcfFileIndex.exists())
vcfFileIndex.delete();
try {
builder.loadIndex(vcfFile, new VCFCodec());