blob: 992877b5c852553b9048d7679960caadea34bb65 [file] [log] [blame]
Damien Martin-Guillerezf88f4d82015-09-25 13:56:55 +00001// Copyright 2015 The Bazel Authors. All rights reserved.
Nathan Harmata53bd3bf2015-04-03 16:12:59 +00002//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14package com.google.devtools.build.skyframe;
15
tomlua155b532017-11-08 20:12:47 +010016import com.google.common.base.Preconditions;
Nathan Harmata53bd3bf2015-04-03 16:12:59 +000017import org.junit.runner.RunWith;
18import org.junit.runners.JUnit4;
19
Googler2dd4c182016-10-31 14:54:37 +000020/** Tests for {@link InMemoryGraphImpl}. */
Nathan Harmata53bd3bf2015-04-03 16:12:59 +000021@RunWith(JUnit4.class)
Googler2dd4c182016-10-31 14:54:37 +000022public class InMemoryGraphTest extends GraphTest {
Janak Ramakrishnan52455102015-08-03 17:05:05 +000023 private ProcessableGraph graph;
24
Nathan Harmata53bd3bf2015-04-03 16:12:59 +000025 @Override
Shreya Bhattaraicc808782016-02-10 22:17:00 +000026 protected Version getStartingVersion() {
27 return IntVersion.of(0);
28 }
29
30 @Override
31 protected Version getNextVersion(Version v) {
32 Preconditions.checkState(v instanceof IntVersion);
33 return ((IntVersion) v).next();
34 }
35
36 @Override
Janak Ramakrishnan52455102015-08-03 17:05:05 +000037 protected void makeGraph() {
Janak Ramakrishnan8be7fd02016-05-10 20:01:40 +000038 graph = new InMemoryGraphImpl();
Janak Ramakrishnan52455102015-08-03 17:05:05 +000039 }
40
41 @Override
42 protected ProcessableGraph getGraph(Version version) {
43 return graph;
Nathan Harmata53bd3bf2015-04-03 16:12:59 +000044 }
45}