You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ne...@apache.org on 2017/01/05 19:47:06 UTC

[05/11] incubator-trafficcontrol git commit: Add TM2 cache.PrecomputeTest

Add TM2 cache.PrecomputeTest


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/e4545877
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/e4545877
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/e4545877

Branch: refs/heads/master
Commit: e454587776612f2c9507830ec827eb1a0e12dda9
Parents: 35dddc9
Author: Robert Butts <ro...@gmail.com>
Authored: Thu Dec 8 14:43:50 2016 -0700
Committer: Dave Neuman <ne...@apache.org>
Committed: Thu Jan 5 12:46:32 2017 -0700

----------------------------------------------------------------------
 .../traffic_monitor/cache/cache_test.go         | 36 ++++++++++++++++++++
 1 file changed, 36 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e4545877/traffic_monitor/experimental/traffic_monitor/cache/cache_test.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/cache/cache_test.go b/traffic_monitor/experimental/traffic_monitor/cache/cache_test.go
new file mode 100644
index 0000000..d08e87b
--- /dev/null
+++ b/traffic_monitor/experimental/traffic_monitor/cache/cache_test.go
@@ -0,0 +1,36 @@
+package cache
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import (
+	"testing"
+
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/peer"
+	todata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
+)
+
+func TestHandlerPrecompute(t *testing.T) {
+	if NewHandler().Precompute() {
+		t.Errorf("expected NewHandler().Precompute() false, actual true")
+	}
+	if !NewPrecomputeHandler(todata.NewThreadsafe(), peer.NewCRStatesPeersThreadsafe()).Precompute() {
+		t.Errorf("expected NewPrecomputeHandler().Precompute() true, actual false")
+	}
+}