aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Common/Mock
diff options
context:
space:
mode:
authorMic Bowman2011-04-18 11:29:43 -0700
committerMic Bowman2011-04-18 11:29:43 -0700
commit452ae375f0fdd62ba16fb170869ea470c6906cfe (patch)
treeb5a7d364e509f2ff7f1b9086e2ba5658f4ee99ac /OpenSim/Tests/Common/Mock
parentRemove the call to remove tokens from the parent. Under heavy load (diff)
parentMantis #5442: Add admin_save_heightmap (diff)
downloadopensim-SC_OLD-452ae375f0fdd62ba16fb170869ea470c6906cfe.zip
opensim-SC_OLD-452ae375f0fdd62ba16fb170869ea470c6906cfe.tar.gz
opensim-SC_OLD-452ae375f0fdd62ba16fb170869ea470c6906cfe.tar.bz2
opensim-SC_OLD-452ae375f0fdd62ba16fb170869ea470c6906cfe.tar.xz
Merge branch 'master' into test-merge0418
Diffstat (limited to 'OpenSim/Tests/Common/Mock')
-rw-r--r--OpenSim/Tests/Common/Mock/MockAssetService.cs109
-rw-r--r--OpenSim/Tests/Common/Mock/MockInventoryService.cs186
2 files changed, 0 insertions, 295 deletions
diff --git a/OpenSim/Tests/Common/Mock/MockAssetService.cs b/OpenSim/Tests/Common/Mock/MockAssetService.cs
deleted file mode 100644
index 4118308..0000000
--- a/OpenSim/Tests/Common/Mock/MockAssetService.cs
+++ /dev/null
@@ -1,109 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31using log4net;
32using OpenMetaverse;
33using OpenSim.Framework;
34using OpenSim.Data;
35using OpenSim.Services.Interfaces;
36using Nini.Config;
37
38namespace OpenSim.Tests.Common.Mock
39{
40 public class MockAssetService : IAssetService
41 {
42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
43
44 private readonly Dictionary<string, AssetBase> Assets = new Dictionary<string, AssetBase>();
45
46 public MockAssetService() {}
47
48 /// <summary>
49 /// This constructor is required if the asset service is being created reflectively (which is the case in some
50 /// tests).
51 /// </summary>
52 /// <param name="config"></param>
53 public MockAssetService(IConfigSource config) {}
54
55 public AssetBase Get(string id)
56 {
57 m_log.DebugFormat("[MOCK ASSET SERVICE]: Getting asset with id {0}", id);
58
59 AssetBase asset;
60 if (Assets.ContainsKey(id))
61 asset = Assets[id];
62 else
63 asset = null;
64
65 return asset;
66 }
67
68 public AssetBase GetCached(string id)
69 {
70 return Get(id);
71 }
72
73 public AssetMetadata GetMetadata(string id)
74 {
75 throw new System.NotImplementedException();
76 }
77
78 public byte[] GetData(string id)
79 {
80 throw new System.NotImplementedException();
81 }
82
83 public bool Get(string id, object sender, AssetRetrieved handler)
84 {
85 handler(id, sender, Get(id));
86
87 return true;
88 }
89
90 public string Store(AssetBase asset)
91 {
92 m_log.DebugFormat("[MOCK ASSET SERVICE]: Storing asset {0}", asset.ID);
93
94 Assets[asset.ID] = asset;
95
96 return asset.ID;
97 }
98
99 public bool UpdateContent(string id, byte[] data)
100 {
101 throw new System.NotImplementedException();
102 }
103
104 public bool Delete(string id)
105 {
106 throw new System.NotImplementedException();
107 }
108 }
109} \ No newline at end of file
diff --git a/OpenSim/Tests/Common/Mock/MockInventoryService.cs b/OpenSim/Tests/Common/Mock/MockInventoryService.cs
deleted file mode 100644
index 4ac1078..0000000
--- a/OpenSim/Tests/Common/Mock/MockInventoryService.cs
+++ /dev/null
@@ -1,186 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Text;
31using OpenSim.Framework;
32using OpenMetaverse;
33using OpenSim.Services.Interfaces;
34using Nini.Config;
35
36namespace OpenSim.Tests.Common.Mock
37{
38 public class MockInventoryService : IInventoryService
39 {
40 public MockInventoryService() {}
41
42 public MockInventoryService(IConfigSource config) {}
43
44 /// <summary>
45 /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/>
46 /// </summary>
47 /// <param name="userId"></param>
48 /// <returns></returns>
49 public bool CreateUserInventory(UUID userId)
50 {
51 return false;
52 }
53
54 /// <summary>
55 /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/>
56 /// </summary>
57 /// <param name="userId"></param>
58 /// <returns></returns>
59 public List<InventoryFolderBase> GetInventorySkeleton(UUID userId)
60 {
61 List<InventoryFolderBase> folders = new List<InventoryFolderBase>();
62 InventoryFolderBase folder = new InventoryFolderBase();
63 folder.ID = UUID.Random();
64 folder.Owner = userId;
65 folders.Add(folder);
66 return folders;
67 }
68
69 public InventoryFolderBase GetRootFolder(UUID userID)
70 {
71 return new InventoryFolderBase();
72 }
73
74 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
75 {
76 return null;
77 }
78
79 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
80 {
81 return null;
82 }
83
84 /// <summary>
85 /// Returns a list of all the active gestures in a user's inventory.
86 /// </summary>
87 /// <param name="userId">
88 /// The <see cref="UUID"/> of the user
89 /// </param>
90 /// <returns>
91 /// A flat list of the gesture items.
92 /// </returns>
93 public List<InventoryItemBase> GetActiveGestures(UUID userId)
94 {
95 return null;
96 }
97
98 public InventoryCollection GetUserInventory(UUID userID)
99 {
100 return null;
101 }
102
103 public void GetUserInventory(UUID userID, OpenSim.Services.Interfaces.InventoryReceiptCallback callback)
104 {
105 }
106
107 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
108 {
109 return null;
110 }
111
112 public bool AddFolder(InventoryFolderBase folder)
113 {
114 return false;
115 }
116
117 public bool UpdateFolder(InventoryFolderBase folder)
118 {
119 return false;
120 }
121
122 public bool MoveFolder(InventoryFolderBase folder)
123 {
124 return false;
125 }
126
127 public bool DeleteFolders(UUID ownerID, List<UUID> ids)
128 {
129 return false;
130 }
131
132 public bool PurgeFolder(InventoryFolderBase folder)
133 {
134 return false;
135 }
136
137 public bool AddItem(InventoryItemBase item)
138 {
139 return true;
140 }
141
142 public bool UpdateItem(InventoryItemBase item)
143 {
144 return false;
145 }
146
147 public bool MoveItems(UUID ownerID, List<InventoryItemBase> items)
148 {
149 return false;
150 }
151
152 public bool DeleteItems(UUID ownerID, List<UUID> itemIDs)
153 {
154 return false;
155 }
156
157 public InventoryItemBase GetItem(InventoryItemBase item)
158 {
159 return null;
160 }
161
162 public InventoryFolderBase GetFolder(InventoryFolderBase folder)
163 {
164 return null;
165 }
166
167 public bool HasInventoryForUser(UUID userID)
168 {
169 return false;
170 }
171
172 public InventoryFolderBase RequestRootFolder(UUID userID)
173 {
174 InventoryFolderBase root = new InventoryFolderBase();
175 root.ID = UUID.Random();
176 root.Owner = userID;
177 root.ParentID = UUID.Zero;
178 return root;
179 }
180
181 public int GetAssetPermissions(UUID userID, UUID assetID)
182 {
183 return 1;
184 }
185 }
186} \ No newline at end of file