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