Return-Path: X-Original-To: apmail-creadur-commits-archive@www.apache.org Delivered-To: apmail-creadur-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AC03310859 for ; Fri, 6 Dec 2013 17:56:33 +0000 (UTC) Received: (qmail 22742 invoked by uid 500); 6 Dec 2013 17:56:33 -0000 Delivered-To: apmail-creadur-commits-archive@creadur.apache.org Received: (qmail 22714 invoked by uid 500); 6 Dec 2013 17:56:33 -0000 Mailing-List: contact commits-help@creadur.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@creadur.apache.org Delivered-To: mailing list commits@creadur.apache.org Received: (qmail 22707 invoked by uid 99); 6 Dec 2013 17:56:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Dec 2013 17:56:32 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Dec 2013 17:56:30 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3C6FF238888F; Fri, 6 Dec 2013 17:56:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1548624 - /creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/DirectoryScanner.java Date: Fri, 06 Dec 2013 17:56:09 -0000 To: commits@creadur.apache.org From: rdonkin@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131206175609.3C6FF238888F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rdonkin Date: Fri Dec 6 17:56:08 2013 New Revision: 1548624 URL: http://svn.apache.org/r1548624 Log: Format Code. Modified: creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/DirectoryScanner.java Modified: creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/DirectoryScanner.java URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/DirectoryScanner.java?rev=1548624&r1=1548623&r2=1548624&view=diff ============================================================================== --- creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/DirectoryScanner.java (original) +++ creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/DirectoryScanner.java Fri Dec 6 17:56:08 2013 @@ -33,35 +33,36 @@ import org.junit.Assert; class DirectoryScanner { - @SuppressWarnings("boxing") - /** - * Get list of files in a directory, and scan for license matches - * @param directory the directory containing the files - * @param matcher the license matcher - * @param expected the expected result of the each scan - * @throws Exception - */ - public static void testFilesInDir(String directory, IHeaderMatcher matcher, boolean expected) throws IOException { - final File[] resourceFiles = Resources.getResourceFiles(directory); - if (resourceFiles.length == 0) { - Assert.fail("No files found under "+directory); - } - for(File f : resourceFiles) { - final Document subject = new MockLocation(f.toString()); - BufferedReader br = null; - try { - boolean result = false; - br = Resources.getBufferedReader(f); - String line; - while(!result && (line = br.readLine()) != null) { - result = matcher.match(subject, line); - } - assertEquals(f.toString(), expected, result); - } finally { - matcher.reset(); - IOUtils.closeQuietly(br); - } - } - } + @SuppressWarnings("boxing") + /** + * Get list of files in a directory, and scan for license matches + * @param directory the directory containing the files + * @param matcher the license matcher + * @param expected the expected result of the each scan + * @throws Exception + */ + public static void testFilesInDir(String directory, IHeaderMatcher matcher, + boolean expected) throws IOException { + final File[] resourceFiles = Resources.getResourceFiles(directory); + if (resourceFiles.length == 0) { + Assert.fail("No files found under " + directory); + } + for (File f : resourceFiles) { + final Document subject = new MockLocation(f.toString()); + BufferedReader br = null; + try { + boolean result = false; + br = Resources.getBufferedReader(f); + String line; + while (!result && (line = br.readLine()) != null) { + result = matcher.match(subject, line); + } + assertEquals(f.toString(), expected, result); + } finally { + matcher.reset(); + IOUtils.closeQuietly(br); + } + } + } }