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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java (+543 lines)
Lines 53-58 Link Here
53
	return buildUniqueComplianceTestSuite(testClass(), ClassFileConstants.JDK1_5);
53
	return buildUniqueComplianceTestSuite(testClass(), ClassFileConstants.JDK1_5);
54
}
54
}
55
55
56
protected void tearDown() throws Exception {
57
	disposeCascadedJars();
58
	super.tearDown();
59
}
60
61
// PREMATURE find a way to build the jars once for the whole suite
62
private boolean cascadedJarsCreated;
63
private String cascadedJarsDirectoryPath;
64
private void createCascadedJars() {
65
	if (!this.cascadedJarsCreated) {
66
		this.cascadedJarsDirectoryPath = ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString();
67
		if (!this.cascadedJarsDirectoryPath.endsWith(File.separator)) {
68
			this.cascadedJarsDirectoryPath = this.cascadedJarsDirectoryPath + File.separator;
69
		}
70
		try {
71
			Util.createJar(
72
				new String[] {
73
					"p/A.java",
74
					"package p;\n" +
75
					"public class A {\n" +
76
					"}",
77
				},
78
				new String[] {
79
					"META-INF/MANIFEST.MF",
80
					"Manifest-Version: 1.0\n" +
81
					"Created-By: Eclipse JDT Test Harness\n" +
82
					"Class-Path: lib2.jar\n",
83
				},
84
				this.cascadedJarsDirectoryPath + "lib1.jar",
85
				JavaCore.VERSION_1_4);
86
			Util.createJar(
87
				new String[] {
88
					"p/B.java",
89
					"package p;\n" +
90
					"public class B {\n" +
91
					"}",
92
					"p/R.java",
93
					"package p;\n" +
94
					"public class R {\n" +
95
					"  public static final int R2 = 2;\n" +
96
					"}",
97
				},
98
				this.cascadedJarsDirectoryPath + "lib2.jar",
99
				JavaCore.VERSION_1_4);
100
			Util.createJar(
101
				new String[] {
102
					"p/C.java",
103
					"package p;\n" +
104
					"public class C {\n" +
105
					"}",
106
					"p/R.java",
107
					"package p;\n" +
108
					"public class R {\n" +
109
					"  public static final int R3 = 3;\n" +
110
					"}",
111
				},
112
				new String[] {
113
					"META-INF/MANIFEST.MF",
114
					"Manifest-Version: 1.0\n" +
115
					"Created-By: Eclipse JDT Test Harness\n" +
116
					"Class-Path: lib4.jar\n",
117
				},
118
				this.cascadedJarsDirectoryPath + "lib3.jar",
119
				JavaCore.VERSION_1_4);
120
			Util.createJar(
121
				new String[] {
122
					"p/D.java",
123
					"package p;\n" +
124
					"public class D {\n" +
125
					"}",
126
				},
127
				new String[] {
128
					"META-INF/MANIFEST.MF",
129
					"Manifest-Version: 1.0\n" +
130
					"Created-By: Eclipse JDT Test Harness\n" +
131
					"Class-Path: lib1.jar lib3.jar\n",
132
				},
133
				this.cascadedJarsDirectoryPath + "lib4.jar",
134
				JavaCore.VERSION_1_4);
135
			Util.createJar(
136
				new String[] {
137
					"p/C.java",
138
					"package p;\n" +
139
					"public class C {\n" +
140
					"}",
141
					"p/R.java",
142
					"package p;\n" +
143
					"public class R {\n" +
144
					"  public static final int R3 = 3;\n" +
145
					"}",
146
				},
147
				new String[] {
148
					"META-INF/MANIFEST.MF",
149
					"Manifest-Version: 1.0\n" +
150
					"Created-By: Eclipse JDT Test Harness\n" +
151
					"Class-Path: s/lib6.jar\n",
152
				},
153
				this.cascadedJarsDirectoryPath + "lib5.jar",
154
				JavaCore.VERSION_1_4);
155
			new File(this.cascadedJarsDirectoryPath + "s").mkdir();
156
			Util.createJar(
157
				new String[] {
158
					"p/D.java",
159
					"package p;\n" +
160
					"public class D {\n" +
161
					"}",
162
				},
163
				new String[] {
164
					"META-INF/MANIFEST.MF",
165
					"Manifest-Version: 1.0\n" +
166
					"Created-By: Eclipse JDT Test Harness\n" +
167
					"Class-Path: ../lib7.jar\n",
168
				},
169
				this.cascadedJarsDirectoryPath + "s" + File.separator + "lib6.jar",
170
				JavaCore.VERSION_1_4);
171
			Util.createJar(
172
				new String[] {
173
					"p/A.java",
174
					"package p;\n" +
175
					"public class A {\n" +
176
					"}",
177
				},
178
				new String[] {
179
					"META-INF/MANIFEST.MF",
180
					"Manifest-Version: 1.0\n" +
181
					"Created-By: Eclipse JDT Test Harness\n" +
182
					"Class-Path: lib2.jar\n",
183
				},
184
				this.cascadedJarsDirectoryPath + "lib7.jar",
185
				JavaCore.VERSION_1_4);
186
			Util.createJar(
187
				new String[] {
188
					"p/F.java",
189
					"package p;\n" +
190
					"public class F {\n" +
191
					"}",
192
				},
193
				new String[] {
194
					"META-INF/MANIFEST.MF",
195
					"Manifest-Version: 1.0\n" +
196
					"Created-By: Eclipse JDT Test Harness\n" +
197
					"Class-Path: " + this.cascadedJarsDirectoryPath + "lib3.jar lib1.jar\n",
198
				},
199
				this.cascadedJarsDirectoryPath + "lib8.jar",
200
				JavaCore.VERSION_1_4);
201
			Util.createJar(
202
				new String[] {
203
					"p/G.java",
204
					"package p;\n" +
205
					"public class G {\n" +
206
					"}",
207
				},
208
				new String[] {
209
					"META-INF/MANIFEST.MF",
210
					"Manifest-Version: 1.0\n" +
211
					"Created-By: Eclipse JDT Test Harness\n" +
212
					"Class-Path: lib1.jar\n" +
213
					"Class-Path: lib3.jar\n",
214
				},
215
				this.cascadedJarsDirectoryPath + "lib9.jar",
216
				JavaCore.VERSION_1_4);
217
			this.cascadedJarsCreated = true;
218
		} catch (IOException e) {
219
			// ignore
220
		}
221
	}
222
}
223
private void disposeCascadedJars() {
224
	if (this.cascadedJarsCreated) {
225
		Util.delete(this.cascadedJarsDirectoryPath + "lib1.jar");
226
		Util.delete(this.cascadedJarsDirectoryPath + "lib2.jar");
227
		Util.delete(this.cascadedJarsDirectoryPath + "lib3.jar");
228
		Util.delete(this.cascadedJarsDirectoryPath + "lib4.jar");
229
		this.cascadedJarsCreated = false;
230
	}
231
}
232
56
private String getLibraryClassesAsQuotedString() {
233
private String getLibraryClassesAsQuotedString() {
57
	String[] paths = Util.getJavaClassLibs();
234
	String[] paths = Util.getJavaClassLibs();
58
	StringBuffer buffer = new StringBuffer();
235
	StringBuffer buffer = new StringBuffer();
Lines 7815-7820 Link Here
7815
		"1 problem (1 warning)",
7992
		"1 problem (1 warning)",
7816
		true);
7993
		true);
7817
}
7994
}
7995
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97332 - jars pointed by jars
7996
// basic link: a jar only referenced in the manifest of the first one is found
7997
public void test214_jar_ref_in_jar(){
7998
	createCascadedJars();
7999
	this.runConformTest(
8000
		new String[] {
8001
			"src/p/X.java",
8002
			"package p;\n" +
8003
			"/** */\n" +
8004
			"public class X {\n" +
8005
			"  A a;\n" +
8006
			"  B b;\n" +
8007
			"}",
8008
		},
8009
        "\"" + OUTPUT_DIR +  File.separator + "src/p/X.java\""
8010
		+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib1.jar\""
8011
		+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib2.jar\"" // WORK SIMULATED SO FAR
8012
		+ " -sourcepath \"" + OUTPUT_DIR +  File.separator + "src\""
8013
        + " -1.5 -g -preserveAllLocals"
8014
        + " -proceedOnError -referenceInfo"
8015
        + " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
8016
        "",
8017
        "",
8018
        true);
8019
}
8020
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97332 - jars pointed by jars
8021
// may want a specific option to mimick javac 1.4
8022
// caveat: javac 1.5 with -source 1.4 and -target 1.4 still uses the links
8023
public void _test215_jar_ref_in_jar(){
8024
	createCascadedJars();
8025
	this.runNegativeTest(
8026
		new String[] {
8027
			"src/p/X.java",
8028
			"package p;\n" +
8029
			"/** */\n" +
8030
			"public class X {\n" +
8031
			"  A a;\n" +
8032
			"  B b;\n" +
8033
			"}",
8034
		},
8035
     "\"" + OUTPUT_DIR +  File.separator + "src/p/X.java\""
8036
		+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib1.jar\""
8037
		+ " -sourcepath \"" + OUTPUT_DIR +  File.separator + "src\""
8038
     + " -ignoreJarClassPath -g -preserveAllLocals"
8039
     + " -proceedOnError -referenceInfo"
8040
     + " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
8041
     "",
8042
     "----------\n" + 
8043
     "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 5)\n" + 
8044
     "	B b;\n" + 
8045
     "	^\n" + 
8046
     "B cannot be resolved to a type\n" + 
8047
     "----------\n" + 
8048
     "1 problem (1 error)",
8049
     true);
8050
}
8051
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97332 - jars pointed by jars
8052
// links are followed recursively, eliminating dupes
8053
public void test216_jar_ref_in_jar(){
8054
	createCascadedJars();
8055
	this.runConformTest(
8056
		new String[] {
8057
			"src/p/X.java",
8058
			"package p;\n" +
8059
			"/** */\n" +
8060
			"public class X {\n" +
8061
			"  A a;\n" +
8062
			"  B b;\n" +
8063
			"  C c;\n" +
8064
			"  D d;\n" +
8065
			"}",
8066
		},
8067
		"\"" + OUTPUT_DIR +  File.separator + "src/p/X.java\""
8068
		+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib3.jar\""
8069
		+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib4.jar\"" // WORK SIMULATED SO FAR
8070
		+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib1.jar\"" // WORK SIMULATED SO FAR
8071
		+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib2.jar\"" // WORK SIMULATED SO FAR
8072
		+ " -sourcepath \"" + OUTPUT_DIR +  File.separator + "src\""
8073
		+ " -1.5 -g -preserveAllLocals"
8074
		+ " -proceedOnError -referenceInfo"
8075
		+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
8076
		"",
8077
		"",
8078
		true);
8079
}
8080
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97332 - jars pointed by jars
8081
// at first level, this is depth first, masking tailing libs
8082
public void test217_jar_ref_in_jar(){
8083
	createCascadedJars();
8084
	this.runNegativeTest(
8085
		new String[] {
8086
			"src/p/X.java",
8087
			"package p;\n" +
8088
			"/** */\n" +
8089
			"public class X {\n" +
8090
			"  int i = R.R2;\n" +
8091
			"  int j = R.R3;\n" +
8092
			"}",
8093
		},
8094
	  "\"" + OUTPUT_DIR +  File.separator + "src/p/X.java\""
8095
			+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib1.jar\""
8096
			+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib2.jar\"" // WORK SIMULATED SO FAR
8097
			+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib3.jar\""
8098
			+ " -sourcepath \"" + OUTPUT_DIR +  File.separator + "src\""
8099
	  + " -1.5 -g -preserveAllLocals"
8100
	  + " -proceedOnError -referenceInfo"
8101
	  + " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
8102
	  "",
8103
	  "----------\n" + 
8104
	  "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 5)\n" + 
8105
	  "	int j = R.R3;\n" + 
8106
	  "	        ^^^^\n" + 
8107
	  "R.R3 cannot be resolved\n" + 
8108
	  "----------\n" + 
8109
	  "1 problem (1 error)",
8110
	  true);
8111
}
8112
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97332 - jars pointed by jars
8113
// using only links, we adopt a depth first algorithm
8114
public void test218_jar_ref_in_jar(){
8115
	createCascadedJars();
8116
	this.runNegativeTest(
8117
		new String[] {
8118
			"src/p/X.java",
8119
			"package p;\n" +
8120
			"/** */\n" +
8121
			"public class X {\n" +
8122
			"  int i = R.R2;\n" +
8123
			"  int j = R.R3;\n" +
8124
			"}",
8125
		},
8126
	  "\"" + OUTPUT_DIR +  File.separator + "src/p/X.java\""
8127
			+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib4.jar\""
8128
			+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib1.jar\"" // WORK SIMULATED SO FAR
8129
			+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib2.jar\"" // WORK SIMULATED SO FAR
8130
			+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib3.jar\""  // WORK SIMULATED SO FAR
8131
			+ " -sourcepath \"" + OUTPUT_DIR +  File.separator + "src\""
8132
	  + " -1.5 -g -preserveAllLocals"
8133
	  + " -proceedOnError -referenceInfo"
8134
	  + " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
8135
	  "",
8136
	  "----------\n" + 
8137
	  "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 5)\n" + 
8138
	  "	int j = R.R3;\n" + 
8139
	  "	        ^^^^\n" + 
8140
	  "R.R3 cannot be resolved\n" + 
8141
	  "----------\n" + 
8142
	  "1 problem (1 error)",
8143
	  true);
8144
}
8145
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97332 - jars pointed by jars
8146
// managing subdirectories and .. properly
8147
public void test219_jar_ref_in_jar(){
8148
	createCascadedJars();
8149
	this.runConformTest(
8150
		new String[] {
8151
			"src/p/X.java",
8152
			"package p;\n" +
8153
			"/** */\n" +
8154
			"public class X {\n" +
8155
			"  A a;\n" +
8156
			"  B b;\n" +
8157
			"  C c;\n" +
8158
			"  D d;\n" +
8159
			"}",
8160
		},
8161
		"\"" + OUTPUT_DIR +  File.separator + "src/p/X.java\""
8162
		+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib5.jar\""
8163
		+ " -cp \"" + this.cascadedJarsDirectoryPath + "s" + File.separator + "lib6.jar\"" // WORK SIMULATED SO FAR
8164
		+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib7.jar\"" // WORK SIMULATED SO FAR
8165
		+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib2.jar\"" // WORK SIMULATED SO FAR
8166
		+ " -sourcepath \"" + OUTPUT_DIR +  File.separator + "src\""
8167
		+ " -1.5 -g -preserveAllLocals"
8168
		+ " -proceedOnError -referenceInfo"
8169
		+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
8170
		"",
8171
		"",
8172
		true);
8173
}
8174
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97332 - jars pointed by jars
8175
// variant: the second jar on a line is found as well
8176
public void test220_jar_ref_in_jar(){
8177
	createCascadedJars();
8178
	this.runConformTest(
8179
		new String[] {
8180
			"src/p/X.java",
8181
			"package p;\n" +
8182
			"/** */\n" +
8183
			"public class X {\n" +
8184
			"  C c;\n" +
8185
			"}",
8186
		},
8187
     "\"" + OUTPUT_DIR +  File.separator + "src/p/X.java\""
8188
		+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib4.jar\""
8189
		+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib3.jar\"" // WORK SIMULATED SO FAR
8190
		+ " -sourcepath \"" + OUTPUT_DIR +  File.separator + "src\""
8191
     + " -1.5 -g -preserveAllLocals"
8192
     + " -proceedOnError -referenceInfo"
8193
     + " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
8194
     "",
8195
     "",
8196
     true);
8197
}
8198
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97332 - jars pointed by jars
8199
// we eat up absolute links silently
8200
public void test221_jar_ref_in_jar(){
8201
	createCascadedJars();
8202
	this.runConformTest(
8203
		new String[] {
8204
			"src/p/X.java",
8205
			"package p;\n" +
8206
			"/** */\n" +
8207
			"public class X {\n" +
8208
			"  F f;\n" +
8209
			"}",
8210
		},
8211
	"\"" + OUTPUT_DIR +  File.separator + "src/p/X.java\""
8212
			+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib8.jar\""
8213
			+ " -sourcepath \"" + OUTPUT_DIR +  File.separator + "src\""
8214
	+ " -1.5 -g -preserveAllLocals"
8215
	+ " -proceedOnError -referenceInfo"
8216
	+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
8217
	"",
8218
	"",
8219
	true);
8220
}
8221
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97332 - jars pointed by jars
8222
// absolute links do not mask following relative links
8223
public void test222_jar_ref_in_jar(){
8224
	createCascadedJars();
8225
	this.runConformTest(
8226
		new String[] {
8227
			"src/p/X.java",
8228
			"package p;\n" +
8229
			"/** */\n" +
8230
			"public class X {\n" +
8231
			"  A a;\n" +
8232
			"  F f;\n" +
8233
			"}",
8234
		},
8235
	"\"" + OUTPUT_DIR +  File.separator + "src/p/X.java\""
8236
			+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib8.jar\""
8237
			+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib1.jar\"" // WORK SIMULATED SO FAR
8238
			+ " -sourcepath \"" + OUTPUT_DIR +  File.separator + "src\""
8239
	+ " -1.5 -g -preserveAllLocals"
8240
	+ " -proceedOnError -referenceInfo"
8241
	+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
8242
	"",
8243
	"",
8244
	true);
8245
}
8246
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97332 - jars pointed by jars
8247
// absolute links are not followed
8248
public void test223_jar_ref_in_jar(){
8249
	createCascadedJars();
8250
	this.runNegativeTest(
8251
		new String[] {
8252
			"src/p/X.java",
8253
			"package p;\n" +
8254
			"/** */\n" +
8255
			"public class X {\n" +
8256
			"  C c;\n" +
8257
			"}",
8258
		},
8259
	"\"" + OUTPUT_DIR +  File.separator + "src/p/X.java\""
8260
			+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib8.jar\""
8261
			+ " -sourcepath \"" + OUTPUT_DIR +  File.separator + "src\""
8262
	+ " -1.5 -g -preserveAllLocals"
8263
	+ " -proceedOnError -referenceInfo"
8264
	+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
8265
	"",
8266
	"----------\n" + 
8267
	"1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 4)\n" + 
8268
	"	C c;\n" + 
8269
	"	^\n" + 
8270
	"C cannot be resolved to a type\n" + 
8271
	"----------\n" + 
8272
	"1 problem (1 error)",
8273
	true);
8274
}
8275
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97332 - jars pointed by jars
8276
// we accept duplicate classpath lines in manifest and we follow the first line
8277
// WORK javac emits a warning - what do we want to do
8278
public void test224_jar_ref_in_jar(){
8279
	createCascadedJars();
8280
	this.runConformTest(
8281
		new String[] {
8282
			"src/p/X.java",
8283
			"package p;\n" +
8284
			"/** */\n" +
8285
			"public class X {\n" +
8286
			"  A a;\n" +
8287
			"  G g;\n" +
8288
			"}",
8289
		},
8290
	"\"" + OUTPUT_DIR +  File.separator + "src/p/X.java\""
8291
			+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib9.jar\""
8292
			+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib1.jar\"" // WORK SIMULATED SO FAR
8293
			+ " -sourcepath \"" + OUTPUT_DIR +  File.separator + "src\""
8294
	+ " -1.5 -g -preserveAllLocals"
8295
	+ " -proceedOnError -referenceInfo"
8296
	+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
8297
	"",
8298
	"",
8299
	true);
8300
}
8301
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97332 - jars pointed by jars
8302
// we accept duplicate classpath lines in manifest and we follow the jars of the
8303
// second and following lines as well
8304
// WORK javac emits a warning - what do we want to do
8305
public void test225_jar_ref_in_jar(){
8306
	createCascadedJars();
8307
	this.runConformTest(
8308
		new String[] {
8309
			"src/p/X.java",
8310
			"package p;\n" +
8311
			"/** */\n" +
8312
			"public class X {\n" +
8313
			"  C c;\n" +
8314
			"  G g;\n" +
8315
			"}",
8316
		},
8317
	"\"" + OUTPUT_DIR +  File.separator + "src/p/X.java\""
8318
			+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib9.jar\""
8319
			+ " -cp \"" + this.cascadedJarsDirectoryPath + "lib3.jar\"" // WORK SIMULATED SO FAR
8320
			+ " -sourcepath \"" + OUTPUT_DIR +  File.separator + "src\""
8321
	+ " -1.5 -g -preserveAllLocals"
8322
	+ " -proceedOnError -referenceInfo"
8323
	+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
8324
	"",
8325
	"",
8326
	true);
8327
}
8328
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97332 - jars pointed by jars
8329
// bootclasspath does not get expanded
8330
// WORK would need taylored jars that can replace the runtime
8331
//      if we manage to do this one, we should also track extensions
8332
public void _test226_jar_ref_in_jar(){
8333
	createCascadedJars();
8334
	this.runNegativeTest(
8335
		new String[] {
8336
			"src/p/X.java",
8337
			"package p;\n" +
8338
			"/** */\n" +
8339
			"public class X {\n" +
8340
			"  A a;\n" +
8341
			"  C c;\n" +
8342
			"}",
8343
		},
8344
		"\"" + OUTPUT_DIR +  File.separator + "src/p/X.java\""
8345
	  	+ " -bootclasspath " + getLibraryClassesAsQuotedString() 
8346
	  	+ File.pathSeparator + "\"" + OUTPUT_DIR + File.separator + this.cascadedJarsDirectoryPath + "lib1.jar\""
8347
		+ " -sourcepath \"" + OUTPUT_DIR +  File.separator + "src\""
8348
		+ " -1.5 -g -preserveAllLocals"
8349
		+ " -proceedOnError -referenceInfo"
8350
		+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
8351
		"",
8352
		"----------\n" + 
8353
		"1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 5)\n" + 
8354
		"	C c;\n" + 
8355
		"	^\n" + 
8356
		"C cannot be resolved to a type\n" + 
8357
		"----------\n" + 
8358
		"1 problem (1 error)",
8359
		true);
8360
}
7818
public static Class testClass() {
8361
public static Class testClass() {
7819
	return BatchCompilerTest.class;
8362
	return BatchCompilerTest.class;
7820
}
8363
}

Return to bug 97332