[jbosstools-commits] JBoss Tools SVN: r7186 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test: resources/jsfTest/WebContent/pages/JBIDE/1494 and 2 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Fri Mar 28 13:58:03 EDT 2008


Author: mareshkau
Date: 2008-03-28 13:58:02 -0400 (Fri, 28 Mar 2008)
New Revision: 7186

Added:
   trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1494/
   trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1494/JBIDE-1494.xhtml
   trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1494.java
Modified:
   trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-1494, junit test for JBIDE-1494

Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1494/JBIDE-1494.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1494/JBIDE-1494.xhtml	                        (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1494/JBIDE-1494.xhtml	2008-03-28 17:58:02 UTC (rev 7186)
@@ -0,0 +1,23 @@
+<!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:c="http://java.sun.com/jstl/core"
+	xmlns:rich="http://richfaces.org/rich">
+<head>
+<title>JBIDE-1494</title>
+</head>
+<body>
+<h:outputText value="JBIDE-1494 Test" />
+<h:dataTable>
+	<h:column>
+		<h:outputText value="column 1" />
+	</h:column>
+	<h:column>
+		<h:outputText value="column 2" />
+	</h:column>
+</h:dataTable>
+<span>Test</span>
+</body>
+</html>
\ 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-03-28 17:15:28 UTC (rev 7185)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java	2008-03-28 17:58:02 UTC (rev 7186)
@@ -20,6 +20,7 @@
 import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1460Test;
 import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1479Test;
 import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1484Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1494;
 import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1615Test;
 import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1720Test;
 import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1730Test;
@@ -62,6 +63,7 @@
 		suite.addTestSuite(JBIDE1720Test.class);
 		suite.addTestSuite(JsfJbide1718Test.class);
 		suite.addTestSuite(JBIDE1730Test.class);
+		suite.addTestSuite(JBIDE1494.class);
 		// $JUnit-END$
 		// added by Max Areshkau
 		// add here projects which should be imported for junit tests
@@ -73,7 +75,7 @@
 
 		// Perfomance Tests
 		// TODO dsakovich adjust perfomance tests
-		 suite.addTestSuite(PerfomanceTest.class);
+//		 suite.addTestSuite(PerfomanceTest.class);
 		 ImportBean importPerfomanceBean = new ImportBean();
 		 importPerfomanceBean.setImportProjectName(PerfomanceTest.IMPORT_PROJECT_NAME);
 		 importPerfomanceBean.setImportProjectPath(JsfTestPlugin.getPluginResourcePath());

Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1494.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1494.java	                        (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1494.java	2008-03-28 17:58:02 UTC (rev 7186)
@@ -0,0 +1,107 @@
+/******************************************************************************* 
+ * Copyright (c) 2007 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
+ *
+ * Contributors:
+ *     Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.editor.template.VpeTemplate;
+import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+import org.w3c.dom.Node;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class JBIDE1494 extends VpeTest{
+
+    public static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
+
+    private static final String TEST_PAGE_NAME = "JBIDE/1494/JBIDE-1494.xhtml"; //$NON-NLS-1$
+    
+	public JBIDE1494(String name) {
+		super(name);
+	}
+	
+	public void testJBIDE1494() throws Throwable {
+		// wait
+		TestUtil.waitForJobs();
+		// set exception
+		setException(null);
+		// Tests CA
+		// get test page path
+		IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME,
+				IMPORT_PROJECT_NAME);
+		assertNotNull("Could not open specified file " + TEST_PAGE_NAME, file); //$NON-NLS-1$
+
+		IEditorInput input = new FileEditorInput(file);
+
+		assertNotNull("Editor input is null", input); //$NON-NLS-1$
+
+		// open and get editor
+		JSPMultiPageEditor part = openEditor(input);
+
+		StyledText styledText = part.getSourceEditor().getTextViewer()
+				.getTextWidget();
+
+			styledText.setCaretOffset(424);
+			Node h_outputText = (Node) ContentAssistUtils.getNodeAt(part
+					.getSourceEditor().getTextViewer(), 424);
+
+			assertNotNull(h_outputText);
+
+			VpeController vpeController = getVpeController(part);
+			
+			VpeTemplateManager templateManager= vpeController.getPageContext().getVisualBuilder().getTemplateManager();
+			assertNotNull(templateManager);
+			Set<?>  dependencySet = new HashSet();
+			VpeTemplate h_output_template = templateManager.getTemplate(vpeController.getPageContext(),h_outputText, dependencySet);
+			
+			assertNotNull(h_output_template.getTextFormatingData());
+			//text formating for h:output
+			assertEquals(7,h_output_template.getTextFormatingData().getAllFormatData().length);
+	
+			Node h_dataTable = (Node) ContentAssistUtils.getNodeAt(part
+					.getSourceEditor().getTextViewer(), 473);
+			
+			assertNotNull(h_dataTable);
+			
+			dependencySet=new HashSet();
+			
+			VpeTemplate h_data_Table = templateManager.getTemplate(vpeController.getPageContext(),h_dataTable , dependencySet);
+	
+			assertNotNull(h_data_Table.getTextFormatingData());
+			
+			assertEquals(8,h_data_Table.getTextFormatingData().getAllFormatData().length);
+
+			Node span =(Node) ContentAssistUtils.getNodeAt(part
+					.getSourceEditor().getTextViewer(), 615);
+			
+			dependencySet=new HashSet();
+			
+			VpeTemplate spanTemplate = templateManager.getTemplate(vpeController.getPageContext(),span, dependencySet);
+		
+			assertNotNull(spanTemplate);
+			assertEquals(10,spanTemplate.getTextFormatingData().getAllFormatData().length);
+	}
+	
+
+}




More information about the jbosstools-commits mailing list