Refactored the Kernel registration fluent interface to be more readable, better suppo...
[castle.git] / Tools / ManagedExtensions / ManagementExtensionsTest / MServerFactoryTestCase.cs
blob3e367904b43e0b885205e1b793edd25a8489f361
1 // Copyright 2003-2004 DigitalCraftsmen - http://www.digitalcraftsmen.com.br/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.ManagementExtensions.Test
17 using System;
18 using System.Runtime.Remoting;
20 using NUnit.Framework;
22 using Castle.ManagementExtensions;
24 /// <summary>
25 /// Summary description for MServerFactoryTestCase.
26 /// </summary>
27 [TestFixture]
28 public class MServerFactoryTestCase : Assertion
30 public MServerFactoryTestCase()
34 [Test]
35 public void MBeanInstantiation()
37 MServer server = null;
39 try
41 server = MServerFactory.CreateServer(false);
42 AssertNotNull(server);
43 Assert( !RemotingServices.IsTransparentProxy(server) );
45 finally
47 MServerFactory.Release(server);
51 [Test]
52 public void MBeanInstantiationWithinAppDomain()
54 MServer server = null;
56 try
58 server = MServerFactory.CreateServer(true);
59 AssertNotNull(server);
60 Assert( RemotingServices.IsTransparentProxy(server) );
62 finally
64 MServerFactory.Release(server);