[Clirr-devel] CVS: clirr/core/src/test/net/sf/clirr/core/internal/checks ArraysTest.java,1.1,1.2
Status: Alpha
Brought to you by:
lkuehne
From: <lk...@us...> - 2006-03-29 12:21:46
|
Update of /cvsroot/clirr/clirr/core/src/test/net/sf/clirr/core/internal/checks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19663/src/test/net/sf/clirr/core/internal/checks Modified Files: ArraysTest.java Log Message: Fixed regression #1459639, array dimension change no longer detected. While I was working on that bug, I noticed a few other glitches that were introduced when switching from BCEL to ASM, some of them are fixed in this commit as well. Index: ArraysTest.java =================================================================== RCS file: /cvsroot/clirr/clirr/core/src/test/net/sf/clirr/core/internal/checks/ArraysTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ArraysTest.java 27 Mar 2006 22:00:14 -0000 1.1 +++ ArraysTest.java 29 Mar 2006 12:21:41 -0000 1.2 @@ -1,33 +1,39 @@ package net.sf.clirr.core.internal.checks; -import net.sf.clirr.core.internal.ClassChangeCheck; -import net.sf.clirr.core.ClassSelector; import net.sf.clirr.core.ClassFilter; -import net.sf.clirr.core.internal.checks.ClassModifierCheck; -import net.sf.clirr.core.internal.checks.AbstractCheckTestCase; +import net.sf.clirr.core.ClassSelector; +import net.sf.clirr.core.ScopeSelector; +import net.sf.clirr.core.Severity; +import net.sf.clirr.core.internal.ClassChangeCheck; +import net.sf.clirr.core.spi.Scope; /** * Tests for the ClassModifierCheck class. */ public class ArraysTest extends AbstractCheckTestCase { - public void testAll() throws Exception + public void testReturnTypeChanges() throws Exception { ExpectedDiff[] expected = new ExpectedDiff[] { -// TODO: enable the following expected messages: -// ERROR: 7006: testlib.arrays.Arrays: Return type of method 'public java.lang.String[][] arrayDimDecreases()' has been changed to java.lang.String[] -// ERROR: 7006: testlib.arrays.Arrays: Return type of method 'public java.lang.String[] arrayDimIncreases()' has been changed to java.lang.String[][] -// ERROR: 7006: testlib.arrays.Arrays: Return type of method 'public java.lang.String[] objectArrayBecomesObject()' has been changed to java.lang.String -// ERROR: 7006: testlib.arrays.Arrays: Return type of method 'public java.lang.String objectBecomesArray()' has been changed to java.lang.String[] -// ERROR: 7006: testlib.arrays.Arrays: Return type of method 'public int[] primitiveArrayBecomesPrimitive()' has been changed to int -// ERROR: 7006: testlib.arrays.Arrays: Return type of method 'public int primitiveBecomesArray()' has been changed to int[] + new ExpectedDiff("Return type of method 'public java.lang.String[][] arrayDimDecreases()' has been changed to java.lang.String[]", + Severity.ERROR, "testlib.arrays.Arrays", "public java.lang.String[][] arrayDimDecreases()", null), + new ExpectedDiff("Return type of method 'public java.lang.String[] arrayDimIncreases()' has been changed to java.lang.String[][]", + Severity.ERROR, "testlib.arrays.Arrays", "public java.lang.String[] arrayDimIncreases()", null), + new ExpectedDiff("Return type of method 'public java.lang.String[] objectArrayBecomesObject()' has been changed to java.lang.String", + Severity.ERROR, "testlib.arrays.Arrays", "public java.lang.String[] objectArrayBecomesObject()", null), + new ExpectedDiff("Return type of method 'public int primitiveBecomesArray()' has been changed to int[]", + Severity.ERROR, "testlib.arrays.Arrays", "public int primitiveBecomesArray()", null), + new ExpectedDiff("Return type of method 'public java.lang.String objectBecomesArray()' has been changed to java.lang.String[]", + Severity.ERROR, "testlib.arrays.Arrays", "public java.lang.String objectBecomesArray()", null), + new ExpectedDiff("Return type of method 'public int[] primitiveArrayBecomesPrimitive()' has been changed to int", + Severity.ERROR, "testlib.arrays.Arrays", "public int[] primitiveArrayBecomesPrimitive()", null), }; verify(expected); } protected ClassChangeCheck createCheck() { - return new ClassModifierCheck(getTestDiffListener()); + return new MethodSetCheck(getTestDiffListener(), new ScopeSelector(Scope.PROTECTED)); } protected ClassFilter createClassFilter() |