Example #1
0
        public void CallRemotService()
        {
            IBankA service = (IBankA)
                             Activator.GetObject(typeof(IBankA), "tcp://localhost:2133/BankA");

            Assert.IsTrue(RemotingServices.IsTransparentProxy(service));
            Assert.IsTrue(RemotingServices.IsObjectOutOfAppDomain(service));

            service.GetBankAccount("test");
        }
Example #2
0
		public void TearDown()
		{
			container.Release(myBankA);
			container.Release(myBankB);
			myBankA=null;
			myBankB=null;

			Configuration cfg = (Configuration) container[  "nhibernate.factory.cfg" ];
			SchemaExport export = new SchemaExport(cfg);
			export.Drop(false, true);

			DisposeContainer();
		}
Example #3
0
		public void SetUp()
		{
			SetContainer();
			Configuration cfg = (Configuration) container[  "nhibernate.factory.cfg"  ];
			SchemaExport export = new SchemaExport(cfg);
			export.Create(false, true);

// It is not possible to add the transaction component here! See http://forum.castleproject.org/posts/list/455.page		
//			container.AddFacility( "transactions", new TransactionFacility() );

			myBankA = (IBankA) container["BankA"];
			myBankB = (IBankB) container["BankB"];
		}
Example #4
0
        public void TearDown()
        {
            container.Release(myBankA);
            container.Release(myBankB);
            myBankA = null;
            myBankB = null;

            Configuration cfg    = (Configuration)container["nhibernate.factory.cfg"];
            SchemaExport  export = new SchemaExport(cfg);

            export.Drop(false, true);

            DisposeContainer();
        }
Example #5
0
        public void SetUp()
        {
            SetContainer();
            Configuration cfg    = (Configuration)container["nhibernate.factory.cfg"];
            SchemaExport  export = new SchemaExport(cfg);

            export.Create(false, true);

// It is not possible to add the transaction component here! See http://forum.castleproject.org/posts/list/455.page
//			container.AddFacility( "transactions", new TransactionFacility() );

            myBankA = (IBankA)container["BankA"];
            myBankB = (IBankB)container["BankB"];
        }
Example #6
0
        public void TestTransactionCreationEComp()
        {
            ISessionManager sessionManager = (ISessionManager)
                                             container[typeof(ISessionManager)];

            using (ISession session = sessionManager.OpenSession())
            {
                Assert.IsNull(session.Transaction);

                IBankA myBankA = (IBankA)container["BankA"];
                myBankA.TestTransactionCreation();

                Assert.IsTrue(session.Transaction.WasCommitted);
            }
        }