diff options
author | Artur Signell <artur@vaadin.com> | 2012-03-13 10:38:28 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-03-14 16:00:33 +0200 |
commit | ed8e3a6d5a904258898b7d46984d4d565a83811e (patch) | |
tree | 4e12085777e5325af17586a6864132e8f54cb942 | |
parent | 7d18c90400b0e81118791f71603dc9d1246741a5 (diff) | |
download | vaadin-framework-ed8e3a6d5a904258898b7d46984d4d565a83811e.tar.gz vaadin-framework-ed8e3a6d5a904258898b7d46984d4d565a83811e.zip |
Removed duplicate file (SourceFileChecker performs the same task)
-rw-r--r-- | tests/server-side/com/vaadin/tests/server/LicenseInJavaFiles.java | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/tests/server-side/com/vaadin/tests/server/LicenseInJavaFiles.java b/tests/server-side/com/vaadin/tests/server/LicenseInJavaFiles.java deleted file mode 100644 index abde241451..0000000000 --- a/tests/server-side/com/vaadin/tests/server/LicenseInJavaFiles.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.vaadin.tests.server; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.util.HashSet; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.commons.io.IOUtils; - -public class LicenseInJavaFiles extends TestCase { - - /** - * The tests are run in the build directory. - */ - public static String SRC_DIR = "../src"; - - public void testJavaFilesContainsLicense() throws IOException { - File srcDir = new File(SRC_DIR); - System.out.println(new File(".").getAbsolutePath()); - HashSet<String> missing = new HashSet<String>(); - checkForLicense(srcDir, missing); - if (!missing.isEmpty()) { - throw new RuntimeException( - "The following files are missing license information:\n" - + missing.toString()); - } - } - - private void checkForLicense(File srcDir, HashSet<String> missing) - throws IOException { - Assert.assertTrue("Source directory " + srcDir + " does not exist", - srcDir.exists()); - - for (File f : srcDir.listFiles()) { - if (f.isDirectory()) { - if (f.getPath().endsWith("com/vaadin/external")) { - continue; - } - checkForLicense(f, missing); - } else if (f.getName().endsWith(".java")) { - checkForLicenseInFile(f, missing); - } - } - } - - private void checkForLicenseInFile(File f, HashSet<String> missing) - throws IOException { - String contents = IOUtils.toString(new FileInputStream(f)); - if (!contents.contains("@" + "VaadinApache2LicenseForJavaFiles" + "@")) { - missing.add(f.getPath()); - } - - } -} |