示例#1
0
        public static int Main(string[] args)
        {
            AmqpTrace.TraceLevel = TraceLevel.Output;
            AmqpTrace.TraceListener = Program.WriteTrace;
            Connection.DisableServerCertValidation = true;

            TestAmqpBroker broker = null;
            if (args.Length == 0)
            {
                Environment.SetEnvironmentVariable("CoreBroker", "1");
                TestTarget target = new TestTarget();
                Address address = target.Address;
                broker = new TestAmqpBroker(new string[] { target.address },
                    string.Join(":", address.User, address.Password), null, null);
                broker.Start();
            }
            else
            {
                Environment.SetEnvironmentVariable("CoreBroker", "0");
            }

            try
            {
                return TestRunner.RunTests();
            }
            finally
            {
                if (broker != null)
                {
                    broker.Stop();
                }
            }
        }
示例#2
0
 public TestQueue(TestAmqpBroker broker)
 {
     this.broker     = broker;
     this.messages   = new LinkedList <BrokerMessage>();
     this.waiters    = new LinkedList <Consumer>();
     this.publishers = new Dictionary <int, Publisher>();
     this.consumers  = new Dictionary <int, Consumer>();
     this.syncRoot   = this.waiters;
 }
示例#3
0
 public TestQueue(TestAmqpBroker broker, string address, bool isImplicit = false)
 {
     this.broker      = broker;
     this.address     = address;
     this.isImplicit  = isImplicit;
     this.connections = isImplicit ? new HashSet <Connection>() : null;
     this.messages    = new LinkedList <BrokerMessage>();
     this.waiters     = new LinkedList <Consumer>();
     this.publishers  = new Dictionary <int, Publisher>();
     this.consumers   = new Dictionary <int, Consumer>();
     this.syncRoot    = new object();
 }
 public TestQueue(TestAmqpBroker broker)
 {
     this.broker = broker;
     this.messages = new LinkedList<BrokerMessage>();
     this.waiters = new Queue<Consumer>();
     this.publishers = new Dictionary<int, Publisher>();
     this.consumers = new Dictionary<int, Consumer>();
     this.syncRoot = this.waiters;
 }