diff options
Diffstat (limited to 'OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs')
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 69 |
1 files changed, 35 insertions, 34 deletions
diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index 8e19aec..59d923c 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Data; | ||
32 | 33 | ||
33 | namespace OpenSim.Tests.Common.Mock | 34 | namespace OpenSim.Tests.Common.Mock |
34 | { | 35 | { |
@@ -43,12 +44,12 @@ namespace OpenSim.Tests.Common.Mock | |||
43 | /// Known inventory folders | 44 | /// Known inventory folders |
44 | /// </value> | 45 | /// </value> |
45 | private Dictionary<UUID, InventoryFolderBase> m_folders = new Dictionary<UUID, InventoryFolderBase>(); | 46 | private Dictionary<UUID, InventoryFolderBase> m_folders = new Dictionary<UUID, InventoryFolderBase>(); |
46 | 47 | ||
47 | /// <value> | 48 | /// <value> |
48 | /// User root folders | 49 | /// User root folders |
49 | /// </value> | 50 | /// </value> |
50 | private Dictionary<UUID, InventoryFolderBase> m_rootFolders = new Dictionary<UUID, InventoryFolderBase>(); | 51 | private Dictionary<UUID, InventoryFolderBase> m_rootFolders = new Dictionary<UUID, InventoryFolderBase>(); |
51 | 52 | ||
52 | public string Version { get { return "0"; } } | 53 | public string Version { get { return "0"; } } |
53 | public string Name { get { return "TestInventoryDataPlugin"; } } | 54 | public string Name { get { return "TestInventoryDataPlugin"; } } |
54 | 55 | ||
@@ -56,10 +57,10 @@ namespace OpenSim.Tests.Common.Mock | |||
56 | public void Initialise(string connect) {} | 57 | public void Initialise(string connect) {} |
57 | public void Dispose() {} | 58 | public void Dispose() {} |
58 | 59 | ||
59 | public List<InventoryFolderBase> getFolderHierarchy(UUID parentID) | 60 | public List<InventoryFolderBase> getFolderHierarchy(UUID parentID) |
60 | { | 61 | { |
61 | List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); | 62 | List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); |
62 | 63 | ||
63 | foreach (InventoryFolderBase folder in m_folders.Values) | 64 | foreach (InventoryFolderBase folder in m_folders.Values) |
64 | { | 65 | { |
65 | if (folder.ParentID == parentID) | 66 | if (folder.ParentID == parentID) |
@@ -68,77 +69,77 @@ namespace OpenSim.Tests.Common.Mock | |||
68 | folders.Add(folder); | 69 | folders.Add(folder); |
69 | } | 70 | } |
70 | } | 71 | } |
71 | 72 | ||
72 | return folders; | 73 | return folders; |
73 | } | 74 | } |
74 | 75 | ||
75 | public List<InventoryItemBase> getInventoryInFolder(UUID folderID) | 76 | public List<InventoryItemBase> getInventoryInFolder(UUID folderID) |
76 | { | 77 | { |
77 | return new List<InventoryItemBase>(); | 78 | return new List<InventoryItemBase>(); |
78 | } | 79 | } |
79 | 80 | ||
80 | public List<InventoryFolderBase> getUserRootFolders(UUID user) { return null; } | 81 | public List<InventoryFolderBase> getUserRootFolders(UUID user) { return null; } |
81 | 82 | ||
82 | public InventoryFolderBase getUserRootFolder(UUID user) | 83 | public InventoryFolderBase getUserRootFolder(UUID user) |
83 | { | 84 | { |
84 | InventoryFolderBase folder = null; | 85 | InventoryFolderBase folder = null; |
85 | m_rootFolders.TryGetValue(user, out folder); | 86 | m_rootFolders.TryGetValue(user, out folder); |
86 | 87 | ||
87 | return folder; | 88 | return folder; |
88 | } | 89 | } |
89 | 90 | ||
90 | public List<InventoryFolderBase> getInventoryFolders(UUID parentID) | 91 | public List<InventoryFolderBase> getInventoryFolders(UUID parentID) |
91 | { | 92 | { |
92 | List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); | 93 | List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); |
93 | 94 | ||
94 | foreach (InventoryFolderBase folder in m_folders.Values) | 95 | foreach (InventoryFolderBase folder in m_folders.Values) |
95 | { | 96 | { |
96 | if (folder.ParentID == parentID) | 97 | if (folder.ParentID == parentID) |
97 | folders.Add(folder); | 98 | folders.Add(folder); |
98 | } | 99 | } |
99 | 100 | ||
100 | return folders; | 101 | return folders; |
101 | } | 102 | } |
102 | 103 | ||
103 | public InventoryItemBase getInventoryItem(UUID item) { return null; } | 104 | public InventoryItemBase getInventoryItem(UUID item) { return null; } |
104 | 105 | ||
105 | public InventoryFolderBase getInventoryFolder(UUID folderId) | 106 | public InventoryFolderBase getInventoryFolder(UUID folderId) |
106 | { | 107 | { |
107 | InventoryFolderBase folder = null; | 108 | InventoryFolderBase folder = null; |
108 | m_folders.TryGetValue(folderId, out folder); | 109 | m_folders.TryGetValue(folderId, out folder); |
109 | 110 | ||
110 | return folder; | 111 | return folder; |
111 | } | 112 | } |
112 | 113 | ||
113 | public void addInventoryItem(InventoryItemBase item) {} | 114 | public void addInventoryItem(InventoryItemBase item) {} |
114 | public void updateInventoryItem(InventoryItemBase item) {} | 115 | public void updateInventoryItem(InventoryItemBase item) {} |
115 | public void deleteInventoryItem(UUID item) {} | 116 | public void deleteInventoryItem(UUID item) {} |
116 | 117 | ||
117 | public void addInventoryFolder(InventoryFolderBase folder) | 118 | public void addInventoryFolder(InventoryFolderBase folder) |
118 | { | 119 | { |
119 | m_folders[folder.ID] = folder; | 120 | m_folders[folder.ID] = folder; |
120 | 121 | ||
121 | if (folder.ParentID == UUID.Zero) | 122 | if (folder.ParentID == UUID.Zero) |
122 | m_rootFolders[folder.Owner] = folder; | 123 | m_rootFolders[folder.Owner] = folder; |
123 | } | 124 | } |
124 | 125 | ||
125 | public void updateInventoryFolder(InventoryFolderBase folder) | 126 | public void updateInventoryFolder(InventoryFolderBase folder) |
126 | { | 127 | { |
127 | m_folders[folder.ID] = folder; | 128 | m_folders[folder.ID] = folder; |
128 | } | 129 | } |
129 | 130 | ||
130 | public void moveInventoryFolder(InventoryFolderBase folder) | 131 | public void moveInventoryFolder(InventoryFolderBase folder) |
131 | { | 132 | { |
132 | // Simple replace | 133 | // Simple replace |
133 | updateInventoryFolder(folder); | 134 | updateInventoryFolder(folder); |
134 | } | 135 | } |
135 | 136 | ||
136 | public void deleteInventoryFolder(UUID folderId) | 137 | public void deleteInventoryFolder(UUID folderId) |
137 | { | 138 | { |
138 | if (m_folders.ContainsKey(folderId)) | 139 | if (m_folders.ContainsKey(folderId)) |
139 | m_folders.Remove(folderId); | 140 | m_folders.Remove(folderId); |
140 | } | 141 | } |
141 | 142 | ||
142 | public List<InventoryItemBase> fetchActiveGestures(UUID avatarID) { return null; } | 143 | public List<InventoryItemBase> fetchActiveGestures(UUID avatarID) { return null; } |
143 | } | 144 | } |
144 | } | 145 | } |