View | Details | Raw Unified | Return to bug 203454 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/apt/pluggable/tests/FilerTests.java (+37 lines)
Lines 78-81 Link Here
78
		expectingNoFile( proj, ".apt_generated/summary.txt" );
78
		expectingNoFile( proj, ".apt_generated/summary.txt" );
79
	}
79
	}
80
80
81
	/**
82
	 * Test generation of a source file that is referenced by the parent, using the GenClass6 annotation
83
	 * @see javax.annotation.processing.Filer#createSourceFile(CharSequence, javax.lang.model.element.Element...)
84
	 */
85
	public void testCreateSourceFileWithGenReference() throws Throwable
86
	{
87
		// Temporary workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=201931
88
		// Bail out on Linux
89
		String osName = System.getProperty("os.name");
90
		if (null == osName || !osName.contains("Windows")) {
91
			return;
92
		}
93
94
		IJavaProject jproj = createJavaProject(_projectName);
95
		IProject proj = jproj.getProject();
96
		IdeTestUtils.copyResources(proj, "targets/filer02a", "src/targets/filer");
97
		AptConfig.setEnabled(jproj, true);
98
		fullBuild();
99
		expectingNoProblems();
100
		
101
		// Check whether generated sources were generated and compiled
102
		expectingFile(proj, ".apt_generated/gen6/Generated02.java");
103
		final String[] expectedClasses = { "targets.filer.Parent02", "gen6.Generated02" };
104
		expectingUniqueCompiledClasses(expectedClasses);
105
		
106
		// Modify target file to change name of generated file and incrementally rebuild; 
107
		// generated file should be deleted.
108
		IdeTestUtils.copyResources(proj, "targets/filer02b", "src/targets/filer");
109
		incrementalBuild();
110
//		expectingNoProblems();
111
//		
112
//		final String[] expectedClasses2 = { "targets.filer.Parent02", "targets.filer.XxxGenerated02" };
113
//		expectingUniqueCompiledClasses(expectedClasses2);
114
//
115
//		expectingNoFile(proj, ".apt_generated/gen6/Generated02.java");
116
	}
117
81
}
118
}
(-)resources/targets/filer02a/Parent02.java (+26 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007 BEA Systems, Inc.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *    wharley@bea.com - initial API and implementation
10
 *******************************************************************************/
11
12
package targets.filer;
13
14
import org.eclipse.jdt.apt.pluggable.tests.annotations.GenClass6;
15
16
/**
17
 * Processing this class should result in creation of a source file,
18
 * thereby allowing this class to compile
19
 */
20
@GenClass6(name="Generated02", pkg="gen6")
21
public class Parent02 {
22
	gen6.Generated02 _gen;
23
}
24
25
26
(-)resources/targets/filer02b/Parent02.java (+24 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007 BEA Systems, Inc.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *    wharley@bea.com - initial API and implementation
10
 *******************************************************************************/
11
12
package targets.filer;
13
14
import org.eclipse.jdt.apt.pluggable.tests.annotations.GenClass6;
15
16
/**
17
 * Processing this class should result in removal of the previously
18
 * generated type and creation of a new one, resulting in a compilation error.
19
 */
20
@GenClass6(name="XxxGenerated02", pkg="gen6")
21
public class Parent02 {
22
	gen6.Generated02 _gen;
23
}
24

Return to bug 203454