Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnKnownProtocolVersionWhenFirstGivenVersionNotKnown()
        public virtual void ShouldReturnKnownProtocolVersionWhenFirstGivenVersionNotKnown()
        {
            // when
            Optional <Org.Neo4j.causalclustering.protocol.Protocol_ApplicationProtocol> applicationProtocol = _applicationProtocolRepository.select(RAFT.canonicalName(), asSet(-1, 1));

            // then
            assertThat(applicationProtocol, OptionalMatchers.contains(TestProtocols_TestApplicationProtocols.RAFT_1));
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnEmptyIfNoVersions()
        public virtual void ShouldReturnEmptyIfNoVersions()
        {
            // when
            Optional <Org.Neo4j.causalclustering.protocol.Protocol_ApplicationProtocol> applicationProtocol = _applicationProtocolRepository.select(RAFT.canonicalName(), emptySet());

            // then
            assertThat(applicationProtocol, OptionalMatchers.empty());
        }
Beispiel #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnEmptyIfUnknownName()
        public virtual void ShouldReturnEmptyIfUnknownName()
        {
            // when
            Optional <Org.Neo4j.causalclustering.protocol.Protocol_ApplicationProtocol> applicationProtocol = _applicationProtocolRepository.select("not a real protocol", 1);

            // then
            assertThat(applicationProtocol, OptionalMatchers.empty());
        }
Beispiel #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnApplicationProtocolOfHighestVersionNumberRequestedAndSupported()
        public virtual void ShouldReturnApplicationProtocolOfHighestVersionNumberRequestedAndSupported()
        {
            // when
            Optional <Org.Neo4j.causalclustering.protocol.Protocol_ApplicationProtocol> applicationProtocol = _applicationProtocolRepository.select(RAFT.canonicalName(), asSet(389432, 1, 3, 2, 71234));

            // then
            assertThat(applicationProtocol, OptionalMatchers.contains(TestProtocols_TestApplicationProtocols.RAFT_3));
        }
Beispiel #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnModifierProtocolOfSingleConfiguredVersionIfOthersRequested()
        public virtual void ShouldReturnModifierProtocolOfSingleConfiguredVersionIfOthersRequested()
        {
            // given
            IList <ModifierSupportedProtocols> supportedProtocols = asList(new ModifierSupportedProtocols(COMPRESSION, new IList <string> {
                LZO.implementation()
            }));
            ModifierProtocolRepository modifierProtocolRepository = new ModifierProtocolRepository(TestProtocols_TestModifierProtocols.values(), supportedProtocols);
            // when
            Optional <Org.Neo4j.causalclustering.protocol.Protocol_ModifierProtocol> modifierProtocol = modifierProtocolRepository.Select(COMPRESSION.canonicalName(), asSet(TestProtocols_TestModifierProtocols.allVersionsOf(COMPRESSION)));

            // then
//JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter:
            assertThat(modifierProtocol.map(Protocol::implementation), OptionalMatchers.contains(LZO.implementation()));
        }
Beispiel #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnModifierProtocolOfFirstConfiguredVersionRequestedAndSupported()
        public virtual void ShouldReturnModifierProtocolOfFirstConfiguredVersionRequestedAndSupported()
        {
            // given
            IList <ModifierSupportedProtocols> supportedProtocols = asList(new ModifierSupportedProtocols(COMPRESSION, new IList <string> {
                LZO.implementation(), SNAPPY.implementation(), LZ4.implementation()
            }), new ModifierSupportedProtocols(GRATUITOUS_OBFUSCATION, new IList <string> {
                NAME_CLASH.implementation()
            }));
            ModifierProtocolRepository modifierProtocolRepository = new ModifierProtocolRepository(TestProtocols_TestModifierProtocols.values(), supportedProtocols);
            // when
            Optional <Org.Neo4j.causalclustering.protocol.Protocol_ModifierProtocol> modifierProtocol = modifierProtocolRepository.Select(COMPRESSION.canonicalName(), asSet("bzip2", SNAPPY.implementation(), LZ4.implementation(), LZO.implementation(), "fast_lz"));

            // then
//JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter:
            assertThat(modifierProtocol.map(Protocol::implementation), OptionalMatchers.contains(LZO.implementation()));
        }