// Create an empty ViewData with the given View.
 static IViewData CreateEmptyViewData(IView view)
 {
     return(ViewData.Create(
                view,
                new Dictionary <TagValues, IAggregationData>(),
                ZERO_TIMESTAMP, ZERO_TIMESTAMP));
 }
 // Create an empty ViewData with the given View.
 static IViewData CreateEmptyViewData(IView view)
 {
     return(ViewData.Create(
                view,
                new Dictionary <TagValues, IAggregationData>(),
                DateTimeOffset.MinValue, DateTimeOffset.MinValue));
 }
示例#3
0
 private void AggregationAndAggregationDataMismatch(IView view, IDictionary <TagValues, IAggregationData> entries)
 {
     // CumulativeData cumulativeData =
     //    CumulativeData.Create(Timestamp.fromMillis(1000), Timestamp.fromMillis(2000));
     // thrown.expect(IllegalArgumentException);
     // thrown.expectMessage("Aggregation and AggregationData types mismatch. ");
     Assert.Throws <ArgumentException>(() => ViewData.Create(view, entries, Timestamp.FromMillis(1000), Timestamp.FromMillis(2000)));
 }
示例#4
0
        public void TestCumulativeViewData()
        {
            IView      view     = View.Create(NAME, DESCRIPTION, MEASURE_DOUBLE, DISTRIBUTION, TAG_KEYS);
            ITimestamp start    = Timestamp.FromMillis(1000);
            ITimestamp end      = Timestamp.FromMillis(2000);
            IViewData  viewData = ViewData.Create(view, ENTRIES, start, end);

            Assert.Equal(view, viewData.View);
            Assert.Equal(ENTRIES, viewData.AggregationMap);
        }
        public void TestCumulativeViewData()
        {
            var view     = View.Create(NAME, DESCRIPTION, MEASURE_DOUBLE, DISTRIBUTION, TAG_KEYS);
            var start    = DateTimeOffset.FromUnixTimeMilliseconds(1000);
            var end      = DateTimeOffset.FromUnixTimeMilliseconds(2000);
            var viewData = ViewData.Create(view, ENTRIES, start, end);

            Assert.Equal(view, viewData.View);
            Assert.Equal(ENTRIES, viewData.AggregationMap);
        }
示例#6
0
        public void TestViewDataEquals()
        {
            IView cumulativeView =
                View.Create(NAME, DESCRIPTION, MEASURE_DOUBLE, DISTRIBUTION, TAG_KEYS);

            // View intervalView =
            //    View.Create(NAME, DESCRIPTION, MEASURE_DOUBLE, DISTRIBUTION, TAG_KEYS, INTERVAL_HOUR);

            // new EqualsTester()
            //    .addEqualityGroup(
            IViewData data1 = ViewData.Create(
                cumulativeView,
                ENTRIES,
                Timestamp.FromMillis(1000),
                Timestamp.FromMillis(2000));
            IViewData data2 = ViewData.Create(
                cumulativeView,
                ENTRIES,
                Timestamp.FromMillis(1000),
                Timestamp.FromMillis(2000));

            Assert.Equal(data1, data2);

            // .addEqualityGroup(
            IViewData data3 = ViewData.Create(
                cumulativeView,
                ENTRIES,
                Timestamp.FromMillis(1000),
                Timestamp.FromMillis(3000));

            Assert.NotEqual(data1, data3);
            Assert.NotEqual(data2, data3);

            // .addEqualityGroup(
            // IViewData data4 = ViewData.Create(intervalView, ENTRIES, IntervalData.Create(Timestamp.fromMillis(2000))),
            // IViewData data5 = ViewData.Create(intervalView, ENTRIES, IntervalData.Create(Timestamp.fromMillis(2000))))
            // .addEqualityGroup(
            //    ViewData.Create(
            //        intervalView,
            //        Collections.< List<TagValue>, AggregationData > emptyMap(),
            //        IntervalData.Create(Timestamp.fromMillis(2000))))
            // .testEquals();
        }