Skip to content

Commit 41e1d2b

Browse files
committed
refactoring unit test based on comments from @josemduarte
1 parent d431378 commit 41e1d2b

File tree

1 file changed

+6
-27
lines changed

1 file changed

+6
-27
lines changed

biojava-structure-gui/src/test/java/org/biojava/nbio/structure/gui/TestSimilarityCalc.java renamed to biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/align/TestSimilarityCalc.java

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
package org.biojava.nbio.structure.gui;
1+
package org.biojava.nbio.structure.test.align;
22

3-
import junit.framework.TestCase;
43
import org.biojava.nbio.structure.Atom;
54
import org.biojava.nbio.structure.Structure;
65
import org.biojava.nbio.structure.StructureTools;
@@ -13,10 +12,14 @@
1312
import org.biojava.nbio.structure.align.util.AtomCache;
1413
import org.junit.Test;
1514

15+
import static org.junit.Assert.assertTrue;
16+
import static org.junit.Assert.fail;
17+
18+
1619
/**
1720
* Created by andreas on 8/3/16.
1821
*/
19-
public class TestSimilarityCalc extends TestCase{
22+
public class TestSimilarityCalc {
2023

2124
@Test
2225
public void testSimilarityDisplay(){
@@ -48,22 +51,7 @@ public void testSimilarityDisplay(){
4851
afpChain.setName2(name2);
4952

5053

51-
52-
// get the scores
53-
int ca1Length = afpChain.getCa1Length();
54-
int ca2Length = afpChain.getCa2Length();
55-
56-
int blockNum = afpChain.getBlockNum();
57-
58-
int optLength = afpChain.getOptLength();
59-
double totalRmsdOpt = afpChain.getTotalRmsdOpt();
60-
61-
double alignScore = afpChain.getAlignScore();
62-
int alnLength = afpChain.getAlnLength();
63-
6454
assertTrue(afpChain.getAlnLength() == 71);
65-
int gapLen = afpChain.getGapLen();
66-
6755

6856
assertTrue(afpChain.getAlnLength() == 71);
6957
assertTrue(afpChain.getSimilarity() > .57);
@@ -75,20 +63,11 @@ public void testSimilarityDisplay(){
7563
assertTrue("wrong similarity score : " + afpChain.getSimilarity(), afpChain.getSimilarity() > .57);
7664
assertTrue("wrong similarity score : " + afpChain.getSimilarity(), afpChain.getSimilarity() <= .6);
7765

78-
79-
double similarity = afpChain.getSimilarity();
80-
double identity = afpChain.getIdentity();
81-
8266
assertTrue(afpChain.getSimilarity() > .58);
8367
assertTrue(afpChain.getSimilarity() < .59);
8468
assertTrue("similarity score is " + afpChain.getSimilarity() , afpChain.getSimilarity() > .46);
8569

8670

87-
88-
89-
90-
91-
9271
} catch (Exception e){
9372

9473
fail(e.getMessage());

0 commit comments

Comments
 (0)