Example usage for org.eclipse.jdt.internal.core.hierarchy TypeHierarchy getAllSuperclasses

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

Introduction

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

Prototype

@Override
public IType[] getAllSuperclasses(IType type) 

Source Link

Usage

From source file:org.eclipse.objectteams.otdt.tests.superhierarchy.OTSuperTypeHierarchyTest004.java

License:Open Source License

public void testGetAllSuperclasses_T21T11T00R2() throws JavaModelException {
    _focusType = _T21T11T00R2;/*from ww  w . j  a v a  2s.  c om*/

    TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
    hierarchy.refresh(new NullProgressMonitor());

    IType[] actual = hierarchy.getAllSuperclasses(_focusType);
    IType[] expected = new IType[] { _objectType, _T20T10T00R0, _T20T10T00R1, _T21T10T00R1, _T21T10T00R2,
            _T21T11T00R0, _T21T11T00R1, };

    assertEquals(expected.length, actual.length);
    assertTrue(compareTypes(expected, actual));
}

From source file:org.eclipse.objectteams.otdt.tests.superhierarchy.OTSuperTypeHierarchyTest009.java

License:Open Source License

public void testGetAllSuperclasses_T11T00R0() throws JavaModelException {
    _focusType = _T11T00R0;//from   w ww  .ja  va  2 s.  com

    TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
    hierarchy.refresh(new NullProgressMonitor());

    IType[] actual = hierarchy.getAllSuperclasses(_focusType);
    IType[] expected = new IType[] { _objectType, _T10T00R0, };

    assertEquals(expected.length, actual.length);
    assertTrue(compareTypes(expected, actual));
}

From source file:org.eclipse.objectteams.otdt.tests.superhierarchy.OTSuperTypeHierarchyTest013.java

License:Open Source License

public void testGetAllSuperclasses_TA2TB2TC2R1() throws JavaModelException {
    _focusType = _TA2TB2TC2R1;//from   w ww  .  ja v a 2  s .c  om

    TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
    hierarchy.refresh(new NullProgressMonitor());

    IType[] actual = hierarchy.getAllSuperclasses(_focusType);
    IType[] expected = new IType[] { _TA1TB2TC2R1, _TA1TB2TC1R1, _TA1TB1TC2R1, _TA1TB1TC1R1, _TA2TB2TC1R1,
            _TA2TB1TC2R1, _TA2TB1TC1R1, _C0, _C1,
            //                              _C2,          // illegal inheritance, causes incompatible supers
            //                              _C3,          // illegal inheritance, causes incompatible supers
            _objectType };

    assertEquals(expected.length, actual.length);
    assertTrue(compareTypes(expected, actual));
}

From source file:org.eclipse.objectteams.otdt.tests.superhierarchy.OTSuperTypeHierarchyTest015.java

License:Open Source License

public void testGetAllSuperclasses_C() throws JavaModelException {
    _focusType = _C;/*from   w w  w  .jav  a2  s  .c  om*/

    TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false);
    hierarchy.refresh(new NullProgressMonitor());

    IType[] actual = hierarchy.getAllSuperclasses(_focusType);
    IType[] expected = new IType[] { _A, _B, _objectType };

    assertEquals(expected.length, actual.length);
    assertTrue(compareTypes(expected, actual));
}