aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib
diff options
context:
space:
mode:
authorGravatar cpeyser <cpeyser@google.com>2018-03-19 10:26:07 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-19 10:28:57 -0700
commite6af9f9178e731a45e552b1d249ded90124945ba (patch)
tree35b1295422c1ceccea26fb54330b6811815a3e41 /src/test/java/com/google/devtools/build/lib
parent6d4386064edbd09b39b5bf5664c0f976713c0fec (diff)
Add behavior to NestedSetCodec to prevent it from running during testing.
PiperOrigin-RevId: 189602622
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib')
-rw-r--r--src/test/java/com/google/devtools/build/lib/collect/nestedset/NestedSetCodecTest.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/collect/nestedset/NestedSetCodecTest.java b/src/test/java/com/google/devtools/build/lib/collect/nestedset/NestedSetCodecTest.java
index da9702abca..978d7a0bb5 100644
--- a/src/test/java/com/google/devtools/build/lib/collect/nestedset/NestedSetCodecTest.java
+++ b/src/test/java/com/google/devtools/build/lib/collect/nestedset/NestedSetCodecTest.java
@@ -15,7 +15,10 @@ package com.google.devtools.build.lib.collect.nestedset;
import static com.google.common.truth.Truth.assertThat;
+import com.google.devtools.build.lib.skyframe.serialization.SerializationConstants;
import com.google.devtools.build.lib.skyframe.serialization.testutils.SerializationTester;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
@@ -27,6 +30,16 @@ public class NestedSetCodecTest {
private static final NestedSet<String> SHARED_NESTED_SET =
NestedSetBuilder.<String>stableOrder().add("e").build();
+ @Before
+ public void setUp() {
+ SerializationConstants.shouldSerializeNestedSet = true;
+ }
+
+ @After
+ public void tearDown() {
+ SerializationConstants.shouldSerializeNestedSet = false;
+ }
+
@Test
public void testCodec() throws Exception {
new SerializationTester(