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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java (+39 lines)
Lines 1522-1527 Link Here
1522
		deleteProject("P");
1522
		deleteProject("P");
1523
	}
1523
	}
1524
}
1524
}
1525
/*
1526
 * Ensure that the order of roots is taken into account when a type is present in multiple roots.
1527
 * (regression test for bug 139555 [hierarchy] Opening a class from Type hierarchy will give the wrong one if source and compiled are in defined in project)
1528
 */
1529
public void testRootOrder() throws CoreException, IOException {
1530
	try {
1531
		IJavaProject project = createJavaProject("P", new String[] {"abc"}, new String[] {"JCL_LIB"}, "bin");
1532
		createFolder("/P/abc/p");
1533
		createFile(
1534
			"/P/abc/p/X.java", 
1535
			"package p;\n"+ 
1536
			"public class X {}"
1537
		);
1538
		createFile(
1539
			"/P/abc/p/Y.java", 
1540
			"package p;\n"+ 
1541
			"public class Y extends X {}"
1542
		);
1543
		addLibrary(project, "lib.jar", "libsrc.zip", new String[] {
1544
			"p/X.java", 
1545
			"package p;\n"+ 
1546
			"public class X {}",
1547
			"p/Y.java", 
1548
			"package p;\n"+ 
1549
			"public class Y extends X {}"
1550
		}, "1.4");
1551
		IType type = getCompilationUnit("/P/abc/p/X.java").getType("X");
1552
		ITypeHierarchy hierarchy = type.newTypeHierarchy(null);
1553
		assertHierarchyEquals(
1554
			"Focus: X [in X.java [in p [in abc [in P]]]]\n" + 
1555
			"Super types:\n" + 
1556
			"  Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" + 
1557
			"Sub types:\n" + 
1558
			"  Y [in Y.java [in p [in abc [in P]]]]\n",
1559
			hierarchy);
1560
	} finally {
1561
		deleteProject("P");
1562
	}
1563
}
1525
/**
1564
/**
1526
 * Ensures that the superclass can be retrieved for a source type's unqualified superclass.
1565
 * Ensures that the superclass can be retrieved for a source type's unqualified superclass.
1527
 */
1566
 */

Return to bug 139555