Lines 1623-1628
Link Here
|
1623 |
} |
1623 |
} |
1624 |
|
1624 |
|
1625 |
/* |
1625 |
/* |
|
|
1626 |
* Ensures that an error is detected after refreshing external archives used by |
1627 |
* an external working copy. |
1628 |
* (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=216772 ) |
1629 |
*/ |
1630 |
public void testExternal3() throws Exception { |
1631 |
try { |
1632 |
this.workingCopy.discardWorkingCopy(); // don't use the one created in setUp() |
1633 |
this.workingCopy = null; |
1634 |
this.problemRequestor = new ProblemRequestor(); |
1635 |
createJar(new String[] { |
1636 |
"p/Lib.java", |
1637 |
"package p;\n" + |
1638 |
"public class Lib {\n" + |
1639 |
"}" |
1640 |
}, getExternalResourcePath("lib.jar")); |
1641 |
IClasspathEntry[] classpath = new IClasspathEntry[] { |
1642 |
JavaCore.newLibraryEntry(getExternalJCLPath(), null, null), |
1643 |
JavaCore.newLibraryEntry(new Path(getExternalResourcePath("lib.jar")), null, null) |
1644 |
}; |
1645 |
this.workingCopy = newExternalWorkingCopy("External.java", classpath, this.problemRequestor, |
1646 |
"public class External {\n"+ |
1647 |
" p.Lib field;\n"+ |
1648 |
"}\n" |
1649 |
); |
1650 |
this.workingCopy.reconcile(ICompilationUnit.NO_AST, false, null/*no owner*/, null); |
1651 |
|
1652 |
createJar(new String[] { |
1653 |
"p/Lib2.java", |
1654 |
"package p;\n" + |
1655 |
"public class Lib2 {\n" + |
1656 |
"}" |
1657 |
}, getExternalResourcePath("lib.jar")); |
1658 |
getJavaModel().refreshExternalArchives(null, null); |
1659 |
this.problemRequestor.reset(); |
1660 |
this.workingCopy.reconcile(ICompilationUnit.NO_AST, true/*force problem detection*/, null/*no owner*/, null); |
1661 |
assertProblems( |
1662 |
"Unexpected problems", |
1663 |
"----------\n" + |
1664 |
"1. ERROR in / /External.java\n" + |
1665 |
"p.Lib cannot be resolved to a type\n" + |
1666 |
"----------\n" |
1667 |
); |
1668 |
} finally { |
1669 |
deleteExternalResource("lib.jar"); |
1670 |
} |
1671 |
} |
1672 |
|
1673 |
/* |
1626 |
* Ensures that included part of prereq project are visible |
1674 |
* Ensures that included part of prereq project are visible |
1627 |
*/ |
1675 |
*/ |
1628 |
public void testIncludePartOfAnotherProject1() throws CoreException { |
1676 |
public void testIncludePartOfAnotherProject1() throws CoreException { |