1/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.quicksearchbox;
18
19import android.content.ComponentName;
20
21import java.util.Collection;
22import java.util.HashMap;
23
24/**
25 * Mock implementation of {@link Sources}.
26 */
27public class MockSources implements Sources {
28
29    private final HashMap<String, Source> mSources = new HashMap<String, Source>();
30
31    public void addSource(Source source) {
32        mSources.put(source.getName(), source);
33    }
34
35    public Source getSource(String name) {
36        return mSources.get(name);
37    }
38
39    public Collection<Source> getSources() {
40        return mSources.values();
41    }
42
43    public Source getWebSearchSource() {
44        return null;
45    }
46
47    public void update() {
48    }
49
50    public Source createSourceFor(ComponentName component) {
51        return null;
52    }
53
54}
55