[Clirr-devel] CVS: clirr/core/src/test/net/sf/clirr/core/internal/checks Regression1022446Test.jav
Status: Alpha
Brought to you by:
lkuehne
Update of /cvsroot/clirr/clirr/core/src/test/net/sf/clirr/core/internal/checks In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv8715/src/test/net/sf/clirr/core/internal/checks Modified Files: Regression1373831Test.java AbstractRegressionTestCase.java Added Files: Regression1022446Test.java Log Message: added regression test for bug #1022446 --- NEW FILE --- package net.sf.clirr.core.internal.checks; import net.sf.clirr.core.Severity; /** * Regression test for bug * <a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1022446&group_id=89627&atid=590799">1022446</a>. * * @author lkuehne */ public class Regression1022446Test extends AbstractRegressionTestCase { public void testRegression() { runChecker(); final TestDiffListener testDiffListener = getTestDiffListener(); assertEquals("false alarm (binary error)", 0, testDiffListener.countBinaryCompatibilityDiffs(Severity.ERROR)); assertEquals("false alarm (source error)", 0, testDiffListener.countSourceCompatibilityDiffs(Severity.ERROR)); assertEquals("false alarm (binary warning)", 0, testDiffListener.countBinaryCompatibilityDiffs(Severity.WARNING)); assertEquals("false alarm (source warning)", 0, testDiffListener.countSourceCompatibilityDiffs(Severity.WARNING)); assertEquals("false alarm (binary info)", 0, testDiffListener.countBinaryCompatibilityDiffs(Severity.INFO)); assertEquals("false alarm (source info)", 0, testDiffListener.countSourceCompatibilityDiffs(Severity.INFO)); } } Index: Regression1373831Test.java =================================================================== RCS file: /cvsroot/clirr/clirr/core/src/test/net/sf/clirr/core/internal/checks/Regression1373831Test.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Regression1373831Test.java 16 Mar 2006 22:30:18 -0000 1.2 +++ Regression1373831Test.java 4 May 2007 18:58:36 -0000 1.3 @@ -1,8 +1,5 @@ package net.sf.clirr.core.internal.checks; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import net.sf.clirr.core.Severity; /** @@ -13,20 +10,6 @@ */ public class Regression1373831Test extends AbstractRegressionTestCase { - Pattern STD_REGRESSION_TEST_PATTERN = Pattern.compile("^.*Regression(.*)Test$"); - - protected String getTrackerId() - { - final String fqTestName = this.getClass().getName(); - final Matcher matcher = STD_REGRESSION_TEST_PATTERN.matcher(fqTestName); - if (matcher.matches()) - { - final String group = matcher.group(1); - return group; - } - throw new UnsupportedOperationException("The default implementation works only for classes that follow the naming scheme 'Regression<id>Test'"); - } - public void testRegression() { runChecker(); Index: AbstractRegressionTestCase.java =================================================================== RCS file: /cvsroot/clirr/clirr/core/src/test/net/sf/clirr/core/internal/checks/AbstractRegressionTestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AbstractRegressionTestCase.java 9 Jan 2006 21:38:38 -0000 1.1 +++ AbstractRegressionTestCase.java 4 May 2007 18:58:36 -0000 1.2 @@ -1,5 +1,8 @@ package net.sf.clirr.core.internal.checks; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + import net.sf.clirr.core.Checker; import net.sf.clirr.core.ClassFilter; import net.sf.clirr.core.ClassSelector; @@ -10,8 +13,20 @@ */ public abstract class AbstractRegressionTestCase extends AbstractCheckerTestCase { - protected abstract String getTrackerId(); + private Pattern STD_REGRESSION_TEST_PATTERN = Pattern.compile("^.*Regression(.*)Test$"); + protected String getTrackerId() + { + final String fqTestName = this.getClass().getName(); + final Matcher matcher = STD_REGRESSION_TEST_PATTERN.matcher(fqTestName); + if (matcher.matches()) + { + final String group = matcher.group(1); + return group; + } + throw new UnsupportedOperationException("The default implementation works only for classes that follow the naming scheme 'Regression<id>Test'"); + } + protected ClassFilter createClassFilter() { ClassSelector classSelector = new ClassSelector(ClassSelector.MODE_IF); |