Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldListExpectedFilesCorrectly() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldListExpectedFilesCorrectly()
        {
            // given (setup) required runtime subject dependencies
            NeoStoreDataSource  neoStoreDataSource  = GetNeoStoreDataSource(_graphDb);
            SimpleCatchupClient simpleCatchupClient = new SimpleCatchupClient(_graphDb, _fsa, _catchupClient, _catchupServer, _temporaryDirectory, _logProvider);

            // when
            PrepareStoreCopyResponse prepareStoreCopyResponse = simpleCatchupClient.RequestListOfFilesFromServer();

            simpleCatchupClient.Close();

            // then
            ListOfDownloadedFilesMatchesServer(neoStoreDataSource, prepareStoreCopyResponse.Files);

            // and downloaded files are identical to source
            IList <File> expectedCountStoreFiles = ListServerExpectedNonReplayableFiles(neoStoreDataSource);

            foreach (File storeFileSnapshot in expectedCountStoreFiles)
            {
                FileContentEquals(DatabaseFileToClientFile(storeFileSnapshot), storeFileSnapshot);
            }

            // and
            AssertTransactionIdMatches(prepareStoreCopyResponse.LastTransactionId());

            //and
            assertTrue("Expected an empty set of ids. Found size " + prepareStoreCopyResponse.IndexIds.size(), prepareStoreCopyResponse.IndexIds.Empty);
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldCommunicateErrorIfStoreIdDoesNotMatchRequest() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldCommunicateErrorIfStoreIdDoesNotMatchRequest()
        {
            // given (setup) required runtime subject dependencies
            AddData(_graphDb);
            SimpleCatchupClient simpleCatchupClient = new SimpleCatchupClient(_graphDb, _fsa, _catchupClient, _catchupServer, _temporaryDirectory, _logProvider);

            // when the list of files are requested from the server with the wrong storeId
            PrepareStoreCopyResponse prepareStoreCopyResponse = simpleCatchupClient.RequestListOfFilesFromServer(_wrongStoreId);

            simpleCatchupClient.Close();

            // then the response is not a list of files but an error
            assertEquals(PrepareStoreCopyResponse.Status.EStoreIdMismatch, prepareStoreCopyResponse.Status());

            // and the list of files is empty because the request should have failed
            File[] remoteFiles = prepareStoreCopyResponse.Files;
            assertArrayEquals(new File[] {}, remoteFiles);
        }