use of org.eclipse.che.ide.ext.java.shared.JarEntry in project che by eclipse.
the class JarNavigationTest method testSortJarEntries.
@Test
public void testSortJarEntries() throws Exception {
String javaHome = getClass().getResource("/temp").getPath() + "/ws/test/gwt-user.jar";
IPackageFragmentRoot root = project.getPackageFragmentRoot(new File(javaHome).getPath());
List<JarEntry> content = navigation.getPackageFragmentRootContent(project, root.hashCode());
assertThat(content).isNotNull().isNotEmpty().onProperty("name").containsSequence("about_files", "com.google", "javax", "org", "META-INF", "about.html", "plugin.properties");
}
use of org.eclipse.che.ide.ext.java.shared.JarEntry in project che by eclipse.
the class JarNavigationTest method testGetFileBypath.
@Test
public void testGetFileBypath() throws Exception {
String javaHome = getClass().getResource("/temp").getPath() + "/ws/test/gwt-user.jar";
IPackageFragmentRoot root = project.getPackageFragmentRoot(new File(javaHome).getPath());
JarEntry entry = navigation.getEntry(project, root.hashCode(), "/com/google/gwt/user/User.gwt.xml");
assertThat(entry).isNotNull();
assertThat(entry.getType()).isEqualTo(JarEntry.JarEntryType.FILE);
assertThat(entry.getPath()).isEqualTo("/com/google/gwt/user/User.gwt.xml");
assertThat(entry.getName()).isEqualTo("User.gwt.xml");
}
use of org.eclipse.che.ide.ext.java.shared.JarEntry in project che by eclipse.
the class JarNavigationTest method testPackageCollapsing.
@Test
public void testPackageCollapsing() 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(), "org");
assertThat(rootContent).isNotNull().isNotEmpty().onProperty("name").contains("omg", "w3c.dom", "xml.sax");
}
use of org.eclipse.che.ide.ext.java.shared.JarEntry 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.che.ide.ext.java.shared.JarEntry 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");
}
Aggregations