use of com.google.devtools.build.lib.actions.cache.VirtualActionInput in project bazel by bazelbuild.
the class DigestTest method testFromVirtualInput.
@Test
public void testFromVirtualInput() throws Exception {
Pair<ByteString, Long> result = Digest.fromVirtualActionInput(new VirtualActionInput() {
@Override
public void writeTo(OutputStream out) throws IOException {
out.write(UGLY.getBytes(UTF_8));
}
@Override
public String getExecPathString() {
throw new UnsupportedOperationException();
}
@Override
public PathFragment getExecPath() {
throw new UnsupportedOperationException();
}
});
assertEquals(UGLY_DIGEST, result.first.toStringUtf8());
assertEquals(UGLY.length(), result.second.longValue());
}
Aggregations