blob: 329676d965e52ca0ce2f37bc4aa2173b2291c19b [file] [log] [blame]
Thieu Le3426c8f2012-01-11 17:35:11 -08001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Chris Masone6515aab2011-10-12 16:19:09 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include <string>
Paul Stewart99dc9f32013-06-27 07:39:25 -07006#include <vector>
Chris Masone6515aab2011-10-12 16:19:09 -07007
8#include "shill/service.h"
9
10namespace shill {
11
12class ControlInterface;
13class Error;
14class EventDispatcher;
15class Manager;
Thieu Le3426c8f2012-01-11 17:35:11 -080016class Metrics;
Chris Masone6515aab2011-10-12 16:19:09 -070017
Paul Stewart99dc9f32013-06-27 07:39:25 -070018// This is a simple Service subclass with all the pure-virtual methods stubbed.
Chris Masone6515aab2011-10-12 16:19:09 -070019class ServiceUnderTest : public Service {
20 public:
21 static const char kRpcId[];
Paul Stewart99dc9f32013-06-27 07:39:25 -070022 static const char kStringsProperty[];
Chris Masone6515aab2011-10-12 16:19:09 -070023 static const char kStorageId[];
24
25 ServiceUnderTest(ControlInterface *control_interface,
26 EventDispatcher *dispatcher,
Thieu Le3426c8f2012-01-11 17:35:11 -080027 Metrics *metrics,
Chris Masone6515aab2011-10-12 16:19:09 -070028 Manager *manager);
29 virtual ~ServiceUnderTest();
30
Chris Masone6515aab2011-10-12 16:19:09 -070031 virtual std::string GetRpcIdentifier() const;
Hristo Stefanoved2c28c2011-11-29 15:37:30 -080032 virtual std::string GetDeviceRpcId(Error *error);
Chris Masone6515aab2011-10-12 16:19:09 -070033 virtual std::string GetStorageIdentifier() const;
34
Paul Stewart99dc9f32013-06-27 07:39:25 -070035 // Getter and setter for a string array property for use in testing.
36 void set_strings(const std::vector<std::string> &strings) {
37 strings_ = strings;
38 }
39 const std::vector<std::string> &strings() const { return strings_; }
40
Chris Masone6515aab2011-10-12 16:19:09 -070041 private:
Paul Stewart99dc9f32013-06-27 07:39:25 -070042 // The Service superclass has no string array properties but we need one
43 // in order to test Service::Configure.
44 std::vector<std::string> strings_;
45
Chris Masone6515aab2011-10-12 16:19:09 -070046 DISALLOW_COPY_AND_ASSIGN(ServiceUnderTest);
47};
48
49} // namespace shill