Changeset 1649 for branches/autoquest-core-tasktrees-alignment-test
- Timestamp:
- 08/03/14 22:53:27 (10 years ago)
- Location:
- branches/autoquest-core-tasktrees-alignment-test/src/test/java/de/ugoe/cs/autoquest/tasktrees
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/autoquest-core-tasktrees-alignment-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/NumberSequenceTest.java
r1648 r1649 21 21 22 22 int[] pat5 = new int[]{-1,-1,-1}; 23 23 24 int[] pat6 = new int[]{10,11,12}; 25 26 int[] pat7 = new int[]{8,9,10}; 27 int[] pat8 = new int[]{7,6,5}; 28 29 int[] pat9 = new int[]{0}; 30 int[] pat10 = new int[]{1}; 24 31 25 32 … … 34 41 Match pattern = new Match(); 35 42 pattern.setFirstSequence(firstpattern); 36 pattern.setSecondSequence(secondpattern); 37 43 pattern.setSecondSequence(secondpattern); 38 44 assertEquals(Integer.valueOf(2),ns.containsPattern(pattern).get(0)); 45 assertEquals(1,ns.containsPattern(pattern).size()); 39 46 40 47 firstpattern.setSequence(pat3); … … 43 50 assertEquals(Integer.valueOf(1),ns.containsPattern(pattern).get(0)); 44 51 assertEquals(Integer.valueOf(5),ns.containsPattern(pattern).get(1)); 52 assertEquals(2,ns.containsPattern(pattern).size()); 45 53 46 54 firstpattern.setSequence(pat5); 47 55 secondpattern.setSequence(pat5); 48 49 56 assertEquals(0,ns.containsPattern(pattern).size()); 50 57 51 58 firstpattern.setSequence(pat6); 52 59 secondpattern.setSequence(pat6); 60 assertEquals(0,ns.containsPattern(pattern).size()); 53 61 62 firstpattern.setSequence(pat7); 63 secondpattern.setSequence(pat8); 54 64 assertEquals(0,ns.containsPattern(pattern).size()); 65 66 firstpattern.setSequence(pat9); 67 secondpattern.setSequence(pat10); 68 assertEquals(Integer.valueOf(0),ns.containsPattern(pattern).get(0)); 69 assertEquals(Integer.valueOf(1),ns.containsPattern(pattern).get(1)); 70 assertEquals(2,ns.containsPattern(pattern).size()); 71 55 72 } 56 73 -
branches/autoquest-core-tasktrees-alignment-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/SmithWatermanRepeatedTest.java
r1648 r1649 5 5 import org.junit.Test; 6 6 7 import de.ugoe.cs.autoquest.tasktrees.alignment.matrix.DummySubstitutionMatrix; 8 7 9 public class SmithWatermanRepeatedTest { 8 10 9 11 @Test 10 12 public void testGetMaxScore() { 11 fail("Not yet implemented"); 13 int[] seq1 = new int[]{0,1,2,3,4,5,6,7,8,9}; 14 int[] seq2 = new int[]{0,1,2,3,4,5,6,7,8,9}; 15 16 NumberSequence ns1 = new NumberSequence(10); 17 NumberSequence ns2 = new NumberSequence(10); 18 19 ns1.setSequence(seq1); 20 ns2.setSequence(seq2); 21 22 DummySubstitutionMatrix submat = new DummySubstitutionMatrix(); 23 24 AlignmentAlgorithm testalignment1 = AlignmentAlgorithmFactory 25 .create(); 26 testalignment1.align(ns1, ns2,submat,5); 27 28 assertTrue(testalignment1.getMaxScore()==10); 12 29 } 13 30 14 31 @Test 15 32 public void testGetAlignmentScore() { 16 fail("Not yet implemented"); 33 int[] seq1 = new int[]{0,1,2,3,4,5,6,7,8,9}; 34 int[] seq2 = new int[]{0,1,2,3,4,5,6,7,8,9}; 35 36 NumberSequence ns1 = new NumberSequence(10); 37 NumberSequence ns2 = new NumberSequence(10); 38 39 ns1.setSequence(seq1); 40 ns2.setSequence(seq2); 41 42 DummySubstitutionMatrix submat = new DummySubstitutionMatrix(); 43 44 AlignmentAlgorithm testalignment1 = AlignmentAlgorithmFactory 45 .create(); 46 testalignment1.align(ns1, ns2,submat,5); 47 assertTrue(testalignment1.getAlignmentScore()==5); 17 48 } 18 49 19 50 @Test 20 51 public void testGetMatches() { 21 fail("Not yet implemented"); 52 int[] seq1 = new int[]{0,1,2,3,4,5,6,7,8,9}; 53 int[] seq2 = new int[]{3,4,5,6,7}; 54 55 NumberSequence ns1 = new NumberSequence(10); 56 NumberSequence ns2 = new NumberSequence(10); 57 58 ns1.setSequence(seq1); 59 ns2.setSequence(seq2); 60 61 DummySubstitutionMatrix submat = new DummySubstitutionMatrix(); 62 63 AlignmentAlgorithm testalignment1 = AlignmentAlgorithmFactory 64 .create(); 65 testalignment1.align(ns1, ns2,submat,4); 66 testalignment1.printDPMatrix(); 67 testalignment1.printAlignment(); 68 69 //testalignment1.getMatches().get(0).getFirstSequence().printSequence(); 70 //testalignment1.getMatches().get(0).getSecondSequence().printSequence(); 71 22 72 } 23 73 24 @Test25 public void testGetAlignment() {26 fail("Not yet implemented");27 }28 74 75 //TODO: Need a better substitution matrix to do proper testing 29 76 @Test 30 77 public void testAlign() { 31 fail("Not yet implemented"); 32 } 78 int[] seq1 = new int[]{0,1,2, 3, 4, 5,6,7,8,9}; 79 int[] seq2 = new int[]{0,1,2,10,11,12,6,7,8,9}; 80 81 82 NumberSequence ns1 = new NumberSequence(10); 83 NumberSequence ns2 = new NumberSequence(10); 84 85 ns1.setSequence(seq1); 86 ns2.setSequence(seq2); 87 88 DummySubstitutionMatrix submat = new DummySubstitutionMatrix(); 89 90 AlignmentAlgorithm testalignment1 = AlignmentAlgorithmFactory 91 .create(); 92 testalignment1.align(ns1, ns2,submat,3); 93 //assertTrue(testalignment1.getAlignmentScore()==7); 94 95 } 33 96 34 97 }
Note: See TracChangeset
for help on using the changeset viewer.