Mercurial > hg > RemoteEditor > REPSessionManager
comparison test/RepCommandOptimizeTest.java @ 421:f8916a96a373
(no commit message)
author | one |
---|---|
date | Sat, 06 Jun 2009 14:42:40 +0900 |
parents | 6f356d160e58 |
children | 0b6b838befeb |
comparison
equal
deleted
inserted
replaced
420:5c95a9020e31 | 421:f8916a96a373 |
---|---|
1 package test; | 1 package test; |
2 | 2 |
3 import static org.junit.Assert.*; | 3 // import static org.junit.Assert.*; |
4 | 4 |
5 import java.util.LinkedList; | 5 import java.util.LinkedList; |
6 import java.util.List; | 6 import java.util.List; |
7 | 7 |
8 import org.junit.Test; | 8 // import org.junit.Test; |
9 | 9 |
10 import rep.REPCommand; | 10 import rep.REPCommand; |
11 import rep.REP; | 11 import rep.REP; |
12 import rep.optimizers.NullOptimizer; | 12 import rep.optimizers.NullOptimizer; |
13 import rep.optimizers.DeleteInsertOptimizer; | 13 import rep.optimizers.DeleteInsertOptimizer; |
93 public static void main(String[] s){ | 93 public static void main(String[] s){ |
94 RepCommandOptimizeTest t = new RepCommandOptimizeTest(); | 94 RepCommandOptimizeTest t = new RepCommandOptimizeTest(); |
95 t.main0(); | 95 t.main0(); |
96 } | 96 } |
97 | 97 |
98 @Test | 98 // @Test |
99 public void main0(){ | 99 public void main0(){ |
100 | 100 |
101 REPCommandOptimizer rco; | 101 REPCommandOptimizer rco; |
102 | 102 |
103 if (true) rco = new DeleteInsertOptimizer(); // | 103 if (true) rco = new DeleteInsertOptimizer(); // |
126 text1.edit(cmdlist); | 126 text1.edit(cmdlist); |
127 result = rco.optimize(cmdlist); | 127 result = rco.optimize(cmdlist); |
128 // this command list applied to other text, and print it. | 128 // this command list applied to other text, and print it. |
129 text2.edit(result); | 129 text2.edit(result); |
130 // check two texts. | 130 // check two texts. |
131 assertEquals(text1.equals(text2),true); | 131 // assertEquals(text1.equals(text2),true); |
132 if(!text1.equals(text2)){ | 132 if(!text1.equals(text2)){ |
133 System.out.println("two texts not match"); | 133 System.out.println("two texts not match"); |
134 print(cmdlist, result, text1, text2); | 134 print(cmdlist, result, text1, text2); |
135 err++; | 135 err++; |
136 } | 136 } |