1   package testcomtest;
2   // Generated by ComTest BEGIN
3   import static org.junit.Assert.*;
4   import org.junit.*;
5   import comtest.Strings;
6   // Generated by ComTest END
7   
8   /**
9    * Test class made by ComTest
10   * @version 2009.08.13 23:29:29 // Generated by ComTest
11   *
12   */
13  public class StringsTest {
14  
15  
16  
17    // Generated by ComTest BEGIN
18    /** testStrings */
19    @Test
20    public void testStrings() {    // Strings: 9
21      Strings list = new Strings(); 
22      assertEquals("From: Strings line: 11", 0, list.size()); 
23      list.add("one"); assertEquals("From: Strings line: 16", 1, list.size()); assertEquals("From: Strings line: 16", "one", list.get(0));  
24      list.add("two"); assertEquals("From: Strings line: 17", 2, list.size()); assertEquals("From: Strings line: 17", "one", list.get(0));  
25      ; ; assertEquals("From: Strings line: 18", "two", list.get(1));  
26    } // Generated by ComTest END
27  
28  
29    // Generated by ComTest BEGIN
30    /** testAdd */
31    @Test
32    public void testAdd() {    // Strings: 30
33      Strings l1 = new Strings(), l2 = new Strings(); 
34      l1.add("one"); l1.add("two"); 
35      l2.add("three"); l2.add("four"); 
36      l1.add(l2); 
37      assertEquals("From: Strings line: 35", "three", l1.get(2)); assertEquals("From: Strings line: 35", "four", l1.get(3)); 
38    } // Generated by ComTest END
39  
40  
41    // Generated by ComTest BEGIN
42    /** testClone */
43    @Test
44    public void testClone() {    // Strings: 47
45      Strings l1 = new Strings(), l2; 
46      l1.add("one"); l1.add("two"); 
47      l2 = l1.clone(); 
48      l1.set(1,"three"); 
49      assertEquals("From: Strings line: 52", "one", l2.get(0)); assertEquals("From: Strings line: 52", "two", l2.get(1)); assertEquals("From: Strings line: 52", "three", l1.get(1)); 
50    } // Generated by ComTest END
51  
52  
53    // Generated by ComTest BEGIN
54    /** testReplace */
55    @Test
56    public void testReplace() {    // Strings: 69
57      Strings l1 = new Strings(); 
58      l1.add("one");  
59      l1.add("two");  
60      l1.add("three");  
61      l1.add("four");  
62      l1.replace("o","p"); 
63      assertEquals("From: Strings line: 85", "pne", l1.get(0));  
64      assertEquals("From: Strings line: 86", "twp", l1.get(1));  
65      assertEquals("From: Strings line: 87", "three", l1.get(2));  
66      assertEquals("From: Strings line: 88", "fpur", l1.get(3));  
67    } // Generated by ComTest END
68  
69  
70    // Generated by ComTest BEGIN
71    /** testToString118 */
72    @Test
73    public void testToString118() {    // Strings: 118
74      Strings list = new Strings(); 
75      assertEquals("From: Strings line: 120", "!", list.toString("|","!")); 
76      list.add("one"); 
77      assertEquals("From: Strings line: 122", "one!", list.toString("|","!")); 
78      list.add("two"); 
79      assertEquals("From: Strings line: 124", "one|two!", list.toString("|","!")); 
80      assertEquals("From: Strings line: 125", "one|two", list.toString("|","")); 
81      assertEquals("From: Strings line: 126", "one|two", list.toString("|",null)); 
82    } // Generated by ComTest END
83  
84  
85    // Generated by ComTest BEGIN
86    /** testToString146 */
87    @Test
88    public void testToString146() {    // Strings: 146
89      Strings list = new Strings(); 
90      assertEquals("From: Strings line: 148", "", list.toString("|")); 
91      list.add("one"); 
92      assertEquals("From: Strings line: 150", "one", list.toString("|")); 
93      list.add("two"); 
94      assertEquals("From: Strings line: 152", "one|two", list.toString("|")); 
95    } // Generated by ComTest END
96  }