Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ tasks.withType(Test).configureEach { task ->

tasks.register('testWithDefaultReference', Test) {
description = "Run tests with a default reference File"
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
jvmArgs += '-Dsamjdk.reference_fasta=src/test/resources/htsjdk/samtools/cram/ce.fa'

useTestNG {
Expand All @@ -127,6 +129,8 @@ tasks.register('testWithDefaultReference', Test) {

tasks.register('testWithOptimisticVCF4_4', Test) {
description = "Run tests with optimistic VCF 4.4 reading"
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
jvmArgs += '-Dsamjdk.optimistic_vcf_4_4=true'

useTestNG {
Expand All @@ -151,6 +155,8 @@ test {

tasks.register('testFTP', Test) {
description = "Runs the tests that require connection to a remote ftp server"
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useTestNG {
includeGroups "ftp"
excludeGroups "slow", "broken"
Expand All @@ -159,6 +165,8 @@ tasks.register('testFTP', Test) {

tasks.register('testExternalApis', Test) {
description = "Run the SRA, ENA, and HTTP tests (tests that interact with external APIs)"
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
jvmArgs += '-Dsamjdk.sra_libraries_download=true'

useTestNG {
Expand Down
54 changes: 27 additions & 27 deletions src/test/java/htsjdk/samtools/SAMBinaryTagAndValueUnitTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ public class SAMBinaryTagAndValueUnitTest extends HtsjdkTest {
public Object[][] allowedTypes() {
return new Object[][] {
{new String("a string")},
{new Byte((byte) 7)},
{new Short((short) 8)},
{new Integer(0)},
{new Character('C')},
{new Float(0.1F)},
{Byte.valueOf((byte) 7)},
{Short.valueOf((short) 8)},
{Integer.valueOf(0)},
{Character.valueOf('C')},
{Float.valueOf(0.1F)},
// unsigned longs
{new Long(0)},
{new Long(BinaryCodec.MAX_UINT)},
{Long.valueOf(0)},
{Long.valueOf(BinaryCodec.MAX_UINT)},
// signed longs
{new Long(-1L)},
{new Long(Integer.MAX_VALUE)},
{new Long(Integer.MIN_VALUE)},
{Long.valueOf(-1L)},
{Long.valueOf(Integer.MAX_VALUE)},
{Long.valueOf(Integer.MIN_VALUE)},
// array values
{new byte[]{0, 1, 2}},
{new short[]{3, 4, 5}},
Expand All @@ -45,9 +45,9 @@ public void test_isAllowedConstructor(final Object value) {
@DataProvider(name="notAllowedAttributeTypes")
public Object[][] notAllowedTypes() {
return new Object[][] {
{new Long(BinaryCodec.MAX_UINT + 1L)},
{new Long(Integer.MIN_VALUE - 1L)},
{new Double(0.3F)},
{Long.valueOf(BinaryCodec.MAX_UINT + 1L)},
{Long.valueOf(Integer.MIN_VALUE - 1L)},
{Double.valueOf(0.3F)},
{new Object()},
{new Object[]{}},
{new Integer[]{}}
Expand Down Expand Up @@ -100,26 +100,26 @@ public Object[][] hashCopyEquals() {
{new SAMBinaryTagAndValue(tag, new String("a string")), new SAMBinaryTagAndValue(tag, new String("a string")), true, true},
{new SAMBinaryTagAndValue(tag, new String("a string")), new SAMBinaryTagAndValue(tag, new String("different string")), false, false},

{new SAMBinaryTagAndValue(tag, new Byte((byte) 0)), new SAMBinaryTagAndValue(tag, new Byte((byte) 0)), true, true},
{new SAMBinaryTagAndValue(tag, new Byte((byte) 0)), new SAMBinaryTagAndValue(tag, new Byte((byte) 1)), false, false},
{new SAMBinaryTagAndValue(tag, Byte.valueOf((byte) 0)), new SAMBinaryTagAndValue(tag, Byte.valueOf((byte) 0)), true, true},
{new SAMBinaryTagAndValue(tag, Byte.valueOf((byte) 0)), new SAMBinaryTagAndValue(tag, Byte.valueOf((byte) 1)), false, false},

{new SAMBinaryTagAndValue(tag, new Short((short) 0)), new SAMBinaryTagAndValue(tag, new Short((short) 0)), true, true},
{new SAMBinaryTagAndValue(tag, new Short((short) 0)), new SAMBinaryTagAndValue(tag, new Short((short) 1)), false, false},
{new SAMBinaryTagAndValue(tag, Short.valueOf((short) 0)), new SAMBinaryTagAndValue(tag, Short.valueOf((short) 0)), true, true},
{new SAMBinaryTagAndValue(tag, Short.valueOf((short) 0)), new SAMBinaryTagAndValue(tag, Short.valueOf((short) 1)), false, false},

{new SAMBinaryTagAndValue(tag, new Integer(0)), new SAMBinaryTagAndValue(tag, new Integer(0)), true, true},
{new SAMBinaryTagAndValue(tag, new Integer(0)), new SAMBinaryTagAndValue(tag, new Integer(0)), true, true},
{new SAMBinaryTagAndValue(tag, Integer.valueOf(0)), new SAMBinaryTagAndValue(tag, Integer.valueOf(0)), true, true},
{new SAMBinaryTagAndValue(tag, Integer.valueOf(0)), new SAMBinaryTagAndValue(tag, Integer.valueOf(0)), true, true},

{new SAMBinaryTagAndValue(tag, new Character('C')), new SAMBinaryTagAndValue(tag, new Character('C')), true, true},
{new SAMBinaryTagAndValue(tag, new Character('C')), new SAMBinaryTagAndValue(tag, new Character('D')), false, false},
{new SAMBinaryTagAndValue(tag, Character.valueOf('C')), new SAMBinaryTagAndValue(tag, Character.valueOf('C')), true, true},
{new SAMBinaryTagAndValue(tag, Character.valueOf('C')), new SAMBinaryTagAndValue(tag, Character.valueOf('D')), false, false},

{new SAMBinaryTagAndValue(tag,new Float(0.1F)), new SAMBinaryTagAndValue(tag, new Float(0.1F)), true, true},
{new SAMBinaryTagAndValue(tag, new Float(0.1F)), new SAMBinaryTagAndValue(tag, new Float(0.2F)), false, false},
{new SAMBinaryTagAndValue(tag,Float.valueOf(0.1F)), new SAMBinaryTagAndValue(tag, Float.valueOf(0.1F)), true, true},
{new SAMBinaryTagAndValue(tag, Float.valueOf(0.1F)), new SAMBinaryTagAndValue(tag, Float.valueOf(0.2F)), false, false},

{new SAMBinaryTagAndValue(tag,new Long(37L)), new SAMBinaryTagAndValue(tag, new Long(37L)), true, true},
{new SAMBinaryTagAndValue(tag, new Long(37L)), new SAMBinaryTagAndValue(tag, new Long(38L)), false, false},
{new SAMBinaryTagAndValue(tag,Long.valueOf(37L)), new SAMBinaryTagAndValue(tag, Long.valueOf(37L)), true, true},
{new SAMBinaryTagAndValue(tag, Long.valueOf(37L)), new SAMBinaryTagAndValue(tag, Long.valueOf(38L)), false, false},

{new SAMBinaryTagAndValue(tag,new Long(BinaryCodec.MAX_UINT)), new SAMBinaryTagAndValue(tag, new Long(BinaryCodec.MAX_UINT)), true, true},
{new SAMBinaryTagAndValue(tag, new Long(BinaryCodec.MAX_UINT)), new SAMBinaryTagAndValue(tag, new Long(BinaryCodec.MAX_UINT-1)), false, false},
{new SAMBinaryTagAndValue(tag,Long.valueOf(BinaryCodec.MAX_UINT)), new SAMBinaryTagAndValue(tag, Long.valueOf(BinaryCodec.MAX_UINT)), true, true},
{new SAMBinaryTagAndValue(tag, Long.valueOf(BinaryCodec.MAX_UINT)), new SAMBinaryTagAndValue(tag, Long.valueOf(BinaryCodec.MAX_UINT-1)), false, false},

// arrays

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/htsjdk/samtools/SAMTextWriterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private void doTest(final SAMRecordSetBuilder recordSetBuilder, final SamFlagFie
final File samFile = File.createTempFile("tmp.", ".sam");
samFile.deleteOnExit();
final Map<String, Object> tagMap = new HashMap<String, Object>();
tagMap.put("XC", new Character('q'));
tagMap.put("XC", 'q');
tagMap.put("XI", 12345);
tagMap.put("XF", 1.2345f);
tagMap.put("XS", "Hi,Mom!");
Expand Down
Loading