[jbosstools-commits] JBoss Tools SVN: r42426 - in trunk/jst/tests/org.jboss.tools.jst.web.kb.test: projects/TestKbModel/WebContent/pages/params and 1 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Thu Jul 5 20:13:32 EDT 2012


Author: scabanovich
Date: 2012-07-05 20:13:30 -0400 (Thu, 05 Jul 2012)
New Revision: 42426

Added:
   trunk/jst/tests/org.jboss.tools.jst.web.kb.test/projects/TestKbModel/WebContent/pages/params/
   trunk/jst/tests/org.jboss.tools.jst.web.kb.test/projects/TestKbModel/WebContent/pages/params/page1.xhtml
   trunk/jst/tests/org.jboss.tools.jst.web.kb.test/projects/TestKbModel/WebContent/pages/params/page2.xhtml
   trunk/jst/tests/org.jboss.tools.jst.web.kb.test/projects/TestKbModel/WebContent/pages/params/template.xhtml
   trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/IncludeModelTest.java
Modified:
   trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java
Log:
JBIDE-3526
https://issues.jboss.org/browse/JBIDE-3526
Test is added.





Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/projects/TestKbModel/WebContent/pages/params/page1.xhtml
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/projects/TestKbModel/WebContent/pages/params/page1.xhtml	                        (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/projects/TestKbModel/WebContent/pages/params/page1.xhtml	2012-07-06 00:13:30 UTC (rev 42426)
@@ -0,0 +1,14 @@
+<!DOCTYPE composition 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: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">
+    
+    <ui:include src="/pages/params/template.xhtml">
+      <ui:param name="param11" value="#{bean1}"/>
+      <ui:param name="param12" value="#{bean2}"/>
+    </ui:include>
+</html>
\ No newline at end of file

Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/projects/TestKbModel/WebContent/pages/params/page2.xhtml
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/projects/TestKbModel/WebContent/pages/params/page2.xhtml	                        (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/projects/TestKbModel/WebContent/pages/params/page2.xhtml	2012-07-06 00:13:30 UTC (rev 42426)
@@ -0,0 +1,17 @@
+<!DOCTYPE composition 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: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">
+    <ui:decorate template="/pages/params/template.xhtml">
+      <ui:param name="param21" value="#{bean3}"/>
+      <ui:param name="param22" value="#{bean4}"/>
+    </ui:decorate>
+    <ui:composition template="/pages/params/template.xhtml">
+      <ui:param name="param31" value="#{bean5}"/>
+      <ui:param name="param32" value="#{bean6}"/>
+    </ui:composition>
+</html>
\ No newline at end of file

Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/projects/TestKbModel/WebContent/pages/params/template.xhtml
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/projects/TestKbModel/WebContent/pages/params/template.xhtml	                        (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/projects/TestKbModel/WebContent/pages/params/template.xhtml	2012-07-06 00:13:30 UTC (rev 42426)
@@ -0,0 +1,9 @@
+<!DOCTYPE composition 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: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">
+</html>
\ No newline at end of file

Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/IncludeModelTest.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/IncludeModelTest.java	                        (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/IncludeModelTest.java	2012-07-06 00:13:30 UTC (rev 42426)
@@ -0,0 +1,71 @@
+/******************************************************************************* 
+ * Copyright (c) 2012 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.jst.web.kb.test;
+
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
+import org.jboss.tools.common.el.core.resolver.Var;
+import org.jboss.tools.jst.web.kb.IKbProject;
+import org.jboss.tools.jst.web.kb.PageContextFactory;
+import org.jboss.tools.jst.web.kb.internal.scanner.LoadedDeclarations;
+import org.jboss.tools.jst.web.kb.internal.scanner.ScannerException;
+import org.jboss.tools.jst.web.kb.internal.scanner.XMLScanner;
+import org.jboss.tools.jst.web.kb.internal.taglib.ELFunction;
+import org.jboss.tools.jst.web.kb.taglib.IELFunction;
+import org.jboss.tools.jst.web.kb.taglib.IFunctionLibrary;
+import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
+import org.jboss.tools.test.util.JUnitUtils;
+
+public class IncludeModelTest extends TestCase {
+	IProject project = null;
+	boolean makeCopy = true;
+
+	public IncludeModelTest() {
+		super("Kb Include Model Test");
+	}
+
+	public void setUp() throws Exception {
+		project = ResourcesPlugin.getWorkspace().getRoot().getProject("TestKbModel");
+		assertNotNull("Can't load TestKbModel", project); //$NON-NLS-1$
+	}
+
+	private IKbProject getKbProject() {
+		IKbProject kbProject = null;
+		try {
+			kbProject = (IKbProject)project.getNature(IKbProject.NATURE_ID);
+		} catch (Exception e) {
+			JUnitUtils.fail("Cannot get seam nature.",e);
+		}
+		return kbProject;
+	}
+
+	public void testIncludeModel() {
+		IKbProject kbProject = getKbProject();
+		
+		IFile f = project.getFile("WebContent/pages/params/page1.xhtml");
+		assertTrue(f.exists());
+		PageContextFactory.createPageContext(f);
+		
+		f = project.getFile("WebContent/pages/params/page2.xhtml");
+		assertTrue(f.exists());
+		PageContextFactory.createPageContext(f);
+
+		List<Var> vars = kbProject.getIncludeModel().getVars(new Path("/TestKbModel/WebContent/pages/params/template.xhtml"));
+		assertEquals(6, vars.size());
+	}
+
+}
\ No newline at end of file


Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/IncludeModelTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Modified: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java	2012-07-05 23:35:06 UTC (rev 42425)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java	2012-07-06 00:13:30 UTC (rev 42426)
@@ -35,6 +35,7 @@
 		suiteAll.addTest(testSetup);
 		suite = new TestSuite(JstWebKbAllTests.class.getName());
 		suite.addTestSuite(KbModelTest.class);
+		suite.addTestSuite(IncludeModelTest.class);
 		suite.addTestSuite(MyFacesKbModelTest.class);
 		suite.addTestSuite(KbMockModelTest.class);
 		suite.addTestSuite(MyFacesKbModelWithMetadataInSourcesTest.class);



More information about the jbosstools-commits mailing list