예제 #1
0
        public void TestIgniteGetVersionAndNodeVersionAreEqual()
        {
            IgniteProductVersion version     = Ignite.GetVersion();
            IgniteProductVersion nodeVersion = Ignite.GetCluster().GetLocalNode().Version;

            Assert.AreEqual(version, nodeVersion);
        }
예제 #2
0
        public void TestBinaryConstructor()
        {
            IBinaryRawReader reader = SetUpRawBinaryReader(_defaultVersion.RevisionHash);

            IgniteProductVersion deserializedVersion = new IgniteProductVersion(reader);

            Assert.AreEqual(_defaultVersion, deserializedVersion);
        }
예제 #3
0
        public void TestLocalNodeGetVersion()
        {
            IgniteProductVersion nodeVersion = Ignite.GetCluster().GetLocalNode().Version;

            Assert.GreaterOrEqual(nodeVersion.Major, 2);
            Assert.GreaterOrEqual(nodeVersion.Minor, 0);
            Assert.GreaterOrEqual(nodeVersion.Maintenance, 0);
            Assert.GreaterOrEqual(nodeVersion.Stage, "SNAPSHOT");
        }
예제 #4
0
        public void TestToStringWithLimitedHashValue()
        {
            var hash = new byte[] { 24, 229 };
            IBinaryRawReader reader = SetUpRawBinaryReader(hash);

            IgniteProductVersion deserializedVersion = new IgniteProductVersion(reader);

            Assert.AreEqual("2.5.7#20180101-sha1:18", deserializedVersion.ToString());
        }
예제 #5
0
        public void TestAssemblyVersionMatchesIgniteVersion()
        {
            Version clientVer = typeof(IIgnite).Assembly.GetName().Version;

            IgniteProductVersion version = Ignite.GetVersion();

            Assert.AreEqual(clientVer.Major, version.Major);
            Assert.AreEqual(clientVer.Minor, version.Minor);
            Assert.AreEqual(clientVer.Build, version.Maintenance);
        }
예제 #6
0
        public void TestSignedByteArrayIsTheSameForStringRepresentation()
        {
            sbyte[] signed = Array.ConvertAll(ByteArray, b => unchecked ((sbyte)b));

            // ReSharper disable once PossibleInvalidCastException
            var unsignedCast = (byte[])(Array)signed;

            var versionSigned   = new IgniteProductVersion(1, 2, 3, "rc1", DefaultReleaseDate, unsignedCast);
            var versionUnsigned = new IgniteProductVersion(1, 2, 3, "rc1", DefaultReleaseDate, ByteArray);

            Assert.AreEqual(versionSigned.ToString(), versionUnsigned.ToString());
        }
예제 #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ClientClusterNode"/> class.
        /// </summary>
        /// <param name="reader">The reader.</param>
        public ClientClusterNode(IBinaryRawReader reader)
        {
            var id = reader.ReadGuid();

            Debug.Assert(id.HasValue);

            _id = id.Value;

            _attrs        = ClusterNodeImpl.ReadAttributes(reader);
            _addrs        = reader.ReadCollectionAsList <string>().AsReadOnly();
            _hosts        = reader.ReadCollectionAsList <string>().AsReadOnly();
            _order        = reader.ReadLong();
            _isLocal      = reader.ReadBoolean();
            _isDaemon     = reader.ReadBoolean();
            _isClient     = reader.ReadBoolean();
            _consistentId = reader.ReadObject <object>();
            _version      = new IgniteProductVersion(reader);
        }
예제 #8
0
 public void SetUp()
 {
     _defaultVersion = new IgniteProductVersion(2, 5, 7, "Stage", DefaultReleaseDate, null);
 }
예제 #9
0
        public void TestUnsignedStringRepresentation()
        {
            var version = new IgniteProductVersion(1, 2, 3, "rc1", new DateTime(2019, 1, 1), ByteArray);

            Assert.AreEqual("1.2.3#20190101-sha1:18e5a7ec", version.ToString());
        }