Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C1503200D0B for ; Wed, 27 Sep 2017 21:09:54 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id BFC6E1609CA; Wed, 27 Sep 2017 19:09:54 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1019E1609C1 for ; Wed, 27 Sep 2017 21:09:53 +0200 (CEST) Received: (qmail 65680 invoked by uid 500); 27 Sep 2017 19:09:53 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 65671 invoked by uid 99); 27 Sep 2017 19:09:53 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Sep 2017 19:09:53 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0CE5CF5B9A; Wed, 27 Sep 2017 19:09:53 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ggregory@apache.org To: commits@commons.apache.org Message-Id: <280a96448ca54eb3b9c0f35d183ed99f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: commons-io git commit: Replace custom temporary folder management with JUnit's TemporaryFolder. This will allow Maven to run tests concurrently. Date: Wed, 27 Sep 2017 19:09:53 +0000 (UTC) archived-at: Wed, 27 Sep 2017 19:09:54 -0000 Repository: commons-io Updated Branches: refs/heads/master ca286ab3f -> bc8773df8 Replace custom temporary folder management with JUnit's TemporaryFolder. This will allow Maven to run tests concurrently. Project: http://git-wip-us.apache.org/repos/asf/commons-io/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-io/commit/bc8773df Tree: http://git-wip-us.apache.org/repos/asf/commons-io/tree/bc8773df Diff: http://git-wip-us.apache.org/repos/asf/commons-io/diff/bc8773df Branch: refs/heads/master Commit: bc8773df85d2db0d2d5bd99aa69d7e7c795e7aed Parents: ca286ab Author: Gary Gregory Authored: Wed Sep 27 13:09:50 2017 -0600 Committer: Gary Gregory Committed: Wed Sep 27 13:09:50 2017 -0600 ---------------------------------------------------------------------- .../org/apache/commons/io/input/TailerTest.java | 39 +++++++++++++++----- 1 file changed, 29 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-io/blob/bc8773df/src/test/java/org/apache/commons/io/input/TailerTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/input/TailerTest.java b/src/test/java/org/apache/commons/io/input/TailerTest.java index a39289e..6e794e8 100644 --- a/src/test/java/org/apache/commons/io/input/TailerTest.java +++ b/src/test/java/org/apache/commons/io/input/TailerTest.java @@ -16,7 +16,25 @@ */ package org.apache.commons.io.input; -import java.io.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.BufferedOutputStream; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.io.RandomAccessFile; +import java.io.Writer; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.ArrayList; @@ -27,23 +45,24 @@ import java.util.concurrent.ScheduledThreadPoolExecutor; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; -import org.apache.commons.io.testtools.FileBasedTestCase; import org.apache.commons.io.testtools.TestUtils; import org.junit.After; +import org.junit.Rule; import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import org.junit.rules.TemporaryFolder; /** * Tests for {@link Tailer}. * */ -public class TailerTest extends FileBasedTestCase { +public class TailerTest { + + @Rule + public TemporaryFolder temporaryFolder = new TemporaryFolder(); + + private File getTestDirectory() { + return temporaryFolder.getRoot(); + } private Tailer tailer;