1 | void testCreateFlatListWithNamesOnly() {↵ | | |
|
2 | List<String> l = new Vector<String>();↵ | | |
|
3 | l.add("name1");↵ | | |
|
4 | l.add("name2");↵ | | |
|
|
5 | List<String> result = ListBuilder.createFlatList(l);↵ | | |
|
6 | assertEquals("name1@mail.org", result.get(0));↵ | | |
|
7 | assertEquals("name2@mail.org", result.get(1));↵ | | |
|
|
8 | }↵ | | |
|
|
9 | /**↵ | | |
|
10 | * Now, mix in real email address↵ | | |
|
11 | */↵ | | |
|
12 | public void testCreateFlatListWithEmailAddressMixedIn() {↵ | | 1 | void testCreateFlatListWithEmailAddressMixedIn() {↵
|
13 | List<String> l = new Vector<String>();↵ | | 2 | List<String> l = new Vector<String>();↵
|
14 | l.add("name1");↵ | | 3 | l.add("name1");↵
|
15 | l.add("name2@mail.org");↵ | | 4 | l.add("name2@mail.org");↵
|
|
16 | List<String> result = ListBuilder.createFlatList(l);↵ | | 5 | List<String> result = ListBuilder.createFlatList(l);↵
|
17 | assertEquals("name1@mail.org", result.get(0));↵ | | 6 | assertEquals("name1@mail.org", result.get(0));↵
|
18 | assertEquals("name2@mail.org", result.get(1));↵ | | 7 | assertEquals("name2@mail.org", result.get(1));↵
|
|
19 | }↵ | | 8 | }↵
|
20 | ↵ | | 9 | ↵
|
21 | /**↵ | | 10 | /**↵
|
22 | * Test if groups are resolved correctly ↵ | | 11 | * Test if groups are resolved correctly ↵
|
23 | *↵ | | 12 | *↵
|
24 | */↵ | | 13 | */↵
|
25 | public void testCreateFlatListWithGroups() {↵ | | 14 | public void testCreateFlatListWithGroups() {↵
|
26 | List<String> l = new Vector<String>();↵ | | 15 | List<String> l = new Vector<String>();↵
|
27 | l.add("groupname1");↵ | | 16 | l.add("groupname1");↵
|
28 | l.add("name2@mail.org");↵ | | 17 | l.add("name2@mail.org");↵
|
|
29 | List<String> result = ListBuilder.createFlatList(l);↵ | | 18 | List<String> result = ListBuilder.createFlatList(l);↵
|
30 | // first group contains first contact item↵ | | 19 | // first group contains first contact item↵
|
31 | assertEquals("name1@mail.org", result.get(0));↵ | | 20 | assertEquals("name1@mail.org", result.get(0));↵
|
32 | assertEquals("name2@mail.org", result.get(1)); | | 21 | assertEquals("name2@mail.org", result.get(1));↵
|
|
| | | 22 | }↵
|
| | | 23 | ↵
|
| | | 24 | /**↵
|
| | | 25 | * Again, but with a group containing two contact items↵
|
| | | 26 | *↵
|
| | | 27 | */↵
|
| | | 28 | public void testCreateFlatListWithGroups2() {↵
|
| | | 29 | List<String> l = new Vector<String>();↵
|
| | | 30 | l.add("groupname2");↵
|
| | | 31 | l.add("name2@mail.org");↵
|
|
| | | 32 | List<String> result = ListBuilder.createFlatList(l);↵
|
| | | 33 | // first group contains first contact item↵
|
| | | 34 | assertEquals("name1@mail.org", result.get(0));↵
|
| | | 35 | assertEquals("name2@mail.org", result.get(1));
|