Esempio n. 1
0
        public Memory(IAddressBus addressBus, IDataBus dataBus)
        {
            _addressBus = addressBus;
            _dataBus    = dataBus;

            _memoryArea = new byte[0xFFFF + 1];
        }
Esempio n. 2
0
        public void SetUp()
        {
            testSender = MockRepository.GenerateStub<ISendMessages>();

            messagePersister = new InMemoryPersistence();
            dataBusForTheReceivingSide = new FileShareDataBus(DATABUS_DIRECTORY);

            HttpChannelReceiver = new HttpChannelReceiver(messagePersister)
                                      {
                                          ListenUrl = "http://localhost:8092/Gateway/",
                                          DataBus = dataBusForTheReceivingSide
                              };

            HttpChannelReceiver.MessageReceived += httpChannel_MessageReceived;

            HttpChannelReceiver.Start();

            bus = Configure.With()
                .DefaultBuilder()
                .XmlSerializer()
                .FileShareDataBus(DATABUS_DIRECTORY_FOR_THE_TEST_ENDPOINT)
                .InMemoryFaultManagement()
                .UnicastBus()
                .MsmqTransport()
                .CreateBus()
                .Start();
        }
Esempio n. 3
0
 public InputUserScreen(IPresenter presenter, Func <IMainScreen> mainScreen, UserFacade userFacade, IDataBus dataBus)
 {
     this.presenter  = presenter;
     this.mainScreen = new Lazy <IMainScreen>(mainScreen);
     this.userFacade = userFacade;
     this.dataBus    = dataBus;
 }
Esempio n. 4
0
        public void SetUp()
        {
            testSender = MockRepository.GenerateStub <ISendMessages>();

            messagePersister           = new InMemoryPersistence();
            dataBusForTheReceivingSide = new FileShareDataBus(DATABUS_DIRECTORY);

            HttpChannelReceiver = new HttpChannelReceiver(messagePersister)
            {
                ListenUrl = "http://localhost:8092/Gateway/",
                DataBus   = dataBusForTheReceivingSide
            };

            HttpChannelReceiver.MessageReceived += httpChannel_MessageReceived;

            HttpChannelReceiver.Start();


            bus = Configure.With()
                  .DefaultBuilder()
                  .XmlSerializer()
                  .FileShareDataBus(DATABUS_DIRECTORY_FOR_THE_TEST_ENDPOINT)
                  .InMemoryFaultManagement()
                  .UnicastBus()
                  .MsmqTransport()
                  .CreateBus()
                  .Start();
        }
Esempio n. 5
0
 public SelectUserScreen(IPresenter presenter, Func <IMainScreen> mainScreen, IDataBus dataBus, IUsersRepository usersRepository)
 {
     this.presenter       = presenter;
     this.mainScreen      = new Lazy <IMainScreen>(mainScreen);
     this.dataBus         = dataBus;
     this.usersRepository = usersRepository;
 }
 static async Task <DataBusAttachment> CreateAttachment(IDataBus dataBus, string text, Dictionary <string, string> optionalMetadata = null)
 {
     using (var source = new MemoryStream(Encoding.UTF8.GetBytes(text)))
     {
         return(await dataBus.CreateAttachment(source, optionalMetadata));
     }
 }
Esempio n. 7
0
 /// <summary>
 /// Creates the fake advanced API, using the given implementation(s). All arguments are optional
 /// </summary>
 public FakeAdvancedApi(IWorkersApi workers = null, ITopicsApi topics = null, IRoutingApi routing = null, ITransportMessageApi transportMessage = null, IDataBus dataBus = null)
 {
     _workers = workers;
     _topics = topics;
     _routing = routing;
     _transportMessage = transportMessage;
     _dataBus = dataBus;
 }
Esempio n. 8
0
 /// <summary>
 /// Creates the fake advanced API, using the given implementation(s). All arguments are optional
 /// </summary>
 public FakeAdvancedApi(IWorkersApi workers = null, ITopicsApi topics = null, IRoutingApi routing = null, ITransportMessageApi transportMessage = null, IDataBus dataBus = null)
 {
     _workers          = workers;
     _topics           = topics;
     _routing          = routing;
     _transportMessage = transportMessage;
     _dataBus          = dataBus;
 }
Esempio n. 9
0
 public MainScreen(Func <ISelectUserScreen> selectUserScreen, Func <IInputUserScreen> inputUserScreen, Func <IProductsListScreen> productsScreen, IPresenter presenter, IDataBus dataBus)
 {
     this.selectUserScreen = new Lazy <ISelectUserScreen>(selectUserScreen);
     this.inputUserScreen  = new Lazy <IInputUserScreen>(inputUserScreen);
     this.productsScreen   = new Lazy <IProductsListScreen>(productsScreen);
     this.presenter        = presenter;
     this.dataBus          = dataBus;
 }
Esempio n. 10
0
 public ProductScreen(IProductsRepository productsRepository, TransactionsFacade transactionsFacade, Func <IMainScreen> mainScreen, IDataBus dataBus, IPresenter presenter, IUsersRepository usersRepository)
 {
     this.productsRepository = productsRepository;
     this.transactionsFacade = transactionsFacade;
     this.mainScreen         = new Lazy <IMainScreen>(mainScreen);
     this.dataBus            = dataBus;
     this.presenter          = presenter;
     this.usersRepository    = usersRepository;
 }
Esempio n. 11
0
 public void SetUp()
 {
     dataBus = new InMemoryDataBus();
     messageMutator = new DataBusMessageMutator(dataBus, new DefaultDatabusSerializer());
     testMessage = new TestMessage
                   	{
                   		Blob = new DataBusProperty<byte[]>(testBlob),
                   		LargeString = new DataBusProperty<string>(testString),
                   		DataBusPropertyWithNullPayload = new DataBusProperty<string>(null)
                     };
 }
Esempio n. 12
0
 public void SetUp()
 {
     dataBus        = new InMemoryDataBus();
     messageMutator = new DataBusMessageMutator(dataBus, new DefaultDatabusSerializer());
     testMessage    = new TestMessage
     {
         Blob        = new DataBusProperty <byte[]>(testBlob),
         LargeString = new DataBusProperty <string>(testString),
         DataBusPropertyWithNullPayload = new DataBusProperty <string>(null)
     };
 }
        static async Task <string> LoadAttachment(IDataBus dataBus, string id)
        {
            using (var destination = new MemoryStream())
            {
                using (var source = await dataBus.OpenRead(id))
                {
                    await source.CopyToAsync(destination);
                }

                return(Encoding.UTF8.GetString(destination.ToArray()));
            }
        }
Esempio n. 14
0
        public void SetUp()
        {
            ExtensionMethods.SetHeaderAction = headerManager.SetHeader;
            ExtensionMethods.GetHeaderAction = headerManager.GetHeader;

            dataBus = MockRepository.GenerateMock <IDataBus>();

            var databusMutator = new DataBusMessageMutator(dataBus, new DefaultDataBusSerializer());

            incomingMutator = databusMutator;
            outgoingMutator = databusMutator;
        }
Esempio n. 15
0
        public void SetUp()
        {
            ExtensionMethods.SetHeaderAction = headerManager.SetHeader;
            ExtensionMethods.GetHeaderAction = headerManager.GetHeader;

            dataBus = MockRepository.GenerateMock<IDataBus>();

            var databusMutator = new DataBusMessageMutator(dataBus, new DefaultDataBusSerializer());

            incomingMutator = databusMutator;
            outgoingMutator = databusMutator;
        }
Esempio n. 16
0
 /// <summary>
 /// Constructs the bus.
 /// </summary>
 public RebusBus(IWorkerFactory workerFactory, IRouter router, ITransport transport, IPipelineInvoker pipelineInvoker, ISubscriptionStorage subscriptionStorage, Options options, IRebusLoggerFactory rebusLoggerFactory, BusLifetimeEvents busLifetimeEvents, IDataBus dataBus)
 {
     _workerFactory       = workerFactory;
     _router              = router;
     _transport           = transport;
     _pipelineInvoker     = pipelineInvoker;
     _subscriptionStorage = subscriptionStorage;
     _options             = options;
     _busLifetimeEvents   = busLifetimeEvents;
     _dataBus             = dataBus;
     _log = rebusLoggerFactory.GetLogger <RebusBus>();
 }
Esempio n. 17
0
 public StoringDataConsumer(IDataBus dataBus, IDataStorage dataStorage)
 {
     if (dataBus == null)
     {
         throw new ArgumentNullException("dataBus");
     }
     if (dataStorage == null)
     {
         throw new ArgumentNullException("dataStorage");
     }
     m_DataBus     = dataBus;
     m_DataStorage = dataStorage;
 }
 public DataTicker(IDataStorage dataStorage, IDataBus dataBus)
 {
     if (dataStorage == null)
     {
         throw new ArgumentNullException("dataStorage");
     }
     if (dataBus == null)
     {
         throw new ArgumentNullException("dataBus");
     }
     m_DataStorage  = dataStorage;
     m_Subscription = dataBus.Subscribe <TimedData>(notifyClients);
     m_HubContext   = GlobalHost.ConnectionManager.GetHubContext <DataTickerHub>();
 }
Esempio n. 19
0
        public ProductsListScreen(IProductsRepository productsRepository,
                                  IPresenter presenter,
                                  Func <IMainScreen> mainScreen,
                                  IDataBus dataBus,
                                  Func <IProductScreen> productScreen)
        {
            this.productsRepository = productsRepository;
            this.presenter          = presenter;
            this.mainScreen         = new Lazy <IMainScreen>(mainScreen);
            this.dataBus            = dataBus;
            this.productScreen      = new Lazy <IProductScreen>(productScreen);

            dataBus.Remove(Constants.DataKeys.SelectedProduct);
        }
Esempio n. 20
0
        public Cpu6502(IAddressBus addressBus, IDataBus dataBus)
        {
            _addressBus     = addressBus;
            _dataBus        = dataBus;
            _instructionSet = new InstructionSet();

            // Set a temp init state for CPU to start executing.
            PC = 0x0500;
            IR = 0x00;

            LoadAddress(PC);
            RW     = true; // Read
            TState = EnumTstate.T1;
        }
Esempio n. 21
0
        public void SetUp()
        {
            dataBus = MockRepository.GenerateMock <IDataBus>();

            receiveBehavior = new DataBusReceiveBehavior
            {
                DataBus           = dataBus,
                DataBusSerializer = new DefaultDataBusSerializer()
            };

            sendBehavior = new DataBusSendBehavior
            {
                DataBus           = dataBus,
                DataBusSerializer = new DefaultDataBusSerializer()
            };
        }
Esempio n. 22
0
        public void SetUp()
        {
            dataBus = MockRepository.GenerateMock<IDataBus>();

            receiveBehavior = new DataBusReceiveBehavior
            {
                DataBus = dataBus,
                DataBusSerializer = new DefaultDataBusSerializer()
            };

            sendBehavior = new DataBusSendBehavior
            {
                DataBus = dataBus,
                DataBusSerializer = new DefaultDataBusSerializer()
            };
        }
Esempio n. 23
0
        /// <summary>
        /// Constructs the bus.
        /// </summary>
        public RebusBus(IWorkerFactory workerFactory, IRouter router, ITransport transport, IPipelineInvoker pipelineInvoker, ISubscriptionStorage subscriptionStorage, Options options, IRebusLoggerFactory rebusLoggerFactory, BusLifetimeEvents busLifetimeEvents, IDataBus dataBus)
        {
            _workerFactory       = workerFactory;
            _router              = router;
            _transport           = transport;
            _pipelineInvoker     = pipelineInvoker;
            _subscriptionStorage = subscriptionStorage;
            _options             = options;
            _busLifetimeEvents   = busLifetimeEvents;
            _dataBus             = dataBus;
            _log = rebusLoggerFactory.GetLogger <RebusBus>();

            var defaultBusName = $"Rebus {Interlocked.Increment(ref _busIdCounter)}";

            _busName = options.OptionalBusName ?? defaultBusName;
        }
 public DataProducer(IDataBus dataBus, IDataGenerator dataGenerator, int period = 3)
 {
     if (dataBus == null)
     {
         throw new ArgumentNullException("dataBus");
     }
     if (dataGenerator == null)
     {
         throw new ArgumentNullException("dataGenerator");
     }
     if (period <= 0)
     {
         throw new ArgumentException("period must be a positive value in seconds", "period");
     }
     m_DataBus       = dataBus;
     m_DataGenerator = dataGenerator;
     m_Period        = period;
 }
Esempio n. 25
0
 public DataBusPropertyOffloader(
     IDataBus dataBus,
     IDataBusSerializer dataBusSerializer,
     IDataBusSettings dataBusSettings)
 {
     if (dataBus == null)
     {
         throw new ArgumentNullException("dataBus");
     }
     if (dataBusSerializer == null)
     {
         throw new ArgumentNullException("dataBusSerializer");
     }
     if (dataBusSettings == null)
     {
         throw new ArgumentNullException("dataBusSettings");
     }
     _dataBus           = dataBus;
     _dataBusSerializer = dataBusSerializer;
     _dataBusSettings   = dataBusSettings;
 }
Esempio n. 26
0
 public DataBusMessageMutator(IDataBus dataBus, IDataBusSerializer serializer)
 {
     this.dataBus    = dataBus;
     this.serializer = serializer;
 }
Esempio n. 27
0
 public SingleCallChannelForwarder(Func <string, IChannelSender> senderFactory, IDataBus databus)
 {
     this.senderFactory = senderFactory;
     this.databus       = databus;
 }
Esempio n. 28
0
 /// <summary>
 /// Creates the step
 /// </summary>
 public DehydrateOutgoingMessageStep(IDataBus dataBus, int messageSizeLimitBytes)
 {
     _dataBus = dataBus;
     _messageSizeLimitBytes = messageSizeLimitBytes;
 }
Esempio n. 29
0
        public void SetUp()
        {
            dataBus = MockRepository.GenerateMock <IDataBus>();

            mutator = new DataBusMessageMutator(dataBus, new DefaultDatabusSerializer());
        }
Esempio n. 30
0
 public SingleCallChannelReceiver(Func <string, IChannelReceiver> channelFactory, IDeduplicateMessages deduplicator, IDataBus databus)
 {
     this.channelFactory = channelFactory;
     this.deduplicator   = deduplicator;
     this.databus        = databus;
     headerManager       = new DataBusHeaderManager();
 }
Esempio n. 31
0
 public IDataBusInitializer(IDataBus dataBus)
 {
     this.dataBus = dataBus;
 }
Esempio n. 32
0
 public Application(IMainScreen startScreen, IPresenter presenter, IDataBus dataBus)
 {
     this.presenter     = presenter;
     this.currentScreen = startScreen;
     this.dataBus       = dataBus;
 }
Esempio n. 33
0
 /// <summary>
 /// Creates the step
 /// </summary>
 public HydrateIncomingMessageStep(IDataBus dataBus)
 {
     _dataBus = dataBus ?? throw new ArgumentNullException(nameof(dataBus));
 }
Esempio n. 34
0
 public DataBusMessageMutator(IDataBus dataBus, IDataBusSerializer serializer)
 {
     this.dataBus = dataBus;
     this.serializer = serializer;
 }
Esempio n. 35
0
 /// <summary>
 /// Creates the step
 /// </summary>
 public HydrateIncomingMessageStep(IDataBus dataBus)
 {
     _dataBus = dataBus;
 }
Esempio n. 36
0
 public DataBusSendBehavior(IDataBus databus, IDataBusSerializer serializer, Conventions conventions)
 {
     this.conventions  = conventions;
     dataBusSerializer = serializer;
     dataBus           = databus;
 }
        public void SetUp()
        {
            dataBus = MockRepository.GenerateMock<IDataBus>();

            mutator = new DataBusMessageMutator(dataBus, new DefaultDatabusSerializer());
        }