use of org.apache.beam.runners.dataflow.util.PackageUtil.PackageAttributes in project beam by apache.
the class PackageUtilTest method testFileWithExtensionPackageNamingAndSize.
@Test
public void testFileWithExtensionPackageNamingAndSize() throws Exception {
String contents = "This is a test!";
File tmpFile = makeFileWithContents("file.txt", contents);
PackageAttributes attr = makePackageAttributes(tmpFile, null);
DataflowPackage target = attr.getDataflowPackage();
assertThat(target.getName(), RegexMatcher.matches("file-" + HASH_PATTERN + ".txt"));
assertThat(target.getLocation(), equalTo(STAGING_PATH + target.getName()));
assertThat(attr.getSize(), equalTo((long) contents.length()));
}
Aggregations