Upgrading to JUnit 3.8.1

This commit is contained in:
Oliver Burn 2002-11-15 14:08:11 +00:00
parent 5fdbc89958
commit f8f6ded7b4
59 changed files with 35 additions and 329 deletions

Binary file not shown.

View File

@ -3,13 +3,8 @@ package com.puppycrawl.tools.checkstyle;
import com.puppycrawl.tools.checkstyle.checks.AvoidStarImport;
public class AvoidStarImportTest
extends BaseCheckTestCase
extends BaseCheckTestCase
{
public AvoidStarImportTest(String aName)
{
super(aName);
}
public void testWithChecker()
throws Exception
{

View File

@ -32,11 +32,6 @@ public abstract class BaseCheckTestCase
private final PrintStream mStream = new PrintStream(mBAOS);
protected final Properties mProps = new Properties();
public BaseCheckTestCase(String aName)
{
super(aName);
}
protected Checker createChecker(CheckConfiguration aCheckConfig)
throws Exception
{

View File

@ -5,11 +5,6 @@ import com.puppycrawl.tools.checkstyle.checks.ConstantNameCheck;
public class ConstantNameCheckTest
extends BaseCheckTestCase
{
public ConstantNameCheckTest(String aName)
{
super(aName);
}
public void testDefault()
throws Exception
{
@ -23,7 +18,7 @@ public class ConstantNameCheckTest
};
verify(c, fname, expected);
}
public void testInterface()
throws Exception
{

View File

@ -6,11 +6,6 @@ import com.puppycrawl.tools.checkstyle.checks.BlockOption;
public class EmptyBlockCheckTest
extends BaseCheckTestCase
{
public EmptyBlockCheckTest(String aName)
{
super(aName);
}
public void testDefault()
throws Exception
{

View File

@ -3,13 +3,8 @@ package com.puppycrawl.tools.checkstyle;
import com.puppycrawl.tools.checkstyle.checks.EqualsHashCodeCheck;
public class EqualsHashCodeCheckTest
extends BaseCheckTestCase
extends BaseCheckTestCase
{
public EqualsHashCodeCheckTest(String aName)
{
super(aName);
}
public void testIt() throws Exception
{
final CheckConfiguration checkConfig = new CheckConfiguration();

View File

@ -4,13 +4,8 @@ import com.puppycrawl.tools.checkstyle.checks.FileLengthCheck;
import org.apache.commons.beanutils.ConversionException;
public class FileLengthCheckTest
extends BaseCheckTestCase
extends BaseCheckTestCase
{
public FileLengthCheckTest(String aName)
{
super(aName);
}
private void runIt(String aMax, String[] aExpected) throws Exception
{
final CheckConfiguration checkConfig = new CheckConfiguration();

View File

@ -3,13 +3,8 @@ package com.puppycrawl.tools.checkstyle;
import com.puppycrawl.tools.checkstyle.checks.GenericIllegalRegexpCheck;
public class GenericIllegalRegexpCheckTest
extends BaseCheckTestCase
extends BaseCheckTestCase
{
public GenericIllegalRegexpCheckTest(String aName)
{
super(aName);
}
public void testIt()
throws Exception
{

View File

@ -13,11 +13,6 @@ import org.apache.regexp.RE;
public class GlobalPropertiesSerializationTest
extends TestCase
{
public GlobalPropertiesSerializationTest(String name)
{
super(name);
}
/**
* Copy mConfig using in-memory serialization
* @param aConfig the original

View File

@ -7,11 +7,6 @@ import java.util.Properties;
public class GlobalPropertiesTest
extends TestCase
{
public GlobalPropertiesTest(String name)
{
super(name);
}
public void test1() throws Exception
{
final Properties p = new Properties();

View File

@ -6,11 +6,6 @@ import com.puppycrawl.tools.checkstyle.CheckstyleException;
public class HeaderCheckTest extends BaseCheckTestCase
{
public HeaderCheckTest(String aName)
{
super(aName);
}
public void testStaticHeader()
throws Exception
{

View File

@ -5,11 +5,6 @@ import com.puppycrawl.tools.checkstyle.checks.HiddenFieldCheck;
public class HiddenFieldCheckTest
extends BaseCheckTestCase
{
public HiddenFieldCheckTest(String aName)
{
super(aName);
}
public void testNoParameters()
throws Exception
{

View File

@ -5,11 +5,6 @@ import com.puppycrawl.tools.checkstyle.checks.IllegalImportCheck;
public class IllegalImportCheckTest
extends BaseCheckTestCase
{
public IllegalImportCheckTest(String aName)
{
super(aName);
}
public void testWithSupplied()
throws Exception
{

View File

@ -3,13 +3,8 @@ package com.puppycrawl.tools.checkstyle;
import com.puppycrawl.tools.checkstyle.checks.IllegalInstantiationCheck;
public class IllegalInstantiationCheckTest
extends BaseCheckTestCase
extends BaseCheckTestCase
{
public IllegalInstantiationCheckTest(String aName)
{
super(aName);
}
public void testIt() throws Exception
{
final CheckConfiguration checkConfig = new CheckConfiguration();

View File

@ -3,13 +3,8 @@ package com.puppycrawl.tools.checkstyle;
import com.puppycrawl.tools.checkstyle.checks.InnerAssignmentCheck;
public class InnerAssignmentCheckTest
extends BaseCheckTestCase
extends BaseCheckTestCase
{
public InnerAssignmentCheckTest(String aName)
{
super(aName);
}
public void testIt() throws Exception
{
final CheckConfiguration checkConfig = new CheckConfiguration();

View File

@ -7,11 +7,6 @@ import com.puppycrawl.tools.checkstyle.checks.JavadocMethodCheck;
public class JavadocMethodCheckTest
extends BaseCheckTestCase
{
public JavadocMethodCheckTest(String aName)
{
super(aName);
}
public void testTags()
throws Exception
{
@ -49,7 +44,7 @@ public class JavadocMethodCheckTest
public void testTagsWithResolver()
throws Exception
{
{
final CheckConfiguration checkConfig = new CheckConfiguration();
checkConfig.setClassname(JavadocMethodCheck.class.getName());
checkConfig.addProperty("checkUnusedThrows", "true");
@ -123,7 +118,7 @@ public class JavadocMethodCheckTest
public void testRelaxedJavadoc()
throws Exception
{
final CheckConfiguration checkConfig = new CheckConfiguration();
checkConfig.setClassname(JavadocMethodCheck.class.getName());
checkConfig.addProperty("scope", Scope.PROTECTED.getName());
@ -182,7 +177,7 @@ public class JavadocMethodCheckTest
};
verify(c, fname, expected);
}
public void testScopeAnonInnerWithResolver()
throws Exception
{

View File

@ -13,11 +13,6 @@ import com.puppycrawl.tools.checkstyle.checks.JavadocTypeCheck;
*/
public class JavadocTypeCheckTest extends BaseCheckTestCase
{
public JavadocTypeCheckTest(String arg0)
{
super(arg0);
}
public void testTags() throws Exception
{
final CheckConfiguration checkConfig = new CheckConfiguration();

View File

@ -7,11 +7,6 @@ import com.puppycrawl.tools.checkstyle.checks.JavadocVariableCheck;
public class JavadocVariableCheckTest
extends BaseCheckTestCase
{
public JavadocVariableCheckTest(String aName)
{
super(aName);
}
public void testDefault()
throws Exception
{

View File

@ -4,12 +4,6 @@ import com.puppycrawl.tools.checkstyle.checks.LineLengthCheck;
public class LineLengthCheckTest extends BaseCheckTestCase
{
public LineLengthCheckTest(String aName)
{
super(aName);
}
public void testSimple()
throws Exception
{

View File

@ -5,11 +5,6 @@ import com.puppycrawl.tools.checkstyle.checks.LocalFinalVariableNameCheck;
public class LocalFinalVariableNameCheckTest
extends BaseCheckTestCase
{
public LocalFinalVariableNameCheckTest(String aName)
{
super(aName);
}
public void testDefault()
throws Exception
{

View File

@ -5,11 +5,6 @@ import com.puppycrawl.tools.checkstyle.checks.LocalVariableNameCheck;
public class LocalVariableNameCheckTest
extends BaseCheckTestCase
{
public LocalVariableNameCheckTest(String aName)
{
super(aName);
}
public void testDefault()
throws Exception
{

View File

@ -9,11 +9,6 @@ import com.puppycrawl.tools.checkstyle.api.LocalizedMessage;
public class LocalizedMessageTest
extends TestCase
{
public LocalizedMessageTest(String name)
{
super(name);
}
protected void setUp() throws Exception
{
LocalizedMessage.setLocale(Locale.ENGLISH);

View File

@ -5,11 +5,6 @@ import com.puppycrawl.tools.checkstyle.checks.MemberNameCheck;
public class MemberNameCheckTest
extends BaseCheckTestCase
{
public MemberNameCheckTest(String aName)
{
super(aName);
}
public void testSpecified()
throws Exception
{

View File

@ -6,11 +6,6 @@ import com.puppycrawl.tools.checkstyle.checks.LeftCurlyOption;
public class MethodLeftCurlyCheckTest
extends BaseCheckTestCase
{
public MethodLeftCurlyCheckTest(String aName)
{
super(aName);
}
public void testDefault()
throws Exception
{

View File

@ -22,11 +22,6 @@ import com.puppycrawl.tools.checkstyle.checks.MethodLengthCheck;
public class MethodLengthCheckTest extends BaseCheckTestCase
{
public MethodLengthCheckTest(String aName)
{
super(aName);
}
public void testIt() throws Exception
{
final CheckConfiguration checkConfig = new CheckConfiguration();
@ -50,4 +45,4 @@ public class MethodLengthCheckTest extends BaseCheckTestCase
};
verify(c, fname, expected);
}
}
}

View File

@ -5,11 +5,6 @@ import com.puppycrawl.tools.checkstyle.checks.MethodNameCheck;
public class MethodNameCheckTest
extends BaseCheckTestCase
{
public MethodNameCheckTest(String aName)
{
super(aName);
}
public void testDefault()
throws Exception
{

View File

@ -3,13 +3,8 @@ package com.puppycrawl.tools.checkstyle;
import com.puppycrawl.tools.checkstyle.checks.ModifierCheck;
public class ModifierCheckTest
extends BaseCheckTestCase
extends BaseCheckTestCase
{
public ModifierCheckTest(String aName)
{
super(aName);
}
public void testIt() throws Exception
{
final CheckConfiguration checkConfig = new CheckConfiguration();

View File

@ -16,18 +16,12 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
////////////////////////////////////////////////////////////////////////////////
package com.puppycrawl.tools.checkstyle;
import com.puppycrawl.tools.checkstyle.checks.NeedBracesCheck;
public class NeedBracesCheckTest extends BaseCheckTestCase
{
public NeedBracesCheckTest(String aName)
{
super(aName);
}
public void testIt() throws Exception
{
final CheckConfiguration checkConfig = new CheckConfiguration();
@ -55,4 +49,4 @@ public class NeedBracesCheckTest extends BaseCheckTestCase
};
verify(c, fname, expected);
}
}
}

View File

@ -6,17 +6,12 @@ public class NoWhitespaceAfterCheckTest
extends BaseCheckTestCase
{
private CheckConfiguration checkConfig;
public NoWhitespaceAfterCheckTest(String aName)
{
super(aName);
}
public void setUp() {
checkConfig = new CheckConfiguration();
checkConfig.setClassname(NoWhitespaceAfterCheck.class.getName());
}
public void testDefault() throws Exception
{
final Checker c = createChecker(checkConfig);
@ -31,7 +26,7 @@ public class NoWhitespaceAfterCheckTest
};
verify(c, fname, expected);
}
public void testDot() throws Exception
{
checkConfig.addTokens("DOT");
@ -47,7 +42,7 @@ public class NoWhitespaceAfterCheckTest
verify(c, fname, expected);
}
public void testDotAllowLineBreaks() throws Exception
{
checkConfig.addTokens("DOT");
@ -61,5 +56,5 @@ public class NoWhitespaceAfterCheckTest
};
verify(c, fname, expected);
}
}

View File

@ -6,17 +6,12 @@ public class NoWhitespaceBeforeCheckTest
extends BaseCheckTestCase
{
private CheckConfiguration checkConfig;
public NoWhitespaceBeforeCheckTest(String aName)
{
super(aName);
}
public void setUp() {
checkConfig = new CheckConfiguration();
checkConfig.setClassname(NoWhitespaceBeforeCheck.class.getName());
}
public void testDefault() throws Exception
{
final Checker c = createChecker(checkConfig);
@ -27,7 +22,7 @@ public class NoWhitespaceBeforeCheckTest
};
verify(c, fname, expected);
}
public void testDot() throws Exception
{
checkConfig.addTokens("DOT");
@ -43,7 +38,7 @@ public class NoWhitespaceBeforeCheckTest
verify(c, fname, expected);
}
public void testDotAllowLineBreaks() throws Exception
{
checkConfig.addTokens("DOT");
@ -57,5 +52,5 @@ public class NoWhitespaceBeforeCheckTest
};
verify(c, fname, expected);
}
}

View File

@ -7,12 +7,7 @@ public class OperatorWrapCheckTest
extends BaseCheckTestCase
{
private CheckConfiguration checkConfig;
public OperatorWrapCheckTest(String aName)
{
super(aName);
}
public void setUp() {
checkConfig = new CheckConfiguration();
checkConfig.setClassname(OperatorWrapCheck.class.getName());
@ -45,7 +40,7 @@ public class OperatorWrapCheckTest
};
verify(c, fname, expected);
}
public void testAssignEOL()
throws Exception
{
@ -57,5 +52,5 @@ public class OperatorWrapCheckTest
"33:13: '=' should be on the previous line.",
};
verify(c, fname, expected);
}
}
}

View File

@ -14,14 +14,6 @@ import junit.framework.TestCase;
*/
public class OptionTest extends TestCase {
/**
* Constructor for OptionTest.
* @param arg0
*/
public OptionTest(String arg0) {
super(arg0);
}
public void testBlockOption()
{
BlockOption stmtOpt = BlockOption.STMT;

View File

@ -6,11 +6,6 @@ import com.puppycrawl.tools.checkstyle.checks.LeftCurlyOption;
public class OtherLeftCurlyCheckTest
extends BaseCheckTestCase
{
public OtherLeftCurlyCheckTest(String aName)
{
super(aName);
}
public void testDefault()
throws Exception
{

View File

@ -4,12 +4,8 @@ import com.puppycrawl.tools.checkstyle.api.FileSetCheck;
import com.puppycrawl.tools.checkstyle.checks.PackageHtmlCheck;
public class PackageHtmlCheckTest
extends BaseCheckTestCase
extends BaseCheckTestCase
{
public PackageHtmlCheckTest(String s) {
super(s);
}
public void testPackageHtml()
throws Exception
{

View File

@ -5,11 +5,6 @@ import com.puppycrawl.tools.checkstyle.checks.PackageNameCheck;
public class PackageNameCheckTest
extends BaseCheckTestCase
{
public PackageNameCheckTest(String aName)
{
super(aName);
}
public void testSpecified()
throws Exception
{

View File

@ -5,11 +5,6 @@ import com.puppycrawl.tools.checkstyle.checks.ParameterNameCheck;
public class ParameterNameCheckTest
extends BaseCheckTestCase
{
public ParameterNameCheckTest(String aName)
{
super(aName);
}
public void testSpecified()
throws Exception
{

View File

@ -5,11 +5,6 @@ import com.puppycrawl.tools.checkstyle.checks.ParameterNumberCheck;
public class ParameterNumberCheckTest
extends BaseCheckTestCase
{
public ParameterNumberCheckTest(String aName)
{
super(aName);
}
public void testDefault()
throws Exception
{

View File

@ -6,11 +6,6 @@ import com.puppycrawl.tools.checkstyle.checks.PadOption;
public class ParenPadCheckTest
extends BaseCheckTestCase
{
public ParenPadCheckTest(String aName)
{
super(aName);
}
public void testDefault()
throws Exception
{

View File

@ -5,11 +5,6 @@ import com.puppycrawl.tools.checkstyle.checks.PublicMemberNameCheck;
public class PublicMemberNameCheckTest
extends BaseCheckTestCase
{
public PublicMemberNameCheckTest(String aName)
{
super(aName);
}
public void testDefault()
throws Exception
{

View File

@ -5,11 +5,6 @@ import com.puppycrawl.tools.checkstyle.checks.RedundantImportCheck;
public class RedundantImportCheckTest
extends BaseCheckTestCase
{
public RedundantImportCheckTest(String aName)
{
super(aName);
}
public void testWithChecker()
throws Exception
{

View File

@ -5,11 +5,6 @@ import com.puppycrawl.tools.checkstyle.checks.RedundantModifierCheck;
public class RedundantModifierTest
extends BaseCheckTestCase
{
public RedundantModifierTest(String aName)
{
super(aName);
}
public void testIt()
throws Exception
{

View File

@ -6,11 +6,6 @@ import com.puppycrawl.tools.checkstyle.checks.RightCurlyOption;
public class RightCurlyCheckTest
extends BaseCheckTestCase
{
public RightCurlyCheckTest(String aName)
{
super(aName);
}
public void testDefault()
throws Exception
{

View File

@ -3,13 +3,8 @@ package com.puppycrawl.tools.checkstyle;
import com.puppycrawl.tools.checkstyle.checks.SimplifyBooleanExpressionCheck;
public class SimplifyBooleanExpressionCheckTest
extends BaseCheckTestCase
extends BaseCheckTestCase
{
public SimplifyBooleanExpressionCheckTest(String aName)
{
super(aName);
}
public void testIt()
throws Exception
{

View File

@ -12,11 +12,6 @@ import com.puppycrawl.tools.checkstyle.checks.SimplifyBooleanReturnCheck;
public class SimplifyBooleanReturnCheckTest
extends BaseCheckTestCase
{
public SimplifyBooleanReturnCheckTest(String aName)
{
super(aName);
}
public void testIt()
throws Exception
{

View File

@ -5,11 +5,6 @@ import com.puppycrawl.tools.checkstyle.checks.StaticVariableNameCheck;
public class StaticVariableNameCheckTest
extends BaseCheckTestCase
{
public StaticVariableNameCheckTest(String aName)
{
super(aName);
}
public void testSpecified()
throws Exception
{

View File

@ -7,11 +7,6 @@ import java.io.IOException;
public class StringArrayReaderTest
extends TestCase
{
public StringArrayReaderTest(String name)
{
super(name);
}
public void testClose()
{
final StringArrayReader o = new StringArrayReader(new String[] {""});

View File

@ -5,11 +5,6 @@ import com.puppycrawl.tools.checkstyle.checks.TabCharacterCheck;
public class TabCharacterCheckTest
extends BaseCheckTestCase
{
public TabCharacterCheckTest(String aName)
{
super(aName);
}
public void testIt() throws Exception
{
final CheckConfiguration checkConfig = new CheckConfiguration();

View File

@ -3,13 +3,8 @@ package com.puppycrawl.tools.checkstyle;
import com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck;
public class TodoCommentCheckTest
extends BaseCheckTestCase
extends BaseCheckTestCase
{
public TodoCommentCheckTest(String aName)
{
super(aName);
}
public void testIt()
throws Exception
{

View File

@ -14,11 +14,6 @@ import com.puppycrawl.tools.checkstyle.api.LocalizedMessages;
public class TreeWalkerTest
extends TestCase
{
public TreeWalkerTest(String s)
{
super(s);
}
public void testCreate()
{
new TreeWalker(new LocalizedMessages(), 8);

View File

@ -6,11 +6,6 @@ import com.puppycrawl.tools.checkstyle.checks.LeftCurlyOption;
public class TypeLeftCurlyCheckTest
extends BaseCheckTestCase
{
public TypeLeftCurlyCheckTest(String aName)
{
super(aName);
}
public void testDefault()
throws Exception
{

View File

@ -5,11 +5,6 @@ import com.puppycrawl.tools.checkstyle.checks.TypeNameCheck;
public class TypeNameCheckTest
extends BaseCheckTestCase
{
public TypeNameCheckTest(String aName)
{
super(aName);
}
public void testSpecified()
throws Exception
{

View File

@ -5,11 +5,6 @@ import com.puppycrawl.tools.checkstyle.checks.UnusedImportsCheck;
public class UnusedImportsCheckTest
extends BaseCheckTestCase
{
public UnusedImportsCheckTest(String aName)
{
super(aName);
}
public void testDefault()
throws Exception
{

View File

@ -3,13 +3,8 @@ package com.puppycrawl.tools.checkstyle;
import com.puppycrawl.tools.checkstyle.checks.UpperEllCheck;
public class UpperEllCheckTest
extends BaseCheckTestCase
extends BaseCheckTestCase
{
public UpperEllCheckTest(String aName)
{
super(aName);
}
public void testWithChecker()
throws Exception
{

View File

@ -7,11 +7,6 @@ import com.puppycrawl.tools.checkstyle.api.Utils;
public class UtilsTest
extends TestCase
{
public UtilsTest(String name)
{
super(name);
}
/**
* Test Utils.countCharInString.
*/

View File

@ -3,13 +3,8 @@ package com.puppycrawl.tools.checkstyle;
import com.puppycrawl.tools.checkstyle.checks.VisibilityModifierCheck;
public class VisibilityModifierCheckTest
extends BaseCheckTestCase
extends BaseCheckTestCase
{
public VisibilityModifierCheckTest(String aName)
{
super(aName);
}
private Checker getChecker() throws Exception
{
final CheckConfiguration checkConfig = new CheckConfiguration();

View File

@ -6,17 +6,12 @@ public class WhitespaceAfterCheckTest
extends BaseCheckTestCase
{
private CheckConfiguration mCheckConfig;
public WhitespaceAfterCheckTest(String aName)
{
super(aName);
}
public void setUp() {
mCheckConfig = new CheckConfiguration();
mCheckConfig.setClassname(WhitespaceAfterCheck.class.getName());
}
public void testDefault() throws Exception
{
final Checker c = createChecker(mCheckConfig);
@ -27,7 +22,7 @@ public class WhitespaceAfterCheckTest
};
verify(c, fname, expected);
}
public void testCast() throws Exception
{
mCheckConfig.addTokens("TYPECAST");
@ -38,7 +33,7 @@ public class WhitespaceAfterCheckTest
};
verify(c, fname, expected);
}
public void testSemi() throws Exception
{;
final Checker c = createChecker(mCheckConfig);

View File

@ -5,11 +5,6 @@ import com.puppycrawl.tools.checkstyle.checks.WhitespaceAroundCheck;
public class WhitespaceAroundTest
extends BaseCheckTestCase
{
public WhitespaceAroundTest(String aName)
{
super(aName);
}
public void testIt()
throws Exception
{

View File

@ -5,11 +5,6 @@ import junit.framework.TestCase;
public class ScopeTest
extends TestCase
{
public ScopeTest(String name)
{
super(name);
}
public void testMisc()
{
final Scope o = Scope.getInstance("public");

View File

@ -8,11 +8,6 @@ import java.util.HashSet;
public class ClassResolverTest
extends TestCase
{
public ClassResolverTest(String name)
{
super(name);
}
public void testMisc() throws ClassNotFoundException
{
final Set imps = new HashSet();