34b8f3243ca3e7ef39eb05b156b0e50dd5b506b9
[pub/Android/ownCloud.git] /
1 package com.owncloud.android.oc_framework_test_project.test;
2
3 import java.text.SimpleDateFormat;
4 import java.util.Date;
5
6 import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
7 import com.owncloud.android.oc_framework_test_project.TestActivity;
8
9 import android.test.ActivityInstrumentationTestCase2;
10 import android.util.Log;
11
12 public class CreateFolderTest extends ActivityInstrumentationTestCase2<TestActivity> {
13
14 private TestActivity mActivity;
15 private String mCurrentDate;
16
17 public CreateFolderTest() {
18 super(TestActivity.class);
19
20 SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss");
21 mCurrentDate = sdf.format(new Date());
22 }
23
24 @Override
25 protected void setUp() throws Exception {
26 super.setUp();
27 setActivityInitialTouchMode(false);
28 mActivity = getActivity();
29 }
30
31 public void testCreateFolder() {
32
33 String remotePath = "/testCreateFolder" + mCurrentDate;
34 boolean createFullPath = true;
35
36 RemoteOperationResult result = mActivity.createFolder(remotePath, createFullPath);
37 Log.d("test CreateFolder", "-----------------------" + result.getCode().name());
38 Log.d("test CreateFolder", "-----------------------" + result.getLogMessage());
39 assertTrue(result.isSuccess());
40 }
41
42 public void testCreateFolderSpecialCharacters() {
43 String remotePath = "/test^^SpecialCharacters" + mCurrentDate;
44 boolean createFullPath = true;
45
46 RemoteOperationResult result = mActivity.createFolder(remotePath, createFullPath);
47 assertFalse(result.isSuccess());
48 }
49
50
51 }