Example usage for org.eclipse.jdt.internal.core.hierarchy IndexBasedHierarchyBuilder IndexBasedHierarchyBuilder

List of usage examples for org.eclipse.jdt.internal.core.hierarchy IndexBasedHierarchyBuilder IndexBasedHierarchyBuilder

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core.hierarchy IndexBasedHierarchyBuilder IndexBasedHierarchyBuilder.

Prototype

public IndexBasedHierarchyBuilder(TypeHierarchy hierarchy, IJavaSearchScope scope) throws JavaModelException 

Source Link

Usage

From source file:org.eclipse.objectteams.otdt.tests.subhierarchy.OTTypeHierarchyBuilderTest.java

License:Open Source License

public void testGetResult_T20T10T00R0() throws CoreException {
    _focusType = _T20T10T00R0;//w w w .j  a v a2 s.  co  m
    TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
    HierarchyBuilder builder = new IndexBasedHierarchyBuilder(hierarchy,
            SearchEngine.createJavaSearchScope(new IJavaElement[] { _focusType.getJavaProject() }));

    IType[] expected = { _T21T11T00R0, _T21T11T00R1, _T21T11T00R2 };

    builder.build(true);
    IType[] actual = hierarchy.getAllSubtypes(_focusType);

    assertTrue(compareTypes(expected, actual));
}

From source file:org.eclipse.objectteams.otdt.tests.subhierarchy.OTTypeHierarchyBuilderTest.java

License:Open Source License

public void testGetResult_T20T10T00R1() throws CoreException {
    _focusType = _T20T10T00R1;//w ww  .  ja  v a  2s.  c  o  m
    TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
    HierarchyBuilder builder = new IndexBasedHierarchyBuilder(hierarchy,
            SearchEngine.createJavaSearchScope(new IJavaElement[] { _focusType.getJavaProject() }));

    IType[] expected = { _T21T10T00R1, _T21T10T00R2, _T21T11T00R1, _T21T11T00R2 };

    builder.build(true);
    IType[] actual = hierarchy.getAllSubtypes(_focusType);

    assertTrue(compareTypes(expected, actual));
}

From source file:org.eclipse.objectteams.otdt.tests.subhierarchy.OTTypeHierarchyBuilderTest.java

License:Open Source License

public void testBug411591() throws CoreException {
    _focusType = javaProject.findType("java.lang.Object");
    TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
    HierarchyBuilder builder = new IndexBasedHierarchyBuilder(hierarchy,
            SearchEngine.createJavaSearchScope(new IJavaElement[] { _focusType.getJavaProject() }));

    builder.build(true);//www.j  a v a2s . co  m
    IType[] actual = hierarchy.getAllSubtypes(_focusType);
    assertNotNull(actual);

    // no real assert not throwing NPE is all we need to check
}