Author: mareshkau
Date: 2008-11-29 08:00:23 -0500 (Sat, 29 Nov 2008)
New Revision: 12145
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3163/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3163/jbide3163.html
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3163Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3144Test.java
Log:
JBIDE-3163
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3163/jbide3163.html
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3163/jbide3163.html
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3163/jbide3163.html 2008-11-29
13:00:23 UTC (rev 12145)
@@ -0,0 +1 @@
+test1<h1>Test2</h1>Test3<input type="submit" value="Test
Selection"></input>
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-11-29
05:07:22 UTC (rev 12144)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-11-29
13:00:23 UTC (rev 12145)
@@ -43,6 +43,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3030Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3127Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3144Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3163Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE675Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE788Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE924Test;
@@ -111,6 +112,7 @@
suite.addTestSuite(JBIDE3127Test.class);
suite.addTestSuite(JBIDE3144Test.class);
suite.addTestSuite(JBIDE2354Test.class);
+ suite.addTestSuite(JBIDE3163Test.class);
// $JUnit-END$
// added by Max Areshkau
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3144Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3144Test.java 2008-11-29
05:07:22 UTC (rev 12144)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3144Test.java 2008-11-29
13:00:23 UTC (rev 12145)
@@ -80,7 +80,7 @@
}
public void testJBIDE3144Selection() throws Exception {
- IEditorInput input = new FileEditorInput(file);
+ IEditorInput input = new FileEditorInput(this.file);
JSPMultiPageEditor part = openEditor(input);
checkSourceSelection(part);
}
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3163Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3163Test.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3163Test.java 2008-11-29
13:00:23 UTC (rev 12145)
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
+import org.mozilla.interfaces.nsIDOMNode;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class JBIDE3163Test extends VpeTest{
+
+ public JBIDE3163Test(String name) {
+ super(name);
+ }
+
+ public void testJBIDE3163() throws Exception {
+ setException(null);
+ IFile file = (IFile)
TestUtil.getComponentPath("JBIDE/3163/jbide3163.html", //$NON-NLS-1$
+ JsfAllTests.IMPORT_PROJECT_NAME);
+ IEditorInput editorInput = new FileEditorInput(file);
+ JSPMultiPageEditor part = openEditor(editorInput);
+ VpeController controller = getVpeController(part);
+ XulRunnerEditor xulRunnerEditor = controller.getXulRunnerEditor();
+ int position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(),
1, 6);
+ part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
+ assertTrue("Show be selected Text
Node",xulRunnerEditor.getLastSelectedNode().getNodeType()==nsIDOMNode.TEXT_NODE);
//$NON-NLS-1$
+ position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1,
7);
+ part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
+ assertTrue("Selected should be Element
Node",xulRunnerEditor.getLastSelectedNode().getNodeType()==nsIDOMNode.ELEMENT_NODE);
//$NON-NLS-1$
+ position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1,
15);
+ part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
+ assertTrue("Selected should be Text
Node",xulRunnerEditor.getLastSelectedNode().getNodeType()==nsIDOMNode.TEXT_NODE);
//$NON-NLS-1$
+ position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1,
20);
+ part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
+ assertTrue("Selected should be Text
Node",xulRunnerEditor.getLastSelectedNode().getNodeType()==nsIDOMNode.TEXT_NODE);
//$NON-NLS-1$
+ position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1,
25);
+ part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
+ assertTrue("Selected should be Text
Node",xulRunnerEditor.getLastSelectedNode().getNodeType()==nsIDOMNode.TEXT_NODE);
//$NON-NLS-1$
+ position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1,
26);
+ part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
+ assertTrue("Selected should be Element
Node",xulRunnerEditor.getLastSelectedNode().getNodeType()==nsIDOMNode.ELEMENT_NODE);
//$NON-NLS-1$
+
+ }
+}