@Test public void testWriteProteinsToFile() throws Exception{ writer.write(PROTEIN_T3); writer.write(PROTEIN_T4); writer.write(PROTEIN_T6); replay(writer); proteinWriter.writeProtein(protein1); proteinWriter.writeProtein(protein2); proteinWriter.writeProtein(protein3); verify(writer); }
public void writeProtein(Gene protein) throws IOException { String id = protein.getId(); if (!writtenIds.contains(id)) { writtenIds.add(id); } String line = protein.getId() + "\tProtein " + protein.getBegin() + " " + protein.getEnd() + "\t" + documentText.substring(protein.getBegin(), protein.getEnd()) + "\n"; writer.write(line); }
ProteinWriter { public void writeProtein(Gene protein) throws IOException { String id = protein.getId(); if (!writtenIds.contains(id)) { writtenIds.add(id); } String line = protein.getId() + "\tProtein " + protein.getBegin() + " " + protein.getEnd() + "\t" + documentText.substring(protein.getBegin(), protein.getEnd()) + "\n"; writer.write(line); } }
ProteinWriter { public void writeProtein(Gene protein) throws IOException { String id = protein.getId(); if (!writtenIds.contains(id)) { writtenIds.add(id); } String line = protein.getId() + "\tProtein " + protein.getBegin() + " " + protein.getEnd() + "\t" + documentText.substring(protein.getBegin(), protein.getEnd()) + "\n"; writer.write(line); } ProteinWriter(Writer writer, String documentText); }
ProteinWriter { public void writeProtein(Gene protein) throws IOException { String id = protein.getId(); if (!writtenIds.contains(id)) { writtenIds.add(id); } String line = protein.getId() + "\tProtein " + protein.getBegin() + " " + protein.getEnd() + "\t" + documentText.substring(protein.getBegin(), protein.getEnd()) + "\n"; writer.write(line); } ProteinWriter(Writer writer, String documentText); Writer getFileWriter(); void setFileWriter(Writer writer); void writeProtein(Gene protein); void close(); boolean isWritten(Gene protein); }
ProteinWriter { public void writeProtein(Gene protein) throws IOException { String id = protein.getId(); if (!writtenIds.contains(id)) { writtenIds.add(id); } String line = protein.getId() + "\tProtein " + protein.getBegin() + " " + protein.getEnd() + "\t" + documentText.substring(protein.getBegin(), protein.getEnd()) + "\n"; writer.write(line); } ProteinWriter(Writer writer, String documentText); Writer getFileWriter(); void setFileWriter(Writer writer); void writeProtein(Gene protein); void close(); boolean isWritten(Gene protein);  }