932ec33cae451b45bd8efe1ca895a36882c565ed
[pub/Android/ownCloud.git] /
1 /* ownCloud webDAV Library for Android is available under MIT license
2 * Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
18 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 * THE SOFTWARE.
22 *
23 */
24 package com.owncloud.android.oc_framework_test_project.test;
25
26 import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
27 import com.owncloud.android.oc_framework_test_project.TestActivity;
28
29 import android.test.ActivityInstrumentationTestCase2;
30
31 /**
32 * Class to test Read File Operation
33 * @author masensio
34 *
35 */
36
37 public class ReadFileTest extends ActivityInstrumentationTestCase2<TestActivity> {
38
39 /* File data to read. This file must exist on the account */
40 private final String mRemoteFolderPath = "/fileToRead.txt";
41
42
43 private TestActivity mActivity;
44
45 public ReadFileTest() {
46 super(TestActivity.class);
47 }
48
49 @Override
50 protected void setUp() throws Exception {
51 super.setUp();
52 setActivityInitialTouchMode(false);
53 mActivity = getActivity();
54 }
55
56 /**
57 * Test Read File
58 */
59 public void testReadFile() {
60
61 RemoteOperationResult result = mActivity.readFile(mRemoteFolderPath);
62 assertTrue(result.getData().size() == 1);
63 assertTrue(result.isSuccess());
64 }
65
66
67 }