View | Details | Raw Unified | Return to bug 301529
Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/ClasspathTests.java (-5 / +17 lines)
Lines 5985-5994 Link Here
5985
	try {
5985
	try {
5986
		preferences.setAutoBuilding(false);
5986
		preferences.setAutoBuilding(false);
5987
		IJavaProject project = createJavaProject("P");
5987
		IJavaProject project = createJavaProject("P");
5988
		JavaCore.setClasspathVariables(
5989
				new String[] {"INVALID_LIB",},
5990
				new IPath[] {new Path("/lib/tmp.jar")},
5991
				null);
5992
		
5988
		StringBuffer buffer = new StringBuffer(
5993
		StringBuffer buffer = new StringBuffer(
5989
				"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
5994
				"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
5990
				"<classpath>\n" +
5995
				"<classpath>\n" +
5991
				"   <classpathentry  kind=\"var\" path=\"TEST_LIB\">\n" +
5996
				"   <classpathentry  kind=\"var\" path=\"INVALID_LIB\">\n" +
5992
				"    	<attributes>\n" + 
5997
				"    	<attributes>\n" + 
5993
				"   	 <attribute name=\"optional\" value=\"true\"/>" +
5998
				"   	 <attribute name=\"optional\" value=\"true\"/>" +
5994
				"    	</attributes>\n" +
5999
				"    	</attributes>\n" +
Lines 6017-6022 Link Here
6017
	} finally {
6022
	} finally {
6018
		preferences.setAutoBuilding(autoBuild);
6023
		preferences.setAutoBuilding(autoBuild);
6019
		deleteProject("P");
6024
		deleteProject("P");
6025
		JavaCore.removeClasspathVariable("INVALID_LIB", null);
6020
	}	
6026
	}	
6021
}
6027
}
6022
/**
6028
/**
Lines 6025-6041 Link Here
6025
 * 
6031
 * 
6026
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=300136"
6032
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=300136"
6027
 */
6033
 */
6028
// TODO (Jay) Enable when bug 301529 will be fixed
6034
public void testBug300136a() throws Exception {
6029
public void _testBug300136a() throws Exception {
6030
	boolean autoBuild = getWorkspace().isAutoBuilding();
6035
	boolean autoBuild = getWorkspace().isAutoBuilding();
6031
	IWorkspaceDescription preferences = getWorkspace().getDescription();
6036
	IWorkspaceDescription preferences = getWorkspace().getDescription();
6032
	try {
6037
	try {
6033
		preferences.setAutoBuilding(false);
6038
		preferences.setAutoBuilding(false);
6034
		IJavaProject project = createJavaProject("P");
6039
		IJavaProject project = createJavaProject("P");
6040
		IPath libPath = new Path("/lib/tmp.jar");
6041
		JavaCore.setClasspathVariables(
6042
				new String[] {"INVALID_LIB",},
6043
				new IPath[] {libPath},
6044
				null);
6045
		
6035
		StringBuffer buffer = new StringBuffer(
6046
		StringBuffer buffer = new StringBuffer(
6036
				"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
6047
				"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
6037
				"<classpath>\n" +
6048
				"<classpath>\n" +
6038
				"    <classpathentry  kind=\"var\" path=\"TEST_LIB\" />\n" +
6049
				"    <classpathentry  kind=\"var\" path=\"INVALID_LIB\" />\n" +
6039
				"    <classpathentry  kind=\"var\" path=\"UNBOUND_VAR\" />\n" +
6050
				"    <classpathentry  kind=\"var\" path=\"UNBOUND_VAR\" />\n" +
6040
				"    <classpathentry kind=\"con\" path=\"org.eclipse.jdt.core.tests.model.TEST_CONTAINER\">\n" +
6051
				"    <classpathentry kind=\"con\" path=\"org.eclipse.jdt.core.tests.model.TEST_CONTAINER\">\n" +
6041
				"	</classpathentry>\n" +
6052
				"	</classpathentry>\n" +
Lines 6048-6060 Link Here
6048
		);
6059
		);
6049
		assertMarkers(
6060
		assertMarkers(
6050
				"Unexpected markers",
6061
				"Unexpected markers",
6051
				"Project \'P\' is missing required library: \'\\lib\\tmp.jar\'\n" + 
6062
				"Project \'P\' is missing required library: \'" + libPath.toOSString() + "'\n" + 
6052
				"Unbound classpath container: \'org.eclipse.jdt.core.tests.model.TEST_CONTAINER\' in project \'P\'\n" + 
6063
				"Unbound classpath container: \'org.eclipse.jdt.core.tests.model.TEST_CONTAINER\' in project \'P\'\n" + 
6053
				"Unbound classpath variable: \'UNBOUND_VAR\' in project \'P\'",
6064
				"Unbound classpath variable: \'UNBOUND_VAR\' in project \'P\'",
6054
				project);
6065
				project);
6055
	} finally {
6066
	} finally {
6056
		preferences.setAutoBuilding(autoBuild);
6067
		preferences.setAutoBuilding(autoBuild);
6057
		deleteProject("P");
6068
		deleteProject("P");
6069
		JavaCore.removeClasspathVariable("INVALID_LIB", null);
6058
	}	
6070
	}	
6059
}
6071
}
6060
6072

Return to bug 301529