Commit d3b3cd75 authored by Tigran Mkrtchyan's avatar Tigran Mkrtchyan
Browse files

nfs4: stop using deprecated guava API in tests

Acked-by: Lea Morschel
Target: master
parent 397b95b7
...@@ -31,7 +31,7 @@ public class ExportFileTest { ...@@ -31,7 +31,7 @@ public class ExportFileTest {
export = File.createTempFile("exports", null); export = File.createTempFile("exports", null);
export.deleteOnExit(); export.deleteOnExit();
Files.write("/export_main 1.1.1.1(sec=sys)", export, UTF_8); Files.asCharSink(export, UTF_8).write("/export_main 1.1.1.1(sec=sys)");
do { do {
// create new unique tmp-directory // create new unique tmp-directory
...@@ -43,16 +43,16 @@ public class ExportFileTest { ...@@ -43,16 +43,16 @@ public class ExportFileTest {
for (int i = 0; i < fileNumber; i++) { for (int i = 0; i < fileNumber; i++) {
File extraExport = File.createTempFile("extra", ".exports", exportDir); File extraExport = File.createTempFile("extra", ".exports", exportDir);
extraExport.deleteOnExit(); extraExport.deleteOnExit();
Files.write("/extra_export" + i + " 2.2.2." + i + "(sec=sys)", extraExport, UTF_8); Files.asCharSink(extraExport, UTF_8).write("/extra_export" + i + " 2.2.2." + i + "(sec=sys)");
} }
File hiddenExport = File.createTempFile(".hidden", ".exports", exportDir); File hiddenExport = File.createTempFile(".hidden", ".exports", exportDir);
hiddenExport.deleteOnExit(); hiddenExport.deleteOnExit();
Files.write("/hidden_export *(sec=sys)", hiddenExport, UTF_8); Files.asCharSink(hiddenExport, UTF_8).write("/hidden_export *(sec=sys)");
File randomFile = File.createTempFile("random", null, exportDir); File randomFile = File.createTempFile("random", null, exportDir);
randomFile.deleteOnExit(); randomFile.deleteOnExit();
Files.write("/random_file_export *(sec=sys)", randomFile, UTF_8); Files.asCharSink(randomFile, UTF_8).write("/random_file_export *(sec=sys)");
} }
@Test @Test
...@@ -118,7 +118,7 @@ public class ExportFileTest { ...@@ -118,7 +118,7 @@ public class ExportFileTest {
assertExportNotExists("/added_export", ef); assertExportNotExists("/added_export", ef);
File addedFile = File.createTempFile("new_export", ".exports", exportDir); File addedFile = File.createTempFile("new_export", ".exports", exportDir);
addedFile.deleteOnExit(); addedFile.deleteOnExit();
Files.write("/added_export *(sec=sys)", addedFile, UTF_8); Files.asCharSink(addedFile, UTF_8).write("/added_export *(sec=sys)");
ef.rescan(); ef.rescan();
assertExportExists("/added_export", ef); assertExportExists("/added_export", ef);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment