From 9d3c3fa243e96fc817b6224971d3151c4eaaf8c7 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 30 Sep 2021 10:30:21 +0100 Subject: [PATCH] =?utf8?q?JAL-2909=20fix=20up=20tests=20and=20ensure=20we=20?= =?utf8?q?don=E2=80=99t=20test=20bam=20as=20a=20writable=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/jalview/io/FileFormat.java | 3 ++- test/jalview/io/FileFormatsTest.java | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/jalview/io/FileFormat.java b/src/jalview/io/FileFormat.java index 389925e..e65c516 100644 --- a/src/jalview/io/FileFormat.java +++ b/src/jalview/io/FileFormat.java @@ -379,7 +379,7 @@ public enum FileFormat implements FileFormatI return true; } }, - Bam("bam", "bam", true, true) + Bam("bam", "bam", true, false) { @Override public AlignmentFileReaderI getReader(FileParse source) @@ -391,6 +391,7 @@ public enum FileFormat implements FileFormatI @Override public AlignmentFileWriterI getWriter(AlignmentI al) { + // not yet writable return new BamFile(); } diff --git a/test/jalview/io/FileFormatsTest.java b/test/jalview/io/FileFormatsTest.java index 3d25bf1..b1c80a1 100644 --- a/test/jalview/io/FileFormatsTest.java +++ b/test/jalview/io/FileFormatsTest.java @@ -58,7 +58,7 @@ public class FileFormatsTest @Test(groups = "Functional") public void testGetReadableFormats() { - String expected = "[Fasta, PFAM, Stockholm, PIR, BLC, AMSA, HTML, RNAML, JSON, PileUp, MSF, Clustal, PHYLIP, GenBank Flatfile, ENA Flatfile, GFF or Jalview features, PDB, mmCIF, Jalview]"; + String expected = "[Fasta, PFAM, Stockholm, PIR, BLC, AMSA, HTML, RNAML, JSON, PileUp, MSF, Clustal, PHYLIP, GenBank Flatfile, ENA Flatfile, GFF or Jalview features, PDB, mmCIF, bam, Jalview]"; FileFormats formats = FileFormats.getInstance(); assertEquals(formats.getReadableFormats().toString(), expected); } @@ -77,14 +77,14 @@ public class FileFormatsTest public void testDeregisterFileFormat() { String writable = "[Fasta, PFAM, Stockholm, PIR, BLC, AMSA, JSON, PileUp, MSF, Clustal, PHYLIP]"; - String readable = "[Fasta, PFAM, Stockholm, PIR, BLC, AMSA, HTML, RNAML, JSON, PileUp, MSF, Clustal, PHYLIP, GenBank Flatfile, ENA Flatfile, GFF or Jalview features, PDB, mmCIF, Jalview]"; + String readable = "[Fasta, PFAM, Stockholm, PIR, BLC, AMSA, HTML, RNAML, JSON, PileUp, MSF, Clustal, PHYLIP, GenBank Flatfile, ENA Flatfile, GFF or Jalview features, PDB, mmCIF, bam, Jalview]"; FileFormats formats = FileFormats.getInstance(); assertEquals(formats.getWritableFormats(true).toString(), writable); assertEquals(formats.getReadableFormats().toString(), readable); formats.deregisterFileFormat(FileFormat.Fasta.getName()); writable = "[PFAM, Stockholm, PIR, BLC, AMSA, JSON, PileUp, MSF, Clustal, PHYLIP]"; - readable = "[PFAM, Stockholm, PIR, BLC, AMSA, HTML, RNAML, JSON, PileUp, MSF, Clustal, PHYLIP, GenBank Flatfile, ENA Flatfile, GFF or Jalview features, PDB, mmCIF, Jalview]"; + readable = "[PFAM, Stockholm, PIR, BLC, AMSA, HTML, RNAML, JSON, PileUp, MSF, Clustal, PHYLIP, GenBank Flatfile, ENA Flatfile, GFF or Jalview features, PDB, mmCIF, bam, Jalview]"; assertEquals(formats.getWritableFormats(true).toString(), writable); assertEquals(formats.getReadableFormats().toString(), readable); @@ -93,7 +93,7 @@ public class FileFormatsTest */ formats.registerFileFormat(FileFormat.Fasta); writable = "[PFAM, Stockholm, PIR, BLC, AMSA, JSON, PileUp, MSF, Clustal, PHYLIP, Fasta]"; - readable = "[PFAM, Stockholm, PIR, BLC, AMSA, HTML, RNAML, JSON, PileUp, MSF, Clustal, PHYLIP, GenBank Flatfile, ENA Flatfile, GFF or Jalview features, PDB, mmCIF, Jalview, Fasta]"; + readable = "[PFAM, Stockholm, PIR, BLC, AMSA, HTML, RNAML, JSON, PileUp, MSF, Clustal, PHYLIP, GenBank Flatfile, ENA Flatfile, GFF or Jalview features, PDB, mmCIF, bam, Jalview, Fasta]"; assertEquals(formats.getWritableFormats(true).toString(), writable); assertEquals(formats.getReadableFormats().toString(), readable); } -- 1.7.10.2