|
Added
Link Here
|
| 1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2004 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Common Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
| 6 |
* http://www.eclipse.org/legal/cpl-v10.html |
| 7 |
* |
| 8 |
* Contributors: |
| 9 |
* IBM Corporation - initial API and implementation |
| 10 |
*******************************************************************************/ |
| 11 |
package org.eclipse.ui.tests.placeholders; |
| 12 |
|
| 13 |
import org.eclipse.swt.SWT; |
| 14 |
import org.eclipse.ui.IPageLayout; |
| 15 |
import org.eclipse.ui.tests.dnd.AbstractTestDropTarget; |
| 16 |
import org.eclipse.ui.tests.dnd.DetachedDropTarget; |
| 17 |
import org.eclipse.ui.tests.dnd.FastViewBarDropTarget; |
| 18 |
import org.eclipse.ui.tests.dnd.ViewDropTarget; |
| 19 |
import org.eclipse.ui.tests.dnd.WindowDropTarget; |
| 20 |
|
| 21 |
import junit.framework.Test; |
| 22 |
import junit.framework.TestSuite; |
| 23 |
|
| 24 |
|
| 25 |
public class PlaceholderTestSuite extends TestSuite { |
| 26 |
|
| 27 |
/** |
| 28 |
* Returns the suite. This is required to use the JUnit Launcher. |
| 29 |
*/ |
| 30 |
public static Test suite() { |
| 31 |
return new PlaceholderTestSuite(); |
| 32 |
} |
| 33 |
|
| 34 |
public PlaceholderTestSuite() { |
| 35 |
|
| 36 |
//the test view is 3rd in a folder, and a multi instance view |
| 37 |
String[] targets = {IPageLayout.ID_PROP_SHEET, |
| 38 |
"org.eclipse.ui.tests.api.MockViewPartMult" |
| 39 |
}; |
| 40 |
|
| 41 |
//the drop targets |
| 42 |
AbstractTestDropTarget[] dragTargets = new AbstractTestDropTarget[] { |
| 43 |
//test for proper restore when dropped onto a stack |
| 44 |
new ViewDropTarget(IPageLayout.ID_RES_NAV, SWT.TOP), |
| 45 |
//test for proper restore when dropped to right of stack |
| 46 |
new ViewDropTarget(IPageLayout.ID_RES_NAV, SWT.RIGHT), |
| 47 |
//test for proper container upon restore |
| 48 |
new WindowDropTarget(SWT.RIGHT), |
| 49 |
//test for proper restore upon removefastview |
| 50 |
new FastViewBarDropTarget(), |
| 51 |
//test for proper windowupon restore |
| 52 |
new DetachedDropTarget()}; |
| 53 |
|
| 54 |
addCombinations(targets, dragTargets); |
| 55 |
|
| 56 |
} |
| 57 |
|
| 58 |
private void addCombinations(String[] targets, AbstractTestDropTarget[] drops){ |
| 59 |
for(int i = 0; i < targets.length; i++){ |
| 60 |
//add the normal case, no movement |
| 61 |
PlaceholderTestOperation t; |
| 62 |
t = new ReopenTest(targets[i], false); |
| 63 |
addTest(t); |
| 64 |
t = new FastUnfastTest(targets[i], false); |
| 65 |
addTest(t); |
| 66 |
t = new PerspectiveSwitchTest(targets[i], false); |
| 67 |
addTest(t); |
| 68 |
t = new ReopenTest(targets[i], true); |
| 69 |
addTest(t); |
| 70 |
t = new FastUnfastTest(targets[i], true); |
| 71 |
addTest(t); |
| 72 |
t = new PerspectiveSwitchTest(targets[i], true); |
| 73 |
addTest(t); |
| 74 |
t = new SaveStateTest(targets[i]); |
| 75 |
addTest(t); |
| 76 |
//t = new DetachDockTest(targets[i]); |
| 77 |
//addTest(t); |
| 78 |
|
| 79 |
|
| 80 |
//move the view to each of the drop targets and try to close/restore it |
| 81 |
for(int j = 0; j < drops.length; j++){ |
| 82 |
t = new ReopenTest(targets[i], drops[j], false); |
| 83 |
addTest(t); |
| 84 |
t = new FastUnfastTest(targets[i], drops[j], false); |
| 85 |
addTest(t); |
| 86 |
t = new PerspectiveSwitchTest(targets[i], drops[j], false); |
| 87 |
addTest(t); |
| 88 |
t = new ReopenTest(targets[i], drops[j], true); |
| 89 |
addTest(t); |
| 90 |
t = new FastUnfastTest(targets[i], drops[j], true); |
| 91 |
addTest(t); |
| 92 |
t = new PerspectiveSwitchTest(targets[i], drops[j], true); |
| 93 |
addTest(t); |
| 94 |
t = new SaveStateTest(targets[i], drops[j]); |
| 95 |
addTest(t); |
| 96 |
//t = new DetachDockTest(targets[i], drops[j]); |
| 97 |
//addTest(t); |
| 98 |
} |
| 99 |
} |
| 100 |
} |
| 101 |
|
| 102 |
|
| 103 |
} |