use of org.eclipse.jdt.core.IPackageFragmentRoot in project che by eclipse.
the class JarNavigationTest method testJavaSource.
@Test
@Ignore
public void testJavaSource() throws Exception {
String javaHome = System.getProperty("java.home") + "/lib/rt.jar";
IPackageFragmentRoot root = project.getPackageFragmentRoot(new File(javaHome).getPath());
ClassContent content = navigation.getContent(project, root.hashCode(), "java.lang.Object");
assertThat(content.getContent()).isNotNull().isNotEmpty().contains("public class Object");
}
use of org.eclipse.jdt.core.IPackageFragmentRoot in project che by eclipse.
the class JarNavigationTest method testClassFile.
@Test
public void testClassFile() throws Exception {
String javaHome = System.getProperty("java.home") + "/lib/rt.jar";
IPackageFragmentRoot root = project.getPackageFragmentRoot(new File(javaHome).getPath());
List<JarEntry> rootContent = navigation.getChildren(project, root.hashCode(), "java.lang");
assertThat(rootContent).isNotNull().isNotEmpty().onProperty("name").contains("Object.class", "String.class", "Integer.class");
}
use of org.eclipse.jdt.core.IPackageFragmentRoot in project che by eclipse.
the class JarNavigationTest method testGetClassByPath.
@Test
@Ignore
public void testGetClassByPath() throws Exception {
String javaHome = System.getProperty("java.home") + "/lib/rt.jar";
IPackageFragmentRoot root = project.getPackageFragmentRoot(new File(javaHome).getPath());
JarEntry entry = navigation.getEntry(project, root.hashCode(), "java.lang.Object");
assertThat(entry).isNotNull();
assertThat(entry.getType()).isEqualTo(JarEntry.JarEntryType.CLASS_FILE);
assertThat(entry.getPath()).isEqualTo("java.lang.Object");
}
use of org.eclipse.jdt.core.IPackageFragmentRoot in project che by eclipse.
the class JarNavigationTest method testNonJavaFolder.
@Test
public void testNonJavaFolder() throws Exception {
String javaHome = System.getProperty("java.home") + "/lib/ext/zipfs.jar";
IPackageFragmentRoot root = project.getPackageFragmentRoot(new File(javaHome).getPath());
List<JarEntry> rootContent = navigation.getChildren(project, root.hashCode(), "/META-INF");
assertThat(rootContent).isNotNull().isNotEmpty().onProperty("name").contains("services", "MANIFEST.MF");
}
use of org.eclipse.jdt.core.IPackageFragmentRoot in project che by eclipse.
the class RenameSourceFolderChange method isValid.
@Override
public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
RefactoringStatus result = super.isValid(pm);
if (result.hasFatalError())
return result;
IPackageFragmentRoot sourceFolder = getSourceFolder();
result.merge(checkIfModifiable(sourceFolder));
return result;
}
Aggregations