Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 90491 Details for
Bug 212285
[context] remove from context doesn't get the children of a non-java project
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Test case patch
patch.txt (text/plain), 8.52 KB, created by
Shawn Minto
on 2008-02-22 12:30:06 EST
(
hide
)
Description:
Test case patch
Filename:
MIME Type:
Creator:
Shawn Minto
Created:
2008-02-22 12:30:06 EST
Size:
8.52 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.java.tests >Index: src/org/eclipse/mylyn/java/tests/AllJavaTests.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.java.tests/src/org/eclipse/mylyn/java/tests/AllJavaTests.java,v >retrieving revision 1.38 >diff -u -r1.38 AllJavaTests.java >--- src/org/eclipse/mylyn/java/tests/AllJavaTests.java 19 Feb 2008 21:49:39 -0000 1.38 >+++ src/org/eclipse/mylyn/java/tests/AllJavaTests.java 22 Feb 2008 17:26:12 -0000 >@@ -38,7 +38,7 @@ > suite.addTestSuite(ContentSpecificContextTest.class); > suite.addTestSuite(ResourceStructureMappingTest.class); > // XXX: Put back >- //suite.addTestSuite(InterestManipulationTest.class); >+ suite.addTestSuite(InterestManipulationTest.class); > suite.addTestSuite(EditorManagerTest.class); > suite.addTestSuite(RefactoringTest.class); > suite.addTestSuite(ContentOutlineRefreshTest.class); >Index: src/org/eclipse/mylyn/java/tests/InterestManipulationTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.java.tests/src/org/eclipse/mylyn/java/tests/InterestManipulationTest.java,v >retrieving revision 1.28 >diff -u -r1.28 InterestManipulationTest.java >--- src/org/eclipse/mylyn/java/tests/InterestManipulationTest.java 18 Oct 2007 18:26:45 -0000 1.28 >+++ src/org/eclipse/mylyn/java/tests/InterestManipulationTest.java 22 Feb 2008 17:26:12 -0000 >@@ -29,6 +29,7 @@ > > /** > * @author Mik Kersten >+ * @author Shawn Minto > */ > public class InterestManipulationTest extends AbstractJavaContextTest { > >@@ -62,6 +63,34 @@ > super.tearDown(); > } > >+ public void testDecrementNonJavaProject() throws CoreException, InvocationTargetException, InterruptedException { >+ IFile file = nonJavaProject.getProject().getFile("foo.txt"); >+ file.create(null, true, null); >+ ResourceStructureBridge bridge = new ResourceStructureBridge(); >+ new ResourceInteractionMonitor().selectionChanged(part, new StructuredSelection(file)); >+ >+ IInteractionElement fileElement = ContextCorePlugin.getContextManager().getElement( >+ bridge.getHandleIdentifier(file)); >+ >+ IInteractionElement projectElement = ContextCorePlugin.getContextManager().getElement( >+ new ResourceStructureBridge().getHandleIdentifier(nonJavaProject.getProject())); >+ >+ assertTrue(fileElement.getInterest().isInteresting()); >+ assertTrue(projectElement.getInterest().isInteresting()); >+ >+ assertTrue(ContextCorePlugin.getContextManager().manipulateInterestForElement(projectElement, false, false, >+ false, "test")); >+ >+ projectElement = ContextCorePlugin.getContextManager().getElement( >+ new ResourceStructureBridge().getHandleIdentifier(nonJavaProject.getProject())); >+ >+ fileElement = ContextCorePlugin.getContextManager().getElement( >+ bridge.getHandleIdentifier(file)); >+ >+ assertFalse(projectElement.getInterest().isInteresting()); >+ assertFalse(fileElement.getInterest().isInteresting()); >+ } >+ > public void testDecrementAcrossBridges() throws CoreException, InvocationTargetException, InterruptedException { > monitor.selectionChanged(part, new StructuredSelection(javaMethod)); > method = ContextCorePlugin.getContextManager().getElement(javaMethod.getHandleIdentifier()); >@@ -83,6 +112,8 @@ > assertTrue(ContextCorePlugin.getContextManager().manipulateInterestForElement(projectElement, false, false, > false, "test")); > >+ fileElement = ContextCorePlugin.getContextManager().getElement( >+ bridge.getHandleIdentifier(file)); > assertFalse(fileElement.getInterest().isInteresting()); > // TODO: re-enable, fails in AllTests > // assertFalse(method.getInterest().isInteresting()); >@@ -104,6 +135,15 @@ > > assertTrue(ContextCorePlugin.getContextManager() > .manipulateInterestForElement(packageNode, false, false, false, "test")); >+ >+ >+ method = ContextCorePlugin.getContextManager().getElement(javaMethod.getHandleIdentifier()); >+ clazz = ContextCorePlugin.getContextManager().getElement(javaType.getHandleIdentifier()); >+ cu = ContextCorePlugin.getContextManager().getElement(javaCu.getHandleIdentifier()); >+ >+ packageNode = ContextCorePlugin.getContextManager().getElement( >+ javaPackage.getHandleIdentifier()); >+ > assertFalse(packageNode.getInterest().isInteresting()); > assertFalse(cu.getInterest().isInteresting()); > assertFalse(clazz.getInterest().isInteresting()); >@@ -124,10 +164,12 @@ > assertTrue(node.getInterest().isLandmark()); > action.changeInterestForSelected(true); > >- assertEquals((2 * scaling.getLandmark()) + scaling.get(InteractionEvent.Kind.SELECTION), >+ assertEquals((scaling.getForcedLandmark()) + scaling.get(InteractionEvent.Kind.SELECTION), > node.getInterest().getValue()); > > action.changeInterestForSelected(false); >+ >+ node = ContextCorePlugin.getContextManager().getElement(m1.getHandleIdentifier()); > assertFalse(node.getInterest().isLandmark()); > assertTrue(node.getInterest().isInteresting()); > action.changeInterestForSelected(false); >@@ -146,7 +188,7 @@ > > public void changeInterestForSelected(boolean increment) { > assertTrue(ContextCorePlugin.getContextManager().manipulateInterestForElement( >- ContextCorePlugin.getContextManager().getActiveElement(), increment, false, false, "")); >+ ContextCorePlugin.getContextManager().getActiveElement(), increment, false, true, "")); > } > } > } >Index: src/org/eclipse/mylyn/java/tests/AbstractJavaContextTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.java.tests/src/org/eclipse/mylyn/java/tests/AbstractJavaContextTest.java,v >retrieving revision 1.47 >diff -u -r1.47 AbstractJavaContextTest.java >--- src/org/eclipse/mylyn/java/tests/AbstractJavaContextTest.java 20 Feb 2008 00:47:03 -0000 1.47 >+++ src/org/eclipse/mylyn/java/tests/AbstractJavaContextTest.java 22 Feb 2008 17:26:12 -0000 >@@ -37,6 +37,8 @@ > protected JavaEditingMonitor monitor = new JavaEditingMonitor(); > > protected TestJavaProject project; >+ >+ protected TestProject nonJavaProject; > > protected IPackageFragment p1; > >@@ -54,6 +56,7 @@ > assertNotNull(JavaPlugin.getDefault()); > assertNotNull(JavaUiBridgePlugin.getDefault()); > project = new TestJavaProject(this.getClass().getSimpleName()); >+ nonJavaProject = new TestProject(this.getClass().getSimpleName() + "nonJava"); > p1 = project.createPackage("p1"); > type1 = project.createType(p1, "Type1.java", "public class Type1 { }"); > context = new InteractionContext(contextId, scaling); >@@ -77,6 +80,7 @@ > manager.getFileForContext(contextId).delete(); > > ResourceTestUtil.deleteProject(project.getProject()); >+ ResourceTestUtil.deleteProject(nonJavaProject.getProject()); > > for (InteractionContext context : manager.getActiveContexts()) { > manager.deactivateContext(context.getHandleIdentifier()); >Index: src/org/eclipse/mylyn/java/tests/TestProject.java >=================================================================== >RCS file: src/org/eclipse/mylyn/java/tests/TestProject.java >diff -N src/org/eclipse/mylyn/java/tests/TestProject.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/java/tests/TestProject.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,36 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2007 Mylyn project committers and others. >+ * 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 >+ *******************************************************************************/ >+/* >+ * Created on Jul 20, 2004 >+ */ >+package org.eclipse.mylyn.java.tests; >+ >+import java.lang.reflect.InvocationTargetException; >+ >+import org.eclipse.core.resources.IProject; >+import org.eclipse.core.resources.IWorkspaceRoot; >+import org.eclipse.core.resources.ResourcesPlugin; >+import org.eclipse.core.runtime.CoreException; >+ >+/** >+ * @author Shawn Minto >+ */ >+public class TestProject { >+ public IProject project; >+ >+ public TestProject(final String name) throws CoreException, InvocationTargetException, InterruptedException { >+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); >+ project = root.getProject(name); >+ project.create(null); >+ project.open(null); >+ } >+ >+ public IProject getProject() { >+ return project; >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 212285
:
84753
|
84754
| 90491 |
90492