Skip to content

Commit 4c6c348

Browse files
committed
addressing requested changes re. throwing exceptions.
1 parent aae364b commit 4c6c348

File tree

1 file changed

+13
-22
lines changed

1 file changed

+13
-22
lines changed

biojava-modfinder/src/test/java/org/biojava/nbio/protmod/phosphosite/TestAcetylation.java

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
import static org.junit.Assert.assertTrue;
1515
import static org.junit.Assert.fail;
1616

17-
/** Makes sure there is a local installation of the Acetyaltion site file from Phosphosite and
17+
18+
/** Makes sure there is a local installation of the Acetylation site file from Phosphosite and
1819
* tests if it can get parsed by the parser.
1920
*
2021
* Created by andreas on 11/29/16.
@@ -27,21 +28,18 @@ public class TestAcetylation {
2728
*
2829
*/
2930
@Before
30-
public void setUp(){
31+
public void setUp() throws IOException{
3132

3233
Dataset ds = new Dataset();
3334

3435
String f = Dataset.ACETYLATION;
3536

3637
File localFile = getLocalFileName(f);
3738

38-
try {
39-
if (!localFile.exists()) {
40-
ds.downloadFile(new URL(f), localFile);
41-
}
42-
} catch (IOException e) {
43-
e.printStackTrace();
39+
if (!localFile.exists()) {
40+
ds.downloadFile(new URL(f), localFile);
4441
}
42+
4543
}
4644

4745
/** returns the local file name where the Acetylation file will get cached locally.
@@ -70,26 +68,19 @@ private File getLocalFileName(String phosphoSiteFileLocation){
7068
*
7169
*/
7270
@Test
73-
public void testAcetylation() {
74-
75-
try {
71+
public void testAcetylation() throws IOException {
7672

77-
File localFile = getLocalFileName(Dataset.ACETYLATION);
73+
File localFile = getLocalFileName(Dataset.ACETYLATION);
7874

79-
List<Site> sites = Site.parseSites(localFile);
75+
List<Site> sites = Site.parseSites(localFile);
8076

81-
assertTrue(sites.size() > 0);
77+
assertTrue(sites.size() > 0);
8278

83-
for (Site s : sites) {
79+
for (Site s : sites) {
8480

85-
assertTrue(s.getResidue() != null);
81+
assertTrue(s.getResidue() != null);
8682

87-
}
88-
89-
90-
} catch (Exception e) {
91-
e.printStackTrace();
92-
fail(e.getMessage());
9383
}
84+
9485
}
9586
}

0 commit comments

Comments
 (0)