use of org.eclipse.xtext.resource.IResourceDescription.Event in project xtext-eclipse by eclipse.
the class Bug486584Test method testNoFullBuildIfAttachmentChangeOnly.
@Test
public void testNoFullBuildIfAttachmentChangeOnly() throws CoreException, InterruptedException {
IJavaProject project = setupProject();
assertFalse(getEvents().isEmpty());
getEvents().clear();
IFile libaryFile = copyAndGetXtendExampleJar(project);
IClasspathEntry libraryEntry = JavaCore.newLibraryEntry(libaryFile.getFullPath(), null, null);
addToClasspath(project, libraryEntry);
build();
assertEquals(1, getEvents().size());
Event singleEvent = getEvents().get(0);
ImmutableList<Delta> deltas = singleEvent.getDeltas();
assertEquals(1, deltas.size());
getEvents().clear();
IClasspathEntry[] classpath = project.getRawClasspath();
for (int i = 0; i < classpath.length; ++i) {
IPath entryPath = classpath[i].getPath();
if (libraryEntry.getPath().equals(entryPath)) {
IClasspathEntry[] newClasspath = new IClasspathEntry[classpath.length];
System.arraycopy(classpath, 0, newClasspath, 0, classpath.length);
classpath[i] = JavaCore.newLibraryEntry(libaryFile.getFullPath(), libaryFile.getFullPath(), null);
project.setRawClasspath(classpath, null);
}
}
build();
assertEquals(0, getEvents().size());
}
use of org.eclipse.xtext.resource.IResourceDescription.Event in project xtext-eclipse by eclipse.
the class Bug486584Test method testFullBuildWhenClasspathChanged_1.
@Test
public void testFullBuildWhenClasspathChanged_1() throws CoreException, InterruptedException {
IJavaProject project = setupProject();
assertFalse(getEvents().isEmpty());
getEvents().clear();
IFile libaryFile = copyAndGetXtendExampleJar(project);
IClasspathEntry libraryEntry = JavaCore.newLibraryEntry(libaryFile.getFullPath(), null, null);
addToClasspath(project, libraryEntry);
assertEquals(1, getEvents().size());
Event singleEvent = getEvents().get(0);
ImmutableList<Delta> deltas = singleEvent.getDeltas();
assertEquals(1, deltas.size());
}
use of org.eclipse.xtext.resource.IResourceDescription.Event in project xtext-eclipse by eclipse.
the class Bug486584Test method testFullBuildWhenClasspathChanged_2.
@Test
public void testFullBuildWhenClasspathChanged_2() throws CoreException, InterruptedException {
IJavaProject project = setupProject();
IFile libaryFile = copyAndGetXtendExampleJar(project);
IClasspathEntry libraryEntry = JavaCore.newLibraryEntry(libaryFile.getFullPath(), null, null);
addToClasspath(project, libraryEntry);
build();
assertFalse(getEvents().isEmpty());
getEvents().clear();
libaryFile.touch(null);
libaryFile.refreshLocal(IResource.DEPTH_INFINITE, null);
build();
assertEquals(1, getEvents().size());
Event singleEvent = getEvents().get(0);
ImmutableList<Delta> deltas = singleEvent.getDeltas();
assertEquals(1, deltas.size());
}
Aggregations