Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest006.java')
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/hierarchy/org/eclipse/objectteams/otdt/tests/subhierarchy/OTSubTypeHierarchyTest006.java120
1 files changed, 60 insertions, 60 deletions
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));
}
-
+
}

Back to the top