Inheritance: ITransportFactory
Exemplo n.º 1
0
 public void CreationFailMockTransportTest()
 {
     MockTransportFactory factory = new MockTransportFactory();
     
     Uri location = new Uri("mock://0.0.0.0:61616?transport.failOnCreate=true");
     
     factory.CreateTransport(location);
 }
Exemplo n.º 2
0
 public void CreateMockTransportWithParamsTest()
 {
     MockTransportFactory factory = new MockTransportFactory();
     
     Uri location = new Uri("mock://0.0.0.0:61616?transport.failOnSendMessage=true&transport.numSentMessagesBeforeFail=20");
     
     MockTransport transport = (MockTransport) factory.CompositeConnect(location);
     
     Assert.IsNotNull(transport);
     Assert.IsTrue(transport.FailOnSendMessage);
     Assert.AreEqual(20, transport.NumSentMessagesBeforeFail);
 }
Exemplo n.º 3
0
        public void CreateMockTransportTest()
        {
            MockTransportFactory factory = new MockTransportFactory();
            
            Uri location = new Uri("mock://0.0.0.0:61616");
            
            ITransport transport = factory.CreateTransport(location);
            
            Assert.IsNotNull(transport);
			Assert.IsInstanceOf<MockTransport>(transport.Narrow(typeof(MockTransport)));
            MockTransport mock = (MockTransport) transport.Narrow(typeof(MockTransport));

            Assert.IsTrue( mock.IsConnected );
            Assert.IsFalse( mock.IsFaultTolerant );
        }
Exemplo n.º 4
0
        public void SetUp()
        {
            this.received = new List<Command>();
            this.exceptions = new List<Exception>();

            Uri uri = new Uri("mock://mock?wireformat=openwire");
            MockTransportFactory factory = new MockTransportFactory();

            this.transport = factory.CompositeConnect( uri ) as MockTransport;

            this.localWireFormatInfo = new WireFormatInfo();

            this.localWireFormatInfo.Version = 5;
            this.localWireFormatInfo.MaxInactivityDuration = 3000;
            this.localWireFormatInfo.TightEncodingEnabled = false;
        }