Lines 31-63
Link Here
|
31 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=117302 |
31 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=117302 |
32 |
public void testFilteredResources() throws JavaModelException { |
32 |
public void testFilteredResources() throws JavaModelException { |
33 |
IPath projectPath = env.addProject("P"); //$NON-NLS-1$ |
33 |
IPath projectPath = env.addProject("P"); //$NON-NLS-1$ |
34 |
IPath src = env.getPackageFragmentRootPath(projectPath, ""); //$NON-NLS-1$ |
34 |
env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ |
35 |
env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ |
35 |
IPath src = env.addPackageFragmentRoot( |
|
|
36 |
projectPath, |
37 |
"", //$NON-NLS-1$ |
38 |
new IPath[] {new org.eclipse.core.runtime.Path("foo/;bar/")}, //$NON-NLS-1$ |
39 |
new IPath[] {new org.eclipse.core.runtime.Path("foo/ignored/")}, //$NON-NLS-1$ |
40 |
"bin"); //$NON-NLS-1$ |
36 |
env.addExternalJars(projectPath, Util.getJavaClassLibs()); |
41 |
env.addExternalJars(projectPath, Util.getJavaClassLibs()); |
37 |
|
42 |
|
38 |
env.addClass(src, "x", "A", //$NON-NLS-1$ //$NON-NLS-2$ |
43 |
env.addClass(src, "foo", "A", //$NON-NLS-1$ //$NON-NLS-2$ |
39 |
"package x;"+ //$NON-NLS-1$ |
44 |
"package foo;"+ //$NON-NLS-1$ |
40 |
"public class A extends q.B {}" //$NON-NLS-1$ |
45 |
"public class A extends bar.B {}" //$NON-NLS-1$ |
41 |
); |
46 |
); |
42 |
env.addClass(src, "q", "B", //$NON-NLS-1$ //$NON-NLS-2$ |
47 |
env.addClass(src, "bar", "B", //$NON-NLS-1$ //$NON-NLS-2$ |
43 |
"package q;"+ //$NON-NLS-1$ |
48 |
"package bar;"+ //$NON-NLS-1$ |
44 |
"public class B {}" //$NON-NLS-1$ |
49 |
"public class B {}" //$NON-NLS-1$ |
45 |
); |
50 |
); |
46 |
env.addFile(src.append("q"), "test.txt", "test file"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
51 |
env.addFolder(src, "foo/skip"); //$NON-NLS-1$ |
|
|
52 |
IPath ignored = env.addFolder(src, "foo/ignored"); //$NON-NLS-1$ |
53 |
env.addFile(ignored, "test.txt", "test file"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
54 |
env.addFile(src.append("bar"), "test.txt", "test file"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
55 |
|
47 |
org.eclipse.jdt.core.IJavaProject p = env.getJavaProject("P"); |
56 |
org.eclipse.jdt.core.IJavaProject p = env.getJavaProject("P"); |
48 |
java.util.Map options = p.getOptions(true); |
57 |
java.util.Map options = p.getOptions(true); |
49 |
options.put(org.eclipse.jdt.core.JavaCore.CORE_JAVA_BUILD_RESOURCE_COPY_FILTER, "q*"); //$NON-NLS-1$ |
58 |
options.put(org.eclipse.jdt.core.JavaCore.CORE_JAVA_BUILD_RESOURCE_COPY_FILTER, "bar*"); //$NON-NLS-1$ |
|
|
59 |
options.put(org.eclipse.jdt.core.JavaCore.CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER, "enabled"); //$NON-NLS-1$ |
50 |
p.setOptions(options); |
60 |
p.setOptions(options); |
51 |
|
61 |
|
52 |
int max = org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.MAX_AT_ONCE; |
62 |
int max = org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.MAX_AT_ONCE; |
53 |
try { |
63 |
try { |
54 |
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.MAX_AT_ONCE = 1; |
64 |
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.MAX_AT_ONCE = 1; |
55 |
fullBuild(); |
65 |
fullBuild(); |
|
|
66 |
expectingNoProblems(); |
67 |
expectingNoPresenceOf(projectPath.append("bin/foo/skip/")); //$NON-NLS-1$ |
68 |
expectingNoPresenceOf(projectPath.append("bin/foo/ignored/")); //$NON-NLS-1$ |
69 |
expectingNoPresenceOf(projectPath.append("bin/bar/test.txt")); //$NON-NLS-1$ |
70 |
|
71 |
env.removeFolder(projectPath.append("bin/bar")); //$NON-NLS-1$ |
72 |
env.addClass(src, "x", "A", //$NON-NLS-1$ //$NON-NLS-2$ |
73 |
"package x;"+ //$NON-NLS-1$ |
74 |
"public class A extends bar.B {}" //$NON-NLS-1$ |
75 |
); |
76 |
env.addFile(src.append("bar"), "test.txt", "changed test file"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
77 |
incrementalBuild(); |
78 |
expectingNoProblems(); |
79 |
expectingNoPresenceOf(projectPath.append("bin/foo/skip/")); //$NON-NLS-1$ |
80 |
expectingNoPresenceOf(projectPath.append("bin/foo/ignored/")); //$NON-NLS-1$ |
81 |
expectingNoPresenceOf(projectPath.append("bin/bar/test.txt")); //$NON-NLS-1$ |
56 |
} finally { |
82 |
} finally { |
57 |
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.MAX_AT_ONCE = max; |
83 |
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.MAX_AT_ONCE = max; |
58 |
} |
84 |
} |
59 |
expectingNoProblems(); |
|
|
60 |
expectingNoPresenceOf(projectPath.append("bin/q/test.txt")); //$NON-NLS-1$ |
61 |
} |
85 |
} |
62 |
|
86 |
|
63 |
public void testSimpleProject() throws JavaModelException { |
87 |
public void testSimpleProject() throws JavaModelException { |