diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 23 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 69 |
2 files changed, 47 insertions, 45 deletions
diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 1663ac1..566d8d2 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | |||
@@ -30,6 +30,7 @@ using OpenSim.Framework.Communications; | |||
30 | using OpenSim.Framework.Communications.Cache; | 30 | using OpenSim.Framework.Communications.Cache; |
31 | using OpenSim.Framework.Servers; | 31 | using OpenSim.Framework.Servers; |
32 | using OpenSim.Region.Communications.Local; | 32 | using OpenSim.Region.Communications.Local; |
33 | using OpenSim.Data; | ||
33 | 34 | ||
34 | namespace OpenSim.Tests.Common.Mock | 35 | namespace OpenSim.Tests.Common.Mock |
35 | { | 36 | { |
@@ -40,36 +41,36 @@ namespace OpenSim.Tests.Common.Mock | |||
40 | get { return m_userDataPlugin; } | 41 | get { return m_userDataPlugin; } |
41 | } | 42 | } |
42 | private IUserDataPlugin m_userDataPlugin; | 43 | private IUserDataPlugin m_userDataPlugin; |
43 | 44 | ||
44 | public IInventoryDataPlugin InventoryDataPlugin | 45 | public IInventoryDataPlugin InventoryDataPlugin |
45 | { | 46 | { |
46 | get { return m_inventoryDataPlugin; } | 47 | get { return m_inventoryDataPlugin; } |
47 | } | 48 | } |
48 | private IInventoryDataPlugin m_inventoryDataPlugin; | 49 | private IInventoryDataPlugin m_inventoryDataPlugin; |
49 | 50 | ||
50 | public TestCommunicationsManager() | 51 | public TestCommunicationsManager() |
51 | : this(null) | 52 | : this(null) |
52 | { | 53 | { |
53 | } | 54 | } |
54 | 55 | ||
55 | public TestCommunicationsManager(NetworkServersInfo serversInfo) | 56 | public TestCommunicationsManager(NetworkServersInfo serversInfo) |
56 | : base(serversInfo, new BaseHttpServer(666), null, false, null) | 57 | : base(serversInfo, new BaseHttpServer(666), null, false, null) |
57 | { | 58 | { |
58 | m_userDataPlugin = new TestUserDataPlugin(); | 59 | m_userDataPlugin = new TestUserDataPlugin(); |
59 | m_inventoryDataPlugin = new TestInventoryDataPlugin(); | 60 | m_inventoryDataPlugin = new TestInventoryDataPlugin(); |
60 | 61 | ||
61 | LocalInventoryService lis = new LocalInventoryService(); | 62 | LocalInventoryService lis = new LocalInventoryService(); |
62 | lis.AddPlugin(m_inventoryDataPlugin); | 63 | lis.AddPlugin(m_inventoryDataPlugin); |
63 | m_interServiceInventoryService = lis; | 64 | m_interServiceInventoryService = lis; |
64 | AddInventoryService(lis); | 65 | AddInventoryService(lis); |
65 | 66 | ||
66 | LocalUserServices lus = new LocalUserServices(991, 992, lis); | 67 | LocalUserServices lus = new LocalUserServices(991, 992, lis); |
67 | lus.AddPlugin(m_userDataPlugin); | 68 | lus.AddPlugin(m_userDataPlugin); |
68 | m_userService = lus; | 69 | m_userService = lus; |
69 | m_userAdminService = lus; | 70 | m_userAdminService = lus; |
70 | 71 | ||
71 | LocalBackEndServices gs = new LocalBackEndServices(); | 72 | LocalBackEndServices gs = new LocalBackEndServices(); |
72 | m_gridService = gs; | 73 | m_gridService = gs; |
73 | m_interRegion = gs; | 74 | m_interRegion = gs; |
74 | } | 75 | } |
75 | } | 76 | } |
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 | } |