예제 #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private PrepareStoreCopyResponse prepareStoreCopy(org.neo4j.helpers.AdvertisedSocketAddress from, org.neo4j.causalclustering.identity.StoreId expectedStoreId, StoreFileStreamProvider storeFileStream) throws org.neo4j.causalclustering.catchup.CatchUpClientException, StoreCopyFailedException
        private PrepareStoreCopyResponse PrepareStoreCopy(AdvertisedSocketAddress from, StoreId expectedStoreId, StoreFileStreamProvider storeFileStream)
        {
            _log.info("Requesting store listing from: " + from);
            PrepareStoreCopyResponse prepareStoreCopyResponse = _catchUpClient.makeBlockingRequest(from, new PrepareStoreCopyRequest(expectedStoreId), prepareStoreCopyAdaptor(storeFileStream, _log));

            if (prepareStoreCopyResponse.Status() != PrepareStoreCopyResponse.Status.Success)
            {
                throw new StoreCopyFailedException("Preparing store failed due to: " + prepareStoreCopyResponse.Status());
            }
            return(prepareStoreCopyResponse);
        }
예제 #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);
        }