diff options
Diffstat (limited to 'testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests')
36 files changed, 1725 insertions, 1725 deletions
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/AllTests.java index 3f165c114..92013b798 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/AllTests.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/AllTests.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/CompleteRoleHierarchyWithClasses.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/CompleteRoleHierarchyWithClasses.java index cc1b7e2ca..1087b8290 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/CompleteRoleHierarchyWithClasses.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/CompleteRoleHierarchyWithClasses.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -39,7 +39,7 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest; */ /* * The testdata setting looks like this: - * + * * SuperSuperTeam * R1 SuperClass * /\ /\ @@ -54,13 +54,13 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest; * |'''''''''''''''''''| |''''''''''''|'''''''''''''| | * SubTeam1 SubTeam2 | | | | * R1 R1------------------>SubSubClass11 SubSubClass12 | - * /\ | | + * /\ | | * |'''''''''''| | | * SubSubTeam11 SubSubTeam12 | | * R1 R1-----------------| | * | | * |---------------------------------------------------------------------| - * + * * The focus role is ATeam.R1 . */ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest @@ -79,15 +79,15 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest private IType _subSubClass11; private IType _subSubClass12; private IType _object; - + private TypeHierarchy _hierarchy; - - + + public CompleteRoleHierarchyWithClasses(String name) { super(name); } - + public static Test suite() { if (true) @@ -95,161 +95,161 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest return new Suite(CompleteRoleHierarchyWithClasses.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(CompleteRoleHierarchyWithClasses.class.getName()); return suite; } - - + + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - - _focusRole = + + _focusRole = getRole(getTestProjectDir(), "complete_rolehierarchy_with_classes", "test002.inlined", "ATeam", "R1"); - + _hierarchy = new TypeHierarchy(_focusRole, null, _focusRole.getJavaProject(), true); - _hierarchy.refresh(new NullProgressMonitor()); - - _implSuperRole = + _hierarchy.refresh(new NullProgressMonitor()); + + _implSuperRole = getRole(getTestProjectDir(), "complete_rolehierarchy_with_classes", "test002.inlined", "SuperTeam", "R1"); - - _implSuperSuperRole = + + _implSuperSuperRole = getRole(getTestProjectDir(), "complete_rolehierarchy_with_classes", "test002.inlined", "SuperSuperTeam", "R1"); - - _implSubRole1 = + + _implSubRole1 = getRole(getTestProjectDir(), "complete_rolehierarchy_with_classes", "test002.inlined", "SubTeam1", "R1"); - - _implSubRole2 = + + _implSubRole2 = getRole(getTestProjectDir(), "complete_rolehierarchy_with_classes", "test002.inlined", "SubTeam2", "R1"); - + _implSubSubRole11 = getRole(getTestProjectDir(), "complete_rolehierarchy_with_classes", "test002.inlined", "SubSubTeam11", "R1"); - + _implSubSubRole12 = getRole(getTestProjectDir(), "complete_rolehierarchy_with_classes", "test002.inlined", "SubSubTeam12", "R1"); - + _class = - getType(getTestProjectDir(), - "complete_rolehierarchy_with_classes", - "test002.standard", + getType(getTestProjectDir(), + "complete_rolehierarchy_with_classes", + "test002.standard", "AClass"); - + _superClass = - getType(getTestProjectDir(), - "complete_rolehierarchy_with_classes", - "test002.standard", + getType(getTestProjectDir(), + "complete_rolehierarchy_with_classes", + "test002.standard", "SuperClass"); - + _subClass1 = - getType(getTestProjectDir(), - "complete_rolehierarchy_with_classes", - "test002.standard", + getType(getTestProjectDir(), + "complete_rolehierarchy_with_classes", + "test002.standard", "SubClass1"); - + _subClass2 = - getType(getTestProjectDir(), - "complete_rolehierarchy_with_classes", - "test002.standard", + getType(getTestProjectDir(), + "complete_rolehierarchy_with_classes", + "test002.standard", "SubClass2"); - + _subSubClass11 = - getType(getTestProjectDir(), - "complete_rolehierarchy_with_classes", - "test002.standard", + getType(getTestProjectDir(), + "complete_rolehierarchy_with_classes", + "test002.standard", "SubSubClass11"); - + _subSubClass12 = - getType(getTestProjectDir(), - "complete_rolehierarchy_with_classes", - "test002.standard", + getType(getTestProjectDir(), + "complete_rolehierarchy_with_classes", + "test002.standard", "SubSubClass12"); - - _object = + + _object = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object"); - + } - + public void testContainment_implSuperRole() { assertTrue(_hierarchy.contains((IType)_implSuperRole.getCorrespondingJavaElement())); } - + public void testGetExplicitSuperclass_ofFocusRole() throws JavaModelException { assertEquals(_class, OTTypeHierarchies.getInstance().getExplicitSuperclass(_hierarchy, (IType)_focusRole.getCorrespondingJavaElement())); - } - - + } + + public void testGetExplicitSuperclass_ofImplSuperSuperRole() throws JavaModelException { assertEquals(_object, OTTypeHierarchies.getInstance().getExplicitSuperclass(_hierarchy, (IType)_implSuperSuperRole.getCorrespondingJavaElement())); } - - + + public void testGetExplicitSuperclass_ofImplSuperRole() throws JavaModelException { assertEquals(_class, OTTypeHierarchies.getInstance().getExplicitSuperclass(_hierarchy, (IType)_implSuperRole.getCorrespondingJavaElement())); } - + public void testGetExplicitSuperclass_ofImplSubRole1() throws JavaModelException { assertEquals(_class, OTTypeHierarchies.getInstance().getExplicitSuperclass(_hierarchy, (IType)_implSubRole1.getCorrespondingJavaElement())); } - - + + public void testGetExplicitSuperclass_ofImplSubRole2() throws JavaModelException { assertEquals(_subSubClass11, OTTypeHierarchies.getInstance().getExplicitSuperclass(_hierarchy, (IType)_implSubRole2.getCorrespondingJavaElement())); } - - + + public void testGetExplicitSuperclass_ofImplSubSubRole11() throws JavaModelException { assertEquals(_subClass2, OTTypeHierarchies.getInstance().getExplicitSuperclass(_hierarchy, (IType)_implSubSubRole11.getCorrespondingJavaElement())); } - - + + public void testGetExplicitSuperclass_ofImplSubSubRole12() throws JavaModelException { assertEquals(_subClass1, OTTypeHierarchies.getInstance().getExplicitSuperclass(_hierarchy, (IType)_implSubSubRole12.getCorrespondingJavaElement())); } - - + + public void testGetAllClasses() { ArrayList<IType> expectedList = new ArrayList<IType>(); @@ -263,17 +263,17 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest expectedList.add(_object); expectedList.add(_superClass); expectedList.add(_class); -// expectedList.add(_subClass1); // not reachable from focusRole +// expectedList.add(_subClass1); // not reachable from focusRole // expectedList.add(_subClass2); // not reachable from focusRole // expectedList.add(_subSubClass11); // not reachable from focusRole - + IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _hierarchy.getAllClasses(); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllTypes() { ArrayList<IType> expectedList = new ArrayList<IType>(); @@ -290,10 +290,10 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest // expectedList.add(_subClass1); // expectedList.add(_subClass2); // expectedList.add(_subSubClass11); - + IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _hierarchy.getAllTypes(); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -318,10 +318,10 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest expectedList.add(_subClass1); // expectedList.add(_subClass2); // still outside expectedList.add(_subSubClass11); - + IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _hierarchy.getAllTypes(); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } finally { @@ -329,8 +329,8 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest _hierarchy.refresh(new NullProgressMonitor()); } } - - + + public void testGetAllSuperclasses_ofFocusRole() { ArrayList<IType> expectedList = new ArrayList<IType>(); @@ -339,28 +339,28 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest expectedList.add(_superClass); expectedList.add(_class); expectedList.add(_object); - - IType[] expected = expectedList.toArray(new IType[expectedList.size()]); + + IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _hierarchy.getAllSuperclasses((IType)_focusRole.getCorrespondingJavaElement()); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_ofImplSuperSuperRole() { ArrayList<IType> expectedList = new ArrayList<IType>(); expectedList.add(_object); expectedList.add(_class); // when seen from focusType ATeam$R1, R1 indeed has this super class expectedList.add(_superClass); - + IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _hierarchy.getAllSuperclasses(_implSuperSuperRole); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_ofImplSuperRole() { ArrayList<IType> expectedList = new ArrayList<IType>(); @@ -368,14 +368,14 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest expectedList.add(_superClass); expectedList.add(_class); expectedList.add(_object); - + IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _hierarchy.getAllSuperclasses((IType)_implSuperRole.getCorrespondingJavaElement()); assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_ofImplSubRole1() { ArrayList<IType> expectedList = new ArrayList<IType>(); @@ -385,14 +385,14 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest expectedList.add(_superClass); expectedList.add(_class); expectedList.add(_object); - + IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _hierarchy.getAllSuperclasses((IType)_implSubRole1.getCorrespondingJavaElement()); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_ofImplSubRole2() { ArrayList<IType> expectedList = new ArrayList<IType>(); @@ -404,10 +404,10 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest // expectedList.add(_subClass1); // not related to focus type // expectedList.add(_subSubClass11); // not related to focus type expectedList.add(_object); - + IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _hierarchy.getAllSuperclasses((IType)_implSubRole2.getCorrespondingJavaElement()); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -426,7 +426,7 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest expectedList.add(_subClass1); expectedList.add(_subSubClass11); expectedList.add(_object); - + IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _hierarchy.getAllSuperclasses((IType)_implSubRole2.getCorrespondingJavaElement()); @@ -437,7 +437,7 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest _hierarchy.refresh(new NullProgressMonitor()); } } - + public void testGetAllSuperclasses_ofImplSubSubRole11() { ArrayList<IType> expectedList = new ArrayList<IType>(); @@ -449,14 +449,14 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest expectedList.add(_class); // expectedList.add(_subClass2); // not related to focus type expectedList.add(_object); - + IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _hierarchy.getAllSuperclasses((IType)_implSubSubRole11.getCorrespondingJavaElement()); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_ofImplSubSubRole12() { ArrayList<IType> expectedList = new ArrayList<IType>(); @@ -468,14 +468,14 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest expectedList.add(_class); // expectedList.add(_subClass1); // not related to focus expectedList.add(_object); - - IType[] expected = expectedList.toArray(new IType[expectedList.size()]); + + IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _hierarchy.getAllSuperclasses((IType)_implSubSubRole12.getCorrespondingJavaElement()); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_ofImplSubSubRole12_withFocus() throws JavaModelException { @@ -492,10 +492,10 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest expectedList.add(_class); expectedList.add(_subClass1); expectedList.add(_object); - - IType[] expected = expectedList.toArray(new IType[expectedList.size()]); + + IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _hierarchy.getAllSuperclasses((IType)_implSubSubRole12.getCorrespondingJavaElement()); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } finally { @@ -503,7 +503,7 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest _hierarchy.refresh(new NullProgressMonitor()); } } - + public void testGetAllSupertypes_ofFocusRole() { ArrayList<IType> expectedList = new ArrayList<IType>(); @@ -512,14 +512,14 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest expectedList.add(_object); expectedList.add(_superClass); expectedList.add(_class); - - IType[] expected = expectedList.toArray(new IType[expectedList.size()]); + + IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _hierarchy.getAllSupertypes((IType)_focusRole.getCorrespondingJavaElement()); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSupertypes_ofImplSuperSuperRole() { ArrayList<IType> expectedList = new ArrayList<IType>(); @@ -527,13 +527,13 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest expectedList.add(_class); // when seen from focusType ATeam$R1, R1 indeed has this super class expectedList.add(_superClass); - IType[] expected = expectedList.toArray(new IType[expectedList.size()]); + IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _hierarchy.getAllSupertypes((IType)_implSuperSuperRole.getCorrespondingJavaElement()); assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSupertypes_ofImplSuperRole() { ArrayList<IType> expectedList = new ArrayList<IType>(); @@ -541,14 +541,14 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest expectedList.add(_superClass); expectedList.add(_class); expectedList.add(_object); - - IType[] expected = expectedList.toArray(new IType[expectedList.size()]); + + IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _hierarchy.getAllSupertypes((IType)_implSuperRole.getCorrespondingJavaElement()); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSupertypes_ofImplSubRole1() { ArrayList<IType> expectedList = new ArrayList<IType>(); @@ -558,14 +558,14 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest expectedList.add(_superClass); expectedList.add(_class); expectedList.add(_object); - + IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _hierarchy.getAllSupertypes((IType)_implSubRole1.getCorrespondingJavaElement()); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSupertypes_ofImplSubRole2() { ArrayList<IType> expectedList = new ArrayList<IType>(); @@ -577,14 +577,14 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest // expectedList.add(_subClass1); // not reachable from focusRole // expectedList.add(_subSubClass11); // not reachable from focusRole expectedList.add(_object); - + IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _hierarchy.getAllSupertypes((IType)_implSubRole2.getCorrespondingJavaElement()); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSupertypes_ofImplSubSubRole11() { ArrayList<IType> expectedList = new ArrayList<IType>(); @@ -596,14 +596,14 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest expectedList.add(_class); // expectedList.add(_subClass2); // not reachable from focusRole expectedList.add(_object); - + IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _hierarchy.getAllSupertypes((IType)_implSubSubRole11.getCorrespondingJavaElement()); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSupertypes_ofImplSubSubRole12() { ArrayList<IType> expectedList = new ArrayList<IType>(); @@ -615,22 +615,22 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest expectedList.add(_class); // expectedList.add(_subClass1); // not reachable from focusRole expectedList.add(_object); - + IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _hierarchy.getAllSupertypes((IType)_implSubSubRole12.getCorrespondingJavaElement()); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + // succeeds although hierarchy was not built for type. public void testGetAllSubtypes_ofSubClass2() { ArrayList<IRoleType> expectedList = new ArrayList<IRoleType>(); expectedList.add(_implSubSubRole11); IType[] expected = expectedList.toArray(new IType[expectedList.size()]); - - assertTrue(compareTypes(expected, _hierarchy.getAllSubtypes(_subClass2))); + + assertTrue(compareTypes(expected, _hierarchy.getAllSubtypes(_subClass2))); } // succeeds although hierarchy was not built for type. @@ -639,17 +639,17 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest ArrayList<IRoleType> expectedList = new ArrayList<IRoleType>(); expectedList.add(_implSubRole2); IType[] expected = expectedList.toArray(new IType[expectedList.size()]); - - assertTrue(compareTypes(expected, _hierarchy.getAllSubtypes(_subSubClass11))); + + assertTrue(compareTypes(expected, _hierarchy.getAllSubtypes(_subSubClass11))); } // succeeds although hierarchy was not built for type. public void testGetAllSubtypes_ofSubSubClass12() { IType[] expected = new IType[0]; - assertTrue(compareTypes(expected, _hierarchy.getAllSubtypes(_subSubClass12))); + assertTrue(compareTypes(expected, _hierarchy.getAllSubtypes(_subSubClass12))); } - + public void testGetAllSubtypes_ofImplSuperSuperRole() { ArrayList<IRoleType> expectedList = new ArrayList<IRoleType>(); @@ -660,7 +660,7 @@ public class CompleteRoleHierarchyWithClasses extends FileBasedModelTest expectedList.add(_implSubSubRole11); expectedList.add(_implSubSubRole12); IType[] expected = expectedList.toArray(new IType[expectedList.size()]); - - assertTrue(compareTypes(expected, _hierarchy.getAllSubtypes((IType)_implSuperSuperRole.getCorrespondingJavaElement()))); + + assertTrue(compareTypes(expected, _hierarchy.getAllSubtypes((IType)_implSuperSuperRole.getCorrespondingJavaElement()))); } } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/FileBasedHierarchyTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/FileBasedHierarchyTest.java index 5e499e285..17c464151 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/FileBasedHierarchyTest.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/FileBasedHierarchyTest.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -37,7 +37,7 @@ public class FileBasedHierarchyTest extends FileBasedModelTest {
super(name);
}
-
+
private ITypeHierarchy createTypeHierarchy(IType focusType, boolean computeSubtypes) throws JavaModelException { ITypeHierarchy hierarchy = new TypeHierarchy(focusType, null, focusType.getJavaProject(), computeSubtypes); diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/ITypeIOTTypeTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/ITypeIOTTypeTest.java index a93418e98..51ac78f4b 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/ITypeIOTTypeTest.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/ITypeIOTTypeTest.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -45,11 +45,11 @@ public class ITypeIOTTypeTest extends FileBasedHierarchyTest private IType _MyTeam; private IType _MySubTeam; private IType _MyOtherSubTeam; - + private IType _MyTeam_MyRole; private IType _MySubTeam_MyRole; // phantom-type! private IType _MyOtherSubTeam_MyRole; - + private IOTType _OT_MyTeam; private IOTType _OT_MySubTeam; @SuppressWarnings("unused") @@ -57,12 +57,12 @@ public class ITypeIOTTypeTest extends FileBasedHierarchyTest private IOTType _OT_MyTeam_MyRole; private IOTType _OT_MyOtherSubTeam_MyRole; - + public ITypeIOTTypeTest(String name) { super(name); } - + public static Test suite() { if (true) @@ -70,90 +70,90 @@ public class ITypeIOTTypeTest extends FileBasedHierarchyTest return new Suite(ITypeIOTTypeTest.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(ITypeIOTTypeTest.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "simple"; - + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object"); - + _MyTeam = getType(getTestProjectDir(), srcFolder, pkg, "MyTeam"); _MySubTeam = getType(getTestProjectDir(), srcFolder, pkg, "MySubTeam"); _MyOtherSubTeam = getType(getTestProjectDir(), srcFolder, pkg, "MyOtherSubTeam"); - + _MyTeam_MyRole = getRole(_MyTeam, "MyTeam.MyRole"); _MySubTeam_MyRole = new PhantomType(_MySubTeam, _MyTeam_MyRole); _MyOtherSubTeam_MyRole = getRole(_MyOtherSubTeam, "MyOtherSubTeam.MyRole"); - + _OT_MyTeam = OTModelManager.getOTElement(_MyTeam); _OT_MySubTeam = OTModelManager.getOTElement(_MySubTeam); _OT_MyOtherSubTeam = OTModelManager.getOTElement(_MyOtherSubTeam); _OT_MyTeam_MyRole = OTModelManager.getOTElement(_MyTeam_MyRole); _OT_MyOtherSubTeam_MyRole = OTModelManager.getOTElement(_MyOtherSubTeam_MyRole); } - + public void testCreation() { assertCreation(_MyTeam); assertCreation(_MySubTeam); - + assertCreation(_MyTeam_MyRole); assertCreation(_MySubTeam_MyRole); - + assertCreation(_OT_MyTeam); assertCreation(_OT_MySubTeam); assertCreation(_OT_MyTeam_MyRole); } - + public void testHierarchyCreation_equalFocusType() throws JavaModelException { ITypeHierarchy first = createTypeHierarchy(_MyTeam); ITypeHierarchy second = createTypeHierarchy(_OT_MyTeam); - - assertEquals(first.getType(), second.getType()); + + assertEquals(first.getType(), second.getType()); } - + // disabled, because this test used to challenge caching of hierarchies, which is not implemented for normal TypeHierarchies public void _testGetOTSuperTypeHierarchy() throws JavaModelException { _testObj = createTypeHierarchy(_MyTeam); - + ITypeHierarchy first = new TypeHierarchy(_MyTeam, null, _MyTeam.getJavaProject(), false); first.refresh(null); ITypeHierarchy second = new TypeHierarchy(_OT_MyTeam, null, _OT_MyTeam.getJavaProject(), false); second.refresh(null); - assertEquals(first, second); + assertEquals(first, second); } - + public void testGetSubtypes() throws JavaModelException { _testObj = createTypeHierarchy(_MyTeam); - + IType [] first = _testObj.getSubtypes(_MyTeam); IType [] second = _testObj.getSubtypes(_OT_MyTeam); - assertEquals(first.length, second.length); + assertEquals(first.length, second.length); assertTrue(compareTypes(first, second)); } public void testGetAllSuperclasses() throws JavaModelException { _testObj = createTypeHierarchy(_MySubTeam); - + IType [] first = _testObj.getAllSuperclasses(_MySubTeam); IType [] second = _testObj.getAllSuperclasses(_OT_MySubTeam); - assertEquals(first.length, second.length); + assertEquals(first.length, second.length); assertTrue(compareTypes(first, second)); } @@ -161,40 +161,40 @@ public class ITypeIOTTypeTest extends FileBasedHierarchyTest public void testGetAllSuperInterfaces() throws JavaModelException { _testObj = createTypeHierarchy(_MyTeam); - + IType [] first = _testObj.getAllSuperInterfaces(_MyTeam); IType [] second = _testObj.getAllSuperInterfaces(_OT_MyTeam); - assertEquals(first.length, second.length); + assertEquals(first.length, second.length); assertTrue(compareTypes(first, second)); } - + public void testGetAllSupertypes() throws JavaModelException { _testObj = createTypeHierarchy(_MySubTeam); - + IType [] first = _testObj.getAllSupertypes(_MySubTeam); IType [] second = _testObj.getAllSupertypes(_OT_MySubTeam); - assertEquals(first.length, second.length); + assertEquals(first.length, second.length); assertTrue(compareTypes(first, second)); } public void testGetAllSubtypes() throws JavaModelException { _testObj = createTypeHierarchy(_MyTeam); - + IType [] first = _testObj.getAllSubtypes(_MyTeam); IType [] second = _testObj.getAllSubtypes(_OT_MyTeam); - assertEquals(first.length, second.length); + assertEquals(first.length, second.length); assertTrue(compareTypes(first, second)); } - + public void testGetCachedFlags() throws JavaModelException { _testObj = createTypeHierarchy(_MyTeam); - + int first = _testObj.getCachedFlags(_MyTeam); int second = _testObj.getCachedFlags(_OT_MyTeam); @@ -204,18 +204,18 @@ public class ITypeIOTTypeTest extends FileBasedHierarchyTest public void testGetSubclasses() throws JavaModelException { _testObj = createTypeHierarchy(_MyTeam); - + IType [] first = _testObj.getSubclasses(_MyTeam); IType [] second = _testObj.getSubclasses(_OT_MyTeam); - assertEquals(first.length, second.length); + assertEquals(first.length, second.length); assertTrue(compareTypes(first, second)); } public void testGetSuperclass() throws JavaModelException { _testObj = createTypeHierarchy(_MySubTeam); - + IType first = _testObj.getSuperclass(_MySubTeam); IType second = _testObj.getSuperclass(_OT_MySubTeam); @@ -225,11 +225,11 @@ public class ITypeIOTTypeTest extends FileBasedHierarchyTest public void testGetSuperclasses() throws JavaModelException { _testObj = createTypeHierarchy(_MySubTeam); - + IType [] first = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _MySubTeam); IType [] second = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _OT_MySubTeam); - assertEquals(first.length, second.length); + assertEquals(first.length, second.length); assertTrue(compareTypes(first, second)); } @@ -237,51 +237,51 @@ public class ITypeIOTTypeTest extends FileBasedHierarchyTest public void testGetSuperInterfaces() throws JavaModelException { _testObj = createTypeHierarchy(_MyTeam); - + IType [] first = _testObj.getSuperInterfaces(_MyTeam); IType [] second = _testObj.getSuperInterfaces(_OT_MyTeam); - assertEquals(first.length, second.length); + assertEquals(first.length, second.length); assertTrue(compareTypes(first, second)); } public void testGetSupertypes() throws JavaModelException { _testObj = createTypeHierarchy(_MySubTeam); - + IType [] first = _testObj.getSupertypes(_MySubTeam); IType [] second = _testObj.getSupertypes(_OT_MySubTeam); - assertEquals(first.length, second.length); + assertEquals(first.length, second.length); assertTrue(compareTypes(first, second)); } public void testGetTSuperTypes() throws JavaModelException { _testObj = createTypeHierarchy(_MyOtherSubTeam_MyRole); - + IType [] first = OTTypeHierarchies.getInstance().getTSuperTypes(_testObj, _MyOtherSubTeam_MyRole); IType [] second = OTTypeHierarchies.getInstance().getTSuperTypes(_testObj, _OT_MyOtherSubTeam_MyRole); - assertEquals(first.length, second.length); + assertEquals(first.length, second.length); assertTrue(compareTypes(first, second)); } public void testGetAllTSuperTypes() throws JavaModelException { _testObj = createTypeHierarchy(_MyOtherSubTeam_MyRole); - + IType [] first = OTTypeHierarchies.getInstance().getAllTSuperTypes(_testObj, _MyOtherSubTeam_MyRole); IType [] second = OTTypeHierarchies.getInstance().getAllTSuperTypes(_testObj, _OT_MyOtherSubTeam_MyRole); - assertEquals(first.length, second.length); + assertEquals(first.length, second.length); assertTrue(compareTypes(first, second)); } public void testGetExplicitSuperclass() throws JavaModelException { _testObj = createTypeHierarchy(_MySubTeam); - + IType first = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _MySubTeam); IType second = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _OT_MySubTeam); @@ -292,11 +292,11 @@ public class ITypeIOTTypeTest extends FileBasedHierarchyTest public void testGetExtendingInterfaces() throws JavaModelException { _testObj = createTypeHierarchy(_MyTeam); - + IType [] first = _testObj.getExtendingInterfaces(_MyTeam); IType [] second = _testObj.getExtendingInterfaces(_OT_MyTeam); - assertEquals(first.length, second.length); + assertEquals(first.length, second.length); assertTrue(compareTypes(first, second)); } @@ -304,11 +304,11 @@ public class ITypeIOTTypeTest extends FileBasedHierarchyTest public void testGetImplementingClasses() throws JavaModelException { _testObj = createTypeHierarchy(_MyTeam); - + IType [] first = _testObj.getImplementingClasses(_MyTeam); IType [] second = _testObj.getImplementingClasses(_OT_MyTeam); - assertEquals(first.length, second.length); + assertEquals(first.length, second.length); assertTrue(compareTypes(first, second)); } } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/OTTypeHierarchyTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/OTTypeHierarchyTests.java index bc2a2fb86..5f5f65674 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/OTTypeHierarchyTests.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/hierarchy/OTTypeHierarchyTests.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -25,10 +25,10 @@ import junit.framework.Test; import junit.framework.TestSuite; /** - * + * * @author Michael Krueger (mkr) * @version $Id: OTTypeHierarchyTests.java 23494 2010-02-05 23:06:44Z stephan $ - * + * */ public class OTTypeHierarchyTests { diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/AllTests.java index d219246a0..b53202c75 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/AllTests.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/AllTests.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest001.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest001.java index 413da0cee..8b110b85a 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest001.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest001.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -37,7 +37,7 @@ import org.eclipse.objectteams.otdt.tests.hierarchy.FileBasedHierarchyTest; */ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest { - + private IType _T1; private IType _T2; private IType _T3; @@ -46,41 +46,41 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest private IType _T6; private IType _T7; private IType _T8; - + private IType _T1_R1; - private IType _T1_R2; + private IType _T1_R2; private IType _T2_R1; private IType _T2_R2; - + private IType _T3_R1; private IType _T3_R2; - + private IType _phantom_T4_R1; private IType _T4_R2; - + private IType _T5_R1; private IType _T5_R2; private IType _T5_R3; - + private IType _T6_R1; private IType _phantom_T6_R2; - + private IType _phantom_T7_R1; private IType _T7_R2; - private IType _T7_R3; - + private IType _T7_R3; + private IType _phantom_T8_R1; private IType _T8_R2; - + @SuppressWarnings("unused") private IType _objectType; - + public OTSubTypeHierarchyTest001(String name) { super(name); } - + public static Test suite() { if (true) @@ -88,19 +88,19 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest return new Suite(OTSubTypeHierarchyTest001.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSubTypeHierarchyTest001.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test001"; - + _T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1"); _T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2"); _T3 = getType(getTestProjectDir(), srcFolder, pkg, "T3"); @@ -128,17 +128,17 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest _T6_R1 = getRole(_T6, "T6.R1"); _phantom_T6_R2 = new PhantomType(_T6, _T2_R2); - + _phantom_T7_R1 = new PhantomType(_T7, _T5_R1); _T7_R2 = getRole(_T7, "T7.R2"); _T7_R3 = getRole(_T7, "T7.R3"); _phantom_T8_R1 = new PhantomType(_T8, _T6_R1); _T8_R2 = getRole(_T8, "T8.R2"); - + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object"); } - + public void testCreation() { assertCreation(_T1); @@ -168,7 +168,7 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest assertCreation(_T6_R1); assertCreation(_phantom_T6_R2); - + assertCreation(_phantom_T7_R1); assertCreation(_T7_R2); assertCreation(_T7_R3); @@ -176,12 +176,12 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest assertCreation(_phantom_T8_R1); assertCreation(_T8_R2); } - + public void testGetAllSubtypes_T1_R1() throws JavaModelException { _focusType = _T1_R1; _testObj = createTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _T2_R1, _T2_R2, _T3_R1, _T3_R2, @@ -191,14 +191,14 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest _T7_R2, _T7_R3, _T8_R2 }; - + IType [] actual = _testObj.getAllSubtypes(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - - + + public void testGetAllSubtypes_T1_R1_phantomMode() throws JavaModelException { _focusType = _T1_R1; @@ -214,18 +214,18 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest _T7_R2, _T7_R3, _phantom_T7_R1, _T8_R2, _phantom_T8_R1 }; - + IType [] actual = _testObj.getAllSubtypes(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSubtypes_T1_R2() throws JavaModelException { _focusType = _T1_R2; _testObj = createTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _T2_R2, _T3_R2, @@ -234,18 +234,18 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest _T7_R2, _T8_R2 }; - + IType [] actual = _testObj.getAllSubtypes(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetSubtypes_T2_R1() throws JavaModelException { _focusType = _T2_R1; _testObj = createTypeHierarchy(_focusType); - + IType[] expected = new IType[] { // _T4_R2, // indirect: explicit subclass of phantom _T2_R2, @@ -253,19 +253,19 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest _T5_R1, _T6_R1 }; - + IType [] actual = _testObj.getSubtypes(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - - + + public void testGetSubclasses_T2_R1() throws JavaModelException { _focusType = _T2_R1; _testObj = createTypeHierarchy(_focusType); - + IType[] expected = new IType[] { // _T4_R2, // indirect: explicit subclass of phantom _T2_R2, @@ -273,27 +273,27 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest _T5_R1, _T6_R1 }; - + IType [] actual = _testObj.getSubclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetSubclasses_T5_R1() throws JavaModelException { _focusType = _T5_R1; _testObj = createTypeHierarchy(_focusType); - + IType[] expected = new IType[] { - _T5_R3, + _T5_R3, // _T7_R3 // indirect: explicit subclass of phantom }; - + IType [] actual = _testObj.getSubclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -301,32 +301,32 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest { _focusType = _T5_R1; _testObj = createTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _T5_R2, _T5_R3, - _T7_R2, _T7_R3 // indirect via phantom + _T7_R2, _T7_R3 // indirect via phantom }; - + IType [] actual = _testObj.getAllSubtypes(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - - + + public void testGetSubclasses_T6_R1() throws JavaModelException { _focusType = _T6_R1; _testObj = createTypeHierarchy(_focusType); - - IType[] expected = new IType[] { + + IType[] expected = new IType[] { _T8_R2, // indirect: tsub of phantom explicit subclass (T6$R2) -// _T2_R2 // not a subclass of T6$R1 +// _T2_R2 // not a subclass of T6$R1 }; - + IType [] actual = _testObj.getSubclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -335,16 +335,16 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest _focusType = _T6_R1; _testObj = createTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - - IType[] expected = new IType[] { + + IType[] expected = new IType[] { _phantom_T8_R1, _phantom_T6_R2, // _T8_R2 // indirect: explicit subclass of phantom }; - + IType [] actual = _testObj.getSubclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -352,31 +352,31 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest { _focusType = _T2_R2; _testObj = createTypeHierarchy(_focusType); - - IType[] expected = new IType[] { + + IType[] expected = new IType[] { _T8_R2, // indirect -// _T2_R2 // not a subclass of T6$R1 +// _T2_R2 // not a subclass of T6$R1 }; - + IType [] actual = _testObj.getSubclasses(_T6_R1); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetSubtypes_T6_R1() throws JavaModelException { _focusType = _T6_R1; _testObj = createTypeHierarchy(_focusType); - - IType[] expected = new IType[] { + + IType[] expected = new IType[] { _T8_R2, // indirect -// _T2_R2 // not a sub type of T6$R1 +// _T2_R2 // not a sub type of T6$R1 }; - + IType [] actual = _testObj.getSubtypes(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -385,14 +385,14 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest _focusType = _T6_R1; _testObj = createTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - + IType[] expected = new IType[] { _phantom_T6_R2, _phantom_T8_R1, // _T8_R2 // indirect: tsub of phantom explicit subclass (T6$R2), but in phantom mode we stop at that phantom - }; + }; IType [] actual = _testObj.getSubtypes(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -400,8 +400,8 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest { _focusType = (_T2_R1); _testObj = createTypeHierarchy(_focusType); - - IType[] expected = new IType[] { _T8_R2, + + IType[] expected = new IType[] { _T8_R2, // _T2_R2 // not a subtype of T6$R1 }; IType [] actual = _testObj.getAllSubtypes(_T6_R1); @@ -414,7 +414,7 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest { PhantomType phantom1 = new PhantomType(_T6, _T2_R2); PhantomType phantom2 = new PhantomType(_T6, _T2_R2); - + assertEquals(phantom1.hashCode(), phantom2.hashCode()); assertTrue(phantom1.equals(phantom2)); } @@ -423,25 +423,25 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest { PhantomType phantom1 = new PhantomType(_T6, _T2_R2); PhantomType phantom2 = new PhantomType(_T6, _T2_R2); - + HashMap<PhantomType, Double> map = new HashMap<PhantomType, Double>(); Double dummy = new Double(0.0); map.put(phantom1, dummy); - + Double expected = dummy; Double actual = map.get(phantom2); assertEquals(expected, actual); } - + public void testPhantomTypeEquality2() throws JavaModelException { PhantomType phantom1 = new PhantomType(_T6, _T2_R2); PhantomType phantom2 = new PhantomType(_T6, _T2_R2); - + PhantomType phantom11 = new PhantomType(phantom1, _T1_R1); PhantomType phantom12 = new PhantomType(phantom2, _T1_R1); - + assertEquals(phantom11.hashCode(), phantom12.hashCode()); assertTrue(phantom11.equals(phantom12)); } @@ -450,14 +450,14 @@ public class OTSubTypeHierarchyTest001 extends FileBasedHierarchyTest { PhantomType phantom1 = new PhantomType(_T6, _T2_R2); PhantomType phantom2 = new PhantomType(_T6, _T2_R2); - + PhantomType phantom11 = new PhantomType(phantom1, _T1_R1); PhantomType phantom12 = new PhantomType(phantom2, _T1_R1); - + HashMap<PhantomType, Double> map = new HashMap<PhantomType, Double>(); Double dummy = new Double(0.0); map.put(phantom11, dummy); - + Double expected = dummy; Double actual = map.get(phantom12); assertEquals(expected, actual); diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest002.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest002.java index 498405e63..763e66929 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest002.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest002.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -34,19 +34,19 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest; * */ public class OTSubTypeHierarchyTest002 extends FileBasedModelTest { - + private TypeHierarchy _testObj; private IType _focusType; - + private IType _T1_R1; - + private IType _T2_R1; - + private IType _T3_R1; private IType _classA; - + @SuppressWarnings("unused") private IType _objectType; @@ -60,7 +60,7 @@ public class OTSubTypeHierarchyTest002 extends FileBasedModelTest { { super(name); } - + public static Test suite() { if (true) @@ -68,23 +68,23 @@ public class OTSubTypeHierarchyTest002 extends FileBasedModelTest { return new Suite(OTSubTypeHierarchyTest002.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSubTypeHierarchyTest002.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test002"; _T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1"); - + _T2 = getType(getTestProjectDir(), srcFolder, pkg, @@ -96,50 +96,50 @@ public class OTSubTypeHierarchyTest002 extends FileBasedModelTest { "T3"); _T1_R1 = getRole(_T1, "T1.R1"); - + _T2_R1 = getRole(_T2, "T2.R1"); - + _T3_R1 = getRole(_T3, "T3.R1"); - + _classA = getType(getTestProjectDir(), srcFolder, pkg, "ClassA"); - - _objectType = + + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object"); } - + public void testGetAllSubtypes_T1_R1() throws JavaModelException { _focusType = _T1_R1; _testObj = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); _testObj.refresh(new NullProgressMonitor()); - + IType[] expected = new IType[] { _T2_R1, _T3_R1}; - + IType [] actual = _testObj.getAllSubtypes(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSubtypes_ClassA() throws JavaModelException { _focusType = _classA; _testObj = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); _testObj.refresh(new NullProgressMonitor()); - + IType[] expected = new IType[] { _T2_R1, _T3_R1}; - + IType [] actual = _testObj.getAllSubtypes(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest004.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest004.java index 2c88ccb31..a66e58bda 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest004.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest004.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -34,19 +34,19 @@ import org.eclipse.objectteams.otdt.tests.hierarchy.FileBasedHierarchyTest; /** * @author Michael Krueger (mkr) - * @version $Id: OTSubTypeHierarchyTest004.java 23494 2010-02-05 23:06:44Z stephan $ - * + * @version $Id: OTSubTypeHierarchyTest004.java 23494 2010-02-05 23:06:44Z stephan $ + * */ -public class OTSubTypeHierarchyTest004 extends FileBasedHierarchyTest +public class OTSubTypeHierarchyTest004 extends FileBasedHierarchyTest { - + private ITypeHierarchy _testObj; private IType _focusType; @SuppressWarnings("unused") private IType _objectType; private IType _T20; private IType _T21; - + private IType _T20T10T00R0; private IType _T20T10T00R1; private IType _T21T10T00R1; @@ -54,13 +54,13 @@ public class OTSubTypeHierarchyTest004 extends FileBasedHierarchyTest private IType _T21T11T00R0; private IType _T21T11T00R1; private IType _T21T11T00R2; - - + + public OTSubTypeHierarchyTest004(String name) { super(name); } - + public static Test suite() { if (true) @@ -68,33 +68,33 @@ public class OTSubTypeHierarchyTest004 extends FileBasedHierarchyTest return new Suite(OTSubTypeHierarchyTest004.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSubTypeHierarchyTest004.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test004"; - - _T20 = + + _T20 = getType(getTestProjectDir(), srcFolder, pkg, "T20"); - _T21 = + _T21 = getType(getTestProjectDir(), srcFolder, pkg, "T21"); - - - _objectType = + + + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", @@ -105,29 +105,29 @@ public class OTSubTypeHierarchyTest004 extends FileBasedHierarchyTest _T21T10T00R1 = TypeHelper.findNestedRoleType(_T21, "T21.T10.T00.R1"); _T21T10T00R2 = TypeHelper.findNestedRoleType(_T21, "T21.T10.T00.R2"); - + _T21T11T00R0 = TypeHelper.findNestedRoleType(_T21, "T21.T11.T00.R0"); _T21T11T00R1 = TypeHelper.findNestedRoleType(_T21, "T21.T11.T00.R1"); _T21T11T00R2 = TypeHelper.findNestedRoleType(_T21, "T21.T11.T00.R2"); } - + public void testCreation() { assertCreation(_T20); assertCreation(_T21); - + assertCreation(_T20T10T00R0); assertCreation(_T20T10T00R1); assertCreation(_T21T10T00R1); assertCreation(_T21T10T00R2); - + assertCreation(_T21T11T00R0); assertCreation(_T21T11T00R1); assertCreation(_T21T11T00R2); } - + public void testGetAllSubtypes_T20T10T00R0() throws JavaModelException { _focusType = _T20T10T00R0; @@ -135,7 +135,7 @@ public class OTSubTypeHierarchyTest004 extends FileBasedHierarchyTest IType[] expected = { _T21T11T00R0, _T21T11T00R1, _T21T11T00R2 }; IType[] actual = _testObj.getAllSubtypes(_focusType); - + assertTrue(compareTypes(expected, actual)); } @@ -147,24 +147,24 @@ public class OTSubTypeHierarchyTest004 extends FileBasedHierarchyTest IType[] expected = { _T21T10T00R1, _T21T10T00R2, _T21T11T00R1, _T21T11T00R2 }; IType[] actual = hierarchy.getAllSubtypes(_focusType); - + assertTrue(compareTypes(expected, actual)); } - + public void testGetSubtypes_T20T10T00R0() throws JavaModelException { _focusType = _T20T10T00R0; _testObj = createTypeHierarchy(_focusType); IType[] expected = { - _T21T11T00R0 // indirect sub + _T21T11T00R0 // indirect sub }; IType[] actual = _testObj.getSubtypes(_focusType); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetTSuperTypes_T21T11T00R0() throws JavaModelException { _focusType = _T21T11T00R0; @@ -173,7 +173,7 @@ public class OTSubTypeHierarchyTest004 extends FileBasedHierarchyTest IType[] expected = { _T20T10T00R0 }; IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(hierarchy, _focusType); - + assertTrue(compareTypes(expected, actual)); } @@ -185,10 +185,10 @@ public class OTSubTypeHierarchyTest004 extends FileBasedHierarchyTest IType[] expected = { _T21T10T00R1 }; IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(hierarchy, _focusType); - + assertTrue(compareTypes(expected, actual)); } - - + + } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest006.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest006.java index c593cd438..a0b258ef6 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest006.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest006.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -38,17 +38,17 @@ public class OTSubTypeHierarchyTest006 extends FileBasedHierarchyTest private IType _T1; private IType _T2; private IType _T3; - + private IType _T1_R1; private IType _T1_R2; - + private IType _T2_R1; private IType _phantom_T2_R2; private IType _phantom_T3_R1; private IType _T3_R2; - - private IType _classA; + + private IType _classA; @SuppressWarnings("unused") private IType _objectType; private IType _MyTeam_MyRole; @@ -58,12 +58,12 @@ public class OTSubTypeHierarchyTest006 extends FileBasedHierarchyTest private IType _MyTeam; private IType _MySubTeam; private IType _MyOtherSubTeam; - + public OTSubTypeHierarchyTest006(String name) { super(name); } - + public static Test suite() { if (true) @@ -71,50 +71,50 @@ public class OTSubTypeHierarchyTest006 extends FileBasedHierarchyTest return new Suite(OTSubTypeHierarchyTest006.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSubTypeHierarchyTest006.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test006"; - + _T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1"); _T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2"); _T3 = getType(getTestProjectDir(), srcFolder, pkg, "T3"); - + _T1_R1 = getRole(_T1, "T1.R1"); _T1_R2 = getRole(_T1, "T1.R2"); - + _T2_R1 = getRole(_T2, "T2.R1"); _phantom_T2_R2 = new PhantomType(_T2, _T1_R2); - + _phantom_T3_R1 = new PhantomType(_T3, _T2_R1); _T3_R2 = getRole(_T3, "T3.R2"); - + _classA = - getType(getTestProjectDir(), srcFolder, pkg, "ClassA"); - + getType(getTestProjectDir(), srcFolder, pkg, "ClassA"); + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object"); - + setupExtraStuff(); } - + private void setupExtraStuff() throws JavaModelException { String srcFolder = "src"; String pkg = "simple"; - + _MyTeam = getType(getTestProjectDir(), srcFolder, pkg, "MyTeam"); _MySubTeam = getType(getTestProjectDir(), srcFolder, pkg, "MySubTeam"); _MyOtherSubTeam = getType(getTestProjectDir(), srcFolder, pkg, "MyOtherSubTeam"); - + _MyTeam_MyRole = getRole(_MyTeam, "MyTeam.MyRole"); _MySubTeam_MyRole = new PhantomType(_MySubTeam, _MyTeam_MyRole); _MyOtherSubTeam_MyRole = getRole(_MyOtherSubTeam, "MyOtherSubTeam.MyRole"); @@ -125,33 +125,33 @@ public class OTSubTypeHierarchyTest006 extends FileBasedHierarchyTest assertCreation(_T1); assertCreation(_T2); assertCreation(_T3); - + assertCreation(_T1_R1); assertCreation(_T1_R2); - + assertCreation(_T2_R1); assertCreation(_phantom_T2_R2); - + assertCreation(_phantom_T3_R1); assertCreation(_T3_R2); - + assertCreation(_MyTeam); assertCreation(_MySubTeam); - + assertCreation(_MyTeam_MyRole); assertCreation(_MySubTeam_MyRole); } - - + + public void testGetAllSubtypes_ClassA() throws JavaModelException { _focusType = _classA; _testObj = createTypeHierarchy(_focusType); - - IType[] expected = new IType[] { _T1_R1, _T2_R1, _T3_R2 }; + + IType[] expected = new IType[] { _T1_R1, _T2_R1, _T3_R2 }; IType [] actual = _testObj.getAllSubtypes(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -160,42 +160,42 @@ public class OTSubTypeHierarchyTest006 extends FileBasedHierarchyTest _focusType = _MyTeam_MyRole; _testObj = createTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - + IType[] expected = new IType[] { _MySubTeam_MyRole, _MyOtherSubTeam_MyRole }; IType [] actual = _testObj.getAllSubtypes(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSubtypes_ClassA_phantomMode() throws JavaModelException { _focusType = _classA; _testObj = createTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - + IType[] expected = new IType[] { _T1_R1, _T2_R1, _T3_R2, - _phantom_T3_R1 }; + _phantom_T3_R1 }; IType [] actual = _testObj.getAllSubtypes(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetSubtypes_ClassA() throws JavaModelException { _focusType = _classA; _testObj = createTypeHierarchy(_focusType); - - IType[] expected = new IType[] { _T1_R1, _T2_R1 }; + + IType[] expected = new IType[] { _T1_R1, _T2_R1 }; IType [] actual = _testObj.getSubtypes(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -203,13 +203,13 @@ public class OTSubTypeHierarchyTest006 extends FileBasedHierarchyTest { _focusType = _classA; _testObj = createTypeHierarchy(_focusType); - - IType[] expected = new IType[] { + + IType[] expected = new IType[] { // _T3_R2 // indirect sub (picture is wrong, T3$R2 extends T3$R1) - }; + }; IType [] actual = _testObj.getSubtypes(_T2_R1); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -217,11 +217,11 @@ public class OTSubTypeHierarchyTest006 extends FileBasedHierarchyTest { _focusType = _classA; _testObj = createTypeHierarchy(_focusType); - - IType[] expected = new IType[] { _T3_R2 }; + + IType[] expected = new IType[] { _T3_R2 }; IType [] actual = _testObj.getAllSubtypes(_T2_R1); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -230,14 +230,14 @@ public class OTSubTypeHierarchyTest006 extends FileBasedHierarchyTest _focusType = _classA; _testObj = createTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - - IType[] expected = new IType[] { + + IType[] expected = new IType[] { // _T3_R2, // indirect sub (picture is wrong, T3$R2 extends T3$R1) - _phantom_T3_R1 - }; + _phantom_T3_R1 + }; IType [] actual = _testObj.getSubtypes(_T2_R1); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -246,12 +246,12 @@ public class OTSubTypeHierarchyTest006 extends FileBasedHierarchyTest _focusType = _classA; _testObj = createTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - - IType[] expected = new IType[] { _T3_R2, _phantom_T3_R1 }; + + IType[] expected = new IType[] { _T3_R2, _phantom_T3_R1 }; IType [] actual = _testObj.getAllSubtypes(_T2_R1); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest010.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest010.java index fd5d3c0ed..b3029c4c0 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest010.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest010.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -37,7 +37,7 @@ import org.eclipse.objectteams.otdt.core.hierarchy.OTTypeHierarchies; */ public class OTSubTypeHierarchyTest010 extends FileBasedModelTest { - + private IType _focusType; private IType _T1; private IType _T2; @@ -47,13 +47,13 @@ public class OTSubTypeHierarchyTest010 extends FileBasedModelTest private IType _T3R1; private IType _interfaceA; private IType _objectType; - - + + public OTSubTypeHierarchyTest010(String name) { super(name); } - + public static Test suite() { if (true) @@ -61,44 +61,44 @@ public class OTSubTypeHierarchyTest010 extends FileBasedModelTest return new Suite(OTSubTypeHierarchyTest010.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSubTypeHierarchyTest010.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test010"; - - _T1 = + + _T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1"); - _T2 = + _T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2"); - - _T3 = + + _T3 = getType(getTestProjectDir(), srcFolder, pkg, "T3"); - _interfaceA = + _interfaceA = getType(getTestProjectDir(), srcFolder, pkg, "InterfaceA"); - - _objectType = + + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", @@ -110,7 +110,7 @@ public class OTSubTypeHierarchyTest010 extends FileBasedModelTest } - + public void testCreation() { assertCreation(_T1R1); @@ -118,57 +118,57 @@ public class OTSubTypeHierarchyTest010 extends FileBasedModelTest assertCreation(_T3R1); assertCreation(_interfaceA); } - - + + public void testGetSubtypes_T1R1() throws JavaModelException { _focusType = _T1R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = hierarchy.getSubtypes(_focusType); IType[] expected = new IType[] { _T2R1 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } public void testGetSubtypes_T2R1() throws JavaModelException { _focusType = _T2R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = hierarchy.getSubtypes(_focusType); IType[] expected = new IType[] { _T3R1 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } public void testGetSubtypes_interfaceA() throws JavaModelException { _focusType = _interfaceA; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = hierarchy.getSubtypes(_focusType); IType[] expected = new IType[] { _T2R1 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSubtypes_T1R1() throws JavaModelException { _focusType = _T1R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); @@ -178,31 +178,31 @@ public class OTSubTypeHierarchyTest010 extends FileBasedModelTest _T2R1, _T3R1 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSubtypes_T2R1() throws JavaModelException { _focusType = _T2R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = hierarchy.getAllSubtypes(_focusType); IType[] expected = new IType[] { _T3R1 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSubtypes_interfaceA() throws JavaModelException { _focusType = _interfaceA; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); @@ -212,75 +212,75 @@ public class OTSubTypeHierarchyTest010 extends FileBasedModelTest _T2R1, _T3R1 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - + public void testGetRootClasses_T1R1() throws JavaModelException { _focusType = _T1R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = hierarchy.getRootClasses(); IType[] expected = new IType[] { _objectType }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - + public void testGetRootClasses_interfaceA() throws JavaModelException { _focusType = _interfaceA; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = hierarchy.getRootClasses(); IType[] expected = new IType[] { _objectType }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - + public void testGetRootInterfaces_interfaceA() throws JavaModelException { _focusType = _interfaceA; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = hierarchy.getRootInterfaces(); IType[] expected = new IType[] { _focusType }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - - + + public void testGetType_T1R1() throws JavaModelException { _focusType = _T1R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType actual = hierarchy.getType(); IType expected = _focusType; - - assertTrue(compareTypes(expected, actual)); + + assertTrue(compareTypes(expected, actual)); } - + public void testGetImplementingClasses_interfaceA() throws JavaModelException { _focusType = _interfaceA; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); @@ -290,16 +290,16 @@ public class OTSubTypeHierarchyTest010 extends FileBasedModelTest _T2R1, // _T3R1 // indirect }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - + public void testGetAllInterfaces_interfaceA() throws JavaModelException { _focusType = _interfaceA; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); @@ -307,15 +307,15 @@ public class OTSubTypeHierarchyTest010 extends FileBasedModelTest IType[] actual = hierarchy.getAllInterfaces(); IType[] expected = new IType[] { _interfaceA }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } public void testGetAllClasses_T1R1() throws JavaModelException { _focusType = _T1R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); @@ -327,83 +327,83 @@ public class OTSubTypeHierarchyTest010 extends FileBasedModelTest _T3R1, _objectType }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } public void testGetTSuperTypes_T1R1() throws JavaModelException { _focusType = _T1R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(hierarchy, _T3R1); IType[] expected = new IType[] { _T2R1 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } public void testGetAllTSuperTypes_T1R1() throws JavaModelException { _focusType = _T1R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = OTTypeHierarchies.getInstance().getAllTSuperTypes(hierarchy, _T3R1); IType[] expected = new IType[] { _T2R1, _T1R1 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - + public void testGetExplicitSuperclass_T2R1_in_T2R1() throws JavaModelException { _focusType = _T2R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(hierarchy, _T2R1); IType expected = _objectType; - - assertTrue(compareTypes(expected, actual)); + + assertTrue(compareTypes(expected, actual)); } public void testGetExplicitSuperclass_T3R1_in_T2R1() throws JavaModelException { _focusType = _T2R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(hierarchy, _T3R1); IType expected = _objectType; - - assertTrue(compareTypes(expected, actual)); + + assertTrue(compareTypes(expected, actual)); } - + public void testGetExplicitSuperclass_T1R1_in_T2R1() throws JavaModelException { _focusType = _T2R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(hierarchy, _T1R1); IType expected = _objectType; - - assertTrue(compareTypes(expected, actual)); + + assertTrue(compareTypes(expected, actual)); } - + } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest011.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest011.java index 45e2a5287..8cf94ca6f 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest011.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest011.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -32,30 +32,30 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest; import org.eclipse.objectteams.otdt.core.TypeHelper; /** - * + * * @author Michael Krueger (mkr) - * @version $Id: OTSubTypeHierarchyTest011.java 23494 2010-02-05 23:06:44Z stephan $ - * + * @version $Id: OTSubTypeHierarchyTest011.java 23494 2010-02-05 23:06:44Z stephan $ + * */ public class OTSubTypeHierarchyTest011 extends FileBasedModelTest { - + @SuppressWarnings("unused") private ITypeHierarchy _testObj; private IType _focusType; private IType _T10; - private IType _T21; + private IType _T21; @SuppressWarnings("unused") private IType _objectType; private IType _T21T11T0R1; private IType _T10T0R1; private IType _T10T0R2; - - + + public OTSubTypeHierarchyTest011(String name) { super(name); } - + public static Test suite() { if (true) @@ -63,33 +63,33 @@ public class OTSubTypeHierarchyTest011 extends FileBasedModelTest { return new Suite(OTSubTypeHierarchyTest011.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSubTypeHierarchyTest011.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test011"; - - _T10 = + + _T10 = getType(getTestProjectDir(), srcFolder, pkg, "T10"); - _T21 = + _T21 = getType(getTestProjectDir(), srcFolder, pkg, "T21"); - - - _objectType = + + + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", @@ -101,7 +101,7 @@ public class OTSubTypeHierarchyTest011 extends FileBasedModelTest { } - + public void testCreation() { assertCreation(_T10); @@ -110,27 +110,27 @@ public class OTSubTypeHierarchyTest011 extends FileBasedModelTest { assertCreation(_T10T0R1); assertCreation(_T10T0R2); } - - + + public void testGetSubtypes_T10T0R1() throws JavaModelException { _focusType = _T10T0R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = hierarchy.getSubtypes(_focusType); IType[] expected = new IType[] { _T21T11T0R1 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } public void testGetSubtypes_T10T0R2() throws JavaModelException { _focusType = _T10T0R2; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); @@ -140,40 +140,40 @@ public class OTSubTypeHierarchyTest011 extends FileBasedModelTest { // _T21T11T0R1, // indirect sub _T10T0R1 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } public void testGetAllSubtypes_T10T0R1() throws JavaModelException { _focusType = _T10T0R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = hierarchy.getAllSubtypes(_focusType); IType[] expected = new IType[] { _T21T11T0R1 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSubtypes_T10T0R2() throws JavaModelException { _focusType = _T10T0R2; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = hierarchy.getAllSubtypes(_focusType); IType[] expected = new IType[] { _T10T0R1, _T21T11T0R1 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - + } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest016.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest016.java index f672f7d75..2eef5780a 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest016.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest016.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -33,13 +33,13 @@ import org.eclipse.objectteams.otdt.core.TypeHelper; import org.eclipse.objectteams.otdt.core.hierarchy.OTTypeHierarchies; /** - * + * * @author Michael Krueger (mkr) - * @version $Id: OTSubTypeHierarchyTest016.java 23494 2010-02-05 23:06:44Z stephan $ - * + * @version $Id: OTSubTypeHierarchyTest016.java 23494 2010-02-05 23:06:44Z stephan $ + * */ public class OTSubTypeHierarchyTest016 extends FileBasedModelTest { - + @SuppressWarnings("unused") private ITypeHierarchy _testObj; private IType _focusType; @@ -56,16 +56,16 @@ public class OTSubTypeHierarchyTest016 extends FileBasedModelTest { private IType _T2R2; private IType _T2R3; private IType _T2R4; - + @SuppressWarnings("unused") private IType _objectType; - - + + public OTSubTypeHierarchyTest016(String name) { super(name); } - + public static Test suite() { if (true) @@ -73,44 +73,44 @@ public class OTSubTypeHierarchyTest016 extends FileBasedModelTest { return new Suite(OTSubTypeHierarchyTest016.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSubTypeHierarchyTest016.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test016"; - _C1 = + _C1 = getType(getTestProjectDir(), srcFolder, pkg, "C1"); - _I1 = + _I1 = getType(getTestProjectDir(), srcFolder, pkg, "I1"); - _T1 = + _T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1"); - _T2 = + _T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2"); - _objectType = + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", @@ -128,7 +128,7 @@ public class OTSubTypeHierarchyTest016 extends FileBasedModelTest { } - + public void testCreation() { assertCreation(_C1); @@ -143,131 +143,131 @@ public class OTSubTypeHierarchyTest016 extends FileBasedModelTest { assertCreation(_T2R3); assertCreation(_T2R4); } - + public void testGetSubtypes_C1() throws JavaModelException { _focusType = _C1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = hierarchy.getSubtypes(_focusType); IType[] expected = new IType[] { _T1R5 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - + public void testGetSubtypes_T1R1() throws JavaModelException { _focusType = _T1R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = hierarchy.getSubtypes(_focusType); IType[] expected = new IType[] { _T1R2, _T2R1 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } public void testGetSubtypes_T1R2() throws JavaModelException { _focusType = _T1R2; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = hierarchy.getSubtypes(_focusType); IType[] expected = new IType[] { _T1R3, _T2R2 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } public void testGetSubtypes_T1R3() throws JavaModelException { _focusType = _T1R3; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = hierarchy.getSubtypes(_focusType); IType[] expected = new IType[] { _T1R4, _T2R3 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - + public void testGetSubtypes_T1R4() throws JavaModelException { _focusType = _T1R4; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = hierarchy.getSubtypes(_focusType); IType[] expected = new IType[] { _T2R4 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - + public void testGetExplicitSuperclass_T1R2() throws JavaModelException { _focusType = _T1R2; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); hierarchy.refresh(new NullProgressMonitor()); IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(hierarchy, _focusType); IType expected = _T1R1; - - assertTrue(compareTypes(expected, actual)); + + assertTrue(compareTypes(expected, actual)); } public void testGetExplicitSuperclass_T1R3() throws JavaModelException { _focusType = _T1R3; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(hierarchy, _focusType); IType expected = _T1R2; - - assertTrue(compareTypes(expected, actual)); + + assertTrue(compareTypes(expected, actual)); } public void testGetExplicitSuperclass_T1R4() throws JavaModelException { _focusType = _T1R4; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(hierarchy, _focusType); IType expected = _T1R3; - - assertTrue(compareTypes(expected, actual)); + + assertTrue(compareTypes(expected, actual)); } public void testGetExplicitSuperclass_T1R5() throws JavaModelException { _focusType = _T1R5; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); @@ -279,98 +279,98 @@ public class OTSubTypeHierarchyTest016 extends FileBasedModelTest { + " extends " + expected.getElementName() + " not in TypeHierarchy!"; - - assertTrue(errorMsg, compareTypes(expected, actual)); + + assertTrue(errorMsg, compareTypes(expected, actual)); } public void testTypeHierarchy_GetSuperclass_T1R5() throws JavaModelException { _focusType = _T1R5; - - + + ITypeHierarchy hierarchy = _focusType.newSupertypeHierarchy(new NullProgressMonitor()); IType actual = hierarchy.getSuperclass(_focusType); IType expected = _C1; - + String errorMsg = _focusType.getElementName() + " extends " + expected.getElementName() + " not in TypeHierarchy!"; - assertTrue(errorMsg, compareTypes(expected, actual)); + assertTrue(errorMsg, compareTypes(expected, actual)); } - - + + public void testGetSuperInterfaces_T1R5() throws JavaModelException { _focusType = _T1R5; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = hierarchy.getSuperInterfaces(_focusType); IType[] expected = new IType[] { _I1 }; - - assertTrue(compareTypes(expected, actual)); + + assertTrue(compareTypes(expected, actual)); } - + public void testGetTSuperTypes_T2R1() throws JavaModelException { _focusType = _T2R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(hierarchy, _focusType); IType[] expected = new IType[] {_T1R1 }; - - assertTrue(compareTypes(expected, actual)); + + assertTrue(compareTypes(expected, actual)); } public void testGetTSuperTypes_T2R2() throws JavaModelException { _focusType = _T2R2; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(hierarchy, _focusType); IType[] expected = new IType[] {_T1R2 }; - - assertTrue(compareTypes(expected, actual)); + + assertTrue(compareTypes(expected, actual)); } public void testGetTSuperTypes_T2R3() throws JavaModelException { _focusType = _T2R3; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(hierarchy, _focusType); IType[] expected = new IType[] {_T1R3 }; - - assertTrue(compareTypes(expected, actual)); + + assertTrue(compareTypes(expected, actual)); } public void testGetTSuperTypes_T2R4() throws JavaModelException { _focusType = _T2R4; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(hierarchy, _focusType); IType[] expected = new IType[] {_T1R4 }; - - assertTrue(compareTypes(expected, actual)); + + assertTrue(compareTypes(expected, actual)); } - + } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest017.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest017.java index 96675ee7d..180d06d97 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest017.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest017.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -33,13 +33,13 @@ import org.eclipse.objectteams.otdt.internal.core.PhantomType; import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest; /** - * + * * @author Michael Krueger (mkr) - * @version $Id: OTSubTypeHierarchyTest017.java 23494 2010-02-05 23:06:44Z stephan $ - * + * @version $Id: OTSubTypeHierarchyTest017.java 23494 2010-02-05 23:06:44Z stephan $ + * */ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest { - + private TypeHierarchy _testObj; @SuppressWarnings("unused") private IType _focusType; @@ -63,17 +63,17 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest { private IType _phantom_TE_R1; private IType _phantom_TD_R2; - - + + @SuppressWarnings("unused") private IType _objectType; - - + + public OTSubTypeHierarchyTest017(String name) { super(name); } - + public static Test suite() { if (true) @@ -81,16 +81,16 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest { return new Suite(OTSubTypeHierarchyTest017.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSubTypeHierarchyTest017.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test017"; @@ -100,7 +100,7 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest { _TD = getType(getTestProjectDir(), srcFolder, pkg, "TD"); _TE = getType(getTestProjectDir(), srcFolder, pkg, "TE"); - _objectType = + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", @@ -116,7 +116,7 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest { _TD_R1 = TypeHelper.findNestedRoleType(_TD, "TD.R1"); _TE_R2 = TypeHelper.findNestedRoleType(_TE, "TE.R2"); _TE_R3 = TypeHelper.findNestedRoleType(_TE, "TE.R3"); - + _phantom_TB_R3 = new PhantomType(_TB, _TA_R3); _phantom_TD_R2 = new PhantomType(_TD, _TB_R2); _phantom_TE_R1 = new PhantomType(_TE, _TD_R1); @@ -125,12 +125,12 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest { private void initHierarchy(IType focus, boolean computeSubtypes) throws JavaModelException - { + { _testObj = new TypeHierarchy(focus, null, focus.getJavaProject(), computeSubtypes); _testObj.refresh(new NullProgressMonitor()); _focusType = focus; } - + public void testCreation() { assertCreation(_TA); @@ -149,21 +149,21 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest { assertCreation(_TC_R3); assertCreation(_TD_R1); - + assertCreation(_TE_R2); - assertCreation(_TE_R3); + assertCreation(_TE_R3); } public void testGetSubtypes_TD_R1() throws JavaModelException { initHierarchy(_TA_R1, true); - - IType[] expected = new IType[] { -// _TB_R2, // not sub of TD$R1 + + IType[] expected = new IType[] { +// _TB_R2, // not sub of TD$R1 _TE_R2 // indirect }; IType[] actual = _testObj.getSubtypes(_TD_R1); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -172,13 +172,13 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest { { initHierarchy(_TA_R1, true); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - - IType[] expected = new IType[] { + + IType[] expected = new IType[] { _phantom_TE_R1, _phantom_TD_R2 }; IType[] actual = _testObj.getSubtypes(_TD_R1); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -186,15 +186,15 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest { public void testGetAllSubtypes_TD_R1() throws JavaModelException { initHierarchy(_TA_R1, true); - - IType[] expected = new IType[] { -// _TA_R3, // not sub of TD$R1 -// _TB_R2, // not sub of TD$R1 - _TE_R2, - _TE_R3 + + IType[] expected = new IType[] { +// _TA_R3, // not sub of TD$R1 +// _TB_R2, // not sub of TD$R1 + _TE_R2, + _TE_R3 }; IType[] actual = _testObj.getAllSubtypes(_TD_R1); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -202,16 +202,16 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest { public void testGetSubtypes_TB_R2() throws JavaModelException { initHierarchy(_TA_R1, true); - - IType[] expected = new IType[] { -// _TA_R3, // not sub of TB$R2 - _TC_R2, + + IType[] expected = new IType[] { +// _TA_R3, // not sub of TB$R2 + _TC_R2, _TC_R3, // indirect _TE_R2, // indirect _TE_R3 // indirect }; IType[] actual = _testObj.getSubtypes(_TB_R2); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -221,13 +221,13 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest { initHierarchy(_TA_R1, true); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - IType[] expected = new IType[] { - _TC_R2, + IType[] expected = new IType[] { + _TC_R2, _phantom_TD_R2, _phantom_TB_R3, }; IType[] actual = _testObj.getSubtypes(_TB_R2); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -235,15 +235,15 @@ public class OTSubTypeHierarchyTest017 extends FileBasedModelTest { public void testGetAllSubtypes_TB_R2() throws JavaModelException { initHierarchy(_TA_R1, true); - - IType[] expected = new IType[] { -// _TA_R3, // not sub of TB$R2 + + IType[] expected = new IType[] { +// _TA_R3, // not sub of TB$R2 _TC_R2, _TC_R3, _TE_R2, _TE_R3 }; IType[] actual = _testObj.getAllSubtypes(_TB_R2); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest018.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest018.java index 4e14e7e02..f5ff8546b 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest018.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest018.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -32,13 +32,13 @@ import org.eclipse.objectteams.otdt.core.TypeHelper; import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest; /** - * + * * @author Michael Krueger (mkr) - * @version $Id: OTSubTypeHierarchyTest018.java 23494 2010-02-05 23:06:44Z stephan $ - * + * @version $Id: OTSubTypeHierarchyTest018.java 23494 2010-02-05 23:06:44Z stephan $ + * */ public class OTSubTypeHierarchyTest018 extends FileBasedModelTest { - + private ITypeHierarchy _testObj; @SuppressWarnings("unused") private IType _focusType; @@ -54,22 +54,22 @@ public class OTSubTypeHierarchyTest018 extends FileBasedModelTest { private IType _TA2_TB2_R2; private IType _TA3_TB2_R2; - private IType _TZ1_TX1; + private IType _TZ1_TX1; + + private IType _TZ1_TX1_TB2_R2; + private IType _TZ1_TX2_TB2_R2; + private IType _TZ2_TX2_TB2_R1; - private IType _TZ1_TX1_TB2_R2; - private IType _TZ1_TX2_TB2_R2; - private IType _TZ2_TX2_TB2_R1; - @SuppressWarnings("unused") private IType _objectType; - - + + public OTSubTypeHierarchyTest018(String name) { super(name); } - + public static Test suite() { if (true) @@ -77,16 +77,16 @@ public class OTSubTypeHierarchyTest018 extends FileBasedModelTest { return new Suite(OTSubTypeHierarchyTest018.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSubTypeHierarchyTest018.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test018"; @@ -96,7 +96,7 @@ public class OTSubTypeHierarchyTest018 extends FileBasedModelTest { _TZ1 = getType(getTestProjectDir(), srcFolder, pkg, "TZ1"); _TZ2 = getType(getTestProjectDir(), srcFolder, pkg, "TZ2"); - _objectType = + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", @@ -117,12 +117,12 @@ public class OTSubTypeHierarchyTest018 extends FileBasedModelTest { private void initHierarchy(IType focus, boolean computeSubtypes) throws JavaModelException - { + { _testObj = new TypeHierarchy(focus, null, focus.getJavaProject(), computeSubtypes); _testObj.refresh(new NullProgressMonitor()); _focusType = focus; } - + public void testCreation() { assertCreation(_TA1); @@ -147,7 +147,7 @@ public class OTSubTypeHierarchyTest018 extends FileBasedModelTest { public void testGetAllSubtypes_TA1_TB1_R1() throws JavaModelException { initHierarchy(_TA1_TB1_R1, true); - + IType[] expected = new IType[] { _TA2_TB1_R1, _TA2_TB2_R1, _TA2_TB2_R2, @@ -155,14 +155,14 @@ public class OTSubTypeHierarchyTest018 extends FileBasedModelTest { _TZ1_TX1_TB2_R2, _TZ1_TX2_TB2_R2, _TZ2_TX2_TB2_R1 - }; - - + }; + + IType[] actual = _testObj.getAllSubtypes(_TA1_TB1_R1); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest019.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest019.java index beafda53d..2ca013b8e 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest019.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest019.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -35,11 +35,11 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest; */ public class OTSubTypeHierarchyTest019 extends FileBasedModelTest { - + private TypeHierarchy _testObj; private IType _focusType; - + private IType _TA; private IType _TB; private IType _TC; @@ -60,12 +60,12 @@ public class OTSubTypeHierarchyTest019 extends FileBasedModelTest private IType _TB_R14; private IType _TB_R15; - + public OTSubTypeHierarchyTest019(String name) { super(name); } - + public static Test suite() { if (true) @@ -73,16 +73,16 @@ public class OTSubTypeHierarchyTest019 extends FileBasedModelTest return new Suite(OTSubTypeHierarchyTest019.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSubTypeHierarchyTest019.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test019"; @@ -90,7 +90,7 @@ public class OTSubTypeHierarchyTest019 extends FileBasedModelTest srcFolder, pkg, "TA"); - + _TB = getType(getTestProjectDir(), srcFolder, pkg, @@ -116,9 +116,9 @@ public class OTSubTypeHierarchyTest019 extends FileBasedModelTest _TB_R13 = getRole(_TB, "TB.R13"); _TB_R14 = getRole(_TB, "TB.R14"); _TB_R15 = getRole(_TB, "TB.R15"); - + } - + public void testCreation() { assertCreation(_TA); @@ -139,17 +139,17 @@ public class OTSubTypeHierarchyTest019 extends FileBasedModelTest assertCreation(_TB_R12); assertCreation(_TB_R13); assertCreation(_TB_R14); - assertCreation(_TB_R15); + assertCreation(_TB_R15); } - + public void testOTTypeHiearchyCreation() throws JavaModelException { _focusType = _TB_R1; _testObj = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), true); _testObj.refresh(new NullProgressMonitor()); - + assertTrue(true); } } - + diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTTypeHierarchyBuilderTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTTypeHierarchyBuilderTest.java index 6d6ebba80..ac7f9d5dd 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTTypeHierarchyBuilderTest.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTTypeHierarchyBuilderTest.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -35,13 +35,13 @@ import org.eclipse.objectteams.otdt.core.TypeHelper; import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest; /** - * + * * @author Michael Krueger (mkr) - * + * */ -public class OTTypeHierarchyBuilderTest extends FileBasedModelTest +public class OTTypeHierarchyBuilderTest extends FileBasedModelTest { - + @SuppressWarnings("unused") private ITypeHierarchy _testObj; private IType _focusType; @@ -49,7 +49,7 @@ public class OTTypeHierarchyBuilderTest extends FileBasedModelTest private IType _objectType; private IType _T20; private IType _T21; - + private IType _T20T10T00R0; private IType _T20T10T00R1; private IType _T21T10T00R1; @@ -57,45 +57,45 @@ public class OTTypeHierarchyBuilderTest extends FileBasedModelTest private IType _T21T11T00R0; private IType _T21T11T00R1; private IType _T21T11T00R2; - - + + public OTTypeHierarchyBuilderTest(String name) { super(name); } - + public static Test suite() { if (true) return new Suite(OTTypeHierarchyBuilderTest.class); @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTTypeHierarchyBuilderTest.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test004"; - - _T20 = + + _T20 = getType(getTestProjectDir(), srcFolder, pkg, "T20"); - _T21 = + _T21 = getType(getTestProjectDir(), srcFolder, pkg, "T21"); - - - _objectType = + + + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", @@ -106,29 +106,29 @@ public class OTTypeHierarchyBuilderTest extends FileBasedModelTest _T21T10T00R1 = TypeHelper.findNestedRoleType(_T21, "T21.T10.T00.R1"); _T21T10T00R2 = TypeHelper.findNestedRoleType(_T21, "T21.T10.T00.R2"); - + _T21T11T00R0 = TypeHelper.findNestedRoleType(_T21, "T21.T11.T00.R0"); _T21T11T00R1 = TypeHelper.findNestedRoleType(_T21, "T21.T11.T00.R1"); _T21T11T00R2 = TypeHelper.findNestedRoleType(_T21, "T21.T11.T00.R2"); } - + public void testCreation() { assertCreation(_T20); assertCreation(_T21); - + assertCreation(_T20T10T00R0); assertCreation(_T20T10T00R1); assertCreation(_T21T10T00R1); assertCreation(_T21T10T00R2); - + assertCreation(_T21T11T00R0); assertCreation(_T21T11T00R1); assertCreation(_T21T11T00R2); } - + public void testGetResult_T20T10T00R0() throws CoreException { _focusType = _T20T10T00R0; @@ -136,10 +136,10 @@ public class OTTypeHierarchyBuilderTest extends FileBasedModelTest 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)); } @@ -148,12 +148,12 @@ public class OTTypeHierarchyBuilderTest extends FileBasedModelTest _focusType = _T20T10T00R1; 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)); } @@ -162,12 +162,12 @@ public class OTTypeHierarchyBuilderTest extends FileBasedModelTest _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); IType[] actual = hierarchy.getAllSubtypes(_focusType); assertNotNull(actual); - + // no real assert not throwing NPE is all we need to check } - + } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/AllTests.java index bfb1910b3..53e429851 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/AllTests.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/AllTests.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/HierarchyResolverTestWithSrc003.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/HierarchyResolverTestWithSrc003.java index 4e7f0933b..1e71664f8 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/HierarchyResolverTestWithSrc003.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/HierarchyResolverTestWithSrc003.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -38,17 +38,17 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest; */ @SuppressWarnings("unused") public class HierarchyResolverTestWithSrc003 extends FileBasedModelTest { - + private ITypeHierarchy _testObj; private NullProgressMonitor _monitor; - + private IType _focusType; - + private IRoleType _T1_R1; private IRoleType _T1_R2; - + private IRoleType _T2_R2; - + private IRoleType _T3_R1; private IRoleType _T3_R2; @@ -57,120 +57,120 @@ public class HierarchyResolverTestWithSrc003 extends FileBasedModelTest { private IRoleType _T4_R3; private IType _interfaceA; - + private IType _objectType; - + public HierarchyResolverTestWithSrc003(String name) { super(name); } - + public static Test suite() { if (true) { return new Suite(HierarchyResolverTestWithSrc003.class); } - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(HierarchyResolverTestWithSrc003.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + _monitor = new NullProgressMonitor(); - + String srcFolder = "src"; String pkg = "test003"; - - _T1_R1 = + + _T1_R1 = getRole(getTestProjectDir(), srcFolder, pkg, "T1", "R1"); - - _T1_R2 = + + _T1_R2 = getRole(getTestProjectDir(), srcFolder, pkg, "T1", "R2"); - - _T2_R2 = + + _T2_R2 = getRole(getTestProjectDir(), srcFolder, pkg, "T2", "R2"); - - - _T3_R1 = + + + _T3_R1 = getRole(getTestProjectDir(), srcFolder, pkg, "T3", "R1"); - - _T3_R2 = + + _T3_R2 = getRole(getTestProjectDir(), srcFolder, pkg, "T3", "R2"); - - - _T4_R1 = + + + _T4_R1 = getRole(getTestProjectDir(), srcFolder, pkg, "T4", "R1"); - - _T4_R2 = + + _T4_R2 = getRole(getTestProjectDir(), srcFolder, pkg, "T4", "R2"); - - _T4_R3 = + + _T4_R3 = getRole(getTestProjectDir(), srcFolder, pkg, "T4", "R3"); - _interfaceA = + _interfaceA = getType(getTestProjectDir(), srcFolder, pkg, "InterfaceA"); - - _objectType = + + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object"); } - - - public void testGetSuperInterfacesFor_T2R2() + + + public void testGetSuperInterfacesFor_T2R2() throws JavaModelException { _focusType = (IType)_T2_R2.getCorrespondingJavaElement(); - - + + ITypeHierarchy hierarchy = _focusType.newTypeHierarchy(_monitor); IType[] expected = new IType[] { _interfaceA }; - + IType [] actual = ((TypeHierarchy)hierarchy).getSuperInterfaces(_focusType); assertEquals(expected.length, actual.length); - + assertTrue("Wrong Types", compareTypes(expected, actual)); } } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest001.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest001.java index 0bd6a8125..6bbbf4a75 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest001.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest001.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -44,42 +44,42 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest private IType _T6; private IType _T7; private IType _T8; - + private IType _T1_R1; - private IType _T1_R2; + private IType _T1_R2; private IType _T2_R1; private IType _T2_R2; - + private IType _T3_R1; private IType _T3_R2; - + private IType _phantom_T4_R1; private IType _T4_R2; - + private IType _T5_R1; private IType _T5_R2; private IType _T5_R3; - + private IType _T6_R1; private IType _phantom_T6_R2; - + private IType _phantom_T7_R1; private IType _T7_R2; - private IType _T7_R3; - + private IType _T7_R3; + private IType _phantom_T8_R1; private IType _T8_R2; - + private IType _objectType; - - + + public OTSuperTypeHierarchyTest001(String name) { super(name); } - - + + public static Test suite() { if (true) @@ -87,20 +87,20 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest return new Suite(OTSuperTypeHierarchyTest001.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSuperTypeHierarchyTest001.class.getName()); return suite; } - - + + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test001"; - + _T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1"); _T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2"); _T3 = getType(getTestProjectDir(), srcFolder, pkg, "T3"); @@ -128,18 +128,18 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest _T6_R1 = getRole(_T6, "T6.R1"); _phantom_T6_R2 = new PhantomType(_T6, _T2_R2); - + _phantom_T7_R1 = new PhantomType(_T7, _T5_R1); _T7_R2 = getRole(_T7, "T7.R2"); _T7_R3 = getRole(_T7, "T7.R3"); _phantom_T8_R1 = new PhantomType(_T8, _T6_R1); _T8_R2 = getRole(_T8, "T8.R2"); - + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object"); } - - + + public void testCreation() { assertCreation(_T1); @@ -169,7 +169,7 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest assertCreation(_T6_R1); assertCreation(_phantom_T6_R2); - + assertCreation(_phantom_T7_R1); assertCreation(_T7_R2); assertCreation(_T7_R3); @@ -182,34 +182,34 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest { _focusType = _T8_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType expected = _T6_R1; IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _focusType); assertTrue(compareTypes(expected, actual)); } - + public void testGetExplicitSuperclass_T8R2_phantomMode() throws JavaModelException { _focusType = _T8_R2; _testObj = createSuperTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - + IType expected = _phantom_T8_R1; IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _focusType); assertTrue(compareTypes(expected, actual)); } - + public void testGetTSuperTypes_T8R2() throws JavaModelException { _focusType = _T8_R2; _testObj = createSuperTypeHierarchy(_focusType); - - IType[] expected = new IType[] { _T2_R2 }; + + IType[] expected = new IType[] { _T2_R2 }; IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(_testObj, _focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -218,26 +218,26 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest _focusType = _T8_R2; _testObj = createSuperTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - - IType[] expected = new IType[] { _phantom_T6_R2 }; + + IType[] expected = new IType[] { _phantom_T6_R2 }; IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(_testObj, _focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllTSuperTypes_T8R2() throws JavaModelException { _focusType = _T8_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _T2_R2, _T1_R2 }; - + IType[] actual = OTTypeHierarchies.getInstance().getAllTSuperTypes(_testObj, _focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -246,30 +246,30 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest _focusType = _T8_R2; _testObj = createSuperTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - + IType[] expected = new IType[] { _phantom_T6_R2, _T2_R2, _T1_R2 }; - + IType[] actual = OTTypeHierarchies.getInstance().getAllTSuperTypes(_testObj, _focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetSuperclasses_T8R2() throws JavaModelException { _focusType = _T8_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _T6_R1, _T2_R2, }; - + IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -278,23 +278,23 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest _focusType = _T8_R2; _testObj = createSuperTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - + IType[] expected = new IType[] { _phantom_T8_R1, _phantom_T6_R2 }; - + IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - - + + public void testGetAllSuperclasses_T8R2() throws JavaModelException { _focusType = _T8_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _T6_R1, _T2_R2, @@ -302,10 +302,10 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest _T1_R2, _T1_R1 }; - + IType[] actual = _testObj.getAllSuperclasses(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -324,7 +324,7 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest _T1_R2, _T1_R1 }; - + IType[] actual = _testObj.getAllSuperclasses(_focusType); assertEquals(expected.length, actual.length); @@ -336,48 +336,48 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest { _focusType = _T6_R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _T2_R1, }; - + IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetSuperclasses_T6R1_phantomMode() throws JavaModelException { _focusType = _T6_R1; _testObj = createSuperTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - + IType[] expected = new IType[] { _objectType, _T2_R1, }; - + IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T6R1() throws JavaModelException { _focusType = _T6_R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _T2_R1, _T1_R1 }; - + IType[] actual = _testObj.getAllSuperclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -386,92 +386,92 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest { _focusType = _T2_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _T2_R1, _T1_R2 }; - + IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T2R2() throws JavaModelException { _focusType = _T2_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _T2_R1, _T1_R1, _T1_R2 }; - + IType[] actual = _testObj.getAllSuperclasses(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - - + + public void testGetAllSuperclasses_T2R1() throws JavaModelException { _focusType = _T2_R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _T1_R1 }; - + IType[] actual = _testObj.getAllSuperclasses(_focusType); assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - - + + public void testGetAllSuperclasses_T1R1() throws JavaModelException { _focusType = _T1_R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType }; - + IType[] actual = _testObj.getAllSuperclasses(_focusType); assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - - + + public void testGetAllSuperclasses_T1R2() throws JavaModelException { _focusType = _T1_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType }; - + IType[] actual = _testObj.getAllSuperclasses(_focusType); assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetSuperclasses_T7R3() throws JavaModelException { _focusType = _T7_R3; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _T5_R1, _T5_R3 }; - + IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -481,43 +481,43 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest _focusType = _T7_R3; _testObj = createSuperTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - + IType[] expected = new IType[] { _phantom_T7_R1, _T5_R3 }; - + IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T7R3() throws JavaModelException { _focusType = _T7_R3; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _T5_R1, _T2_R1, _T1_R1, _T5_R3 }; - + IType[] actual = _testObj.getAllSuperclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T7R3_phantomMode() throws JavaModelException { _focusType = _T7_R3; _testObj = createSuperTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - + IType[] expected = new IType[] { _objectType, _phantom_T7_R1, _T5_R1, @@ -525,19 +525,19 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest _T1_R1, _T5_R3 }; - + IType[] actual = _testObj.getAllSuperclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T7R2() throws JavaModelException { _focusType = _T7_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _T7_R3, _T5_R1, @@ -548,20 +548,20 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest _T1_R2, _T1_R1 }; - + IType[] actual = _testObj.getAllSuperclasses(_T7_R2); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - - + + public void testGetAllSuperclasses_T7R2_phantomMode() throws JavaModelException { _focusType = _T7_R2; _testObj = createSuperTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - + IType[] expected = new IType[] { _objectType, _T7_R3, _phantom_T7_R1, @@ -573,54 +573,54 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest _T1_R2, _T1_R1 }; - + IType[] actual = _testObj.getAllSuperclasses(_T7_R2); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T7R3inT7R2() throws JavaModelException { _focusType = _T7_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _T5_R1, _T5_R3, _T2_R1, _T1_R1 }; - + IType[] actual = _testObj.getAllSuperclasses(_T7_R3); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T2R1inT7R2() throws JavaModelException { _focusType = _T7_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _T1_R1 }; - + IType[] actual = _testObj.getAllSuperclasses(_T2_R1); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T5R2() throws JavaModelException { _focusType = _T5_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _T5_R3, _T5_R1, @@ -629,108 +629,108 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest _T1_R1, _T1_R2 }; - + IType[] actual = _testObj.getAllSuperclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - - + + public void testGetAllSuperclasses_T5R3() throws JavaModelException { _focusType = _T5_R3; _testObj = createSuperTypeHierarchy(_focusType); - - + + IType[] expected = new IType[] { _objectType, _T5_R1, _T2_R1, _T1_R1 }; - + IType[] actual = _testObj.getAllSuperclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - - + + public void testGetAllSuperclasses_T5R1() throws JavaModelException { _focusType = _T5_R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _T2_R1, _T1_R1 }; - + IType[] actual = _testObj.getAllSuperclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetSuperclasses_T4R2() throws JavaModelException { _focusType = _T4_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _T2_R2, _T2_R1 }; - + IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetSuperclasses_T4R2_phantomMode() throws JavaModelException { _focusType = _T4_R2; _testObj = createSuperTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - + IType[] expected = new IType[] { _T2_R2, _phantom_T4_R1 }; - + IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T4R2() throws JavaModelException { _focusType = _T4_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _T2_R2, _T2_R1, _T1_R1, _T1_R2 }; - + IType[] actual = _testObj.getAllSuperclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T4R2_phantomMode() throws JavaModelException { _focusType = _T4_R2; _testObj = createSuperTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - + IType[] expected = new IType[] { _objectType, _phantom_T4_R1, _T2_R2, @@ -738,20 +738,20 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest _T1_R1, _T1_R2 }; - + IType[] actual = _testObj.getAllSuperclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - - + + public void testGetAllSuperclasses_T3R2() throws JavaModelException { _focusType = _T3_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _T3_R1, _T2_R2, @@ -759,46 +759,46 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest _T1_R1, _T1_R2 }; - + IType[] actual = _testObj.getAllSuperclasses(_focusType); assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T3R1() throws JavaModelException { _focusType = _T3_R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _T2_R1, _T1_R1, }; - + IType[] actual = _testObj.getAllSuperclasses(_focusType); assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - - + + public void testGetAllTSuperTypes_T5R1inT7R2() throws JavaModelException { _focusType = _T7_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _T2_R1, _T1_R1, }; - + IType[] actual = OTTypeHierarchies.getInstance().getAllTSuperTypes(_testObj, _T5_R1); assertEquals(expected.length, actual.length); - + assertTrue(compareTypes(expected, actual)); } - - + + public void testToString_forNoException() throws JavaModelException { _focusType = _T5_R1; @@ -806,26 +806,26 @@ public class OTSuperTypeHierarchyTest001 extends FileBasedHierarchyTest try { - _testObj.toString(); + _testObj.toString(); } catch (Exception ex) { assertTrue(ex.getClass().toString() + " in OTTypeHierarchy.toString()", false); } - + assertTrue(true); } - + public void testLinearizationR2() throws JavaModelException { _focusType = _T7_R2; _testObj = createSuperTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); IType superType = _testObj.getSuperclass(_focusType); - IType[] expected = new IType[] {_T5_R2, _T2_R2, _T1_R2, _T7_R3, _T5_R3, _phantom_T7_R1, _T5_R1, _T2_R1, _T1_R1}; + IType[] expected = new IType[] {_T5_R2, _T2_R2, _T1_R2, _T7_R3, _T5_R3, _phantom_T7_R1, _T5_R1, _T2_R1, _T1_R1}; for (int i=0; i<expected.length; i++) { assertTrue(compareTypes(expected[i], superType)); superType = _testObj.getSuperclass(superType); } } - + } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest002.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest002.java index 11bd81994..8e63decab 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest002.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest002.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -34,7 +34,7 @@ import org.eclipse.objectteams.otdt.tests.hierarchy.FileBasedHierarchyTest; */ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest { - + private IType _T1; private IType _T2; private IType _T3; @@ -43,12 +43,12 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest private IType _T3_R1; private IType _classA; private IType _objectType; - + public OTSuperTypeHierarchyTest002(String name) { super(name); } - + public static Test suite() { if (true) @@ -56,23 +56,23 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest return new Suite(OTSuperTypeHierarchyTest002.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSuperTypeHierarchyTest002.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test002"; - + _T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1"); _T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2"); _T3 = getType(getTestProjectDir(), srcFolder, pkg, "T3"); - + _T1_R1 = getRole(_T1, "T1.R1"); _T2_R1 = getRole(_T2, "T2.R1"); _T3_R1 = getRole(_T3, "T3.R1"); @@ -81,7 +81,7 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object"); } - + public void testCreation() { assertCreation(_T1); @@ -92,20 +92,20 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest assertCreation(_T3_R1); assertCreation(_classA); } - + public void testGetAllSuperclasses_T3R1() throws JavaModelException { _focusType = _T3_R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _T2_R1, _T1_R1, _classA }; - + IType [] actual = _testObj.getAllSuperclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -117,26 +117,26 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest IType[] expected = new IType[] { _objectType, _T1_R1, _classA }; - + IType [] actual = _testObj.getAllSuperclasses(_focusType); assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllClasses_T2R1() throws JavaModelException { _focusType = _T2_R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _T1_R1, _T2_R1, _classA }; - + IType [] actual = _testObj.getAllClasses(); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -144,13 +144,13 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest { _focusType = _T2_R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _T1_R1, _classA }; - + IType [] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -158,9 +158,9 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest { _focusType = _T2_R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType expected = _classA; - + IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _focusType); assertTrue(compareTypes(expected, actual)); @@ -170,9 +170,9 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest { _focusType = _T3_R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType expected = _classA; - + IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _focusType); assertTrue(compareTypes(expected, actual)); @@ -182,11 +182,11 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest { _focusType = _T1_R1; _testObj = createSuperTypeHierarchy(_focusType); - - IType[] expected = new IType[] { _objectType }; + + IType[] expected = new IType[] { _objectType }; IType [] actual = _testObj.getAllSuperclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -194,13 +194,13 @@ public class OTSuperTypeHierarchyTest002 extends FileBasedHierarchyTest { _focusType = _T3_R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _T2_R1, _T1_R1 }; IType [] actual = OTTypeHierarchies.getInstance().getAllTSuperTypes(_testObj, _focusType); assertEquals(expected.length, actual.length); - + assertTrue(compareTypes(expected, actual)); } - + } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest003.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest003.java index 0ef3bdb1d..e0a33b6c5 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest003.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest003.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -52,12 +52,12 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest private IType _interfaceA; private IType _objectType; - + public OTSuperTypeHierarchyTest003(String name) { super(name); } - + public static Test suite() { if (true) @@ -65,16 +65,16 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest return new Suite(OTSuperTypeHierarchyTest003.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSuperTypeHierarchyTest003.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test003"; @@ -82,7 +82,7 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest _T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2"); _T3 = getType(getTestProjectDir(), srcFolder, pkg, "T3"); _T4 = getType(getTestProjectDir(), srcFolder, pkg, "T4"); - + _T1_R1 = getRole(_T1, "T1.R1"); _T1_R2 = getRole(_T1, "T1.R2"); @@ -98,11 +98,11 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest _interfaceA = getType(getTestProjectDir(), srcFolder, pkg, "InterfaceA"); - + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object"); } - + public void testCreation() { assertCreation(_T1); @@ -129,10 +129,10 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest _focusType = _T4_R1; _testObj = createSuperTypeHierarchy(_focusType); - IType[] expected = new IType[] { _T1_R1 }; + IType[] expected = new IType[] { _T1_R1 }; IType [] actual = OTTypeHierarchies.getInstance().getSuperInterfaces(_testObj, _focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue("Wrong Types", compareTypes(expected, actual)); } @@ -141,11 +141,11 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest _focusType = _T4_R1; _testObj = createSuperTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - - IType[] expected = new IType[] { _phantom_T2_R1 }; + + IType[] expected = new IType[] { _phantom_T2_R1 }; IType [] actual = OTTypeHierarchies.getInstance().getSuperInterfaces(_testObj, _focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue("Wrong Types", compareTypes(expected, actual)); } @@ -154,10 +154,10 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest _focusType = _T4_R2; _testObj = createSuperTypeHierarchy(_focusType); - IType[] expected = new IType[] { _T2_R2, _interfaceA }; + IType[] expected = new IType[] { _T2_R2, _interfaceA }; IType [] actual = OTTypeHierarchies.getInstance().getSuperInterfaces(_testObj, _focusType); // expl.&impl. - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue("Wrong Types", compareTypes(expected, actual)); } @@ -166,37 +166,37 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest _focusType = _T4_R3; _testObj = createSuperTypeHierarchy(_focusType); - IType[] expected = new IType[] { _T4_R2 }; + IType[] expected = new IType[] { _T4_R2 }; IType [] actual = OTTypeHierarchies.getInstance().getSuperInterfaces(_testObj, _focusType); // expl.&impl. - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue("Wrong Types", compareTypes(expected, actual)); } - + public void testGetSuperInterfaces_T2R2() throws JavaModelException { _focusType = _T2_R2; _testObj = createSuperTypeHierarchy(_focusType); - IType[] expected = new IType[] { _T1_R2, _interfaceA }; + IType[] expected = new IType[] { _T1_R2, _interfaceA }; IType [] actual = OTTypeHierarchies.getInstance().getSuperInterfaces(_testObj, _focusType); // expl.&impl. - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue("Wrong Types", compareTypes(expected, actual)); } - + public void testGetAllSuperInterfaces_T4R1() throws JavaModelException { _focusType = _T4_R1; _testObj = createSuperTypeHierarchy(_focusType); - IType[] expected = new IType[] { _T1_R1 }; + IType[] expected = new IType[] { _T1_R1 }; IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); // expl.&impl. - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue("Wrong Types", compareTypes(expected, actual)); } - + public void testGetAllSuperInterfaces_T4R2() throws JavaModelException { _focusType = _T4_R2; @@ -204,25 +204,25 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest IType[] expected = new IType[] { _interfaceA, _T1_R2, - _T2_R2 }; + _T2_R2 }; IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); // expl.&impl. - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue("Wrong Types", compareTypes(expected, actual)); } - + public void testGetAllSuperInterfaces_T3R1() throws JavaModelException { _focusType = _T3_R1; _testObj = createSuperTypeHierarchy(_focusType); - IType[] expected = new IType[] { _T1_R1 }; + IType[] expected = new IType[] { _T1_R1 }; IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); // expl.&impl. - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue("Wrong Types", compareTypes(expected, actual)); } - + public void testGetAllSuperInterfaces_T3R2() throws JavaModelException { _focusType = _T3_R2; @@ -230,23 +230,23 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest IType[] expected = new IType[] { _interfaceA, _T1_R2, - _T2_R2 }; + _T2_R2 }; IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); // expl.&impl. - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue("Wrong Types", compareTypes(expected, actual)); } - + public void testGetAllSuperInterfaces_T2R2() throws JavaModelException { _focusType = _T2_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _T1_R2, - _interfaceA }; + _interfaceA }; IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); // expl.&impl. - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue("Wrong Types", compareTypes(expected, actual)); } @@ -257,23 +257,23 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest IType[] expected = new IType[] {}; IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); // expl.&impl. - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue("Wrong Types", compareTypes(expected, actual)); } - + public void testGetAllSuperInterfaces_T1R1() throws JavaModelException { _focusType = _T1_R1; _testObj = createSuperTypeHierarchy(_focusType); - IType[] expected = new IType[] {}; + IType[] expected = new IType[] {}; IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); // expl.&impl. - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue("Wrong Types", compareTypes(expected, actual)); } - + public void testGetAllSuperInterfaces_interfaceA() throws JavaModelException { _focusType = _interfaceA; @@ -281,11 +281,11 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest IType[] expected = new IType[] {}; IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); // expl.&impl. - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue("Wrong Types", compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T4R1() throws JavaModelException { _focusType = _T4_R1; @@ -293,68 +293,68 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest IType[] expected = new IType[] {}; IType [] actual = _testObj.getAllSuperclasses(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T4R2() throws JavaModelException { _focusType = _T4_R2; _testObj = createSuperTypeHierarchy(_focusType); - IType[] expected = new IType[] {}; + IType[] expected = new IType[] {}; IType [] actual = _testObj.getAllSuperclasses(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T3R1() throws JavaModelException { _focusType = _T3_R1; _testObj = createSuperTypeHierarchy(_focusType); - IType[] expected = new IType[] {}; + IType[] expected = new IType[] {}; IType [] actual = _testObj.getAllSuperclasses(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T3R2() throws JavaModelException { _focusType = _T3_R2; _testObj = createSuperTypeHierarchy(_focusType); - IType[] expected = new IType[] {}; + IType[] expected = new IType[] {}; IType [] actual = _testObj.getAllSuperclasses(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T2R2() throws JavaModelException { _focusType = _T2_R2; _testObj = createSuperTypeHierarchy(_focusType); - IType[] expected = new IType[] {}; + IType[] expected = new IType[] {}; IType [] actual = _testObj.getAllSuperclasses(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T1R1() throws JavaModelException { _focusType = _T1_R1; _testObj = createSuperTypeHierarchy(_focusType); - IType[] expected = new IType[] {}; + IType[] expected = new IType[] {}; IType [] actual = _testObj.getAllSuperclasses(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -363,25 +363,25 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest _focusType = _T1_R2; _testObj = createSuperTypeHierarchy(_focusType); - IType[] expected = new IType[] {}; + IType[] expected = new IType[] {}; IType [] actual = _testObj.getAllSuperclasses(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_interfaceA() throws JavaModelException { _focusType = _interfaceA; _testObj = createSuperTypeHierarchy(_focusType); - IType[] expected = new IType[] {}; + IType[] expected = new IType[] {}; IType [] actual = _testObj.getAllSuperclasses(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperInterfaces_T4R3() throws JavaModelException { _focusType = _T4_R3; @@ -390,23 +390,23 @@ public class OTSuperTypeHierarchyTest003 extends FileBasedHierarchyTest IType[] expected = new IType[] { _T4_R2, _T2_R2, _T1_R2, - _interfaceA }; + _interfaceA }; IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); // expl.&impl. - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue("Wrong Types", compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T4R3() throws JavaModelException { _focusType = _T4_R3; _testObj = createSuperTypeHierarchy(_focusType); - IType[] expected = new IType[] { _objectType }; + IType[] expected = new IType[] { _objectType }; IType [] actual = _testObj.getAllSuperclasses(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue("Wrong Types", compareTypes(expected, actual)); } - + } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest004.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest004.java index be8870be4..152c12b18 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest004.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest004.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -31,18 +31,18 @@ import org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy; import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest; /** - * + * * @author michael - * @version $Id: OTSuperTypeHierarchyTest004.java 23494 2010-02-05 23:06:44Z stephan $ - * + * @version $Id: OTSuperTypeHierarchyTest004.java 23494 2010-02-05 23:06:44Z stephan $ + * */ public class OTSuperTypeHierarchyTest004 extends FileBasedModelTest { - + @SuppressWarnings("unused") private ITypeHierarchy _testObj; private IType _focusType; private IType _T20; - private IType _T21; + private IType _T21; private IType _objectType; private IType _T20T10T00R0; private IType _T20T10T00R1; @@ -51,14 +51,14 @@ public class OTSuperTypeHierarchyTest004 extends FileBasedModelTest { private IType _T21T11T00R0; private IType _T21T11T00R1; private IType _T21T11T00R2; - - - + + + public OTSuperTypeHierarchyTest004(String name) { super(name); } - + public static Test suite() { if (true) @@ -66,33 +66,33 @@ public class OTSuperTypeHierarchyTest004 extends FileBasedModelTest { return new Suite(OTSuperTypeHierarchyTest004.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSuperTypeHierarchyTest004.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test004"; - - _T20 = + + _T20 = getType(getTestProjectDir(), srcFolder, pkg, "T20"); - _T21 = + _T21 = getType(getTestProjectDir(), srcFolder, pkg, "T21"); - - - _objectType = + + + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", @@ -106,7 +106,7 @@ public class OTSuperTypeHierarchyTest004 extends FileBasedModelTest { _T21T11T00R1 = getRole(_T21, "T21.T11.T00.R1"); _T21T11T00R2 = getRole(_T21, "T21.T11.T00.R2"); } - + public void testCreation() { assertCreation(_T20); @@ -123,7 +123,7 @@ public class OTSuperTypeHierarchyTest004 extends FileBasedModelTest { public void testGetAllSuperclasses_T21T11T00R2() throws JavaModelException { _focusType = _T21T11T00R2; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); hierarchy.refresh(new NullProgressMonitor()); @@ -137,9 +137,9 @@ public class OTSuperTypeHierarchyTest004 extends FileBasedModelTest { _T21T11T00R0, _T21T11T00R1, }; - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest006.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest006.java index de3478601..5d10572e0 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest006.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest006.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -38,24 +38,24 @@ public class OTSuperTypeHierarchyTest006 extends FileBasedHierarchyTest private IType _T1; private IType _T2; private IType _T3; - + private IType _T1_R1; private IType _T1_R2; - + private IType _T2_R1; private IType _phantom_T2_R2; private IType _phantom_T3_R1; private IType _T3_R2; - - private IType _classA; + + private IType _classA; private IType _objectType; - + public OTSuperTypeHierarchyTest006(String name) { super(name); } - + public static Test suite() { if (true) @@ -63,38 +63,38 @@ public class OTSuperTypeHierarchyTest006 extends FileBasedHierarchyTest return new Suite(OTSuperTypeHierarchyTest006.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSuperTypeHierarchyTest006.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test006"; _T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1"); _T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2"); _T3 = getType(getTestProjectDir(), srcFolder, pkg, "T3"); - + _T1_R1 = getRole(_T1, "T1.R1"); _T1_R2 = getRole(_T1, "T1.R2"); - + _T2_R1 = getRole(_T2, "T2.R1"); _phantom_T2_R2 = new PhantomType(_T2, _T1_R2); - + _phantom_T3_R1 = new PhantomType(_T3, _T2_R1); _T3_R2 = getRole(_T3, "T3.R2"); - + _classA = - getType(getTestProjectDir(), srcFolder, pkg, "ClassA"); - + getType(getTestProjectDir(), srcFolder, pkg, "ClassA"); + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object"); } - + public void testCreation() { assertCreation(_T1); @@ -110,46 +110,46 @@ public class OTSuperTypeHierarchyTest006 extends FileBasedHierarchyTest assertCreation(_phantom_T3_R1); assertCreation(_T3_R2); } - + public void testGetAllSuperclasses_T1R1() throws JavaModelException { _focusType = _T1_R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _classA }; - + IType [] actual = _testObj.getAllSuperclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T2R2() throws JavaModelException { _focusType = _T1_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType }; - + IType [] actual = _testObj.getAllSuperclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T2R1() throws JavaModelException { _focusType = _T2_R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _T1_R1, _classA }; - + IType [] actual = _testObj.getAllSuperclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -157,25 +157,25 @@ public class OTSuperTypeHierarchyTest006 extends FileBasedHierarchyTest { _focusType = _T3_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _T2_R1, _T1_R1, _T1_R2, _classA }; - + IType [] actual = _testObj.getAllSuperclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T3R2_phantomMode() throws JavaModelException { _focusType = _T3_R2; _testObj = createSuperTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - + IType[] expected = new IType[] { _objectType, _T2_R1, _T1_R1, @@ -183,19 +183,19 @@ public class OTSuperTypeHierarchyTest006 extends FileBasedHierarchyTest _phantom_T2_R2, _phantom_T3_R1, _classA }; - + IType [] actual = _testObj.getAllSuperclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetExplicitSuperclass_T3R2() throws JavaModelException { _focusType = _T3_R2; _testObj = createSuperTypeHierarchy(_focusType); - - IType expected = _T2_R1; + + IType expected = _T2_R1; IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _focusType); assertTrue(compareTypes(expected, actual)); @@ -206,24 +206,24 @@ public class OTSuperTypeHierarchyTest006 extends FileBasedHierarchyTest _focusType = _T3_R2; _testObj = createSuperTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - + IType expected = _phantom_T3_R1; IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _focusType); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllTSuperTypes_T3R2() throws JavaModelException { _focusType = _T3_R2; _testObj = createSuperTypeHierarchy(_focusType); IType[] expected = new IType[] { _T1_R2 }; - + IType [] actual = OTTypeHierarchies.getInstance().getAllTSuperTypes(_testObj, _focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -231,12 +231,12 @@ public class OTSuperTypeHierarchyTest006 extends FileBasedHierarchyTest { _focusType = _T2_R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _T1_R1 }; IType [] actual = OTTypeHierarchies.getInstance().getAllTSuperTypes(_testObj, _focusType); assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest007.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest007.java index 01be3efc1..ab068ef31 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest007.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest007.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -36,27 +36,27 @@ public class OTSuperTypeHierarchyTest007 extends FileBasedHierarchyTest { private IType _T1; private IType _T2; - + private IType _T1_R1; private IType _T1_R2; - + private IType _T2_R1; private IType _T2_R2; - + private IType _classA; private IType _classB; - + private IType _interfaceA; private IType _interfaceB; private IType _interfaceC; - + private IType _objectType; - + public OTSuperTypeHierarchyTest007(String name) { super(name); } - + public static Test suite() { if (true) @@ -64,28 +64,28 @@ public class OTSuperTypeHierarchyTest007 extends FileBasedHierarchyTest return new Suite(OTSuperTypeHierarchyTest007.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSuperTypeHierarchyTest007.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test007"; - + _T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1"); _T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2"); - + _T1_R1 = getRole(_T1, "T1.R1"); _T1_R2 = getRole(_T1, "T1.R2"); - + _T2_R1 = getRole(_T2, "T2.R1"); _T2_R2 = getRole(_T2, "T2.R2"); - + _classA = getType(getTestProjectDir(), srcFolder, pkg, "ClassA"); _classB = @@ -99,8 +99,8 @@ public class OTSuperTypeHierarchyTest007 extends FileBasedHierarchyTest _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object"); } - - + + public void testCreation() { assertCreation(_T1); @@ -112,7 +112,7 @@ public class OTSuperTypeHierarchyTest007 extends FileBasedHierarchyTest assertCreation(_T2_R1); assertCreation(_T2_R2); } - + public void testGetAllSuperclassesFor_T2R1() throws JavaModelException { _focusType = _T2_R1; @@ -123,8 +123,8 @@ public class OTSuperTypeHierarchyTest007 extends FileBasedHierarchyTest _classA, _T1_R1 }; IType [] actual = _testObj.getAllSuperclasses(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -132,63 +132,63 @@ public class OTSuperTypeHierarchyTest007 extends FileBasedHierarchyTest { _focusType = _T2_R2; _testObj = createSuperTypeHierarchy(_focusType); - - IType[] expected = new IType[] { _objectType, _T1_R2 }; + + IType[] expected = new IType[] { _objectType, _T1_R2 }; IType [] actual = _testObj.getAllSuperclasses(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - - + + public void testGetAllSuperInterfacesFor_T2R2() throws JavaModelException { _focusType = _T2_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _interfaceA, _interfaceB, - _interfaceC }; + _interfaceC }; IType [] actual = _testObj.getAllSuperInterfaces(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetSuperInterfaces_T1R2() throws JavaModelException { _focusType = _T1_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _interfaceA }; IType [] actual = _testObj.getSuperInterfaces(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclassesFor_interfaceB() throws JavaModelException { _focusType = _interfaceB; _testObj = createSuperTypeHierarchy(_focusType); - - IType[] expected = new IType[0]; + + IType[] expected = new IType[0]; IType [] actual = _testObj.getAllSuperclasses(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperInterfacesFor_interfaceB() throws JavaModelException { _focusType = _interfaceB; - _testObj = createSuperTypeHierarchy(_focusType); + _testObj = createSuperTypeHierarchy(_focusType); - IType[] expected = new IType[] { _interfaceA }; + IType[] expected = new IType[] { _interfaceA }; IType [] actual = _testObj.getAllSuperInterfaces(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -196,50 +196,50 @@ public class OTSuperTypeHierarchyTest007 extends FileBasedHierarchyTest { _focusType = _classA; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[0]; IType [] actual = _testObj.getAllSuperInterfaces(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetSuperInterfaces_interfaceB_In_T2R2() throws JavaModelException { _focusType = _T2_R2; _testObj = createSuperTypeHierarchy(_focusType); - - IType[] expected = new IType[] { _interfaceA }; + + IType[] expected = new IType[] { _interfaceA }; IType [] actual = _testObj.getSuperInterfaces(_interfaceB); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclassesFor_classB() throws JavaModelException { _focusType = _classB; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, - _classA }; + _classA }; IType [] actual = _testObj.getAllSuperclasses(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetExplicitSuperclassFor_classB() throws JavaModelException { _focusType = _classB; - _testObj = createSuperTypeHierarchy(_focusType); + _testObj = createSuperTypeHierarchy(_focusType); - IType expected = _classA; + IType expected = _classA; IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _focusType); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllInterfaces_T2R2() throws JavaModelException { _focusType = _T2_R2; @@ -250,24 +250,24 @@ public class OTSuperTypeHierarchyTest007 extends FileBasedHierarchyTest _interfaceB, _interfaceC }; IType [] actual = _testObj.getAllInterfaces(); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } public void testGetImplementingClasses_interfaceA_in_T2R2() throws JavaModelException { _focusType = _T2_R2; - _testObj = createSuperTypeHierarchy(_focusType); + _testObj = createSuperTypeHierarchy(_focusType); IType[] expected = new IType[] { _T1_R2, // _T2_R2 // not a direct implementor - }; + }; IType [] actual = _testObj.getImplementingClasses(_interfaceA); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest007_Stress.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest007_Stress.java index cfc89fbbd..7d4e14b18 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest007_Stress.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest007_Stress.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -37,55 +37,55 @@ public class OTSuperTypeHierarchyTest007_Stress extends FileBasedHierarchyTest { private IType _T1; private IType _T2; - + private IType _T1_R1; private IType _T1_R2; - + private IType _T2_R1; private IType _T2_R2; - + private IType _classA; private IType _classB; - + private IType _interfaceA; private IType _interfaceB; private IType _interfaceC; - + private IType _objectType; - + public OTSuperTypeHierarchyTest007_Stress(String name) { super(name); } - + public static Test suite() { if (true) { return new Suite(OTSuperTypeHierarchyTest007_Stress.class); } - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSuperTypeHierarchyTest007_Stress.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test007"; - + _T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1"); _T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2"); - + _T1_R1 = getRole(_T1, "T1.R1"); _T1_R2 = getRole(_T1, "T1.R2"); - + _T2_R1 = getRole(_T2, "T2.R1"); _T2_R2 = getRole(_T2, "T2.R2"); - + _classA = getType(getTestProjectDir(), srcFolder, pkg, "ClassA"); _classB = @@ -98,9 +98,9 @@ public class OTSuperTypeHierarchyTest007_Stress extends FileBasedHierarchyTest getType(getTestProjectDir(), srcFolder, pkg, "InterfaceC"); _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object"); - + } - + public void testGetAllSuperInterfacesFor_T2R2_Run001() throws JavaModelException { @@ -112,66 +112,66 @@ public class OTSuperTypeHierarchyTest007_Stress extends FileBasedHierarchyTest { runActualTestCase(); } - + public void testGetAllSuperInterfacesFor_T2R2_Run003() throws JavaModelException { runActualTestCase(); } - + public void testGetAllSuperInterfacesFor_T2R2_Run004() throws JavaModelException { runActualTestCase(); } - + public void testGetAllSuperInterfacesFor_T2R2_Run005() throws JavaModelException { runActualTestCase(); } - + public void testGetAllSuperInterfacesFor_T2R2_Run006() throws JavaModelException { runActualTestCase(); } - + public void testGetAllSuperInterfacesFor_T2R2_Run007() throws JavaModelException { runActualTestCase(); } - + public void testGetAllSuperInterfacesFor_T2R2_Run008() throws JavaModelException { runActualTestCase(); } - + public void testGetAllSuperInterfacesFor_T2R2_Run009() throws JavaModelException { runActualTestCase(); } - + public void testGetAllSuperInterfacesFor_T2R2_Run010() throws JavaModelException { runActualTestCase(); - } + } private void runActualTestCase() throws JavaModelException { _focusType = _T2_R2; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _interfaceA, _interfaceB, - _interfaceC }; + _interfaceC }; IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest008.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest008.java index 6910a6255..fabd78da6 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest008.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest008.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -33,16 +33,16 @@ import org.eclipse.objectteams.otdt.tests.hierarchy.FileBasedHierarchyTest; import org.eclipse.objectteams.otdt.core.hierarchy.OTTypeHierarchies; /** - * + * * @author Michael Krueger (michael) - * @version $Id: OTSuperTypeHierarchyTest008.java 23494 2010-02-05 23:06:44Z stephan $ - * + * @version $Id: OTSuperTypeHierarchyTest008.java 23494 2010-02-05 23:06:44Z stephan $ + * */ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest { - + private IType _T21; - private IType _T22; + private IType _T22; private IType _objectType; private IType _T21T12R1; private IType _T21T12R2; @@ -56,12 +56,12 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest private IType _T22T11R1; private IType _T22T11R2; private IType _T22T11R3; - + public OTSuperTypeHierarchyTest008(String name) { super(name); } - + public static Test suite() { if (true) @@ -69,21 +69,21 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest return new Suite(OTSuperTypeHierarchyTest008.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSuperTypeHierarchyTest008.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test008"; - + _T22 = getType(getTestProjectDir(), srcFolder, pkg, "T22"); - _T21 = getType(getTestProjectDir(), srcFolder, pkg, "T21"); + _T21 = getType(getTestProjectDir(), srcFolder, pkg, "T21"); _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object"); @@ -100,7 +100,7 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest _T22T11R2 = getRole(_T22, "T22.T11.R2"); _T22T11R3 = getRole(_T22, "T22.T11.R3"); } - + public void testCreation() { assertCreation(_T21); @@ -123,7 +123,7 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest public void testGetAllSuperclasses_T22T11R2() throws JavaModelException { _focusType = _T22T11R2; - + ITypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); hierarchy.refresh(new NullProgressMonitor()); @@ -134,15 +134,15 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest _T21T11R1, _T21T11R2, }; - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } public void testGetAllSuperclasses_T22T12R3() throws JavaModelException { _focusType = _T22T12R3; - + ITypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); hierarchy.refresh(new NullProgressMonitor()); @@ -161,8 +161,8 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest _T22T12R1, _T22T12R2, }; - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -170,26 +170,26 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest { _focusType = _T22T12R3; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(_testObj, _focusType); IType[] expected = new IType[] { _T21T12R3, _T22T11R3 }; - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllTSuperTypes_T22T12R3() throws JavaModelException { _focusType = _T22T12R3; ITypeHierarchy hier = createSuperTypeHierarchy(_focusType); - + IType[] actual = OTTypeHierarchies.getInstance().getAllTSuperTypes(hier, _focusType); IType[] expected = new IType[] { _T21T12R3, _T22T11R3, _T21T11R3 }; - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -197,7 +197,7 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest { _focusType = _T22T12R3; _testObj = createSuperTypeHierarchy(_focusType); - + boolean result = false; try { @@ -209,15 +209,15 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest } assertFalse(result); } - + public void testGetExplicitSuperclass_T22T12R3() throws JavaModelException { _focusType = _T22T12R3; _testObj = createSuperTypeHierarchy(_focusType); - + IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(_testObj, _focusType); IType expected = _T22T12R2; - + assertTrue(compareTypes(expected, actual)); } @@ -225,14 +225,14 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest { _focusType = _T22T12R3; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType); IType[] expected = new IType[] { _T22T12R2, _T21T12R3, _T22T11R3 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } public void testGetSuperclasses_T22T12R2inT22T12R3() throws JavaModelException @@ -244,9 +244,9 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest IType[] expected = new IType[] { _T22T12R1, _T21T12R2, _T22T11R2 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } public void testGetSuperclasses_T22T12R1inT21T12R1() throws JavaModelException @@ -258,9 +258,9 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest IType[] expected = new IType[] { _T21T12R1, // direct tsuper _T22T11R1, // direct tsuper _objectType }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } public void testGetAllSuperclasses_T22T12R1inT21T12R1() throws JavaModelException @@ -273,9 +273,9 @@ public class OTSuperTypeHierarchyTest008 extends FileBasedHierarchyTest // _T22T11R1, // not related to focusType _T21T11R1, _objectType }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest009.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest009.java index 5a737df57..efc25d6e1 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest009.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest009.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -33,31 +33,31 @@ import org.eclipse.objectteams.otdt.core.TypeHelper; import org.eclipse.objectteams.otdt.core.hierarchy.OTTypeHierarchies; /** - * + * * @author michael - * @version $Id: OTSuperTypeHierarchyTest009.java 23494 2010-02-05 23:06:44Z stephan $ - * + * @version $Id: OTSuperTypeHierarchyTest009.java 23494 2010-02-05 23:06:44Z stephan $ + * */ public class OTSuperTypeHierarchyTest009 extends FileBasedModelTest { - + @SuppressWarnings("unused") private ITypeHierarchy _testObj; private IType _focusType; private IType _T10; - private IType _T11; + private IType _T11; private IType _objectType; private IType _T10T00; private IType _T11T00; private IType _T10T00R0; private IType _T11T00R0; - - - + + + public OTSuperTypeHierarchyTest009(String name) { super(name); } - + public static Test suite() { if (true) @@ -65,33 +65,33 @@ public class OTSuperTypeHierarchyTest009 extends FileBasedModelTest { return new Suite(OTSuperTypeHierarchyTest009.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSuperTypeHierarchyTest009.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test009"; - - _T10 = + + _T10 = getType(getTestProjectDir(), srcFolder, pkg, "T10"); - _T11 = + _T11 = getType(getTestProjectDir(), srcFolder, pkg, "T11"); - - - _objectType = + + + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", @@ -104,7 +104,7 @@ public class OTSuperTypeHierarchyTest009 extends FileBasedModelTest { } - + public void testCreation() { assertCreation(_T10); @@ -114,46 +114,46 @@ public class OTSuperTypeHierarchyTest009 extends FileBasedModelTest { assertCreation(_T10T00R0); assertCreation(_T11T00R0); - + } - + public void testGetTSuperTypes_T11T00R0() throws JavaModelException { _focusType = _T11T00R0; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(hierarchy, _focusType); IType[] expected = new IType[] { _T10T00R0 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - - + + public void testGetSuperclass_T11T00R0() throws JavaModelException { _focusType = _T11T00R0; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); hierarchy.refresh(new NullProgressMonitor()); IType actual = hierarchy.getSuperclass(_focusType); IType expected = _T10T00R0; - + assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T11T00R0() throws JavaModelException { _focusType = _T11T00R0; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); hierarchy.refresh(new NullProgressMonitor()); @@ -162,31 +162,31 @@ public class OTSuperTypeHierarchyTest009 extends FileBasedModelTest { IType[] expected = new IType[] { _objectType, _T10T00R0, }; - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetSuperInterfaces_T11T00R0() throws JavaModelException { _focusType = _T11T00R0; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); hierarchy.refresh(new NullProgressMonitor()); IType[] actual = OTTypeHierarchies.getInstance().getSuperInterfaces(hierarchy, _focusType); IType[] expected = new IType[0]; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - - - - - - + + + + + + } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest010.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest010.java index 4c33c3d6e..7ee0fade6 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest010.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest010.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -37,19 +37,19 @@ public class OTSuperTypeHierarchyTest010 extends FileBasedHierarchyTest private IType _T1; private IType _T2; private IType _T3; - + private IType _T1_R1; private IType _T2_R1; private IType _T3_R1; - private IType _interfaceA; + private IType _interfaceA; private IType _objectType; - + public OTSuperTypeHierarchyTest010(String name) { super(name); } - + public static Test suite() { if (true) @@ -57,19 +57,19 @@ public class OTSuperTypeHierarchyTest010 extends FileBasedHierarchyTest return new Suite(OTSuperTypeHierarchyTest010.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSuperTypeHierarchyTest010.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test010"; - + _T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1"); _T2 = getType(getTestProjectDir(), srcFolder, pkg, "T2"); _T3 = getType(getTestProjectDir(), srcFolder, pkg, "T3"); @@ -81,7 +81,7 @@ public class OTSuperTypeHierarchyTest010 extends FileBasedHierarchyTest _interfaceA = getType(getTestProjectDir(), srcFolder, pkg, "InterfaceA"); _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object"); } - + public void testCreation() { assertCreation(_T1); @@ -101,8 +101,8 @@ public class OTSuperTypeHierarchyTest010 extends FileBasedHierarchyTest _T2_R1, _T1_R1 }; IType [] actual = _testObj.getAllSuperclasses(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -112,22 +112,22 @@ public class OTSuperTypeHierarchyTest010 extends FileBasedHierarchyTest _testObj = createSuperTypeHierarchy(_focusType); IType[] expected = new IType[] { _objectType, - _T1_R1 }; + _T1_R1 }; IType [] actual = _testObj.getAllSuperclasses(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_T1R1() throws JavaModelException { _focusType = _T1_R1; _testObj = createSuperTypeHierarchy(_focusType); - - IType[] expected = new IType[] { _objectType }; + + IType[] expected = new IType[] { _objectType }; IType [] actual = _testObj.getAllSuperclasses(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -135,24 +135,24 @@ public class OTSuperTypeHierarchyTest010 extends FileBasedHierarchyTest { _focusType = _T3_R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _T2_R1, - _T1_R1 }; + _T1_R1 }; IType [] actual = OTTypeHierarchies.getInstance().getAllTSuperTypes(_testObj, _focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperinterfacesFor_T2_R1() throws JavaModelException { _focusType = _T2_R1; _testObj = createSuperTypeHierarchy(_focusType); - - IType[] expected = new IType[] { _interfaceA }; + + IType[] expected = new IType[] { _interfaceA }; IType [] actual = _testObj.getAllSuperInterfaces(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -160,11 +160,11 @@ public class OTSuperTypeHierarchyTest010 extends FileBasedHierarchyTest { _focusType = _T2_R1; _testObj = createSuperTypeHierarchy(_focusType); - - IType[] expected = new IType[] { _interfaceA }; + + IType[] expected = new IType[] { _interfaceA }; IType [] actual = _testObj.getSuperInterfaces(_focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -172,13 +172,13 @@ public class OTSuperTypeHierarchyTest010 extends FileBasedHierarchyTest { _focusType = _T2_R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] expected = new IType[] { _objectType, _T1_R1, - _interfaceA }; + _interfaceA }; IType [] actual = _testObj.getAllSupertypes(_focusType); - assertEquals(expected.length, actual.length); + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } @@ -186,12 +186,12 @@ public class OTSuperTypeHierarchyTest010 extends FileBasedHierarchyTest { _focusType = _T3_R1; _testObj = createSuperTypeHierarchy(_focusType); - - IType[] expected = new IType[] { _interfaceA }; + + IType[] expected = new IType[] { _interfaceA }; IType [] actual = OTTypeHierarchies.getInstance().getSuperInterfaces(_testObj, _focusType); - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest011.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest011.java index ac9c6d7a8..29c679995 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest011.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest011.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -30,30 +30,30 @@ import org.eclipse.objectteams.otdt.internal.core.PhantomType; import org.eclipse.objectteams.otdt.tests.hierarchy.FileBasedHierarchyTest; /** - * + * * @author Michael Krueger (mkr) - * @version $Id: OTSuperTypeHierarchyTest011.java 23494 2010-02-05 23:06:44Z stephan $ - * + * @version $Id: OTSuperTypeHierarchyTest011.java 23494 2010-02-05 23:06:44Z stephan $ + * */ public class OTSuperTypeHierarchyTest011 extends FileBasedHierarchyTest { - + private IType _T10; - private IType _T21; + private IType _T21; private IType _T21T11T0R1; private IType _phantom_T21T11T0R2; private IType _T10T0R1; private IType _T10T0R2; - + private IType _objectType; public OTSuperTypeHierarchyTest011(String name) { super(name); } - + public static Test suite() { if (true) @@ -61,23 +61,23 @@ public class OTSuperTypeHierarchyTest011 extends FileBasedHierarchyTest return new Suite(OTSuperTypeHierarchyTest011.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSuperTypeHierarchyTest011.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test011"; - + _T10 = getType(getTestProjectDir(), srcFolder, pkg, "T10"); _T21 = getType(getTestProjectDir(), srcFolder, pkg, "T21"); - + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", "Object"); @@ -86,13 +86,13 @@ public class OTSuperTypeHierarchyTest011 extends FileBasedHierarchyTest _T10T0R2 = getRole(_T10, "T10.T0.R2"); _phantom_T21T11T0R2 = new PhantomType(getRole(_T21, "T21.T11.T0"), _T10T0R2); } - + public void testCreation() { assertCreation(_T10); assertCreation(_T21); assertCreation(_T21T11T0R1); - assertCreation(_phantom_T21T11T0R2); + assertCreation(_phantom_T21T11T0R2); assertCreation(_T10T0R1); assertCreation(_T10T0R2); } @@ -101,41 +101,41 @@ public class OTSuperTypeHierarchyTest011 extends FileBasedHierarchyTest { _focusType = _T21T11T0R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] actual = OTTypeHierarchies.getInstance().getTSuperTypes(_testObj, _focusType); IType[] expected = new IType[] { _T10T0R1 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - + public void testGetSuperclasses_T21T11T0R1() throws JavaModelException { _focusType = _T21T11T0R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType); IType[] expected = new IType[] { _T10T0R1, _T10T0R2 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } public void testGetAllClasses_T21T11T0R1() throws JavaModelException { _focusType = _T21T11T0R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] actual = _testObj.getAllClasses(); IType[] expected = new IType[] { _T21T11T0R1, _T10T0R1, _T10T0R2, _objectType }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } public void testGetAllClasses_T21T11T0R1_phantom() throws JavaModelException @@ -143,29 +143,29 @@ public class OTSuperTypeHierarchyTest011 extends FileBasedHierarchyTest _focusType = _T21T11T0R1; _testObj = createSuperTypeHierarchy(_focusType); OTTypeHierarchies.getInstance().setPhantomMode(_testObj, true); - + IType[] actual = _testObj.getAllClasses(); IType[] expected = new IType[] { _T21T11T0R1, _phantom_T21T11T0R2, _T10T0R1, _T10T0R2, _objectType }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - + public void testGetAllClasses_T10T0R1() throws JavaModelException { _focusType = _T10T0R1; _testObj = createSuperTypeHierarchy(_focusType); - + IType[] actual = _testObj.getAllClasses(); IType[] expected = new IType[] { _T10T0R1, _T10T0R2, _objectType }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest013.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest013.java index 81335d8f9..ddd16aa24 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest013.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest013.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -32,18 +32,18 @@ import org.eclipse.objectteams.otdt.core.TypeHelper; import org.eclipse.objectteams.otdt.core.hierarchy.OTTypeHierarchies; /** - * + * * @author Michael Krueger (mkr) - * @version $Id: OTSuperTypeHierarchyTest013.java 23494 2010-02-05 23:06:44Z stephan $ - * + * @version $Id: OTSuperTypeHierarchyTest013.java 23494 2010-02-05 23:06:44Z stephan $ + * */ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest { - + private IType _focusType; private IType _objectType; private IType _TA1; - private IType _TA2; + private IType _TA2; private IType _TA1TB2TC2R1; private IType _TA1TB2TC1R1; private IType _TA1TB1TC2R1; @@ -56,12 +56,12 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest private IType _C1; private IType _C2; private IType _C3; - + public OTSuperTypeHierarchyTest013(String name) { super(name); } - + public static Test suite() { if (true) @@ -69,56 +69,56 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest return new Suite(OTSuperTypeHierarchyTest013.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSuperTypeHierarchyTest013.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test013"; - - _TA1 = + + _TA1 = getType(getTestProjectDir(), srcFolder, pkg, "TA1"); - _TA2 = + _TA2 = getType(getTestProjectDir(), srcFolder, pkg, "TA2"); - _C0 = + _C0 = getType(getTestProjectDir(), srcFolder, pkg, "C0"); - - _C1 = + + _C1 = getType(getTestProjectDir(), srcFolder, pkg, "C1"); - _C2 = + _C2 = getType(getTestProjectDir(), srcFolder, pkg, "C2"); - - _C3 = + + _C3 = getType(getTestProjectDir(), srcFolder, pkg, "C3"); - _objectType = + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", @@ -136,7 +136,7 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest } - + public void testCreation() { assertCreation(_TA1); @@ -145,7 +145,7 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest assertCreation(_C1); assertCreation(_C2); assertCreation(_C3); - + assertCreation(_TA2TB2TC2R1); assertCreation(_TA2TB2TC1R1); assertCreation(_TA2TB1TC2R1); @@ -155,12 +155,12 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest assertCreation(_TA1TB1TC2R1); assertCreation(_TA1TB1TC1R1); } - - + + public void testGetTSuperTypes_TA2TB2TC2R1() throws JavaModelException { _focusType = _TA2TB2TC2R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); hierarchy.refresh(new NullProgressMonitor()); @@ -171,16 +171,16 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest _TA2TB1TC2R1, _TA1TB2TC2R1 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } public void testGetSuperclasses_TA2TB2TC2R1() throws JavaModelException { _focusType = _TA2TB2TC2R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); hierarchy.refresh(new NullProgressMonitor()); @@ -192,15 +192,15 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest _TA1TB2TC2R1, _C1 }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } public void testGetAllSuperclasses_TA2TB2TC2R1() throws JavaModelException { _focusType = _TA2TB2TC2R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); hierarchy.refresh(new NullProgressMonitor()); @@ -210,7 +210,7 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest _TA1TB2TC2R1, _TA1TB2TC1R1, _TA1TB1TC2R1, - _TA1TB1TC1R1, + _TA1TB1TC1R1, _TA2TB2TC1R1, _TA2TB1TC2R1, _TA2TB1TC1R1, @@ -220,44 +220,44 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest // _C3, // illegal inheritance, causes incompatible supers _objectType }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - + public void testGetExplicitSuperclass_TA2TB2TC2R1() throws JavaModelException { _focusType = _TA2TB2TC2R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); hierarchy.refresh(new NullProgressMonitor()); IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(hierarchy, _focusType); IType expected = _C1; - - assertTrue(compareTypes(expected, actual)); + + assertTrue(compareTypes(expected, actual)); } - + public void testGetImplicitSuperclass_TA2TB2TC2R1() throws JavaModelException { _focusType = _TA2TB2TC2R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); hierarchy.refresh(new NullProgressMonitor()); IType actual = hierarchy.getSuperclass(_focusType); IType expected = _TA1TB2TC2R1; - - assertTrue(compareTypes(expected, actual)); + + assertTrue(compareTypes(expected, actual)); } public void testGetAllClasses_TA2TB2TC2R1() throws JavaModelException { _focusType = _TA2TB2TC2R1; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); hierarchy.refresh(new NullProgressMonitor()); @@ -278,9 +278,9 @@ public class OTSuperTypeHierarchyTest013 extends FileBasedModelTest _C3, // illegal inheritance, causes incompatible supers _objectType }; - - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - + } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest014.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest014.java index 4b31dbd27..f51487524 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest014.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest014.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -31,29 +31,29 @@ import org.eclipse.objectteams.otdt.core.hierarchy.OTTypeHierarchies; import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest; /** - * + * * @author michael - * @version $Id: OTSuperTypeHierarchyTest014.java 23494 2010-02-05 23:06:44Z stephan $ - * + * @version $Id: OTSuperTypeHierarchyTest014.java 23494 2010-02-05 23:06:44Z stephan $ + * */ public class OTSuperTypeHierarchyTest014 extends FileBasedModelTest { - + private TypeHierarchy _testObj; private IType _focusType; private IType _T1; private IType _T1R1; - private IType _C1; + private IType _C1; @SuppressWarnings("unused") private IType _javaLangObject; private IType _I1; private IType _I2; - - + + public OTSuperTypeHierarchyTest014(String name) { super(name); } - + public static Test suite() { if (true) @@ -61,45 +61,45 @@ public class OTSuperTypeHierarchyTest014 extends FileBasedModelTest { return new Suite(OTSuperTypeHierarchyTest014.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSuperTypeHierarchyTest014.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test014"; - - _T1 = + + _T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1"); - _C1 = + _C1 = getType(getTestProjectDir(), srcFolder, pkg, "C1"); - - _I1 = + + _I1 = getType(getTestProjectDir(), srcFolder, pkg, "I1"); - _I2 = + _I2 = getType(getTestProjectDir(), srcFolder, pkg, "I2"); - - _javaLangObject = + + _javaLangObject = getType(getTestProjectDir(), "rt.jar", "java.lang", @@ -107,7 +107,7 @@ public class OTSuperTypeHierarchyTest014 extends FileBasedModelTest { _T1R1 = getRole(_T1, "T1.R1"); } - + public void testCreation() { assertCreation(_T1); @@ -117,48 +117,48 @@ public class OTSuperTypeHierarchyTest014 extends FileBasedModelTest { assertCreation(_I2); } - + public void testGetAllSuperInterfaces_C1() throws JavaModelException { _focusType = _C1; - - _testObj = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); + + _testObj = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); _testObj.refresh(new NullProgressMonitor()); IType[] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); IType[] expected = new IType[] { _I1, _I2 }; - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperInterfaces_T1R1() throws JavaModelException { _focusType = _T1R1; - + _testObj = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); _testObj.refresh(new NullProgressMonitor()); IType[] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); IType[] expected = new IType[] { _I1, _I2 }; - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperInterfaces_I1() throws JavaModelException { _focusType = _I1; - + _testObj = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); _testObj.refresh(new NullProgressMonitor()); IType[] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); IType[] expected = new IType[] { _I2 }; - - assertEquals(expected.length, actual.length); + + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest015.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest015.java index b040ce2ee..3c383e5d8 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest015.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest015.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -32,13 +32,13 @@ import org.eclipse.objectteams.otdt.core.hierarchy.OTTypeHierarchies; import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest; /** - * + * * @author michael - * @version $Id: OTSuperTypeHierarchyTest015.java 23494 2010-02-05 23:06:44Z stephan $ - * + * @version $Id: OTSuperTypeHierarchyTest015.java 23494 2010-02-05 23:06:44Z stephan $ + * */ public class OTSuperTypeHierarchyTest015 extends FileBasedModelTest { - + @SuppressWarnings("unused") private ITypeHierarchy _testObj; private IType _focusType; @@ -47,14 +47,14 @@ public class OTSuperTypeHierarchyTest015 extends FileBasedModelTest { private IType _A; private IType _B; private IType _C; - - - + + + public OTSuperTypeHierarchyTest015(String name) { super(name); } - + public static Test suite() { if (true) @@ -62,40 +62,40 @@ public class OTSuperTypeHierarchyTest015 extends FileBasedModelTest { return new Suite(OTSuperTypeHierarchyTest015.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSuperTypeHierarchyTest015.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "test015"; - - _A = + + _A = getType(getTestProjectDir(), srcFolder, pkg, "A"); - _B = + _B = getType(getTestProjectDir(), srcFolder, pkg, "B"); - - _C = + + _C = getType(getTestProjectDir(), srcFolder, pkg, "C"); - - _objectType = + + _objectType = getType(getTestProjectDir(), "rt.jar", "java.lang", @@ -103,7 +103,7 @@ public class OTSuperTypeHierarchyTest015 extends FileBasedModelTest { } - + public void testCreation() { assertCreation(_A); @@ -111,40 +111,40 @@ public class OTSuperTypeHierarchyTest015 extends FileBasedModelTest { assertCreation(_C); } - + public void testGetExplicitSuperclass_B() throws JavaModelException { _focusType = _B; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); hierarchy.refresh(new NullProgressMonitor()); IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(hierarchy, _focusType); IType expected = _A; - - assertTrue(compareTypes(expected, actual)); + + assertTrue(compareTypes(expected, actual)); } - + public void testGetExplicitSuperclass_C() throws JavaModelException { _focusType = _C; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); hierarchy.refresh(new NullProgressMonitor()); IType actual = OTTypeHierarchies.getInstance().getExplicitSuperclass(hierarchy, _focusType); IType expected = _B; - - assertTrue(compareTypes(expected, actual)); + + assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperclasses_C() throws JavaModelException { _focusType = _C; - + TypeHierarchy hierarchy = new TypeHierarchy(_focusType, null, _focusType.getJavaProject(), false); hierarchy.refresh(new NullProgressMonitor()); @@ -152,15 +152,15 @@ public class OTSuperTypeHierarchyTest015 extends FileBasedModelTest { IType[] actual = hierarchy.getAllSuperclasses(_focusType); IType[] expected = new IType[] { _A, _B, _objectType }; - assertEquals(expected.length, actual.length); - assertTrue(compareTypes(expected, actual)); + assertEquals(expected.length, actual.length); + assertTrue(compareTypes(expected, actual)); } - - - - - - - + + + + + + + } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest016_Regression.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest016_Regression.java index 43eadd0d7..12c751bae 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest016_Regression.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OTSuperTypeHierarchyTest016_Regression.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -30,14 +30,14 @@ import org.eclipse.objectteams.otdt.tests.hierarchy.FileBasedHierarchyTest; public class OTSuperTypeHierarchyTest016_Regression extends FileBasedHierarchyTest { - private IType _T1; + private IType _T1; private IType _T1_IR; public OTSuperTypeHierarchyTest016_Regression(String name) { super(name); } - + @SuppressWarnings("unused") // variants to statically choose from public static Test suite() { @@ -45,24 +45,24 @@ public class OTSuperTypeHierarchyTest016_Regression extends FileBasedHierarchyTe { return new Suite(OTSuperTypeHierarchyTest016_Regression.class); } - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OTSuperTypeHierarchyTest016_Regression.class.getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("HierarchyRegression"); super.setUpSuite(); - + String srcFolder = "src"; String pkg = "t"; - + _T1 = getType(getTestProjectDir(), srcFolder, pkg, "T1"); - + _T1_IR = getRole(_T1, "T1.IR"); } - + // see http://bugs.eclipse.org/366976 public void testInterfaceAtSyntaxError() throws JavaModelException @@ -73,8 +73,8 @@ public class OTSuperTypeHierarchyTest016_Regression extends FileBasedHierarchyTe // due to severe syntax errors, T1.IR is not connected: IType [] actual = OTTypeHierarchies.getInstance().getAllSuperInterfaces(_testObj, _focusType); assertEquals(0, actual.length); - + actual = OTTypeHierarchies.getInstance().getSuperclasses(_testObj, _focusType); - assertEquals(0, actual.length); + assertEquals(0, actual.length); } } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OrdinaryClassesHierarchyWithSubRolesTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OrdinaryClassesHierarchyWithSubRolesTest.java index 9d82388ac..e2ebcd159 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OrdinaryClassesHierarchyWithSubRolesTest.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OrdinaryClassesHierarchyWithSubRolesTest.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -39,7 +39,7 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest; */ /* * The testdata setting looks like this: - * + * * SuperSuperTeam * R1 SuperClass * /\ /\ @@ -54,19 +54,19 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest; * |'''''''''''''''''''| |''''''''''''|'''''''''''''| | * SubTeam1 SubTeam2 | | | | * R1 R1------------------>SubSubClass11 SubSubClass12 | - * /\ | | + * /\ | | * |'''''''''''| | | * SubSubTeam11 SubSubTeam12 | | * R1 R1-----------------| | * | | * |---------------------------------------------------------------------| - * + * * The focus type is SuperClass . */ public class OrdinaryClassesHierarchyWithSubRolesTest extends FileBasedModelTest { private ITypeHierarchy _testObj; - + private IRoleType _aRole; private IRoleType _implSuperRole; @SuppressWarnings("unused") @@ -81,13 +81,13 @@ public class OrdinaryClassesHierarchyWithSubRolesTest extends FileBasedModelTest private IType _subClass2; private IType _subSubClass11; private IType _subSubClass12; - - + + public OrdinaryClassesHierarchyWithSubRolesTest(String name) { super(name); } - + public static Test suite() { if (true) @@ -95,127 +95,127 @@ public class OrdinaryClassesHierarchyWithSubRolesTest extends FileBasedModelTest return new Suite(OrdinaryClassesHierarchyWithSubRolesTest.class); } @SuppressWarnings("unused") - junit.framework.TestSuite suite = + junit.framework.TestSuite suite = new Suite(OrdinaryClassesHierarchyWithSubRolesTest.class.getName()); return suite; } - - + + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - - _aRole = + + _aRole = getRole(getTestProjectDir(), "complete_rolehierarchy_with_classes", "test002.inlined", "ATeam", "R1"); - - _implSuperRole = + + _implSuperRole = getRole(getTestProjectDir(), "complete_rolehierarchy_with_classes", "test002.inlined", "SuperTeam", "R1"); - - _implSuperSuperRole = + + _implSuperSuperRole = getRole(getTestProjectDir(), "complete_rolehierarchy_with_classes", "test002.inlined", "SuperTeam", "R1"); - - _implSubRole1 = + + _implSubRole1 = getRole(getTestProjectDir(), "complete_rolehierarchy_with_classes", "test002.inlined", "SubTeam1", "R1"); - - _implSubRole2 = + + _implSubRole2 = getRole(getTestProjectDir(), "complete_rolehierarchy_with_classes", "test002.inlined", "SubTeam2", "R1"); - + _implSubSubRole11 = getRole(getTestProjectDir(), "complete_rolehierarchy_with_classes", "test002.inlined", "SubSubTeam11", "R1"); - + _implSubSubRole12 = getRole(getTestProjectDir(), "complete_rolehierarchy_with_classes", "test002.inlined", "SubSubTeam12", "R1"); - + _aClass = - getType(getTestProjectDir(), - "complete_rolehierarchy_with_classes", - "test002.standard", + getType(getTestProjectDir(), + "complete_rolehierarchy_with_classes", + "test002.standard", "AClass"); - + _superClass = - getType(getTestProjectDir(), - "complete_rolehierarchy_with_classes", - "test002.standard", + getType(getTestProjectDir(), + "complete_rolehierarchy_with_classes", + "test002.standard", "SuperClass"); - + _subClass1 = - getType(getTestProjectDir(), - "complete_rolehierarchy_with_classes", - "test002.standard", + getType(getTestProjectDir(), + "complete_rolehierarchy_with_classes", + "test002.standard", "SubClass1"); - + _subClass2 = - getType(getTestProjectDir(), - "complete_rolehierarchy_with_classes", - "test002.standard", + getType(getTestProjectDir(), + "complete_rolehierarchy_with_classes", + "test002.standard", "SubClass2"); - + _subSubClass11 = - getType(getTestProjectDir(), - "complete_rolehierarchy_with_classes", - "test002.standard", + getType(getTestProjectDir(), + "complete_rolehierarchy_with_classes", + "test002.standard", "SubSubClass11"); - + _subSubClass12 = - getType(getTestProjectDir(), - "complete_rolehierarchy_with_classes", - "test002.standard", + getType(getTestProjectDir(), + "complete_rolehierarchy_with_classes", + "test002.standard", "SubSubClass12"); - + } - + public void testGetAllSubtypes_ofSuperClass() throws JavaModelException { assertNotNull(_superClass); assertTrue(_superClass.exists()); _testObj = new TypeHierarchy(_superClass, null, _superClass.getJavaProject(), true); _testObj.refresh(new NullProgressMonitor()); - + ArrayList<IType> expectedList = new ArrayList<IType>(); expectedList.add(_aClass); expectedList.add(_subClass1); expectedList.add(_subClass2); expectedList.add(_subSubClass11); expectedList.add(_subSubClass12); - + expectedList.add(_implSuperRole); expectedList.add(_aRole); - expectedList.add(_implSubRole1); + expectedList.add(_implSubRole1); expectedList.add(_implSubRole2); expectedList.add(_implSubSubRole11); expectedList.add(_implSubSubRole12); IType[] expected = expectedList.toArray(new IType[expectedList.size()]); IType[] actual = _testObj.getAllSubtypes(_superClass); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OrdinaryInterfaceHierarchyTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OrdinaryInterfaceHierarchyTests.java index 3f0d5dedd..84a40d0b9 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OrdinaryInterfaceHierarchyTests.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/superhierarchy/OrdinaryInterfaceHierarchyTests.java @@ -1,20 +1,20 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute and Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -37,7 +37,7 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest; public class OrdinaryInterfaceHierarchyTests extends FileBasedModelTest { private ITypeHierarchy _testObject; - + private IType _superSuperInterface; private IType _superInterface1; private IType _superInterface2; @@ -47,8 +47,8 @@ public class OrdinaryInterfaceHierarchyTests extends FileBasedModelTest private IType _subSubInterface2; private IType _javaLangObject; - - + + public OrdinaryInterfaceHierarchyTests(String name) { super(name); @@ -64,27 +64,27 @@ public class OrdinaryInterfaceHierarchyTests extends FileBasedModelTest junit.framework.TestSuite suite = new Suite(OrdinaryInterfaceHierarchyTests.class.getName()); return suite; } - + protected void setUp() throws Exception { super.setUp(); } - + public void setUpSuite() throws Exception { setTestProjectDir("Hierarchy"); super.setUpSuite(); - _focusInterface = + _focusInterface = getType(getTestProjectDir(), "src", "standard.interface_hierarchy", "AnInterface"); - + _testObject = new TypeHierarchy(_focusInterface, null, _focusInterface.getJavaProject(), true); _testObject.refresh(new NullProgressMonitor()); - + _javaLangObject = getJavaLangObject(_focusInterface.getJavaProject()); - + _superSuperInterface = getType(getTestProjectDir(), "src", @@ -115,9 +115,9 @@ public class OrdinaryInterfaceHierarchyTests extends FileBasedModelTest "src", "standard.interface_hierarchy", "SubSubInterface2"); - + } - + public void testExistence_SuperSuperInterface() throws JavaModelException { @@ -166,8 +166,8 @@ public class OrdinaryInterfaceHierarchyTests extends FileBasedModelTest assertNotNull(_subSubInterface2); assertTrue(_subSubInterface2.exists()); } - - + + public void testGetAllTypes() throws JavaModelException { @@ -181,51 +181,51 @@ public class OrdinaryInterfaceHierarchyTests extends FileBasedModelTest _subSubInterface1, _subSubInterface2}; IType[] actual = _testObject.getAllTypes(); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllClasses() throws JavaModelException { IType[] expected = new IType[] { _javaLangObject }; IType[] actual = _testObject.getAllClasses(); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetSuperclass_ofFocusInterface() { assertNull("Interfaces have no superclass", _testObject.getSuperclass(_focusInterface)); } - + public void testGetSubclass_ofFocusInterface() { IType[] actual = _testObject.getSubclasses(_focusInterface); IType[] expected = new IType[] {}; - assertTrue(compareTypes(expected, actual)); + assertTrue(compareTypes(expected, actual)); } - + public void testGetSubtypes_ofFocusInterface() { IType[] expected = new IType[]{_subInterface}; IType[] actual = _testObject.getSubtypes(_focusInterface); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetRootInterfaces() { IType[] actual = _testObject.getRootInterfaces(); IType[] expected = new IType[] { _superInterface2, _superSuperInterface } ; - - assertTrue(compareTypes(expected, actual)); + + assertTrue(compareTypes(expected, actual)); } - + public void testGetAllInterfaces_SevenInterfaces() throws JavaModelException { @@ -238,11 +238,11 @@ public class OrdinaryInterfaceHierarchyTests extends FileBasedModelTest _subSubInterface1, _subSubInterface2}; IType[] actual = _testObject.getAllInterfaces(); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetAllSuperInterfaces_FiveParents() throws JavaModelException { @@ -253,18 +253,18 @@ public class OrdinaryInterfaceHierarchyTests extends FileBasedModelTest _focusInterface, _subInterface }; IType[] actual = _testObject.getAllSuperInterfaces(_subSubInterface1); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); } - + public void testGetExtendingInterfaces_OneChild() throws JavaModelException { IType[] expected = new IType[]{ _superInterface1 }; IType[] actual = _testObject.getExtendingInterfaces(_superSuperInterface); - + assertEquals(expected.length, actual.length); assertTrue(compareTypes(expected, actual)); - } + } } |