示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldEnableShufflingOfDelegate() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldEnableShufflingOfDelegate()
        {
            // given
            Config config = Config.builder().withSetting(CausalClusteringSettings.load_balancing_plugin, DUMMY_PLUGIN_NAME).withSetting(CausalClusteringSettings.load_balancing_shuffle, "true").build();

            // when
            LoadBalancingProcessor plugin = LoadBalancingPluginLoader.Load(mock(typeof(TopologyService)), mock(typeof(LeaderLocator)), NullLogProvider.Instance, config);

            // then
            assertTrue(plugin is ServerShufflingProcessor);
            assertTrue((( ServerShufflingProcessor )plugin).@delegate() is DummyLoadBalancingPlugin);
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldFindServerPoliciesPlugin() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldFindServerPoliciesPlugin()
        {
            // given
            Config config = Config.builder().withSetting(CausalClusteringSettings.load_balancing_plugin, ServerPoliciesPlugin.PLUGIN_NAME).withSetting(CausalClusteringSettings.load_balancing_shuffle, "false").build();

            // when
            LoadBalancingProcessor plugin = LoadBalancingPluginLoader.Load(mock(typeof(TopologyService)), mock(typeof(LeaderLocator)), NullLogProvider.Instance, config);

            // then
            assertTrue(plugin is ServerPoliciesPlugin);
            assertEquals(ServerPoliciesPlugin.PLUGIN_NAME, (( ServerPoliciesPlugin )plugin).pluginName());
        }
示例#3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnSelectedPlugin() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldReturnSelectedPlugin()
        {
            // given
            Config config = Config.builder().withSetting(CausalClusteringSettings.load_balancing_plugin, DUMMY_PLUGIN_NAME).withSetting(CausalClusteringSettings.load_balancing_shuffle, "false").build();

            // when
            LoadBalancingProcessor plugin = LoadBalancingPluginLoader.Load(mock(typeof(TopologyService)), mock(typeof(LeaderLocator)), NullLogProvider.Instance, config);

            // then
            assertTrue(plugin is DummyLoadBalancingPlugin);
            assertEquals(DUMMY_PLUGIN_NAME, (( DummyLoadBalancingPlugin )plugin).PluginName());
            assertTrue((( DummyLoadBalancingPlugin )plugin).WasInitialized);
        }
示例#4
0
 public ServerShufflingProcessor(LoadBalancingProcessor @delegate)
 {
     this.@delegate = @delegate;
 }