Package Annotation Check compilbale UT input
This commit is contained in:
parent
2efbd52f77
commit
a94d50133e
|
|
@ -25,40 +25,6 @@ import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
|||
|
||||
public class PackageAnnotationTest extends BaseCheckTestSupport
|
||||
{
|
||||
/**
|
||||
* This tests 1 package annotation that is not in the package-info.java file.
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
public void testBadPackageAnnotation1() throws Exception
|
||||
{
|
||||
DefaultConfiguration checkConfig = createCheckConfig(PackageAnnotationCheck.class);
|
||||
|
||||
final String[] expected = {
|
||||
"0: Package annotations must be in the package-info.java info.",
|
||||
};
|
||||
|
||||
verify(checkConfig, getPath("annotation" + File.separator + "BadPackageAnnotation1.java"), expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* This tests 2 package annotations that are not in the package-info.java file.
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
public void testBadPackageAnnotation2() throws Exception
|
||||
{
|
||||
DefaultConfiguration checkConfig = createCheckConfig(PackageAnnotationCheck.class);
|
||||
|
||||
final String[] expected = {
|
||||
"0: Package annotations must be in the package-info.java info.",
|
||||
};
|
||||
|
||||
verify(checkConfig, getPath("annotation" + File.separator + "BadPackageAnnotation2.java"), expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* This tests a package annotation that is in the package-info.java file.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
@GunNRoses //this will not compile in Sun's compiler as of 1.6.0.11
|
||||
package com.puppycrawl.tools.checkstyle.annotation;
|
||||
|
||||
|
||||
public class BadPackageAnnotation1
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@interface GunNRoses {
|
||||
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
@Package//this will not compile in Sun's compiler as of 1.6.0.11
|
||||
@Metallica
|
||||
package com.puppycrawl.tools.checkstyle.annotation;
|
||||
|
||||
|
||||
public class BadPackageAnnotation2
|
||||
{
|
||||
|
||||
}
|
||||
@interface Package {
|
||||
|
||||
}
|
||||
|
||||
@interface Metallica {
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue