Exemplo n.º 1
0
 private byte[] EncodeInfo(CallbackObjectInfoCollections callbackInfo, ByteArrayOutputStream
     os)
 {
     EncodeObjectInfoCollection(os, callbackInfo.added, new InternalIDEncoder
         (this));
     EncodeObjectInfoCollection(os, callbackInfo.deleted, new FrozenObjectInfoEncoder
         (this));
     EncodeObjectInfoCollection(os, callbackInfo.updated, new InternalIDEncoder
         (this));
     return os.ToByteArray();
 }
Exemplo n.º 2
0
		/// <exception cref="System.Security.SecurityException"></exception>
		/// <exception cref="System.MissingMethodException"></exception>
		public virtual void TestPrintWriterLogger()
		{
			ByteArrayOutputStream bout = new ByteArrayOutputStream();
			PrintWriterLoggerInterceptor interceptor = new PrintWriterLoggerInterceptor(new PrintWriter
				(bout, true));
			Logger.Intercept(interceptor);
			ILogging logger = Logger.Get(typeof(LoggingTestCase.ITestLogger));
			((LoggingTestCase.ITestLogger)logger.Debug()).Msg();
			((LoggingTestCase.ITestLogger)logger.Info()).Msg();
			string actual = Platform4.AsUtf8(bout.ToByteArray());
			string debugMsg = PrintWriterLoggerInterceptor.FormatMessage(Logger.Debug, "msg", 
				null);
			string infoMsg = PrintWriterLoggerInterceptor.FormatMessage(Logger.Info, "msg", null
				);
			Assert.IsTrue((actual.IndexOf(debugMsg) >= 0));
			Assert.IsTrue((actual.IndexOf(infoMsg) >= 0));
		}