diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2012-05-07 18:16:48 +0600 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2012-05-08 21:02:54 +0600 |
commit | 54ce0edc38605421e91a660ccbacd8765a8e2a6d (patch) | |
tree | c425901f0d5d11101512dca95840aba81899e7a2 /sonar-duplications/src/test | |
parent | c4136d4e4ae8bac0c30a0c0cef8b5b4688565642 (diff) | |
download | sonarqube-54ce0edc38605421e91a660ccbacd8765a8e2a6d.tar.gz sonarqube-54ce0edc38605421e91a660ccbacd8765a8e2a6d.zip |
SONAR-3182 Remove unused code
Diffstat (limited to 'sonar-duplications/src/test')
-rw-r--r-- | sonar-duplications/src/test/java/net/sourceforge/pmd/cpd/AbstractLanguageTest.java | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/sonar-duplications/src/test/java/net/sourceforge/pmd/cpd/AbstractLanguageTest.java b/sonar-duplications/src/test/java/net/sourceforge/pmd/cpd/AbstractLanguageTest.java deleted file mode 100644 index 404df716657..00000000000 --- a/sonar-duplications/src/test/java/net/sourceforge/pmd/cpd/AbstractLanguageTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package net.sourceforge.pmd.cpd; - -import org.junit.Test; - -import java.io.File; -import java.io.FilenameFilter; - -import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertThat; - -/** - * We use modified version of {@link AbstractLanguage} in comparison with PMD - it doesn't use package "net.sourceforge.pmd.util.filter", - * so goal of this test is to verify that behavior wasn't changed: - * filter should always accept directories and files with a specified set of extensions (comparison is case insensitive). - */ -public class AbstractLanguageTest { - - @Test - public void shouldCreateCorrectFilenameFilterForExtensions() { - AbstractLanguage language = new AbstractLanguage(null, "java") { - }; - - FilenameFilter filter = language.getFileFilter(); - assertThat(filter.accept(new File("test-resources"), "org"), is(true)); - assertThat(filter.accept(new File("test-resources/org/sonar/duplications/cpd/CPDTest"), "CPDFile1.java"), is(true)); - assertThat(filter.accept(new File("test-resources/org/sonar/duplications/cpd/CPDTest"), "CPDFile1.cpp"), is(false)); - - language = new AbstractLanguage(null, "Java") { - }; - assertThat(filter.accept(new File("test-resources/org/sonar/duplications/cpd/CPDTest"), "CPDFile1.java"), is(true)); - - language = new AbstractLanguage(null, new String[] {}) { - }; - assertThat(filter.accept(new File("test-resources/org/sonar/duplications/cpd/CPDTest"), "CPDFile1.java"), is(true)); - } - - @Test(expected = NullPointerException.class) - public void shouldThrowException() { - new AbstractLanguage(null, (String) null) { - }; - } - - @Test(expected = NullPointerException.class) - public void shouldAlsoThrowException() { - new AbstractLanguage(null, (String[]) null) { - }; - } - -} |