1 package com.owncloud.android.oc_framework_test_project.test;
3 import java.text.SimpleDateFormat;
6 import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
7 import com.owncloud.android.oc_framework_test_project.TestActivity;
9 import android.test.ActivityInstrumentationTestCase2;
10 import android.util.Log;
12 public class CreateFolderTest extends ActivityInstrumentationTestCase2<TestActivity> {
14 private TestActivity mActivity;
15 private String mCurrentDate;
17 public CreateFolderTest() {
18 super(TestActivity.class);
20 SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss");
21 mCurrentDate = sdf.format(new Date());
25 protected void setUp() throws Exception {
27 setActivityInitialTouchMode(false);
28 mActivity = getActivity();
31 public void testCreateFolder() {
33 String remotePath = "/testCreateFolder" + mCurrentDate;
34 boolean createFullPath = true;
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());
42 public void testCreateFolderSpecialCharacters() {
43 String remotePath = "/test^^SpecialCharacters" + mCurrentDate;
44 boolean createFullPath = true;
46 RemoteOperationResult result = mActivity.createFolder(remotePath, createFullPath);
47 assertFalse(result.isSuccess());