예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup() throws javax.management.NotCompliantMBeanException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void Setup()
        {
            DataSourceManager dataSourceManager = new DataSourceManager(Config.defaults());

            _fileSystem = new DefaultFileSystemAbstraction();
            _kernelData = new TestHighlyAvailableKernelData(this, dataSourceManager);
            ManagementData data = new ManagementData(_bean, _kernelData, ManagementSupport.load());

            NeoStoreDataSource dataSource = mock(typeof(NeoStoreDataSource));

            when(dataSource.DatabaseLayout).thenReturn(TestDirectory.databaseLayout());
            dataSourceManager.Register(dataSource);
            when(dataSource.DependencyResolver).thenReturn(_dependencies);
            _dependencies.satisfyDependency(DatabaseInfo.HA);
            _haBean = ( HighAvailability )(new HighAvailabilityBean()).CreateMBean(data);
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldAccessHaBeans()
        public virtual void ShouldAccessHaBeans()
        {
            ManagedCluster cluster = ClusterRule.startCluster();

            // High Availability bean
            HighAvailability ha = ha(cluster.Master);

            assertNotNull("could not get ha bean", ha);
            AssertMasterInformation(ha);
            AssertMasterAndSlaveInformation(ha.InstancesInCluster);
            foreach (ClusterMemberInfo info in ha.InstancesInCluster)
            {
                assertTrue(info.Alive);
                assertTrue(info.Available);
            }

            // Branched data bean
            BranchedStore bs = Beans(cluster.Master).BranchedStoreBean;

            assertNotNull("could not get branched store bean", bs);
        }
예제 #3
0
 private void AssertMasterInformation(HighAvailability ha)
 {
     assertTrue("should be available", ha.Available);
     assertEquals("should be master", HighAvailabilityModeSwitcher.MASTER, ha.Role);
 }