29 using System.Diagnostics;
32 using NUnit.Framework;
35 namespace OpenSim.Tests.Common
39 private static Stream EnableLoggingConfigStream
41 Encoding.UTF8.GetBytes(
43 <!-- A1 is set to be a ConsoleAppender -->
44 <appender name=""A1"" type=""log4net.Appender.ConsoleAppender"">
46 <!-- A1 uses PatternLayout -->
47 <layout type=""log4net.Layout.PatternLayout"">
48 <!-- Print the date in ISO 8601 format -->
49 <!-- <conversionPattern value=""%date [%thread] %-5level %logger %ndc - %message%newline"" /> -->
50 <conversionPattern value=""%date %message%newline"" />
54 <!-- Set root logger level to DEBUG and its only appender to A1 -->
56 <level value=""DEBUG"" />
57 <appender-ref ref=""A1"" />
61 private static MemoryStream DisableLoggingConfigStream
63 Encoding.UTF8.GetBytes(
69 "<log4net><root/></log4net>"));
77 catch(ArgumentException)
90 StackTrace stackTrace =
new StackTrace();
92 Console.WriteLine(
"===> In Test Method : {0} <===", stackTrace.GetFrame(1).GetMethod().Name);
97 log4net.Config.XmlConfigurator.Configure(EnableLoggingConfigStream);
98 EnableLoggingConfigStream.Position = 0;
112 log4net.Config.XmlConfigurator.Configure(DisableLoggingConfigStream);
113 DisableLoggingConfigStream.Position = 0;
130 string rawUuid = stem.PadRight(32,
'0');
132 return UUID.Parse(rawUuid);
142 return new UUID(
string.Format(
"00000000-0000-0000-0000-{0:X12}", tail));
159 string rawUuid = stem.PadLeft(32,
'0');
161 return UUID.Parse(rawUuid);
static UUID ParseTail(string stem)
Parse a UUID tail section into a full UUID.
static void InMethod()
A debugging method that can be used to print out which test method you are in
static UUID ParseStem(string stem)
Parse a UUID stem into a full UUID.
static UUID ParseTail(int tail)
Parse tail section into full UUID.
static void EnableLogging()
static bool AssertThisDelegateCausesArgumentException(TestDelegate d)
static void DisableLogging()
Disable logging whilst running the tests.