StartServer() public method

Start the temporary Db4o server file
public StartServer ( ) : void
return void
Esempio n. 1
0
        public void ListConnectedClients_SingleRunningServerWithNoConnectedClients_ReturnsEmptyCollection()
        {
            using (var db4OServerFile = new TemporaryDb4OServerFile(m_db4OServerInfo))
            {
                db4OServerFile.StartServer();

                // The test.
                Assert.AreEqual(0, m_db4OServerInfo.ListConnectedClients(db4OServerFile.ProjectName).Count());

                db4OServerFile.StopServer();
            }
        }
        public void ProjectNames_LocalhostServiceIsRunning_ProjectsReturned()
        {
            ClientServerServices.Current.Local.SetProjectSharing(true, m_progress);

            using (var db4OServerFile = new TemporaryDb4OServerFile(m_db4OServerInfo))
            {
                db4OServerFile.StartServer();

                Assert.Greater(ClientServerServices.Current.ProjectNames("127.0.0.1").Length, 0,
                               "At least one project should have been found.");

                db4OServerFile.StopServer();
            }
        }
Esempio n. 3
0
        public void StopServer_ServerIsRunningWithConnectedClient_ReturnsFalse()
        {
            using (var db4OServerFile = new TemporaryDb4OServerFile(m_db4OServerInfo))
            {
                db4OServerFile.StartServer();

                using (var dummyLocalConnectedClient = db4OServerFile.ConnectADummyClient())
                {
                    Assert.IsFalse(m_db4OServerInfo.StopServer(db4OServerFile.ProjectName),
                                   "Server should not stop because a client is connected");
                }

                Assert.IsTrue(m_db4OServerInfo.StopServer(db4OServerFile.ProjectName),
                              "Server should stop because client is not connected - (this may be a unit test timing issue)");
            }
        }
Esempio n. 4
0
        public void ListConnectedClients_SingleConnectedClientDoNotSpecifyProjectName_ReturnsSingleClientIpAddress()
        {
            using (var db4OServerFile = new TemporaryDb4OServerFile(m_db4OServerInfo))
            {
                db4OServerFile.StartServer();

                int existingConnectedClientsCount = m_db4OServerInfo.ListConnectedClients().Count();

                using (var dummyClient = db4OServerFile.ConnectADummyClient())
                {
                    // The test.
                    Assert.AreEqual(existingConnectedClientsCount + 1, m_db4OServerInfo.ListConnectedClients().Count());
                }

                db4OServerFile.StopServer();
            }
        }
Esempio n. 5
0
		public void ListConnectedClients_SingleConnectedClientDoNotSpecifyProjectName_ReturnsSingleClientIpAddress()
		{
			using (var db4OServerFile = new TemporaryDb4OServerFile(m_db4OServerInfo))
			{
				db4OServerFile.StartServer();

				int existingConnectedClientsCount = m_db4OServerInfo.ListConnectedClients().Count();

				using (var dummyClient = db4OServerFile.ConnectADummyClient())
				{
					// The test.
					Assert.AreEqual(existingConnectedClientsCount + 1, m_db4OServerInfo.ListConnectedClients().Count());
				}

				db4OServerFile.StopServer();
			}
		}
Esempio n. 6
0
		public void ListConnectedClients_SingleRunningServerWithNoConnectedClients_ReturnsEmptyCollection()
		{
			using (var db4OServerFile = new TemporaryDb4OServerFile(m_db4OServerInfo))
			{
				db4OServerFile.StartServer();

				// The test.
				Assert.AreEqual(0, m_db4OServerInfo.ListConnectedClients(db4OServerFile.ProjectName).Count());

				db4OServerFile.StopServer();
			}
		}
Esempio n. 7
0
		public void StopServer_ServerIsRunningWithConnectedClient_ReturnsFalse()
		{
			using (var db4OServerFile = new TemporaryDb4OServerFile(m_db4OServerInfo))
			{
				db4OServerFile.StartServer();

				using (var dummyLocalConnectedClient = db4OServerFile.ConnectADummyClient())
				{
					Assert.IsFalse(m_db4OServerInfo.StopServer(db4OServerFile.ProjectName),
						"Server should not stop because a client is connected");
				}

				Assert.IsTrue(m_db4OServerInfo.StopServer(db4OServerFile.ProjectName),
					"Server should stop because client is not connected - (this may be a unit test timing issue)");
			}
		}
		public void ProjectNames_LocalhostServiceIsRunning_ProjectsReturned()
		{
			ClientServerServices.Current.Local.SetProjectSharing(true, m_progress);

			using (var db4OServerFile = new TemporaryDb4OServerFile(m_db4OServerInfo))
			{
				db4OServerFile.StartServer();

				Assert.Greater(ClientServerServices.Current.ProjectNames("127.0.0.1").Length, 0,
					"At least one project should have been found.");

				db4OServerFile.StopServer();
			}
		}