use of org.eclipse.che.ide.ext.java.shared.JarEntry in project che by eclipse.
the class JarNavigationTest method testDoNotIncludeDefaultEmptyPackage.
@Test
public void testDoNotIncludeDefaultEmptyPackage() throws Exception {
String javaHome = System.getProperty("java.home") + "/lib/ext/zipfs.jar";
IPackageFragmentRoot root = project.getPackageFragmentRoot(new File(javaHome).getPath());
List<JarEntry> rootContent = navigation.getPackageFragmentRootContent(project, root.hashCode());
assertThat(rootContent).isNotNull().isNotEmpty().onProperty("name").excludes("(default package)");
assertThat(rootContent).onProperty("path").contains("/META-INF");
}
use of org.eclipse.che.ide.ext.java.shared.JarEntry in project che by eclipse.
the class JarNavigationTest method testClassFileFQN.
@Test
public void testClassFileFQN() 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("path").contains("java.lang.Object", "java.lang.String", "java.lang.Integer");
}
use of org.eclipse.che.ide.ext.java.shared.JarEntry in project che by eclipse.
the class JarNavigationTest method testNonJavaElement.
@Test
public void testNonJavaElement() throws Exception {
String javaHome = System.getProperty("java.home") + "/lib/ext/zipfs.jar";
IPackageFragmentRoot root = project.getPackageFragmentRoot(new File(javaHome).getPath());
List<JarEntry> rootContent = navigation.getPackageFragmentRootContent(project, root.hashCode());
assertThat(rootContent).isNotNull().isNotEmpty().onProperty("name").contains("META-INF");
assertThat(rootContent).onProperty("path").contains("/META-INF");
}
use of org.eclipse.che.ide.ext.java.shared.JarEntry in project che by eclipse.
the class JarNavigationTest method testSortJarEntriesWithClasses.
@Test
public void testSortJarEntriesWithClasses() 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.getChildren(project, root.hashCode(), "org.hibernate.validator");
assertThat(content).isNotNull().isNotEmpty().onProperty("name").containsSequence("engine", "HibernateValidationMessageResolver.class", "ValidationMessages.class", "HibernateValidator.gwt.xml", "README.txt");
}
use of org.eclipse.che.ide.ext.java.shared.JarEntry in project che by eclipse.
the class JarNavigationTest method testDoesNotReturnInnerClasses.
@Test
public void testDoesNotReturnInnerClasses() 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").excludes("Character$Subset.class");
}
Aggregations