From f3d387a780cd3da40847ba199f492f7752bef50a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 15 Oct 2015 23:33:20 +0200 Subject: [PATCH] =?utf8?q?Remove=20JUnit=20@Rule,=20the=20files=20don?= =?utf8?q?=E2=80=99t=20have=20to=20exist?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../fcp/quelaton/DefaultFcpClientTest.java | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java index a4dc5a9..e526f2f 100644 --- a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java +++ b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java @@ -1667,25 +1667,9 @@ public class DefaultFcpClientTest { public class ClientPutDiskDir { - private final TemporaryFolder folder = new TemporaryFolder(); - - @Before - public void setup() throws IOException { - folder.create(); - Files.write("file1\n", folder.newFile("file1.txt"), StandardCharsets.UTF_8); - Files.write("file2\n", folder.newFile("file2.txt"), StandardCharsets.UTF_8); - File directory = folder.newFolder("dir"); - Files.write("file3\n", new File(directory, "file3.txt"), StandardCharsets.UTF_8); - } - - @After - public void removeFolder() { - folder.delete(); - } - @Test public void commandIsSentCorrectly() throws InterruptedException, ExecutionException, IOException { - Future> key = fcpClient.clientPutDiskDir().fromDirectory(folder.getRoot()).uri("CHK@").execute(); + Future> key = fcpClient.clientPutDiskDir().fromDirectory(new File("")).uri("CHK@").execute(); connectAndAssert(this::matchesClientPutDiskDir); fcpServer.writeLine("PutSuccessful", "Identifier=" + identifier, "URI=CHK@abc", "EndMessage"); assertThat(key.get().get().getKey(), is("CHK@abc")); @@ -1693,7 +1677,7 @@ public class DefaultFcpClientTest { @Test public void protocolErrorAbortsCommand() throws InterruptedException, ExecutionException, IOException { - Future> key = fcpClient.clientPutDiskDir().fromDirectory(folder.getRoot()).uri("CHK@").execute(); + Future> key = fcpClient.clientPutDiskDir().fromDirectory(new File("")).uri("CHK@").execute(); connectAndAssert(this::matchesClientPutDiskDir); replyWithProtocolError(); assertThat(key.get().isPresent(), is(false)); @@ -1704,7 +1688,7 @@ public class DefaultFcpClientTest { "ClientPutDiskDir", "Identifier=" + identifier, "URI=CHK@", - "Filename=" + folder.getRoot().getPath() + "Filename=" + new File("").getPath() ); } -- 2.7.4