Author: mareshkau
Date: 2009-01-26 10:58:57 -0500 (Mon, 26 Jan 2009)
New Revision: 13275
Added:
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3632/
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3632/home.xhtml
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3632/layout/
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3632/layout/menu.xhtml
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3632/layout/template.xhtml
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3632Test.java
Modified:
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
branches/jbosstools-3.0.0.CR2/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/NodesManagingUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3632
Added:
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3632/home.xhtml
===================================================================
---
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3632/home.xhtml
(rev 0)
+++
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3632/home.xhtml 2009-01-26
15:58:57 UTC (rev 13275)
@@ -0,0 +1,35 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.org/rich"
+ template="layout/template.xhtml">
+
+<ui:define name="body">
+
+ <h:messages globalOnly="true" styleClass="message"/>
+
+ <rich:panel>
+ <f:facet name="header">Welcome!</f:facet><h:outputText
value=""/>
+ <p>This empty shell application includes:</p>
+ <ul>
+ <h:outputText value="" />
+ <li>Ant build script</li>
+ <li>Deployment to JBoss AS (EAR or WAR)</li>
+ <li>Development and production profiles</li>
+ <li>Integration testing using TestNG and Embedded JBoss</li>
+ <li>JavaBean or EJB 3.0 Seam components</li>
+ <li>JPA entity classes</li>
+ <li>A configurable DataSource and JPA EntityManager</li>
+ <li>Templated Facelets views</li>
+ <li>RichFaces panels and tables</li>
+ <li>Default CSS stylesheet</li>
+ <li>Internationalization support</li>
+ </ul>
+ </rich:panel>
+
+</ui:define>
+</ui:composition>
Added:
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3632/layout/menu.xhtml
===================================================================
---
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3632/layout/menu.xhtml
(rev 0)
+++
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3632/layout/menu.xhtml 2009-01-26
15:58:57 UTC (rev 13275)
@@ -0,0 +1,18 @@
+<rich:toolBar
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:rich="http://richfaces.org/rich">
+ <rich:toolBarGroup>
+ <h:outputText value="#{projectName}:"/>
+ <s:link view="/home.xhtml" value="Home"/>
+ </rich:toolBarGroup>
+ <!-- @newMenuItem@ -->
+ <rich:toolBarGroup location="right">
+ <h:outputText value="Welcome, #{identity.username}!"
rendered="#{identity.loggedIn}"/>
+ <s:link view="/login.xhtml" value="Login"
rendered="#{not identity.loggedIn}"/>
+ <s:link view="/home.xhtml" action="#{identity.logout}"
value="Logout" rendered="#{identity.loggedIn}"/>
+ </rich:toolBarGroup>
+</rich:toolBar>
Added:
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3632/layout/template.xhtml
===================================================================
---
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3632/layout/template.xhtml
(rev 0)
+++
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3632/layout/template.xhtml 2009-01-26
15:58:57 UTC (rev 13275)
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:s="http://jboss.com/products/seam/taglib">
+<head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
+ <title>jbide3632</title>
+ <link href="stylesheet/theme.css" rel="stylesheet"
type="text/css" />
+</head>
+
+<body>
+
+ <ui:include src="menu.xhtml">
+ <ui:param name="projectName" value="jbide3632"/>
+ </ui:include>
+
+ <div class="body">
+ <ui:insert name="body"/>
+ </div>
+
+ <div class="footer">
+ Powered by <a
href="http://jboss.com/products/seam">Seam</a>.
+ Generated by seam-gen.
+ </div>
+
+</body>
+</html>
Modified:
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
---
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-01-26
15:56:28 UTC (rev 13274)
+++
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-01-26
15:58:57 UTC (rev 13275)
@@ -49,6 +49,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3441Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3473Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3482Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3632Test;
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;
@@ -123,6 +124,7 @@
suite.addTestSuite(JBIDE3376Test.class);
suite.addTestSuite(JBIDE3396Test.class);
suite.addTestSuite(JBIDE3482Test.class);
+ suite.addTestSuite(JBIDE3632Test.class);
// $JUnit-END$
// added by Max Areshkau
Added:
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3632Test.java
===================================================================
---
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3632Test.java
(rev 0)
+++
branches/jbosstools-3.0.0.CR2/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3632Test.java 2009-01-26
15:58:57 UTC (rev 13275)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 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.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class JBIDE3632Test extends VpeTest {
+
+ public JBIDE3632Test(String name) {
+ super(name);
+ }
+
+ public void testJBIDE3632Test() throws Throwable {
+ setException(null);
+ IFile ifile = (IFile)
TestUtil.getComponentPath("JBIDE/3632/home.xhtml", //$NON-NLS-1$
+ JsfAllTests.IMPORT_PROJECT_NAME);
+ IEditorInput input = new FileEditorInput(ifile);
+ JSPMultiPageEditor part = openEditor(input);
+ //wait for initialization of editor
+ TestUtil.getVpeController(part);
+ int position =
TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 19, 26);
+ // sets selection for h:outputText
+ part.getSourceEditor().getTextViewer().getTextWidget().setCaretOffset(position);
+ // delete one of "
+ part.getSourceEditor().getTextViewer().getTextWidget().replaceTextRange(position,
1, ""); //$NON-NLS-1$
+ //wait while update job will be running
+ TestUtil.delay(600);
+ closeEditors();
+ if(getException()!=null) {
+ throw getException();
+ }
+ }
+
+}
Modified:
branches/jbosstools-3.0.0.CR2/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/NodesManagingUtil.java
===================================================================
---
branches/jbosstools-3.0.0.CR2/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/NodesManagingUtil.java 2009-01-26
15:56:28 UTC (rev 13274)
+++
branches/jbosstools-3.0.0.CR2/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/NodesManagingUtil.java 2009-01-26
15:58:57 UTC (rev 13275)
@@ -71,7 +71,8 @@
*/
public static int getNodeLength(Node node) {
- if (node instanceof IDOMAttr) {
+ if ( (node instanceof IDOMAttr)
+ && (((IDOMAttr) node).getValueSource()!=null) ) {
return ((IDOMAttr) node).getValueSource().length();
} else if (node instanceof IndexedRegion) {
return ((IndexedRegion) node).getEndOffset()