~michihenning/storage-framework/no-exception-on-unknown-metadata

« back to all changes in this revision

Viewing changes to tests/provider-ProviderInterface/TestProvider.h

  • Committer: Tarmac
  • Author(s): James Henstridge
  • Date: 2016-08-10 13:23:42 UTC
  • mfrom: (39.3.7 provider-tests-dbus)
  • Revision ID: tarmac-20160810132342-1w0hjoeglfjxzafp
Add tests for the D-Bus interface code in libstorage-framework-provider.

Approved by unity-api-1-bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2016 Canonical Ltd
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify
 
5
 * it under the terms of the GNU Lesser General Public License version 3 as
 
6
 * published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU Lesser General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authors: James Henstridge <james.henstridge@canonical.com>
 
17
 */
 
18
 
 
19
#pragma once
 
20
 
 
21
#include <unity/storage/provider/ProviderBase.h>
 
22
 
 
23
using namespace std;
 
24
using namespace unity::storage::provider;
 
25
 
 
26
class TestProvider : public ProviderBase {
 
27
public:
 
28
    boost::future<ItemList> roots(Context const& ctx) override;
 
29
    boost::future<tuple<ItemList,string>> list(
 
30
        string const& item_id, string const& page_token,
 
31
        Context const& ctx) override;
 
32
    boost::future<ItemList> lookup(
 
33
        string const& parent_id, string const& name,
 
34
        Context const& ctx) override;
 
35
    boost::future<Item> metadata(
 
36
        string const& item_id, Context const& ctx) override;
 
37
    boost::future<Item> create_folder(
 
38
        string const& parent_id, string const& name,
 
39
        Context const& ctx) override;
 
40
 
 
41
    boost::future<unique_ptr<UploadJob>> create_file(
 
42
        string const& parent_id, string const& name,
 
43
        int64_t size, string const& content_type, bool allow_overwrite,
 
44
        Context const& ctx) override;
 
45
    boost::future<unique_ptr<UploadJob>> update(
 
46
        string const& item_id, int64_t size, string const& old_etag,
 
47
        Context const& ctx) override;
 
48
 
 
49
    boost::future<unique_ptr<DownloadJob>> download(
 
50
        string const& item_id, Context const& ctx) override;
 
51
 
 
52
    boost::future<void> delete_item(
 
53
        string const& item_id, Context const& ctx) override;
 
54
    boost::future<Item> move(
 
55
        string const& item_id, string const& new_parent_id,
 
56
        string const& new_name, Context const& ctx) override;
 
57
    boost::future<Item> copy(
 
58
        string const& item_id, string const& new_parent_id,
 
59
        string const& new_name, Context const& ctx) override;
 
60
};