33 using System.Xml.Serialization;
35 using NUnit.Framework;
37 using OpenSim.Framework;
38 using OpenSim.Server.Handlers.Asset;
39 using OpenSim.Services.AssetService;
40 using OpenSim.Services.Interfaces;
41 using OpenSim.Tests.Common;
51 TestHelpers.InMethod();
53 UUID assetId = TestHelpers.ParseTail(0x1);
55 IConfigSource config =
new IniConfigSource();
56 config.AddConfig(
"AssetService");
57 config.Configs[
"AssetService"].Set(
"StorageProvider",
"OpenSim.Tests.Common.dll");
63 AssetBase asset = AssetHelpers.CreateNotecardAsset(assetId,
"Hello World");
65 MemoryStream buffer =
new MemoryStream();
67 XmlWriterSettings settings =
new XmlWriterSettings();
68 settings.Encoding = Encoding.UTF8;
70 using (XmlWriter writer = XmlWriter.Create(buffer, settings))
72 XmlSerializer serializer =
new XmlSerializer(typeof(
AssetBase));
73 serializer.Serialize(writer, asset);
78 asph.Handle(null, buffer, null, null);
80 AssetBase retrievedAsset = assetService.Get(assetId.ToString());
82 Assert.That(retrievedAsset, Is.Not.Null);
88 TestHelpers.InMethod();
90 IConfigSource config =
new IniConfigSource();
91 config.AddConfig(
"AssetService");
92 config.Configs[
"AssetService"].Set(
"StorageProvider",
"OpenSim.Tests.Common.dll");
98 MemoryStream buffer =
new MemoryStream();
99 byte[] badData =
new byte[] { 0x48, 0x65, 0x6c, 0x6c, 0x6f };
100 buffer.Write(badData, 0, badData.Length);
104 asph.Handle(null, buffer, null, response);
106 Assert.That(response.StatusCode, Is.EqualTo((int)HttpStatusCode.BadRequest));
Asset class. All Assets are reference by this class or a class derived from this class ...
void TestBadXmlAssetStoreRequest()
Interactive OpenSim region server
void TestGoodAssetStoreRequest()