|
| 1 | +/* |
| 2 | + * BioJava development code |
| 3 | + * |
| 4 | + * This code may be freely distributed and modified under the |
| 5 | + * terms of the GNU Lesser General Public Licence. This should |
| 6 | + * be distributed with the code. If you do not have a copy, |
| 7 | + * see: |
| 8 | + * |
| 9 | + * http://www.gnu.org/copyleft/lesser.html |
| 10 | + * |
| 11 | + * Copyright for this code is held jointly by the individual |
| 12 | + * authors. These should be listed in @author doc comments. |
| 13 | + * |
| 14 | + * For more information on the BioJava project and its aims, |
| 15 | + * or to join the biojava-l mailing list, visit the home page |
| 16 | + * at: |
| 17 | + * |
| 18 | + * http://www.biojava.org/ |
| 19 | + * |
| 20 | + */ |
| 21 | +package org.biojava.nbio.core.sequence.loader; |
| 22 | + |
| 23 | +import java.io.IOException; |
| 24 | +import org.biojava.nbio.core.sequence.ProteinSequence; |
| 25 | +import org.biojava.nbio.core.sequence.compound.AminoAcidCompound; |
| 26 | +import org.biojava.nbio.core.sequence.compound.AminoAcidCompoundSet; |
| 27 | +import org.junit.Test; |
| 28 | +import org.slf4j.Logger; |
| 29 | +import org.slf4j.LoggerFactory; |
| 30 | + |
| 31 | + |
| 32 | +/** |
| 33 | + * Testing example for issue #834 |
| 34 | + * |
| 35 | + * @author Jacek Grzebyta |
| 36 | + * @author Paolo Pavan |
| 37 | + * @see InfoTask |
| 38 | + */ |
| 39 | +public class SimpleGenbankProxySequenceReaderTest { |
| 40 | + |
| 41 | + |
| 42 | + private final static Logger logger = LoggerFactory.getLogger(SimpleGenbankProxySequenceReaderTest.class); |
| 43 | + |
| 44 | + @Test(expected = IOException.class) |
| 45 | + public void testWrongSequence() throws Exception { |
| 46 | + logger.info("test wrong sequence"); |
| 47 | + |
| 48 | + String wrongGi = "34567"; |
| 49 | + |
| 50 | + GenbankProxySequenceReader<AminoAcidCompound> genbankReader |
| 51 | + = new GenbankProxySequenceReader<AminoAcidCompound>(System.getProperty("java.io.tmpdir"), |
| 52 | + wrongGi, |
| 53 | + AminoAcidCompoundSet.getAminoAcidCompoundSet()); |
| 54 | + |
| 55 | + ProteinSequence seq = new ProteinSequence(genbankReader); |
| 56 | + } |
| 57 | +} |
0 commit comments