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 6296 Details for
Bug 43844
Write test cases for bugs fixed in M4
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
version 1
org.eclipse.ui.tests-Bug43844_v1.patch (text/plain), 12.00 KB, created by
Douglas Pollock
on 2003-09-30 16:44:25 EDT
(
hide
)
Description:
version 1
Filename:
MIME Type:
Creator:
Douglas Pollock
Created:
2003-09-30 16:44:25 EDT
Size:
12.00 KB
patch
obsolete
>Index: .classpath >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.tests/.classpath,v >retrieving revision 1.13 >diff -u -r1.13 .classpath >--- .classpath 11 Mar 2003 21:23:53 -0000 1.13 >+++ .classpath 30 Sep 2003 20:40:28 -0000 >@@ -9,7 +9,9 @@ > <classpathentry kind="src" path="/org.eclipse.core.resources"/> > <classpathentry kind="src" path="/org.eclipse.core.runtime"/> > <classpathentry kind="var" path="ECLIPSE_HOME/startup.jar"/> >- <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/> >+ <classpathentry kind="var" path="JRE_LIB" sourcepath="JRE_SRC"/> > <classpathentry kind="src" path="Benchmark Tests"/> >+ <classpathentry exported="true" kind="src" path="/org.eclipse.ui.workbench"/> >+ <classpathentry kind="src" path="/org.eclipse.core.boot"/> > <classpathentry kind="output" path="bin"/> > </classpath> >Index: .project >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.tests/.project,v >retrieving revision 1.3 >diff -u -r1.3 .project >--- .project 11 Mar 2003 21:23:53 -0000 1.3 >+++ .project 30 Sep 2003 20:40:28 -0000 >@@ -3,10 +3,12 @@ > <name>org.eclipse.ui.tests</name> > <comment></comment> > <projects> >+ <project>org.eclipse.core.boot</project> > <project>org.eclipse.core.resources</project> > <project>org.eclipse.core.runtime</project> > <project>org.eclipse.swt</project> > <project>org.eclipse.ui</project> >+ <project>org.eclipse.ui.workbench</project> > <project>org.junit</project> > </projects> > <buildSpec> >Index: Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug43321Test.java >=================================================================== >RCS file: Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug43321Test.java >diff -N Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug43321Test.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug43321Test.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,103 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2003 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Common Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/cpl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.ui.tests.keys; >+ >+ >+import org.eclipse.core.resources.IProject; >+import org.eclipse.core.resources.IWorkspace; >+import org.eclipse.core.resources.ResourcesPlugin; >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.jface.action.IAction; >+import org.eclipse.swt.widgets.Display; >+import org.eclipse.swt.widgets.Event; >+import org.eclipse.swt.widgets.MenuItem; >+import org.eclipse.swt.widgets.Shell; >+import org.eclipse.ui.IWorkbenchActionConstants; >+import org.eclipse.ui.IWorkbenchWindow; >+import org.eclipse.ui.internal.Workbench; >+import org.eclipse.ui.keys.KeyStroke; >+import org.eclipse.ui.keys.ParseException; >+import org.eclipse.ui.tests.util.UITestCase; >+import org.eclipse.ui.texteditor.AbstractTextEditor; >+ >+/** >+ * Tests Bug 43321 >+ * >+ * @since 3.0 >+ */ >+public class Bug43321Test extends UITestCase { >+ >+ private static final String NAVIGATOR_VIEW_ID = "org.eclipse.ui.views.ResourceNavigator"; >+ >+ /* >+ * @see TestCase#setUp() >+ */ >+ protected void setUp() throws Exception { >+ super.setUp(); >+ } >+ >+ /* >+ * @see TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception { >+ super.tearDown(); >+ } >+ >+ /** >+ * Constructor for Bug43321Test. >+ * >+ * @param name >+ * The name of the test >+ */ >+ public Bug43321Test(String name) { >+ super(name); >+ } >+ >+ /** >+ * Tests that non-check box items on the menu are not checked when activated >+ * from the keyboard. >+ * @throws ParseException If "CTRL+C" isn't a valid key stroke. >+ */ >+ public void testNoCheckOnNonCheckbox() throws CoreException, ParseException { >+ IWorkbenchWindow window = openTestWindow(); >+ IWorkspace workspace = ResourcesPlugin.getWorkspace(); >+ IProject testProject = workspace.getRoot().getProject("TestProject"); //$NON-NLS-1$ >+ testProject.create(null); >+ testProject.open(null); >+ AbstractTextEditor editor = (AbstractTextEditor) window.getActivePage().openEditor(testProject.getFile(".project")); //$NON-NLS-1$ >+ editor.selectAndReveal(0, 1); >+ >+ // Update the display. >+ Shell shell = window.getShell(); >+ Display display = shell.getDisplay(); >+ while (display.readAndDispatch()); >+ >+ // Press "Ctrl+C" to perform a copy. >+ KeyStroke[] keyStrokes = { KeyStroke.getInstance("CTRL+C") }; //$NON-NLS-1$ >+ Event event = new Event(); >+ ((Workbench) window.getWorkbench()).press(keyStrokes, event); >+ >+ // Get the menu item we've just selected. >+ IAction action = editor.getEditorSite().getActionBars().getGlobalActionHandler(IWorkbenchActionConstants.COPY); >+ assertTrue("Non-checkbox menu item is checked.", !action.isChecked()); //$NON-NLS-1$ >+ } >+ >+ public static MenuItem getMenuItem(MenuItem[] menuItems, String text) { >+ for (int i = 0; i < menuItems.length; i++) { >+ if (menuItems[i].getText().equals(text)) { >+ return menuItems[i]; >+ } >+ } >+ >+ return null; >+ } >+} >Index: Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug43597Test.java >=================================================================== >RCS file: Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug43597Test.java >diff -N Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug43597Test.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug43597Test.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,88 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2003 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Common Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/cpl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.ui.tests.keys; >+ >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.graphics.Font; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.Display; >+import org.eclipse.swt.widgets.Shell; >+import org.eclipse.swt.widgets.Text; >+import org.eclipse.ui.tests.util.UITestCase; >+ >+/** >+ * Tests Bug 43597 >+ * >+ * @since 3.0 >+ */ >+public class Bug43597Test extends UITestCase { >+ >+ /* >+ * @see TestCase#setUp() >+ */ >+ protected void setUp() throws Exception { >+ super.setUp(); >+ } >+ >+ /* >+ * @see TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception { >+ super.tearDown(); >+ } >+ >+ /** >+ * Constructor for Bug43597Test. >+ * >+ * @param name >+ * The name of the test >+ */ >+ public Bug43597Test(String name) { >+ super(name); >+ } >+ >+ /** >+ * Tests that setting the text on a text widget to an empty string does not >+ * reset the font. This was a problem only on carbon. >+ */ >+ public void testFontReset() { >+ String metaCharacter = "\u2325X"; //$NON-NLS-1$ >+ >+ // Set up a working environment. >+ Display display = Display.getCurrent(); >+ Shell shell = new Shell(display); >+ GridLayout gridLayout = new GridLayout(); >+ shell.setLayout(gridLayout); >+ Text text = new Text(shell, SWT.LEFT); >+ text.setFont(new Font(text.getDisplay(), "Lucida Grande", 13, SWT.NORMAL)); //$NON-NLS-1$ >+ text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ >+ // Set the text once, and get the font. >+ text.setText(metaCharacter); //$NON-NLS-1$ >+ Font fontBefore = text.getFont(); >+ >+ // Set the font again, and get the font afterward. >+ text.setText(""); //$NON-NLS-1$ >+ text.setText(metaCharacter); >+ Font fontAfter = text.getFont(); >+ >+ // Test. >+ assertEquals("Clearing text resets font.", fontBefore.handle, fontAfter.handle); //$NON-NLS-1$ >+ >+ // Clean up after myself. >+ shell.pack(); >+ shell.open(); >+ shell.close(); >+ shell.dispose(); >+ } >+} >Index: Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug43800Test.java >=================================================================== >RCS file: Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug43800Test.java >diff -N Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug43800Test.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug43800Test.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,65 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2003 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Common Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/cpl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.ui.tests.keys; >+ >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.widgets.Event; >+import org.eclipse.ui.internal.keys.KeySupport; >+import org.eclipse.ui.tests.util.UITestCase; >+ >+/** >+ * Test for Bug 43800. >+ * >+ * @since 3.0 >+ */ >+public class Bug43800Test extends UITestCase { >+ >+ /** >+ * Constructs a new instance of this test case. >+ * @param testName The name of the test >+ */ >+ public Bug43800Test(String testName) { >+ super(testName); >+ } >+ >+ /* >+ * @see TestCase#setUp() >+ */ >+ protected void setUp() throws Exception { >+ super.setUp(); >+ } >+ >+ /* >+ * @see TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception { >+ super.tearDown(); >+ } >+ >+ /** >+ * Tests that key pressed with key codes greater than 16 bits are correctly >+ * converted into accelerator values. >+ */ >+ public void testTruncatingCast() { >+ /* Make an event representing a key stroke with a key code greater than >+ * 16 bits. >+ */ >+ Event event = new Event(); >+ event.keyCode = SWT.ARROW_LEFT; >+ event.character = 0x00; >+ event.stateMask = 0x00; >+ >+ // Convert the event, and test the resulting accelerator value. >+ int accelerator = KeySupport.convertEventToUnmodifiedAccelerator(event); >+ assertEquals("Arrow_Left key truncated", SWT.ARROW_LEFT, accelerator); //$NON-NLS-1$ >+ } >+} >Index: Eclipse UI Tests/org/eclipse/ui/tests/keys/KeysTestSuite.java >=================================================================== >RCS file: Eclipse UI Tests/org/eclipse/ui/tests/keys/KeysTestSuite.java >diff -N Eclipse UI Tests/org/eclipse/ui/tests/keys/KeysTestSuite.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse UI Tests/org/eclipse/ui/tests/keys/KeysTestSuite.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,36 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2003 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Common Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/cpl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.ui.tests.keys; >+ >+import junit.framework.Test; >+import junit.framework.TestSuite; >+ >+/** >+ * Tests for all areas of the key support for the platform. >+ */ >+public class KeysTestSuite extends TestSuite { >+ >+ /** >+ * Returns the suite. This is required to use the JUnit Launcher. >+ */ >+ public static Test suite() { >+ return new KeysTestSuite(); >+ } >+ >+ /** >+ * Construct the test suite. >+ */ >+ public KeysTestSuite() { >+ addTest(new TestSuite(Bug43321Test.class)); >+ addTest(new TestSuite(Bug43597Test.class)); >+ addTest(new TestSuite(Bug43800Test.class)); >+ } >+}
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 43844
: 6296