Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring')
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/AllTests.java5
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodRefactoringUtilTests.java20
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/requiredfeatures/AllTests.java2
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/AllTests.java5
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/RefactoringUtilTest.java66
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/TypeHelperGetInheritedMethodsTest.java152
6 files changed, 205 insertions, 45 deletions
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/AllTests.java
index 75062084a..14700f9f6 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/AllTests.java
@@ -41,7 +41,10 @@ public class AllTests
{
TestSuite suite = new TestSuite(
"All Refactoring Tests");
-
+
+ // util
+ suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.util.AllTests.suite());
+
// OTDT refactoring tests
// rename
suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.rename.RenameMethodInInterfaceTests.suite());
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodRefactoringUtilTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodRefactoringUtilTests.java
index 720083b16..12483d66a 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodRefactoringUtilTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractmethod/ExtractMethodRefactoringUtilTests.java
@@ -167,7 +167,7 @@ public class ExtractMethodRefactoringUtilTests extends FileBasedRefactoringTest
_refactoring.setMethodName("f");
_refactoring.setVisibility(Modifier.PROTECTED);
_refactoring.checkInitialConditions(new NullProgressMonitor());
- IMethod[] inheritedMethods = TypeHelper.getInheritedMethods(_a, true, true, true, null);
+ IMethod[] inheritedMethods = RefactoringUtil.getInheritedMethods(_a, true, true, true, null);
RefactoringStatus expected = RefactoringUtil.addOverloadingWarning(new ExtractMethodOverloadingMsgCreator());
RefactoringStatus actual = RefactoringUtil.checkOverloading(inheritedMethods, _refactoring.getMethodName(), fetchNewParameterTypes(),
new ExtractMethodOverloadingMsgCreator());
@@ -184,7 +184,7 @@ public class ExtractMethodRefactoringUtilTests extends FileBasedRefactoringTest
_refactoring.setMethodName("g");
_refactoring.setVisibility(Modifier.PROTECTED);
_refactoring.checkInitialConditions(new NullProgressMonitor());
- IMethod[] inheritedMethods = TypeHelper.getInheritedMethods(_b, true, true, true, null);
+ IMethod[] inheritedMethods = RefactoringUtil.getInheritedMethods(_b, true, true, true, null);
RefactoringStatus expected = RefactoringUtil.addOverloadingWarning(new ExtractMethodOverloadingMsgCreator());
RefactoringStatus actual = RefactoringUtil.checkOverloading(inheritedMethods, _refactoring.getMethodName(), fetchNewParameterTypes(),
new ExtractMethodOverloadingMsgCreator());
@@ -201,7 +201,7 @@ public class ExtractMethodRefactoringUtilTests extends FileBasedRefactoringTest
_refactoring.setMethodName("g");
_refactoring.setVisibility(Modifier.PROTECTED);
_refactoring.checkInitialConditions(new NullProgressMonitor());
- IMethod[] inheritedMethods = TypeHelper.getInheritedMethods(_c, true, true, true, null);
+ IMethod[] inheritedMethods = RefactoringUtil.getInheritedMethods(_c, true, true, true, null);
RefactoringStatus expected = RefactoringUtil.addOverloadingWarning(new ExtractMethodOverloadingMsgCreator());
RefactoringStatus actual = RefactoringUtil.checkOverloading(inheritedMethods, _refactoring.getMethodName(), fetchNewParameterTypes(),
new ExtractMethodOverloadingMsgCreator());
@@ -218,7 +218,7 @@ public class ExtractMethodRefactoringUtilTests extends FileBasedRefactoringTest
_refactoring.setMethodName("m");
_refactoring.setVisibility(Modifier.PROTECTED);
_refactoring.checkInitialConditions(new NullProgressMonitor());
- IMethod[] inheritedMethods = TypeHelper.getInheritedMethods(_q, true, true, true, null);
+ IMethod[] inheritedMethods = RefactoringUtil.getInheritedMethods(_q, true, true, true, null);
RefactoringStatus expected = RefactoringUtil.addOverloadingWarning(new ExtractMethodOverloadingMsgCreator());
RefactoringStatus actual = RefactoringUtil.checkOverloading(inheritedMethods, _refactoring.getMethodName(), fetchNewParameterTypes(),
new ExtractMethodOverloadingMsgCreator());
@@ -235,7 +235,7 @@ public class ExtractMethodRefactoringUtilTests extends FileBasedRefactoringTest
_refactoring.setMethodName("m");
_refactoring.setVisibility(Modifier.PROTECTED);
_refactoring.checkInitialConditions(new NullProgressMonitor());
- IMethod[] inheritedMethods = TypeHelper.getInheritedMethods(_s, true, true, true, null);
+ IMethod[] inheritedMethods = RefactoringUtil.getInheritedMethods(_s, true, true, true, null);
RefactoringStatus expected = RefactoringUtil.addOverloadingWarning(new ExtractMethodOverloadingMsgCreator());
RefactoringStatus actual = RefactoringUtil.checkOverloading(inheritedMethods, _refactoring.getMethodName(), fetchNewParameterTypes(),
new ExtractMethodOverloadingMsgCreator());
@@ -252,7 +252,7 @@ public class ExtractMethodRefactoringUtilTests extends FileBasedRefactoringTest
_refactoring.setMethodName("m");
_refactoring.setVisibility(Modifier.PROTECTED);
_refactoring.checkInitialConditions(new NullProgressMonitor());
- IMethod[] inheritedMethods = TypeHelper.getInheritedMethods(_t1, true, true, true, null);
+ IMethod[] inheritedMethods = RefactoringUtil.getInheritedMethods(_t1, true, true, true, null);
RefactoringStatus expected = RefactoringUtil.addOverloadingWarning(new ExtractMethodOverloadingMsgCreator());
RefactoringStatus actual = RefactoringUtil.checkOverloading(inheritedMethods, _refactoring.getMethodName(), fetchNewParameterTypes(),
new ExtractMethodOverloadingMsgCreator());
@@ -269,7 +269,7 @@ public class ExtractMethodRefactoringUtilTests extends FileBasedRefactoringTest
_refactoring.setMethodName("m");
_refactoring.setVisibility(Modifier.PROTECTED);
_refactoring.checkInitialConditions(new NullProgressMonitor());
- IMethod[] inheritedMethods = TypeHelper.getInheritedMethods(_t2r1, true, true, true, null);
+ IMethod[] inheritedMethods = RefactoringUtil.getInheritedMethods(_t2r1, true, true, true, null);
RefactoringStatus expected = RefactoringUtil.addOverloadingWarning(new ExtractMethodOverloadingMsgCreator());
RefactoringStatus actual = RefactoringUtil.checkOverloading(inheritedMethods, _refactoring.getMethodName(), fetchNewParameterTypes(),
new ExtractMethodOverloadingMsgCreator());
@@ -286,7 +286,7 @@ public class ExtractMethodRefactoringUtilTests extends FileBasedRefactoringTest
_refactoring.setMethodName("rm");
_refactoring.setVisibility(Modifier.PROTECTED);
_refactoring.checkInitialConditions(new NullProgressMonitor());
- IMethod[] inheritedMethods = TypeHelper.getInheritedMethods(_t3r2, true, true, true, null);
+ IMethod[] inheritedMethods = RefactoringUtil.getInheritedMethods(_t3r2, true, true, true, null);
RefactoringStatus expected = RefactoringUtil.addOverloadingWarning(new ExtractMethodOverloadingMsgCreator());
RefactoringStatus actual = RefactoringUtil.checkOverloading(inheritedMethods, _refactoring.getMethodName(), fetchNewParameterTypes(),
new ExtractMethodOverloadingMsgCreator());
@@ -306,7 +306,7 @@ public class ExtractMethodRefactoringUtilTests extends FileBasedRefactoringTest
_refactoring.setMethodName("n");
_refactoring.setVisibility(Modifier.PRIVATE);
_refactoring.checkInitialConditions(new NullProgressMonitor());
- IMethod[] inheritedMethods = TypeHelper.getInheritedMethods(_c, true, true, false, null);
+ IMethod[] inheritedMethods = RefactoringUtil.getInheritedMethods(_c, true, true, false, null);
RefactoringStatus expected = RefactoringUtil.addOverloadingWarning(new ExtractMethodOverloadingMsgCreator());
RefactoringStatus actual = RefactoringUtil.checkOverloading(inheritedMethods, _refactoring.getMethodName(), fetchNewParameterTypes(),
new ExtractMethodOverloadingMsgCreator());
@@ -324,7 +324,7 @@ public class ExtractMethodRefactoringUtilTests extends FileBasedRefactoringTest
_refactoring.setMethodName("k");
_refactoring.setVisibility(Modifier.PRIVATE);
_refactoring.checkInitialConditions(new NullProgressMonitor());
- IMethod[] inheritedMethods = TypeHelper.getInheritedMethods(_t3r2, true, true, false, null);
+ IMethod[] inheritedMethods = RefactoringUtil.getInheritedMethods(_t3r2, true, true, false, null);
RefactoringStatus expected = RefactoringUtil.addOverloadingWarning(new ExtractMethodOverloadingMsgCreator());
RefactoringStatus actual = RefactoringUtil.checkOverloading(inheritedMethods, _refactoring.getMethodName(), fetchNewParameterTypes(),
new ExtractMethodOverloadingMsgCreator());
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/requiredfeatures/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/requiredfeatures/AllTests.java
index 394daa321..2a3123b38 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/requiredfeatures/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/requiredfeatures/AllTests.java
@@ -46,7 +46,7 @@ public class AllTests
// Hierarchy
suite.addTest(org.eclipse.objectteams.otdt.tests.superhierarchy.AllTests.suite());
// TypeHelper.getInheritedMethods
- suite.addTest(org.eclipse.objectteams.otdt.tests.otmodel.internal.TypeHelperGetInheritedMethodsTest.suite());
+ suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.util.TypeHelperGetInheritedMethodsTest.suite());
// SearchEngine
suite.addTest(org.eclipse.objectteams.otdt.tests.search.OTJavaMethodSearchTests.suite());
suite.addTest(org.eclipse.objectteams.otdt.tests.search.OTJavaTypeSearchTests.suite());
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/AllTests.java
index 2e3be0552..33704f2ab 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/AllTests.java
@@ -21,6 +21,7 @@
package org.eclipse.objectteams.otdt.ui.tests.refactoring.util;
+
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -42,7 +43,9 @@ public class AllTests
TestSuite suite = new TestSuite(
"All OT-Refactoring-Util Tests");
- suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.util.RefactoringUtilTest.suite());
+ suite.addTest(org.eclipse.objectteams.otdt.ui.tests.refactoring.util.RefactoringUtilTest.suite());
+ suite.addTest(TypeHelperGetInheritedMethodsTest.suite());
+
return suite;
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/RefactoringUtilTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/RefactoringUtilTest.java
index 0664a2e2f..d1fdfbfcc 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/RefactoringUtilTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/RefactoringUtilTest.java
@@ -25,14 +25,17 @@ import junit.framework.Test;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.internal.refactoring.util.RefactoringUtil;
import org.eclipse.objectteams.otdt.ui.tests.refactoring.FileBasedRefactoringTest;
/**
* @author svacina
* @version $Id: RefactoringUtilTest.java 6446 2005-08-02 10:49:59Z svacina $
*/
+@SuppressWarnings("nls")
public class RefactoringUtilTest extends FileBasedRefactoringTest
{
@@ -58,6 +61,7 @@ public class RefactoringUtilTest extends FileBasedRefactoringTest
private IMethod _team4role2m1;
private IMethod _team4role2m2;
+ ITypeHierarchy _hierarchy;
public RefactoringUtilTest(String name)
{
@@ -72,7 +76,7 @@ public class RefactoringUtilTest extends FileBasedRefactoringTest
/**
* Creates a team hierarchy with implicit role type inheritance.
*/
- public void setUpSuite() throws Exception
+ public void setUpSuite() throws Exception
{
setTestProjectDir("RefactoringUtil");
super.setUpSuite();
@@ -146,7 +150,7 @@ public class RefactoringUtilTest extends FileBasedRefactoringTest
_team4role2m1 = _team4role2.getMethods()[0];
-
+ _hierarchy = ((IType)_team4role2.getCorrespondingJavaElement()).newTypeHierarchy(null);
}
protected void setUp() throws Exception
@@ -156,36 +160,34 @@ public class RefactoringUtilTest extends FileBasedRefactoringTest
public void testIsDeclaredInInterface_yes() throws JavaModelException
{
- fail("Not yet implemented");
-// MIGRATE
-// IMethod expected = _itest2m1;
-// IMethod actual = RefactoringUtil.isDeclaredInInterface(_team2role1m1, new NullProgressMonitor());
-// assertTrue(expected.equals(actual));
-// }
-//
-// public void testIsDeclaredInInterface_no1() throws JavaModelException
-// {
-// IMethod actual = RefactoringUtil.isDeclaredInInterface(_team2role1m2, new NullProgressMonitor());
-// assertNull(actual);
-// }
-//
-// public void testIsDeclaredInInterface_no2() throws JavaModelException
-// {
-// IMethod actual = RefactoringUtil.isDeclaredInInterface(_team4role2m2, new NullProgressMonitor());
-// assertNull(actual);
-// }
-//
-// public void testOverridesAnotherMethod_yes() throws JavaModelException
-// {
-// IMethod expected = _cm2;
-// IMethod actual = RefactoringUtil.overridesAnotherMethod(_team4role2m2, new NullProgressMonitor());
-// assertTrue(expected.equals(actual));
-// }
-//
-// public void testOverridesAnotherMethod_no() throws JavaModelException
-// {
-// IMethod actual = RefactoringUtil.overridesAnotherMethod(_team2role1m2, new NullProgressMonitor());
-// assertNull(actual);
+ IMethod expected = _itest2m1;
+ IMethod actual = RefactoringUtil.isDeclaredInInterface(_team2role1m1, _hierarchy, new NullProgressMonitor());
+ assertTrue(expected.equals(actual));
+ }
+
+ public void testIsDeclaredInInterface_no1() throws JavaModelException
+ {
+ IMethod actual = RefactoringUtil.isDeclaredInInterface(_team2role1m2, _hierarchy, new NullProgressMonitor());
+ assertNull(actual);
+ }
+
+ public void testIsDeclaredInInterface_no2() throws JavaModelException
+ {
+ IMethod actual = RefactoringUtil.isDeclaredInInterface(_team4role2m2, _hierarchy, new NullProgressMonitor());
+ assertNull(actual);
+ }
+
+ public void testOverridesAnotherMethod_yes() throws JavaModelException
+ {
+ IMethod expected = _cm2;
+ IMethod actual = RefactoringUtil.overridesAnotherMethod(_team4role2m2, _hierarchy, new NullProgressMonitor());
+ assertTrue(expected.equals(actual));
+ }
+
+ public void testOverridesAnotherMethod_no() throws JavaModelException
+ {
+ IMethod actual = RefactoringUtil.overridesAnotherMethod(_team2role1m2, _hierarchy, new NullProgressMonitor());
+ assertNull(actual);
}
//TODO(jsv) test with nested teams
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/TypeHelperGetInheritedMethodsTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/TypeHelperGetInheritedMethodsTest.java
new file mode 100644
index 000000000..73cee2291
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/util/TypeHelperGetInheritedMethodsTest.java
@@ -0,0 +1,152 @@
+/**********************************************************************
+ * 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.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: TypeHelperGetInheritedMethodsTest.java 23494 2010-02-05 23:06:44Z stephan $
+ *
+ * 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
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.ui.tests.refactoring.util;
+
+import junit.framework.Test;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.TypeHelper;
+import org.eclipse.objectteams.otdt.internal.refactoring.util.RefactoringUtil;
+import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest;
+
+/**
+ * @author svacina
+ * @version $Id: TypeHelperGetInheritedMethodsTest.java 23494 2010-02-05 23:06:44Z stephan $
+ */
+@SuppressWarnings("unused")
+public class TypeHelperGetInheritedMethodsTest extends FileBasedModelTest
+{
+
+ private IRoleType _t1r1;
+ private IRoleType _t2r1;
+ private IRoleType _t2r2;
+ private IRoleType _t3r1;
+ private IRoleType _t3r2;
+ private IType _c1;
+ private IMethod _c1m1;
+ private IMethod _c1m2;
+ private IMethod _t1r1m3;
+ private IMethod _t2r1m1;
+ private IMethod _t2r2m3;
+ private IMethod _t2r2m4;
+ private IMethod _t2r1m5;
+ private IMethod _t3r2m1;
+ private IMethod _t3r2m3;
+
+
+
+ public TypeHelperGetInheritedMethodsTest(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return new Suite(TypeHelperGetInheritedMethodsTest.class);
+ }
+
+ /**
+ * Creates a team hierarchy with implicit role type inheritance.
+ */
+ public void setUpSuite() throws Exception
+ {
+ setTestProjectDir("Hierarchy");
+ super.setUpSuite();
+
+ _t1r1 =
+ getRole(getTestProjectDir(),
+ "analysis",
+ "rolehierarchy4",
+ "T1",
+ "R1");
+
+ _t2r1 =
+ getRole(getTestProjectDir(),
+ "analysis",
+ "rolehierarchy4",
+ "T2",
+ "R1");
+
+ _t2r2 =
+ getRole(getTestProjectDir(),
+ "analysis",
+ "rolehierarchy4",
+ "T2",
+ "R2");
+
+ _t3r1 =
+ getRole(getTestProjectDir(),
+ "analysis",
+ "rolehierarchy4",
+ "T3",
+ "R1");
+
+ _t3r2 =
+ getRole(getTestProjectDir(),
+ "analysis",
+ "rolehierarchy4",
+ "T3",
+ "R2");
+
+ _c1 =
+ getType(getTestProjectDir(),
+ "analysis",
+ "rolehierarchy4",
+ "C1");
+
+ _c1m1 = _c1.getMethods()[0];
+ _c1m2 = _c1.getMethods()[1];
+ _t1r1m3 = _t1r1.getMethods()[0];
+ _t2r1m1 = _t2r1.getMethods()[0];
+ _t2r1m5 = _t2r1.getMethods()[1];
+ _t2r2m3 = _t2r2.getMethods()[0];
+ _t2r2m4 = _t2r2.getMethods()[1];
+
+ _t3r2m1 = _t3r2.getMethods()[0];
+ _t3r2m3 = _t3r2.getMethods()[1];
+
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ }
+
+ public void testGetInheritedMethodsFocusTypeNotIncluded() throws JavaModelException
+ {
+ IMethod[] expected = new IMethod[] {_t2r2m3, _t2r2m4, _t2r1m1, _c1m2};
+ IMethod[] actual = RefactoringUtil.getInheritedMethods(_t3r2, false, false, true, new NullProgressMonitor());
+ assertTrue( compareMethods(expected, actual) );
+ }
+
+ public void testGetInheritedMethodsFocusTypeIncluded() throws JavaModelException
+ {
+ IMethod[] expected = new IMethod[] {_t3r2m3, _t2r2m4, _t3r2m1, _c1m2};
+ IMethod[] actual = RefactoringUtil.getInheritedMethods(_t3r2, true, false, true, new NullProgressMonitor());
+ assertTrue( compareMethods(expected, actual) );
+ }
+
+ //TODO(jsv) test with nested teams
+} \ No newline at end of file

Back to the top