aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/buildeventstream/transports/TextFormatFileTransportTest.java
diff options
context:
space:
mode:
authorGravatar buchgr <buchgr@google.com>2017-04-06 18:54:22 +0000
committerGravatar Marcel Hlopko <hlopko@google.com>2017-04-07 11:17:34 +0200
commit0b937434094c38333fad07ec603d269f5b750c30 (patch)
tree9864d657078fbd34b0d1a4e03deb8861dd2cd45a /src/test/java/com/google/devtools/build/lib/buildeventstream/transports/TextFormatFileTransportTest.java
parented959e2a460e23cb253ce0c5c758e91e0f12e7bd (diff)
BEP: Improve the BuildEventTransport interface.
Better specify the BuildEventTransport interface. Besides clarifying threading and blocking issues, this change also clarifies error handling/reporting. After several discussions we concluded that the BuildEventTransport interface should not provide error reporting / handling facilities, as there is not much bazel could do with this information. Instead, a transport may decide for itself if an error is fatal and abort the build or if an error should be logged to the user's terminal or if it should be ignored. Furthermore, changing the close() method lays the groundwork for an upcoming change that will report the transport shutdown status to the user command line. PiperOrigin-RevId: 152408938
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/buildeventstream/transports/TextFormatFileTransportTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/buildeventstream/transports/TextFormatFileTransportTest.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/buildeventstream/transports/TextFormatFileTransportTest.java b/src/test/java/com/google/devtools/build/lib/buildeventstream/transports/TextFormatFileTransportTest.java
index ac62c7476c..7a008fabb0 100644
--- a/src/test/java/com/google/devtools/build/lib/buildeventstream/transports/TextFormatFileTransportTest.java
+++ b/src/test/java/com/google/devtools/build/lib/buildeventstream/transports/TextFormatFileTransportTest.java
@@ -28,7 +28,6 @@ import com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos.Tar
import com.google.devtools.build.lib.buildeventstream.PathConverter;
import com.google.protobuf.TextFormat;
import java.io.File;
-import java.io.IOException;
import java.nio.charset.StandardCharsets;
import org.junit.After;
import org.junit.Before;
@@ -63,7 +62,7 @@ public class TextFormatFileTransportTest {
}
@Test
- public void testCreatesFileAndWritesProtoTextFormat() throws IOException {
+ public void testCreatesFileAndWritesProtoTextFormat() throws Exception {
File output = tmp.newFile();
BuildEventStreamProtos.BuildEvent started =
@@ -87,7 +86,7 @@ public class TextFormatFileTransportTest {
when(buildEvent.asStreamProto(Matchers.<BuildEventConverters>any())).thenReturn(completed);
transport.sendBuildEvent(buildEvent);
- transport.close();
+ transport.close().get();
String contents =
trimLines(
Joiner.on(System.lineSeparator())