Lines 15-24
Link Here
|
15 |
import junit.framework.*; |
15 |
import junit.framework.*; |
16 |
|
16 |
|
17 |
import org.eclipse.core.resources.IFolder; |
17 |
import org.eclipse.core.resources.IFolder; |
|
|
18 |
import org.eclipse.core.resources.IMarker; |
18 |
import org.eclipse.core.resources.IProject; |
19 |
import org.eclipse.core.resources.IProject; |
19 |
import org.eclipse.core.runtime.CoreException; |
20 |
import org.eclipse.core.runtime.CoreException; |
20 |
import org.eclipse.core.runtime.IPath; |
21 |
import org.eclipse.core.runtime.IPath; |
21 |
import org.eclipse.jdt.core.JavaModelException; |
22 |
import org.eclipse.jdt.core.JavaModelException; |
|
|
23 |
import org.eclipse.jdt.core.compiler.CategorizedProblem; |
22 |
import org.eclipse.jdt.core.tests.util.Util; |
24 |
import org.eclipse.jdt.core.tests.util.Util; |
23 |
|
25 |
|
24 |
public class PackageTests extends BuilderTests { |
26 |
public class PackageTests extends BuilderTests { |
Lines 83-88
Link Here
|
83 |
expectingNoProblems(); |
85 |
expectingNoProblems(); |
84 |
} |
86 |
} |
85 |
|
87 |
|
|
|
88 |
/** |
89 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=251690 |
90 |
*/ |
91 |
public void testNoPackageProblem() throws JavaModelException { |
92 |
IPath projectPath = env.addProject("Project"); //$NON-NLS-1$ |
93 |
env.addExternalJars(projectPath, Util.getJavaClassLibs()); |
94 |
env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ |
95 |
IPath src = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ |
96 |
env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ |
97 |
|
98 |
IPath aPath = env.addClass(src, "p", "A", //$NON-NLS-1$ //$NON-NLS-2$ |
99 |
"package p;\n"+ //$NON-NLS-1$ |
100 |
"public class A {}" //$NON-NLS-1$ |
101 |
); |
102 |
|
103 |
IPath bPath = env.addClass(src, "p.A", "B", //$NON-NLS-1$ //$NON-NLS-2$ |
104 |
"public class B {}" //$NON-NLS-1$ |
105 |
); |
106 |
|
107 |
fullBuild(); |
108 |
expectingOnlySpecificProblemFor(aPath, |
109 |
new Problem("", "The type A collides with a package", aPath, 24, 25, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_WARNING)); //$NON-NLS-1$ //$NON-NLS-2$ |
110 |
expectingOnlySpecificProblemFor(bPath, |
111 |
new Problem("", "The declared package \"\" does not match the expected package \"p.A\"", bPath, 0, 0, CategorizedProblem.CAT_INTERNAL, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ |
112 |
} |
113 |
|
86 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=117092 |
114 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=117092 |
87 |
// simplistic linked subfolder used as package, external case (not in workspace) |
115 |
// simplistic linked subfolder used as package, external case (not in workspace) |
88 |
public void test001() throws CoreException { |
116 |
public void test001() throws CoreException { |