aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib
diff options
context:
space:
mode:
authorGravatar janakr <janakr@google.com>2017-09-14 22:30:06 +0200
committerGravatar Philipp Wollermann <philwo@google.com>2017-09-15 11:28:37 +0200
commitfe46788eaf91673916c12e83396277e00fd0a9bd (patch)
treed29f839b4931c8e78733ea7fea374e3b0316d393 /src/test/java/com/google/devtools/build/lib
parentf38b433bf5d311a5bd914b8ef7ea497fd3b09941 (diff)
Add serialization support to BlazeDirectories (and .hashCode() and .equals() support into the bargain).
Equality checking isn't that important since there's only one instance per Blaze server, but it keeps serialization semantics reasonable. PiperOrigin-RevId: 168735669
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib')
-rw-r--r--src/test/java/com/google/devtools/build/lib/skyframe/serialization/BlazeDirectoriesCodecTest.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/serialization/BlazeDirectoriesCodecTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/serialization/BlazeDirectoriesCodecTest.java
new file mode 100644
index 0000000000..ef7916d295
--- /dev/null
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/serialization/BlazeDirectoriesCodecTest.java
@@ -0,0 +1,46 @@
+// Copyright 2017 The Bazel Authors. All rights reserved.
+//
+// Licensed 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.
+
+package com.google.devtools.build.lib.skyframe.serialization;
+
+import com.google.devtools.build.lib.analysis.BlazeDirectories;
+import com.google.devtools.build.lib.analysis.BlazeDirectoriesCodec;
+import com.google.devtools.build.lib.analysis.ServerDirectories;
+
+/** Tests for {@link BlazeDirectoriesCodec}. */
+public class BlazeDirectoriesCodecTest extends AbstractObjectCodecTest<BlazeDirectories> {
+ public BlazeDirectoriesCodecTest() {
+ super(
+ new BlazeDirectoriesCodec(new PathCodec(FsUtils.TEST_FILESYSTEM)),
+ new BlazeDirectories(
+ new ServerDirectories(
+ FsUtils.TEST_FILESYSTEM.getPath("install_base"),
+ FsUtils.TEST_FILESYSTEM.getPath("output_base")),
+ FsUtils.TEST_FILESYSTEM.getPath("workspace"),
+ "Blaze"),
+ new BlazeDirectories(
+ new ServerDirectories(
+ FsUtils.TEST_FILESYSTEM.getPath("install_base"),
+ FsUtils.TEST_FILESYSTEM.getPath("output_base"),
+ "ab"),
+ FsUtils.TEST_FILESYSTEM.getPath("workspace"),
+ "Blaze"),
+ new BlazeDirectories(
+ new ServerDirectories(
+ FsUtils.TEST_FILESYSTEM.getPath("install_base"),
+ FsUtils.TEST_FILESYSTEM.getPath("output_base")),
+ FsUtils.TEST_FILESYSTEM.getPath("workspace"),
+ "Bazel"));
+ }
+}