Exemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReportWhenClusterStateDirectoryIsNotPresent() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldReportWhenClusterStateDirectoryIsNotPresent()
        {
            // given
            CreateUnlockedFakeDbDir(_homeDir);
            UnbindFromClusterCommand command = new UnbindFromClusterCommand(_homeDir, _confDir, _outsideWorld);

            command.Execute(DatabaseNameParameter(GraphDatabaseSettings.DEFAULT_DATABASE_NAME));
            verify(_outsideWorld).stdErrLine("This instance was not bound. No work performed.");
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldIgnoreIfSpecifiedDatabaseDoesNotExist() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldIgnoreIfSpecifiedDatabaseDoesNotExist()
        {
            // given
            File clusterStateDir             = CreateClusterStateDir(_fs);
            UnbindFromClusterCommand command = new UnbindFromClusterCommand(_homeDir, _confDir, _outsideWorld);

            // when
            command.Execute(DatabaseNameParameter("doesnotexist.db"));

            // then
            assertFalse(_fs.fileExists(clusterStateDir));
        }
Exemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldRemoveClusterStateDirectoryForGivenDatabase() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldRemoveClusterStateDirectoryForGivenDatabase()
        {
            // given
            File clusterStateDir = CreateClusterStateDir(_fs);

            CreateUnlockedFakeDbDir(_homeDir);
            UnbindFromClusterCommand command = new UnbindFromClusterCommand(_homeDir, _confDir, _outsideWorld);

            // when
            command.Execute(DatabaseNameParameter("graph.db"));

            // then
            assertFalse(_fs.fileExists(clusterStateDir));
        }
Exemplo n.º 4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldFailToUnbindLiveDatabase() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldFailToUnbindLiveDatabase()
        {
            // given
            CreateClusterStateDir(_fs);
            UnbindFromClusterCommand command = new UnbindFromClusterCommand(_homeDir, _confDir, _outsideWorld);

            FileLock fileLock = CreateLockedFakeDbDir(_homeDir);

            try
            {
                // when
                command.Execute(DatabaseNameParameter(GraphDatabaseSettings.DEFAULT_DATABASE_NAME));
                fail();
            }
            catch (CommandFailed e)
            {
                // then
                assertThat(e.Message, containsString("Database is currently locked. Please shutdown Neo4j."));
            }
            finally
            {
                fileLock.release();
            }
        }
Exemplo n.º 5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Override @Nonnull public org.neo4j.commandline.arguments.Arguments allArguments()
        public override Arguments AllArguments()
        {
            return(UnbindFromClusterCommand.Arguments());
        }
Exemplo n.º 6
0
 internal UnbindFailureException(UnbindFromClusterCommand outerInstance, Exception e) : base(e)
 {
     this._outerInstance = outerInstance;
 }