Author: mareshkau
Date: 2011-03-02 11:19:36 -0500 (Wed, 02 Mar 2011)
New Revision: 29443
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/MultipleSelectionTest.java
Log:
https://issues.jboss.org/browse/JBIDE-8115, junit test for multiple selection
functionality
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java 2011-03-02
09:48:27 UTC (rev 29442)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java 2011-03-02
16:19:36 UTC (rev 29443)
@@ -17,6 +17,7 @@
import org.jboss.tools.vpe.ui.test.dialog.VpeEditAnyDialogTest;
import org.jboss.tools.vpe.ui.test.dialog.VpeResourcesDialogTest;
import org.jboss.tools.vpe.ui.test.editor.CustomSashFormTest;
+import org.jboss.tools.vpe.ui.test.editor.MultipleSelectionTest;
import org.jboss.tools.vpe.ui.test.handlers.VpeCommandsTests;
import org.jboss.tools.vpe.ui.test.preferences.VpeEditorPreferencesPageTest;
@@ -32,8 +33,9 @@
suite.addTestSuite(VpeResourcesDialogTest.class);
suite.addTestSuite(VpeEditorPreferencesPageTest.class);
suite.addTestSuite(CustomSashFormTest.class);
- //suite.addTestSuite(VpePopupMenuTest.class);
+// suite.addTestSuite(VpePopupMenuTest.class);
suite.addTestSuite(VpeEditAnyDialogTest.class);
+ suite.addTestSuite(MultipleSelectionTest.class);
return new VpeTestSetup(suite);
}
}
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/MultipleSelectionTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/MultipleSelectionTest.java 2011-03-02
09:48:27 UTC (rev 29442)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/MultipleSelectionTest.java 2011-03-02
16:19:36 UTC (rev 29443)
@@ -11,6 +11,7 @@
package org.jboss.tools.vpe.ui.test.editor;
import java.io.IOException;
+import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
@@ -20,7 +21,9 @@
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.base.test.TestUtil;
import org.jboss.tools.vpe.base.test.VpeTest;
+import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.ui.test.VpeUiTests;
+import org.mozilla.interfaces.nsIDOMNode;
/**
* Junit test for JBIDE-8115
@@ -30,7 +33,7 @@
*/
public class MultipleSelectionTest extends VpeTest{
- private static final String
TEST_CASE="WebContent/pages/selection/jbide-8115-test-case.html"; //$NON-NLS-1$
+ private static final String TEST_CASE="selection/jbide-8115-test-case.html";
//$NON-NLS-1$
public MultipleSelectionTest(String name) {
super(name);
@@ -44,7 +47,12 @@
ITextViewer viewer = part.getSourceEditor().getTextViewer();
int startSelectionOffcet = TestUtil.getLinePositionOffcet(viewer, 6, 1);
- int endSelectionOffcet = TestUtil.getLinePositionOffcet(viewer, 9, 4);
- viewer.setSelectedRange(startSelectionOffcet, endSelectionOffcet);
+ int length = TestUtil.getLinePositionOffcet(viewer, 9, 4)-startSelectionOffcet;
+ viewer.setSelectedRange(startSelectionOffcet, length);
+ VpeController vpeController = TestUtil.getVpeController(part);
+ vpeController.sourceSelectionChanged();
+ List<nsIDOMNode> selectedNodes =
vpeController.getXulRunnerEditor().getLastSelectedNodes();
+ assertEquals("Shuld be selected ",3,selectedNodes.size());
//$NON-NLS-1$
}
+
}