Added more test cases for Type Resolution. Change so that test files are available both as .java and .class, this is really the only way to properly test Type Resolution.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5866 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Ryan Gustafson
2008-03-05 22:56:26 +00:00
parent 4e78fbaba6
commit 6aa4be951a
7 changed files with 371 additions and 29 deletions

View File

@@ -219,6 +219,7 @@
<sysproperty key="pmd.regress" value="${test.regression}"/>
<classpath>
<path refid="${test.dependencies}" />
<path path="${dir.regress}"/>
</classpath>
<batchtest fork="yes" todir="${test.outputdir}/xml">
<fileset dir="${dir.regress}">

View File

@@ -0,0 +1,18 @@
package test.net.sourceforge.pmd.typeresolution.testdata;
import java.util.AbstractList;
import java.util.List;
public class AnonymousInnerClass {
List<Object> list = new AbstractList<Object>() {
@Override
public Object get(int index) {
return null;
}
@Override
public int size() {
return 0;
}
};
}

View File

@@ -0,0 +1,7 @@
package test.net.sourceforge.pmd.typeresolution.testdata;
import java.util.ArrayList;
public class ArrayListFound {
ArrayList x;
}

View File

@@ -0,0 +1,7 @@
package test.net.sourceforge.pmd.typeresolution.testdata;
public class ExtraTopLevelClass {
}
class TheExtraTopLevelClass {
}

View File

@@ -0,0 +1,6 @@
package test.net.sourceforge.pmd.typeresolution.testdata;
public class InnerClass {
public class TheInnerClass {
}
}

View File

@@ -0,0 +1,39 @@
package test.net.sourceforge.pmd.typeresolution.testdata;
public class Literals {
String s = "s";
boolean boolean1 = false;
boolean boolean2 = true;
Object obj = null;
byte byte1 = 0;
byte byte2 = 0x0F;
byte byte3 = -007;
short short1 = 0;
short short2 = 0x0F;
short short3 = -007;
char char1 = 0;
char char2 = 0x0F;
char char3 = 007;
char char4 = 'a';
int int1 = 0;
int int2 = 0x0F;
int int3 = -007;
int int4 = 'a';
long long1 = 0;
long long2 = 0x0F;
long long3 = -007;
long long4 = 0L;
long long5 = 0x0Fl;
long long6 = -007L;
long long7 = 'a';
float float1 = 0.0f;
float float2 = -10e+01f;
float float3 = 0x08.08p3f;
float float4 = 0xFF;
float float5 = 'a';
double double1 = 0.0;
double double2 = -10e+01;
double double3 = 0x08.08p3;
double double4 = 0xFF;
double double5 = 'a';
}