diff options
Diffstat (limited to 'testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test8.java')
-rw-r--r-- | testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test8.java | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test8.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test8.java index f6dee20fb..1fee1f695 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test8.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/anonymousinnerclass/teamlevel/Test8.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,7 +32,7 @@ import org.eclipse.objectteams.otdt.core.OTModelManager; import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest; /** - * + * * testcase: * a team class with a method * instantiation of an anonymous class inside the method @@ -40,9 +40,9 @@ import org.eclipse.objectteams.otdt.tests.otmodel.FileBasedModelTest; */ public class Test8 extends FileBasedModelTest { - + private IType _teamJavaElem = null; - + public Test8(String name) { super(name); @@ -58,13 +58,13 @@ public class Test8 extends FileBasedModelTest .getName()); return suite; } - + public void setUpSuite() throws Exception { setTestProjectDir("AnonymousInnerclass"); super.setUpSuite(); } - + protected void setUp() throws Exception { super.setUp(); @@ -76,7 +76,7 @@ public class Test8 extends FileBasedModelTest "teamlevel.teampkg", "Test8_TeamB.java"); _teamJavaElem = teamUnit.getType("Test8_TeamB"); - + System.out.println("\nAnonymousInnerclassTeamLevelTest8:"); System.out.println("Teamklasse:\n" +_teamJavaElem); } @@ -84,31 +84,31 @@ public class Test8 extends FileBasedModelTest { ex.printStackTrace(); } - } + } public void testExistenceOfAnonymousType() throws JavaModelException { assertNotNull(_teamJavaElem); assertTrue(_teamJavaElem.exists()); - + IMethod teamlevelMethod = _teamJavaElem.getMethod("teamlevelMethod", new String[0]); assertNotNull(teamlevelMethod); assertTrue(teamlevelMethod.exists()); - + IType anonymousType = teamlevelMethod.getType("",1); assertNotNull(anonymousType); assertTrue(anonymousType.exists()); } - + private IType getAnonymousType() throws JavaModelException { if ((_teamJavaElem != null) && (_teamJavaElem.exists())) { IMethod teamlevelMethod = _teamJavaElem.getMethod("teamlevelMethod", new String[0]); - + if ((teamlevelMethod != null) && (teamlevelMethod.exists())) { IType anonymousType = teamlevelMethod.getType("",1); - + if ((anonymousType != null) && (anonymousType.exists())) { return anonymousType; @@ -117,36 +117,36 @@ public class Test8 extends FileBasedModelTest } return null; } - + public void testExistenceOfAnonymousTypeInOTModel() throws JavaModelException { IType anonymousTypeJavaElem = getAnonymousType(); assertNotNull(anonymousTypeJavaElem); - + IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem); assertNotNull(anonymousTypeOTElem); } - + public void testTeamPropertyOfAnonymousType() throws JavaModelException { IType anonymousTypeJavaElem = getAnonymousType(); assertNotNull(anonymousTypeJavaElem); - + IOTType anonymousTypeOTElem = OTModelManager.getOTElement(anonymousTypeJavaElem); assertNotNull(anonymousTypeOTElem); - + assertTrue(anonymousTypeOTElem.isTeam()); } - + public void testContainmentOfMethodInAnonymousType() throws JavaModelException { IType anonymousTypeJavaElem = getAnonymousType(); assertNotNull(anonymousTypeJavaElem); - + IMethod method = anonymousTypeJavaElem.getMethod("method", new String[]{"QSampleBase;"}); assertNotNull(method); assertTrue(method.exists()); } - - //TODO (kaschja) create test for declared lifting by the time declared lifting is integrated into the OT-model + + //TODO (kaschja) create test for declared lifting by the time declared lifting is integrated into the OT-model } |