Author: mareshkau
Date: 2008-11-19 12:30:03 -0500 (Wed, 19 Nov 2008)
New Revision: 11883
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml.xml
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNamedNodeMapInvocationHandler.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3144Test.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeProxyUtil.java
Log:
junit for JBIDE-3144, JBIDE-3214
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml 2008-11-19
17:30:03 UTC (rev 11883)
@@ -0,0 +1,23 @@
+<!1DOCTYPE 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="#{request.contextPath}/layout/template.xhtml">
+<ui:define name="body">
+<div id="body_test">
+<rich:dataTable style="#{test.dataTablecolor}">
+ <rich:column
style="#{test.columnColor}">#{test.color}</rich:column>
+</rich:dataTable>
+<rich:scrollableDataTable style="#{test.scrolable}" width="100px;"
height="100px;" >
+ <rich:columns style="#{test.columnsColor}"> </rich:columns>
+</rich:scrollableDataTable>
+<rich:dataGrid style="#{test.richDataGrid}">
+ssssssssss
+</rich:dataGrid>
+</div>
+</ui:define>
+<ui:composition>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml.xml 2008-11-19
17:30:03 UTC (rev 11883)
@@ -0,0 +1,86 @@
+<tests>
+ <test id="body_test">
+ <DIV ID="body_test" STYLE="-moz-user-modify: read-write;">
+ <TABLE STYLE="background-color: red;" CLASS="dr-table
rich-table">
+ <COLGROUP SPAN="1">
+ </COLGROUP>
+ <TR CLASS="dr-table-firstrow rich-table-firstrow">
+ <TD STYLE="background-color: green;" CLASS="dr-table-cell
rich-table-cell">
+ <SPAN>
+ #{test.color}
+</SPAN>
+ </TD>
+ </TR>
+ </TABLE>
+ <TABLE>
+ <TR>
+ <TD>
+ <DIV CLASS="dr-table-hidden" STYLE="width: 100px; height:
100px;">
+ <TABLE WIDTH="100" STYLE="background-color: blue;"
CLASS="dr-table rich-table">
+ <COLGROUP SPAN="1">
+ </COLGROUP>
+ <TBODY>
+ </TBODY>
+ <TR CLASS="dr-table-firstrow rich-table-firstrow">
+ <TD STYLE="background-color: rgb(160, 32, 240);"
CLASS="dr-table-cell rich-table-cell">
+ <BR _MOZ_DIRTY="" TYPE="_moz"></BR>
+
+ </TD>
+ </TR>
+ <TR CLASS="dr-table-firstrow rich-table-firstrow">
+ <TD STYLE="background-color: rgb(160, 32, 240);"
CLASS="dr-table-cell rich-table-cell">
+ <BR _MOZ_DIRTY="" TYPE="_moz"></BR>
+
+ </TD>
+ </TR>
+ <TR CLASS="dr-table-firstrow rich-table-firstrow">
+ <TD STYLE="background-color: rgb(160, 32, 240);"
CLASS="dr-table-cell rich-table-cell">
+ <BR _MOZ_DIRTY="" TYPE="_moz"></BR>
+
+ </TD>
+ </TR>
+ <TR CLASS="dr-table-firstrow rich-table-firstrow">
+ <TD STYLE="background-color: rgb(160, 32, 240);"
CLASS="dr-table-cell rich-table-cell">
+ <BR _MOZ_DIRTY="" TYPE="_moz"></BR>
+
+ </TD>
+ </TR>
+ <TR CLASS="dr-table-firstrow rich-table-firstrow">
+ <TD STYLE="background-color: rgb(160, 32, 240);"
CLASS="dr-table-cell rich-table-cell">
+ <BR _MOZ_DIRTY="" TYPE="_moz"></BR>
+
+ </TD>
+ </TR>
+ </TABLE>
+ </DIV>
+ <BR _MOZ_DIRTY="" TYPE="_moz"></BR>
+
+ </TD>
+ <TD>
+ <DIV STYLE="overflow: scroll; width: 17px; height: 100%;">
+ </DIV>
+ <BR _MOZ_DIRTY="" TYPE="_moz"></BR>
+
+ </TD>
+ </TR>
+ <TR>
+ <TD>
+ <DIV STYLE="overflow: scroll; width: 100%; height: 17px;">
+ </DIV>
+ <BR _MOZ_DIRTY="" TYPE="_moz"></BR>
+
+ </TD>
+ </TR>
+ </TABLE>
+ <TABLE STYLE="background-color: pink;" CLASS="dr-table
rich-table" >
+ <COLGROUP SPAN="1">
+ </COLGROUP>
+ <TBODY>
+ </TBODY>
+ <SPAN>
+ ssssssssss
+</SPAN>
+ </TABLE>
+ </DIV>
+ </test>
+</tests>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml 2008-11-19
17:30:03 UTC (rev 11883)
@@ -0,0 +1,24 @@
+<!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:form id="test_el">
+ <f:loadBundle basename="demo.resources" var="msg" />
+ <h:messages globalOnly="true" styleClass="message"/>
+
+ <rich:panel style="#{test.color} ">123456789 #{test.scope}
#{test.scope} #{test.scope}
+ <div style="width : 109px; height : 106px;
background-color:green;"></div>
+ <h:outputText value="#{msg.hello_message}" />
+ #{msg.prompt_message} #{test.scope}
+ </rich:panel>
+ </h:form>
+</ui:define>
+</ui:composition>
+
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml.xml 2008-11-19
17:30:03 UTC (rev 11883)
@@ -0,0 +1,29 @@
+<tests>
+ <test id="test_el">
+<DIV
+ STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%; display:
table;">
+ <SPAN CLASS="message" STYLE="-moz-user-modify: read-only;">
+ Error Messages
+</SPAN>
+ <DIV CLASS="dr-pnl rich-panel" STYLE="">
+ <DIV CLASS="dr-pnl-b rich-panel-body">
+ <SPAN>
+ 123456789 Test El expression Test El expression Test El expression
+</SPAN>
+ <DIV
+ STYLE="width: 109px; height: 106px; background-color: green; -moz-user-modify:
read-write;">
+ <BR VPE:PSEUDO-ELEMENT="yes"
+ STYLE="font-style: italic; color: green; -moz-user-modify:
read-only;">
+ </BR>
+ </DIV>
+ <SPAN>
+ Hello
+</SPAN>
+ <SPAN>
+ Name: Test El expression
+</SPAN>
+ </DIV>
+ </DIV>
+</DIV>
+</test>
+</tests>
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-19
15:56:15 UTC (rev 11882)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3144Test.java 2008-11-19
17:30:03 UTC (rev 11883)
@@ -20,14 +20,14 @@
import org.jboss.tools.common.resref.core.ResourceReference;
import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.ui.test.ComponentContentTest;
import org.jboss.tools.vpe.ui.test.TestUtil;
-import org.jboss.tools.vpe.ui.test.VpeTest;
/**
* @author mareshkau
*
*/
-public class JBIDE3144Test extends VpeTest{
+public class JBIDE3144Test extends ComponentContentTest{
/**
* Test Page
@@ -37,6 +37,7 @@
/* (non-Javadoc)
* @see org.jboss.tools.vpe.ui.test.VpeTest#setUp()
*/
+
@Override
protected void setUp() throws Exception {
super.setUp();
@@ -45,6 +46,13 @@
JsfAllTests.IMPORT_PROJECT_NAME);
elValuesMap = new HashMap<String, String>();
elValuesMap.put("request.contextPath", "./"); //$NON-NLS-1$
//$NON-NLS-2$
+ elValuesMap.put("test.dataTablecolor", "background-color:red;");
//$NON-NLS-1$ //$NON-NLS-2$
+ elValuesMap.put("test.columnColor", "background-color:green;");
//$NON-NLS-1$ //$NON-NLS-2$
+
+ elValuesMap.put("test.columnsColor", "background-color:#A020F0;");
//$NON-NLS-1$ //$NON-NLS-2$
+ elValuesMap.put("test.scrolable", "background-color:blue;");
//$NON-NLS-1$ //$NON-NLS-2$
+ elValuesMap.put("test.richDataGrid", "background-color:pink;");
//$NON-NLS-1$ //$NON-NLS-2$
+ elValuesMap.put("test.scope", "Test El expression");
//$NON-NLS-1$//$NON-NLS-2$
ResourceReference[] entries = new ResourceReference[elValuesMap.size()];
int i = 0;
for (Entry<String, String> string : elValuesMap.entrySet()) {
@@ -77,11 +85,16 @@
checkSourceSelection(part);
}
- public void testJBIDE3144EditingOfSimpleTextNodes() {
- fail("Implement test case");
+ public void testJBIDE3144Test2() throws Throwable {
+ performContentTest("JBIDE/3144/test.xhtml"); //$NON-NLS-1$
}
- public void testJBIDE3144EditingJSFElements() {
- fail("Implement test case");
+ public void testJBIDE3214() throws Throwable {
+ performContentTest("JBIDE/3144/jbide3214test.xhtml"); //$NON-NLS-1$
}
-}
+
+ @Override
+ protected String getTestProjectName() {
+ return JsfAllTests.IMPORT_PROJECT_NAME;
+ }
+ }
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNamedNodeMapInvocationHandler.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNamedNodeMapInvocationHandler.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNamedNodeMapInvocationHandler.java 2008-11-19
17:30:03 UTC (rev 11883)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * 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.vpe.editor.proxy;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class VpeNamedNodeMapInvocationHandler implements InvocationHandler {
+
+ private NamedNodeMap namedNodeMap;
+ private VpePageContext pageContext;
+
+ /**
+ * @param node
+ */
+ public VpeNamedNodeMapInvocationHandler(VpePageContext pageContext,NamedNodeMap
namedNodeMap) {
+ this.namedNodeMap = namedNodeMap;
+ this.pageContext = pageContext;
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws Throwable {
+ Object result = method.invoke(namedNodeMap, args);
+ if(result instanceof Node) {
+ return VpeProxyUtil.createProxyForELExpressionNode(pageContext, (Node)result);
+ }
+ return result;
+ }
+
+
+}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java 2008-11-19
15:56:15 UTC (rev 11882)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java 2008-11-19
17:30:03 UTC (rev 11883)
@@ -17,6 +17,7 @@
import org.jboss.tools.vpe.editor.util.ElService;
import org.jboss.tools.vpe.editor.util.ResourceUtil;
import org.w3c.dom.Attr;
+import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
/**
@@ -49,6 +50,8 @@
} else if(result instanceof Attr) {
result = VpeProxyUtil.createProxyForELExpressionNode(pageContext,
(Node)result);
+ } else if(result instanceof NamedNodeMap) {
+ result = VpeProxyUtil.createProxyForNamedNodeMap(pageContext, (NamedNodeMap)result);
}
return result;
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeProxyUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeProxyUtil.java 2008-11-19
15:56:15 UTC (rev 11882)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeProxyUtil.java 2008-11-19
17:30:03 UTC (rev 11883)
@@ -16,6 +16,7 @@
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
/**
@@ -49,4 +50,13 @@
return proxy;
}
+
+ public static NamedNodeMap createProxyForNamedNodeMap(VpePageContext pageContext,
+ NamedNodeMap namedNodeMap) {
+ NamedNodeMap proxy
=(NamedNodeMap)Proxy.newProxyInstance(NamedNodeMap.class.getClassLoader(),
+ new Class[] {NamedNodeMap.class},
+ new VpeNamedNodeMapInvocationHandler(pageContext,namedNodeMap));
+
+ return proxy;
+ }
}