1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.exoplatform.mobile.tests;
20
21 import static org.junit.Assert.assertEquals;
22
23 import org.exoplatform.model.ExoFile;
24 import org.robolectric.annotation.Config;
25
26 import android.os.Build;
27
28 import org.junit.After;
29 import org.junit.Before;
30 import org.junit.Test;
31 import org.junit.runner.RunWith;
32 import org.robolectric.RobolectricTestRunner;
33
34
35
36
37
38 @RunWith(RobolectricTestRunner.class)
39 @Config(sdk=Build.VERSION_CODES.LOLLIPOP)
40 public class ExoDocumentUtilsTest {
41
42 @Before
43 public void setup() {
44 }
45
46 @After
47 public void teardown() {
48 }
49
50 @Test
51 public void testConvertTechnicalToNaturalNames() {
52
53 final String[] technicalNames = { ".organization.employees", ".spaces.exo_fr",
54 ".spaces.exo_mobile", ".platform.web-contributors", ".platform.users.managers",
55 ".spaces.thu_muc_tieng_viet_100", ".spaces.aađoiec", "Âã-đô-ịẻç", ".élus.députés",
56 ".spaces.my-spaces", ".spaces.spaces-for-admins", "日本語", "عربي عربى", "指事字",
57 "λάμβδα", "אותיות השימוש" };
58
59 final String[] naturalNames = { "Organization Employees", "eXo Fr", "eXo Mobile",
60 "Platform Web Contributors", "Platform Users Managers", "Thu Muc Tieng Viet 100",
61 "Aađoiec", "Âã Đô Ịẻç", "Élus Députés", "My Spaces", "Spaces For Admins", "日本語",
62 "عربي عربى", "指事字", "Λάμβδα", "אותיות השימוש" };
63
64 for (int i = 0; i < technicalNames.length; i++) {
65 String name = technicalNames[i];
66 ExoFile file = new ExoFile();
67 file.name = name;
68 file.createNaturalName();
69 assertEquals("Incorrect technical -> natural name conversion.",
70 naturalNames[i],
71 file.getName());
72 }
73
74 }
75
76 public void testGetDrivesFromHttpResponse() {
77
78
79 }
80 }