minor: removed exceptions not thrown

This commit is contained in:
rnveach 2015-10-29 21:55:59 -04:00 committed by Roman Ivanov
parent 83c70ff293
commit 8cdcc5091a
6 changed files with 26 additions and 28 deletions

View File

@ -437,7 +437,7 @@ public class ConfigurationLoaderTest {
}
@Test
public void testLoadConfigurationWrongURL() throws CheckstyleException {
public void testLoadConfigurationWrongURL() {
try {
final DefaultConfiguration config =
(DefaultConfiguration) ConfigurationLoader.loadConfiguration(
@ -454,7 +454,7 @@ public class ConfigurationLoaderTest {
}
@Test
public void testLoadConfigurationDeprecated() throws CheckstyleException {
public void testLoadConfigurationDeprecated() {
try {
@SuppressWarnings("deprecation")
final DefaultConfiguration config =
@ -482,7 +482,7 @@ public class ConfigurationLoaderTest {
}
@Test
public void testLoadConfigurationFromClassPath() throws CheckstyleException {
public void testLoadConfigurationFromClassPath() {
try {
final DefaultConfiguration config =
(DefaultConfiguration) ConfigurationLoader.loadConfiguration(

View File

@ -38,7 +38,7 @@ public class PackageObjectFactoryTest {
new HashSet<String>(), Thread.currentThread().getContextClassLoader());
@Test(expected = IllegalArgumentException.class)
public void testCtorException() throws CheckstyleException {
public void testCtorException() {
new PackageObjectFactory(new HashSet<String>(), null);
}

View File

@ -21,12 +21,10 @@ package com.puppycrawl.tools.checkstyle;
import org.junit.Test;
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
public class PropertiesExpanderTest {
@Test(expected = IllegalArgumentException.class)
public void testCtorException() throws CheckstyleException {
public void testCtorException() {
new PropertiesExpander(null);
}

View File

@ -61,7 +61,7 @@ public class PropertyCacheFileTest {
}
@Test
public void testCtor() throws IOException {
public void testCtor() {
try {
new PropertyCacheFile(null, "");
}

View File

@ -43,7 +43,7 @@ public class AnnotationUtilityTest {
}
@Test
public void testContainsAnnotationNull() throws ReflectiveOperationException {
public void testContainsAnnotationNull() {
try {
AnnotationUtility.containsAnnotation(null);
Assert.fail();
@ -54,7 +54,7 @@ public class AnnotationUtilityTest {
}
@Test
public void testContainsAnnotationNull2() throws ReflectiveOperationException {
public void testContainsAnnotationNull2() {
try {
AnnotationUtility.containsAnnotation(null, "");
Assert.fail();
@ -65,14 +65,14 @@ public class AnnotationUtilityTest {
}
@Test
public void testContainsAnnotationFalse() throws ReflectiveOperationException {
public void testContainsAnnotationFalse() {
final DetailAST ast = new DetailAST();
ast.setType(1);
Assert.assertFalse(AnnotationUtility.containsAnnotation(ast));
}
@Test
public void testContainsAnnotationFalse2() throws ReflectiveOperationException {
public void testContainsAnnotationFalse2() {
final DetailAST ast = new DetailAST();
ast.setType(1);
final DetailAST ast2 = new DetailAST();
@ -82,7 +82,7 @@ public class AnnotationUtilityTest {
}
@Test
public void testContainsAnnotationTrue() throws ReflectiveOperationException {
public void testContainsAnnotationTrue() {
final DetailAST ast = new DetailAST();
ast.setType(1);
final DetailAST ast2 = new DetailAST();
@ -95,7 +95,7 @@ public class AnnotationUtilityTest {
}
@Test
public void testAnnotationHolderNull() throws ReflectiveOperationException {
public void testAnnotationHolderNull() {
try {
AnnotationUtility.getAnnotationHolder(null);
Assert.fail();
@ -106,7 +106,7 @@ public class AnnotationUtilityTest {
}
@Test
public void testAnnotationNull() throws ReflectiveOperationException {
public void testAnnotationNull() {
try {
AnnotationUtility.getAnnotation(null, null);
Assert.fail();
@ -117,7 +117,7 @@ public class AnnotationUtilityTest {
}
@Test
public void testAnnotationNull2() throws ReflectiveOperationException {
public void testAnnotationNull2() {
try {
AnnotationUtility.getAnnotation(new DetailAST(), null);
Assert.fail();
@ -128,7 +128,7 @@ public class AnnotationUtilityTest {
}
@Test
public void testAnnotationEmpty() throws ReflectiveOperationException {
public void testAnnotationEmpty() {
try {
AnnotationUtility.getAnnotation(new DetailAST(), "");
Assert.fail();

View File

@ -35,13 +35,13 @@ public class ScopeUtilsTest {
}
@Test
public void testInEnumOnRoot() throws ReflectiveOperationException {
public void testInEnumOnRoot() {
final DetailAST ast = new DetailAST();
Assert.assertFalse(ScopeUtils.isInEnumBlock(ast));
}
@Test
public void testInEnumBlockInNew() throws ReflectiveOperationException {
public void testInEnumBlockInNew() {
final DetailAST ast = new DetailAST();
ast.setType(TokenTypes.LITERAL_NEW);
final DetailAST ast2 = new DetailAST();
@ -52,7 +52,7 @@ public class ScopeUtilsTest {
}
@Test
public void testInEnumBlockWithEnum() throws ReflectiveOperationException {
public void testInEnumBlockWithEnum() {
final DetailAST ast0 = new DetailAST();
ast0.setType(TokenTypes.OBJBLOCK);
final DetailAST ast1 = new DetailAST();
@ -66,7 +66,7 @@ public class ScopeUtilsTest {
}
@Test
public void testInEnumBlockInInterface() throws ReflectiveOperationException {
public void testInEnumBlockInInterface() {
final DetailAST ast = new DetailAST();
ast.setType(TokenTypes.INTERFACE_DEF);
final DetailAST ast2 = new DetailAST();
@ -77,7 +77,7 @@ public class ScopeUtilsTest {
}
@Test
public void testInEnumBlockInAnnotation() throws ReflectiveOperationException {
public void testInEnumBlockInAnnotation() {
final DetailAST ast = new DetailAST();
ast.setType(TokenTypes.ANNOTATION_DEF);
final DetailAST ast2 = new DetailAST();
@ -88,7 +88,7 @@ public class ScopeUtilsTest {
}
@Test
public void testInEnumBlockInClass() throws ReflectiveOperationException {
public void testInEnumBlockInClass() {
final DetailAST ast = new DetailAST();
ast.setType(TokenTypes.CLASS_DEF);
final DetailAST ast2 = new DetailAST();
@ -99,7 +99,7 @@ public class ScopeUtilsTest {
}
@Test
public void testIsOuterMostTypeInterface() throws ReflectiveOperationException {
public void testIsOuterMostTypeInterface() {
final DetailAST ast = new DetailAST();
ast.setType(TokenTypes.INTERFACE_DEF);
final DetailAST ast2 = new DetailAST();
@ -110,7 +110,7 @@ public class ScopeUtilsTest {
}
@Test
public void testIsOuterMostTypeAnnotation() throws ReflectiveOperationException {
public void testIsOuterMostTypeAnnotation() {
final DetailAST ast = new DetailAST();
ast.setType(TokenTypes.ANNOTATION_DEF);
final DetailAST ast2 = new DetailAST();
@ -121,7 +121,7 @@ public class ScopeUtilsTest {
}
@Test
public void testIsOuterMostTypeEnum() throws ReflectiveOperationException {
public void testIsOuterMostTypeEnum() {
final DetailAST ast = new DetailAST();
ast.setType(TokenTypes.ENUM_DEF);
final DetailAST ast2 = new DetailAST();
@ -132,7 +132,7 @@ public class ScopeUtilsTest {
}
@Test
public void testIsLocalVariableDefCatch() throws ReflectiveOperationException {
public void testIsLocalVariableDefCatch() {
final DetailAST ast = new DetailAST();
ast.setType(TokenTypes.LITERAL_CATCH);
final DetailAST ast2 = new DetailAST();
@ -143,7 +143,7 @@ public class ScopeUtilsTest {
}
@Test
public void testIsLocalVariableDefUnexpected() throws ReflectiveOperationException {
public void testIsLocalVariableDefUnexpected() {
final DetailAST ast = new DetailAST();
ast.setType(TokenTypes.LITERAL_CATCH);