Lines 37-42
Link Here
|
37 |
public static Test suite() { |
37 |
public static Test suite() { |
38 |
return buildTestSuite(PackageInfoTest.class); |
38 |
return buildTestSuite(PackageInfoTest.class); |
39 |
} |
39 |
} |
|
|
40 |
|
41 |
//test for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=258145 : JME on duplicate package-info |
42 |
public void test258145() throws JavaModelException { |
43 |
IPath projectPath = env.addProject("Project", "1.5"); //$NON-NLS-1$ |
44 |
env.addExternalJars(projectPath, Util.getJavaClassLibs()); |
45 |
fullBuild(projectPath); |
46 |
|
47 |
// remove old package fragment root so that names don't collide |
48 |
env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ |
49 |
|
50 |
IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ |
51 |
env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ |
52 |
|
53 |
IPath otherRoot = env.addPackageFragmentRoot(projectPath, "test"); //$NON-NLS-1$ |
54 |
env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ |
55 |
|
56 |
env.addPackage(root, "my.foo"); |
57 |
env.addFile(root, "my/foo/package-info.java", //$NON-NLS-1$ //$NON-NLS-2$ |
58 |
"/**\n" + |
59 |
"* A demo package for foo.\n" + |
60 |
"*/\n" + |
61 |
"package my.foo;\n" |
62 |
); |
63 |
|
64 |
fullBuild(projectPath); |
65 |
|
66 |
env.addPackage(otherRoot, "my.foo"); |
67 |
|
68 |
|
69 |
IPath otherPackageInfoPath = env.addFile(otherRoot, "my/foo/package-info.java", //$NON-NLS-1$ //$NON-NLS-2$ |
70 |
"/**\n" + |
71 |
"* A demo package for foo.\n" + |
72 |
"*/\n" + |
73 |
"package my.foo;\n" |
74 |
); |
75 |
|
76 |
incrementalBuild(projectPath); |
77 |
expectingOnlySpecificProblemFor(otherPackageInfoPath, new Problem("my/foo/package-info.java", "The type package-info is already defined", otherPackageInfoPath, 0, 0, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ |
78 |
} |
40 |
public void test001() throws JavaModelException { |
79 |
public void test001() throws JavaModelException { |
41 |
IPath projectPath = env.addProject("Project", "1.5"); //$NON-NLS-1$ |
80 |
IPath projectPath = env.addProject("Project", "1.5"); //$NON-NLS-1$ |
42 |
env.addExternalJars(projectPath, Util.getJavaClassLibs()); |
81 |
env.addExternalJars(projectPath, Util.getJavaClassLibs()); |