aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google
diff options
context:
space:
mode:
authorGravatar janakr <janakr@google.com>2018-04-04 11:03:09 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-04-04 11:05:05 -0700
commiteb0671b638d6385e6aab5c4b273586ed22f8f48b (patch)
treea745c383b33ac5d7fe74bbc4beb4cbdc6b65675b /src/test/java/com/google
parent00b72a1590713e7650285d84ae2a1e5c2041defe (diff)
Add ObjectCodec for AtomicReference.
PiperOrigin-RevId: 191615301
Diffstat (limited to 'src/test/java/com/google')
-rw-r--r--src/test/java/com/google/devtools/build/lib/skyframe/serialization/AtomicReferenceCodecTest.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/serialization/AtomicReferenceCodecTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/serialization/AtomicReferenceCodecTest.java
new file mode 100644
index 0000000000..f8e55f8880
--- /dev/null
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/serialization/AtomicReferenceCodecTest.java
@@ -0,0 +1,36 @@
+// Copyright 2018 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 static com.google.common.truth.Truth.assertThat;
+
+import com.google.devtools.build.lib.skyframe.serialization.testutils.SerializationTester;
+import java.util.concurrent.atomic.AtomicReference;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+/** Tests for {@link AtomicReferenceCodec}. */
+@RunWith(JUnit4.class)
+public class AtomicReferenceCodecTest {
+ @Test
+ public void smoke() throws Exception {
+ new SerializationTester(new AtomicReference<>(), new AtomicReference<>("hello"))
+ .<AtomicReference<?>>setVerificationFunction(
+ (original, deserialized) ->
+ assertThat(deserialized.get()).isEqualTo(deserialized.get()))
+ .runTests();
+ }
+}